shapes-ISSUE-62 (General selection or filtering): Selection or filtering by arbitrary expressions and shapes [SHACL Spec]

shapes-ISSUE-62 (General selection or filtering): Selection or filtering by arbitrary expressions and shapes [SHACL Spec]

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

Raised by: Holger Knublauch
On product: SHACL Spec

See also:

https://www.w3.org/2014/data-shapes/wiki/Requirements#Selection_by_expression

Peter's proposal has facilities to establish a connection between resources and their shapes via sh:shapeScope and sh:sparqlScope. These can be used stand-alone, i.e. they are evaluated across the whole graph to find matching resources, leading to bindings of the focus node.

The SHACL proposal has a similar facility via sh:scopeShape, but is more limiting: it can only be used in conjunction with a previous scoping (via rdf:type/sh:scopeClass or sh:nodeShape). The reason for this limitation is that (I don't think) there is a reliable way to ensure that the focus node (?this) will always be bound in Peter's approach, since some shapes can only be evaluated when a focus node is already present. To simulate Peter's use cases, one would simply associate such shapes on rdfs:Resource, making it applicable to every resource that has any rdf:type in the graph:

# Shape applies to everything that has an rdfs:label
ex:MyShape
    sh:scopeClass rdfs:Resource ;
    sh:scopeShape [
        sh:property [
            sh:predicate rdfs:label ;
            sh:minCount 1 ;
        ]
    ]

To make this easier to understand, I suggest renaming sh:scopeShape to sh:filterShape, because it narrows down the scope specified via sh:scopeClass.

Received on Saturday, 30 May 2015 04:10:12 UTC