w3c / shacl

SHACL Community Group (Post-REC activitities)
32 stars 5 forks source link

SHACL-AF Path expressions example invalid? #1

Closed dthume closed 3 years ago

dthume commented 6 years ago

The Advanced Features Note provides an example usage of path expressions:

[  sh:nodes ex:children ;
   sh:path rdfs:label ;
] .

equating it to the SPARQL graph pattern:

{  $this ex:children ?a .
    ?a rdfs:label ?result .
}

However the value of sh:nodes in the example (ex:children) is a constant term expression which - according to the note - should evaluate to the term, whereas in the given example it appears to itself be applied in a similar way to the sh:path. The "Evaluation of Path Expressions" definition doesn't suggest any special handling for sh:nodes in this case, and the "Example Shapes Graph" shown just below the table at the beginning of section 6 uses sh:filterShape with sh:nodes in (what appears to be) the manner I would expect from the definition. Obviously it wouldn't really make sense to have:

[
  sh:nodes [ sh:path ex:children ]
  sh:path rdfs:label
]

vs

[
  sh:path ( ex:children rdfs:label )
]

So is this just an incorrect example in the note? or have I misunderstood the definition?

sanyam19106 commented 4 years ago

in shacl we write in sh:property [ sh:node ex:children; sh:path rdfs;label; ] ex: children rdf:type sh:shape; [ sh:path property(if any); ] ]

HolgerKnublauch commented 3 years ago

Weird, I completely missed this ticket so far. Yes you are right the example is incorrect. I have created a branch to fix this

https://github.com/w3c/shacl/tree/fixed-path-example

and now only need to find someone who is allowed to review this so that it can get merged in...