Re: shapes-ISSUE-65 (shapes, scopes, and constraints): A consistent and cohesive definition of shapes, scopes, and constraints [SHACL Spec]

On 6/2/2015 0:27, RDF Data Shapes Working Group Issue Tracker wrote:
> shapes-ISSUE-65 (shapes, scopes, and constraints): A consistent and cohesive definition of shapes, scopes, and constraints [SHACL Spec]
>
> http://www.w3.org/2014/data-shapes/track/issues/65
>
> Raised by: Peter Patel-Schneider
> On product: SHACL Spec
>
> The current version of the Shapes Constraint Language (SHACL) document, at
> https://w3c.github.io/data-shapes/shacl/, does not have a clear definition of a shape, a scope, or a constraint.

I did a couple of minor edits

https://github.com/w3c/data-shapes/commit/252086313244c115f4e4d9d62659d32f6341e987

but I agree we have much more to do to get the terminology consistent, 
precise and clean. I am not very good at word-smithing and welcome help.

>
> Here are some things that the document says about shapes, scopes, and constraints:
>
>
> Shape
> WRONG - "describes a group of constraints with the same focus node"
> WRONG - "is a group of constraints that have the same focus node"
>   - Ignores scope aspect of shapes.
>   - Misleading about the role of a focus node.
>
> Closed Shape
> ? - closed shape as one of the "other shape-based constraints"
> - Is closed shape a constraint?

Yes, in the current proposal there is a template called 
sh:ClosedShapeConstraint that is backed by a SPARQL query just like the 
other constraints. So closed shapes don't require special treatment, 
assuming that the queries can access the shapes graph (ISSUE-47).

>
> Scope
> AMBIGUOUS - "pre-conditions that must hold before a constraint is applied to
>        a given focus node"
> - No notion of constraint application defined in document.
> - Scope is used on both shapes and constraints.
>
> Class Scope -
> AMBIGUOUS - "apply to all instances of these linked classes"
> - What is an instance of a class?

I have tried to clarify what this means in the update.

>
> Constraint
> WRONG - "a condition that can be validated against a graph"
> WRONG - "defines restrictions on the structure of an RDF graph"
> - Most constraints are validated against a graph and a node in the graph.
> WRONG - "evaluated against a focus node"
> - Not for global constraints.

In my current draft there are no real global constraints. (I had them as 
a separate concept in earlier versions). Currently, they are merely a 
syntax convention to attach "global" constraints to the graph resource 
itself. Such constraints may or may not access the focus node, but this 
is currently also true for any other constraints. (We may need to be 
explicit about whether constraints *must* access the focus node).

>
> Global Constraint
> - Different from other constraints as they don't have a real scope.
>
> I propose that shapes, scopes, and constraints be given a firm and clear structure, along the lines of:
>
> A shape has either a query or a scope, a set of constraints, and whether or not the shape is closed.
>
> A scope picks out some of the nodes in an RDF graph for validation against the constraints of the shape.
>
> A constraint forms a condition that a node in an RDF graph must satisfy to satisfy the constraint.

Some of this depends on ISSUE-62. I would currently say

- A *constraint* forms a condition that a node in the RDF graph must 
satisfy.
- A *shape* is a collection of constraints on the same focus node.
- A shape must have a *scope* that picks out some focus nodes in an RDF 
graph.
- Scopes are either per class or per individual.
- Shape and constraints may have a *filter* shape to narrow down the scope.

(Additional scoping mechanisms may of course be defined by other 
communities, producing mappings from nodes to shapes).

Holger

Received on Tuesday, 2 June 2015 06:39:18 UTC