Core SHACL Semantics - Abstract Syntax Bugs

Iovka,

I am reviewing [1]. I have a couple of questions about the abstract syntax.

1. The grammar production reads:

ShapeConstr ::= ('!')? DisjShapeConstr | ConjShapeConstraint

The alternation operator "|" has lower precedence than forming
sequences of terms, so I read this as only allowing negation of
DisjShapeConstr. However, the following text says "Additionally, a
shape constraint can be negated, when preceded by an exclamation
mark". which implies you can negate a ConjShapeConstraint. If that is
correct, then don't you need parentheses like so?:

ShapeConstr ::= ('!')? (DisjShapeConstr | ConjShapeConstraint)

2. The grammar is ambiguous because a single ShapeLabel matches both
DisjShapeConstr and ConjShapeConstraint:

DisjShapeConstr ::= ShapeLabel ('or' ShapeLabel)*
ConjShapeConstraint ::= ShapeLabel ('and' ShapeLabel)*

This can be corrected by requiring at least one 'or' in DisjShapeConstr:

DisjShapeConstr ::= ShapeLabel ('or' ShapeLabel)+
ConjShapeConstraint ::= ShapeLabel ('and' ShapeLabel)*

[1] http://w3c.github.io/data-shapes/semantics/

-- Arthur

Received on Wednesday, 24 June 2015 14:37:09 UTC