Open VladimirAlexiev opened 4 months ago
Here we will need to check all design patterns and describe them. We will also need to see if we change the style depending on the usage and see how this impacts the validation report.
the sh:message was put in sparql part to be able to print variable there using {?x} as part of the message. i am not sure if this would work if the message is in the NodeShape
The pattern to use (at least in most cases) NodeShape, explicit PropertyShape and the SPARQL was to be able to refer to this PropertyShape from multiple nodes and it also brings some more clarity in the validation report. In general W3C is using a lot of blank nodes for the sh:property which was not coming handy in many places
the path rdf:type is an artificial thing as some python validators complained that property shape is missing sh:path. Jena was not having issues with missing sh:path. In that particular case we do not needed as it is not used in the sparql part We need to see how to deal with these nuances and test the patterns in multiple validation engines
path
is mandatory for PropertyShape
: https://www.w3.org/TR/shacl/#property-shapes. In fact the spec defines PropertyShape
by the presence of path
(i.e. the type PropertyShape
is optional). sh:message
in the SPARQL part so you've placed it correctly.sh:or
in NodeShape
. Then you can reuse the PropertyShapes
of the individual props.sh:alternatePath
in PropertyShape
. Then you can reuse that PropertyShape
We should consider creating new https://www.w3.org/TR/shacl/#sparql-constraint-components because if they are used often, then validator vendor may decide to implement them specially, thus optimizing performance.
I guess this requires to package the issues and have dedicated SHACL discussion
The shape shown in https://github.com/Sveino/Inst4CIM-KG/issues/17 (and many like it) is structured like this:
The
PropertyShape
is parasitic:rdf:type
has nothing to do with themsh:sparql
is invoked not on the original target node, but on its type node! Which (given sh:targetClass) is alwaysnc:EnergyComponent
: of course that node has none of the 4 desired outgoing propsSo it should be changed to:
According to https://w3c.github.io/data-shapes/shacl/#constraints-section:
sh:name, sh:description, sh:order, sh:group
apply only to sh:PropertyShape.sh:message
skos:notation
, which is intended for such sort of specialized "identifiers"