w3c / shacl

SHACL Community Group (Post-REC activitities)
27 stars 4 forks source link

Negated Property Path #20

Open tpluscode opened 8 months ago

tpluscode commented 8 months ago

I propose to add to SPARQL property path support for the equivalent of SPARQL's NegatedPropertySet (re https://www.w3.org/TR/sparql11-query/#pp-language)

For example, !(ex:foo | ex:bar) could be expressed as

[
  sh:path [ sh:negatedPath [ sh:alternativePath ( ex:foo ex:bar ) ] ] ;
] .

The object of sh:negatedPath would have to be defined as any valid SHACL Property Path

HolgerKnublauch commented 8 months ago

From the Jena implementation, it seems that the NegativePropertySet takes a list of either forward or backward properties as input, not any arbitrary path. So the exact syntax would need to be specified in a way that excludes the other cases (like oneOrMorePaths etc)?

Note that right now there is no SHACL 1.1 draft where this could be merged into though. Therefore a PR is difficult. We would need to get some dedicated individuals from other vendors to indicate whether a SHACL 1.1 effort (as a living standard) should be started.

afs commented 8 months ago

From the Jena implementation, it seems that the NegativePropertySet takes a list of either forward or backward properties

Yes - that's how it is defined in SPARQL.

https://www.w3.org/TR/sparql11-query/#rPathNegatedPropertySet

NPS's aren't a general "any route except such-and-such"; they are a restriction on a single step in the path.

TallTed commented 8 months ago

[@HolgerKnublauch] We would need to get some dedicated individuals from other vendors to indicate whether a SHACL 1.1 effort (as a living standard) should be started.

It might be worth starting a fresh issue, there to keep a living list (in its initial comment) of open issues (such as #19 and #20) that might together justify spinning up such a SHACL-1.1 (or SHACL-Next) WG...