Lift syntactic restrictions on property path notation
wouterbeek opened this issue · 0 comments
User story
- [Who] As a user of this SHACL library,
- [What] I want to be able to use IRIs to encode complex property paths,
- [Why] So that I can use SHACL to validate my data in contexts where blank node Skolemization is applied.
Background
SHACL 1.0 puts syntactic restrictions on how complex property paths should be encoded. It is strange that such syntactic restrictions are mandated, since RDF lists may consist of blank nodes or IRIs or combinations of blank nodes and IRIs in any other context. In contexts where blank nodes are Skolemized to well-known IRI (a common practice that is part of the RDF 1.1 standard) complex property paths cannot be used at all.
A more in-depth discussion is over at w3c/data-shapes#137.
Would it be possible to lift this restriction on syntax in this library? Maybe using an option to indicate that this functionality purposefully deviates from the SHACL 1.0 standard in this respect.
Example
The following snippet gives a full example. The complex property path is encoded using IRI i.o. blank nodes. If the list IRI (<list-pq>
) is replaced with the Turtle list notation (<p><q>)
then the snippet works as intended.
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix sh: <http://www.w3.org/ns/shacl#>
<shp>
sh:property <pq-shp>;
sh:targetSubjectsOf <p>.
<pq-shp>
sh:class <C>;
sh:minCount 1;
sh:path <list-pq>.
<list-pq>
a rdf:List;
rdf:first <p>;
rdf:rest <list-q>.
<list-q>
a rdf:List;
rdf:first <q>;
rdf:rest rdf:nil.
<a> <p> <b>.
<b> <q> <c>.
<c> a <C>.