Closed init-dcat-ap-de closed 1 year ago
@init-dcat-ap-de
I am not a SHACL wizzard. But I like to help.
In the shape given by you:
ex:mainShape
a sh:NodeShape ;
sh:targetClass ex:TestClass ;
sh:message "Custom message in mainShape!" ;
sh:property ex:singlePathProperty ;
sh:property ex:orPathProperty ;
.
you want the sh:property "ex:orPathProperty" to bear two possible paths [ex:orPathOne, ex:orPathTwo].
ex:orPathProperty
sh:message "Custom message for ex:orPathProperty!" ;
sh:or (
[
sh:path ex:orPathOne ;
sh:minCount 1 ;
]
[
sh:path ex:orPathTwo ;
sh:minCount 1 ;
]
)
.
This is IMHO a violation of https://www.w3.org/TR/shacl/#dfn-property-shape which claims:
A property shape is a shape in the shapes graph that is the subject of a triple that has sh:path as its predicate. A shape has at most one value for sh:path. Each value of sh:path in a shape must be a well-formed SHACL property path.
Your SHACL code violates "A [property] shape has at most one value for sh:path" since the sh:or statement gives TWO possible paths.
IMHO you have to rewrite your "properties" to become proper "nodes" since they are not limited so much.
Cheers Volker
Hello,
this lead me to the solution.
Thank you!
Is there a new version with the sh:or fixed? Unable too find, or blind :-) Cheers, Volker
Updates went online today. For one use-case it was not yet possible to fix the shapes, but this use-case was minor.
All used files are now valid according to https://www.itb.ec.europa.eu/shacl/shacl/upload
https://github.com/w3c/data-shapes/issues/147