-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is a shape (whether node or property) restricted to one instance of sh:not? #217
Comments
As an aside, I am able to implement this C-not-A, C-not-B disjointedness in two other ways. Using a union ... @prefix ex: <http://example.org/ontology/> .
@prefix sh-ex: <http://example.org/shapes/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
sh-ex:ClassC-shape
a sh:NodeShape ;
sh:not [
a sh:NodeShape ;
sh:or (
[
a sh:NodeShape ;
sh:class ex:ClassA ;
]
[
a sh:NodeShape ;
sh:class ex:ClassB ;
]
) ;
] ;
sh:targetClass ex:ClassC ;
. ... flags the individuals I expect:
Using indirect node shapes ... @prefix ex: <http://example.org/ontology/> .
@prefix sh-ex: <http://example.org/shapes/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
sh-ex:ClassC-shape
a sh:NodeShape ;
sh:node
[
a sh:NodeShape ;
sh:not [
a sh:NodeShape ;
sh:class ex:ClassA ;
] ;
] ,
[
a sh:NodeShape ;
sh:not [
a sh:NodeShape ;
sh:class ex:ClassB ;
] ;
]
;
sh:targetClass ex:ClassC ;
. ... flags the individuals I expect:
|
Hi @ajnelson-nist
and the Textual Definition:
both mention just a single shape for However, the "parameters" section contains:
That mentions values plural. So to me that indeed shows multiple values are allowed. So this is a bug. Even though you've shown it is relatively easy to work around, it will still be fixed to allow multiple values for |
Thank you for the review! I look forward to the fix. |
@ajnelson-nist two releases today (v0.24.1 for users of Python 3.7 + RDFLib 6.2, and v0.25.0 for users of Python 3.8+ & RDFlib 7.0.0) - both contain this fix. |
Many thanks! |
I've encountered something
pyshacl
is telling me is not allowed, but I'm having a hard time finding this in the spec and SHACL-SHACL.Given this ontology graph:
And given this data graph:
I would like to write a SHACL shapes graph that implements the OWL disjointedness checks. If I didn't have class B and just had one disjointedness to concern myself with, I would try this graph:
And this gives me the validation report I expect -
kb:Thing-2
alone is flagged:But, if I try one naïve maneuver and tie another anonymous node shape via
sh:not
...... I get an interesting message from
pyshacl
, which seems to be sourced from here (in today's code-state):I have other ways to satisfy my disjointedness-review goal (and I'll note those in a follow-on comment), but I'm interested in seeing the source of this constraint on
sh:not
usage.The referenced specification section (4.6.1) neither demonstrates a second
sh:not
, nor makes any statement on the predicate's cardinality.From the SHACL-SHACL graph (linked in Section C), all of the occurrences of
sh:not
in that file fit at once on my computer screen, and nothing among the occurrences appears to assign an upper bound on how many times it can be used. (And I concluded likewise when I ran the graph through a Turtle syntax normalizer, in case the line breaks and bracket wrapping were throwing me.)Is this max-cardinality-1 constraint on
sh:not
a bit more than is in the spec?The text was updated successfully, but these errors were encountered: