shexSpec / shex

ShEx language issues, including new features for e.g. ShEx2.1
24 stars 8 forks source link

Type mismatch in 5.2 Validation Definition #80

Closed hsolbrig closed 5 years ago

hsolbrig commented 6 years ago

The definition of isValid states:

The expression isValid(G, m) indicates that for every nodeSelector/shapeLabel pair (n, s) in m, s has a corresponding shape expression se and satisfies(n, se, G, m)

The signature for satisfies states that:

The expression satisfies(n, se, G, m) indicates that a node n and graph G satisfy a shape expression se with shapeMap m

m is not formally defined in isValid but it can be inferred to contain a set of nodeSelector/shapeLabel pairs, which could imply that it is a Query or a Fixed Shape Map. It doesn't explain, however, how an element in m becomes a shapeMap unto itself. Perhaps the intent is, for each element in the isValid Query Shape Map, to create a Result Shape Map with a single entry?

ericprud commented 6 years ago

The intent was to say there there is some shapeMap m which is consistent through the entire validation of n@s. That said, I'm not entirely sure it's required. I started to make the following argument but realized that it's about cardinality, not about consistency of m.

bogus argument:

Validation of data:

<n> <p> 2 .

against schema:

<S1> { <p> @<S2> ; <p> @<S3> }
<S2> [1 2]
<S3> [2 3]

could be (incorrectly) satisfied if 2 were assigned to two different shapes.

The flaw in this argument is that we don't use the shapeMap to test for cardinality conformance.

ericprud commented 5 years ago

Iovka's update replaces all the concearned text