Skip to content
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

Lift syntactic restrictions on property path notation #69

Closed
wouterbeek opened this issue Aug 13, 2021 · 0 comments
Closed

Lift syntactic restrictions on property path notation #69

wouterbeek opened this issue Aug 13, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@wouterbeek
Copy link

wouterbeek commented Aug 13, 2021

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>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants