Closed ajnelson-nist closed 3 months ago
Hi @ajnelson-nist Thanks for reporting this.
As you suspected, this is some left over logic from when pyshacl assumed only a single value for sh:not
on the Shape.
It is a problem in the reporting, not in the evaluation. The violation result generated is correct, but it is displaying the incorrect sh:not constraint in the message.
This is likely an easy fix.
Fix for this was created back in January, but only just pushed into the codebase now. It will be in the next release.
The resolution of Issue #217 enabled attaching multiple
sh:not
s to ash:Shape
, bumping up from a restriction on only-one-sh:not
.I think there is some leftover logic that was assuming singleton occurrences of
sh:not
on shapes. This comes to light with an exercise of a 3-way disjointedness in OWL 2 DL.owl:ObjectProperty
,owl:DatatypeProperty
, andowl:AnnotationProperty
are all disjoint with one another. So, if I have someowl:ObjectProperty
, it should be neither aowl:DatatypeProperty
nor anowl:AnnotationProperty
. This constraint is realizable with these shapes:(As an aside, I tried the form
ex:AnnotationProperty-shape sh:not ex:DatatypeProperty-shape .
, etc., but was quickly informed bypyshacl
that that forms an infinite loop of the shapes loading one another. Yup. I'm just leaving that here in case someone else is about to stub their toe trying that.)I got a curious result trying the above graph on this test ontology:
Shell transcript:
First, the node
ex:PASS-AP
doesn't show up in among thesh:Violation
s. Great!That first
sh:Violation
looks fine - the focus node matches the object property targeter, and has the class annotation property, conforming to the disallowed node shape.The second one, though, matches the annotation property targeter (fine), but uses the datatype property shape. That node in the OWL file does not tie in
owl:DatatypeProperty
.Is this an issue in the report displaying, or in the constraint evaluation?