w3c / data-shapes

RDF Data Shapes WG repo
87 stars 33 forks source link

SHACL vocabulary issue sh:property #122

Closed griddigit closed 4 years ago

griddigit commented 4 years ago

Hello,

In the SHACL vocabulary https://www.w3.org/ns/shacl.ttl we have this

sh:property a rdf:Property ; rdfs:label "property"@en ; rdfs:comment "Links a shape to its property shapes."@en ; rdfs:domain sh:Shape ; rdfs:range sh:PropertyShape ; rdfs:isDefinedBy sh: .

Shouldn't the line "rdfs:domain sh:Shape ;" actually be "rdfs:domain sh:NodeShape ;" as the range is to sh:PropertyShape and also according to the informative figure in section 2 here: https://www.w3.org/TR/shacl/#constraints-section the sh:property is listed in the sh:NodeShape and not in the sh:Shape?

Can actually a sh:PropertyShape has a reference to itself which would be the case if the sh:property is a property of sh:Shape?

Best regards Chavdar

HolgerKnublauch commented 4 years ago

The formal spec is correct. It is legal for both node shapes and property shapes to declare sh:property constraints. The meaning in the latter case is that the values of the property itself need to have further properties.

The Working Group had debated this topic extensively, and the goal was to keep the language "symmetric" so that most constraint components can be used across node and property shapes. Whether this symmetry is relevant (or even helpful) in practice is unclear - I have seen very very few cases of anyone using sh:property at a property shape. The informal diagram was meant to illustrate the more common case, in which node shapes point to property shapes.

A consequence is also that property shapes may point to themselves.

If this answers your question, please close this issue.

griddigit commented 4 years ago

Thank you very much Holger. I understand the reasoning. It makes sense to keep the model general . So I am closing the issue.