shapes-ISSUE-98 (Node constraints): Proposal to generalize property constraints into node constraints [SHACL Spec]

shapes-ISSUE-98 (Node constraints): Proposal to generalize property constraints into node constraints [SHACL Spec]

http://www.w3.org/2014/data-shapes/track/issues/98

Raised by: Holger Knublauch
On product: SHACL Spec

I am still not sure why this requires a new ISSUE, because it is mainly a response to already open issues such as

- ISSUE-84 (limit IRIs of focus nodes to enumeration)
- ISSUE-88 (sh:qualifiedValue)

As already mentioned in https://lists.w3.org/Archives/Public/public-data-shapes-wg/2015Sep/0128.html I would like to propose a generalization of the mechanism that we currently use for sh:property and ui:inverseProperty so that it also applies to sh:constraint. This would allow a syntax such as

ex:MyShape
     a sh:Shape ;
     sh:property [
         # Applies to all objects of the property
         sh:predicate ex:someProperty ;
         sh:class ex:SomeClass ;
     ] ;
     sh:inverseProperty [
         # Applies to all subjects of the property
         sh:predicate ex:someIncomingProperty ;
         sh:class ex:SomeClass ;
     ] ;
     sh:constraint [
         # Applies to the focus node itself
         a sh:NodeConstraint ;
         sh:class ex:SomeClass ;
     ] .

Summary of suggested changes:
- Rename sh:valueClass to sh:class
- Rename sh:directValueType to sh:directType
- Rename sh:allowedValues to sh:memberOf (or sh:oneOf)
- Add sh:NodeConstraint with properties sh:datatype, sh:class, etc
- Generalize validation function mechanism to also work with NodeConstraints
- Make sh:NodeConstraint the default type of sh:constraint
- Use sh:SPARQLConstraint at sh:constraint if you need sh:sparql

Since the bulk of the property constraints has already been represented by validation functions, it is a relatively small step to allow these same validation functions to be used at sh:constraint, and have them apply to the focus node.

The spec should probably contain a matrix that ticks off constraint types against the columns sh:property, sh:inverseProperty, sh:constraint (and sh:argument).

I can elaborate and provide an updated SHACL system file if anyone needs details.

Received on Friday, 2 October 2015 01:19:12 UTC