neosemantics icon indicating copy to clipboard operation
neosemantics copied to clipboard

Support for sh:message

Open Mitmischer opened this issue 3 years ago • 0 comments

Hello,

Consider the following SHACL:

neo4j:SomeShape a sh:NodeShape ;
  sh:targetClass neo4j:Some ;
  sh:property [
    sh:path neo4j:name ;
    sh:minCount 1 ;
    sh:severity sh:Critical ;
    sh:message "Some is missing a name!" ;
  ];

For Some without a name, I get the correct severity, but still the default resultMessage.

{'focusNode': 623, 'nodeType': 'Some', 'propertyShape': 'MinCountConstraintComponent', 'offendingValue': None, 'resultPath': 'name', 'severity': 'Critical', 'resultMessage': 'unnacceptable cardinality: 0'}

I expected the output to be:

{'focusNode': 623, 'nodeType': 'Some', 'propertyShape': 'MinCountConstraintComponent', 'offendingValue': None, 'resultPath': 'name', 'severity': 'Critical', 'resultMessage': 'Some is missing a name!'}

Is the implementation of custom error messages planned for the near future?

The specification for sh:message can be found here: https://www.w3.org/TR/shacl/#message

Mitmischer avatar Apr 22 '22 17:04 Mitmischer