Closed sroze closed 3 years ago
It appears to behave the same in the original playground, which could mean it's by-design (cc @HolgerKnublauch)
As a workaround, you can add sh:ignoredProperties
to your shape
sh:ignoredProperties ( schema:ROLE_CAREGIVER schema:ROLE_CAREMANAGER ) ;
Yes this is by design. sh:closed is really simplistic and only looks at the named properties that are the values of sh:path of the directly associated property shapes. See https://www.w3.org/TR/shacl/#ClosedConstraintComponent (which is very brief, like many specifications are). Path expressions are not evaluated.
There are other limitations of sh:closed, which is why we have added http://datashapes.org/constraints.html#ClosedByTypesConstraintComponent using SHACL-SPARQL.
As a workaround, you can add sh:ignoredProperties to your shape
@tpluscode this would mean that the sh:node
wouldn't be validated though if I understand correctly.
There are other limitations of sh:closed, which is why we have added http://datashapes.org/constraints.html#ClosedByTypesConstraintComponent using SHACL-SPARQL.
@HolgerKnublauch Oh interesting, I didn't know. My understanding is that this isn't supported by this validator though but great to know!
@tpluscode this would mean that the sh:node wouldn't be validated though if I understand correctly.
Wasn't sure, but apparently it will: https://s.zazuko.com/25pXUe :)
What's the issue? When using a closed shape and properties with an alternative path, I always get a violation because the predicate is not allowed.
What's expected? I am expecting predicates
schema:ROLE_CAREGIVER
to not be violations of the closed shape.Example SHACL
Playground example https://s.zazuko.com/JrT3P
Is that a real bug or am I misunderstanding SHACL? Either way, would you have any direction as to which part of the code should I change and PR or how might I be able to tackle this (without redeclaring each property one by one, hopefully)? Thank you!