Re: ISSUE-95: Proposal for model simplifications

Peter,

I thought about global constraints but they don't really add a lot to
the expressive power of SHACL since they can be expressed as a
FocusNodeConstraint that is scoped to all nodes in the graph but
ignores the focus nodes. An optimizer could detect that there was no
dependency on the focus node and just evaluate the constraint once. So
if the data graph contains at least one node, then you can express a
global constraint. If global constraints are a frequent requirement
then we can introduce syntactic sugar for this pattern.

-- Arthur

On Thu, Nov 19, 2015 at 2:26 PM, Peter F. Patel-Schneider
<pfpschneider@gmail.com> wrote:
> Oops, I missed the qualified stuff in Arthur's proposal, so ignore the bit
> about that.
>
> peter
>
> On 11/19/2015 11:05 AM, Peter F. Patel-Schneider wrote:
>> The cleanup of SHACL constraints could be something like:
>>
>> - A constraint is either a node constraint or a global constraint.
>>
>> - A node constraint is something that is true or false of nodes in a graph.
>>   Node constraints can be just about anything, including SPARQL-based
>>   constraints.  Node constraints include boolean constructs and closed
>>   versions of constraints.
>>
>> - Node constraints include property-path constraints.  A property-path
>>   constraint contains a property path, perhaps some cardinality
>>   constraints, and perhaps some node constraints.
>>   - For example "at least 5 children and all male" or "all inverse of
>>     children are people" are property-path constraints.
>>   - Cardinality constraints are "at least n" or "at most n" or qualified
>>     versions of these, e.g., "at least 5 are male", which contain a
>>     cardinality and a node constraint.
>>     a qualified cardinality constraint here ("at least 1 x is y").
>>   - A property-path constraint is evaluated on a node by finding the set of
>>     values of the property path from the node, checking to see if this set
>>     satisfies the cardinality constraints and then checking to see if the
>>     values each satisfy each of the node constraints.
>>   - A set of values satisfies an unqualified cardinality constraint
>>     depending only on the size of the set.  A set of values satisfies a
>>     qualified cardinality constraint if the subset of the values that
>>     satisfy the node constraint satisfy the cardinality.
>>
>> - A global constraint is something that is true or false of a graph as a
>>   whole.  All (current) global constraints are SPARQL-based.
>>
>> A SHACL shape is then just a node constraint.  Shapes tend to be named, and
>> used as targets of scoping (control) triples.
>>
>>
>> The difference between this goes beyond Arthur's to cover qualified
>> cardinalities, which don't fit into Arthur's setup; closure; and global
>> constraints.
>>
>>
>> The difference between node constraints and ShEx is that ShEx distinguishes
>> between node constraints (Shape Expressions) and shapes (combination of
>> Label and Shape Definition).
>>
>>
>>
>> peter
>>

Received on Thursday, 19 November 2015 20:00:51 UTC