shex
shex copied to clipboard
does negation draw from partition?
What do people mean by !
in a triple pattern?
I propose that it is that there are no corresponding triples in the neighborhood (as opposed to the partition). For instance:
<S> {
(foaf:name . | foaf:givenName .; foaf:familyName ); # either a name or components
foaf:shoeSize .;
(foaf:homepage .; ! foaf:name .)? # no foaf:homepage if there's a foaf:name.
}
would pass
<s> foaf:name "Bob"; foaf:homepage <http://...> .
if negation draws from the partition but fail if it draws from the neighborhood.
IMO, the author's intent is that it fail.
There are other ways of expressing this, e.g.
<S> {
( foaf:name .; foaf:homepage .?
| foaf:givenName .; foaf:familyName );
foaf:shoeSize .
}
but they require reordering the properties which is a problem for e.g. FHIR where we use the order to convert RDF to an ordered XML document.
I believe this is easy to document and implement, but let me know if you disagree. See matches TripleConstraint