The second EachOfSolution (the nested one) has an array of three expressions, where one is a TripleConstraintSolutions with predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type - which is copied/duplicated from the first EachOf expression (the outer / not nested one).
In fact the referenced objects are the same: result.solution.solutions[0].expressions[0] === result.solution.solutions[0].expressions[1].solutions[0].expressions[0].
If another solution to the nested EachOf is added - like validating against
then only the first nested EachOfSolution has three expressions, and the second nested EachOfSolution has just the two expected expressions.
Is this correct? I would have expected the expression tree in results to match the expression tree of the schema.
Complete demo code is here. Thanks again for all the work on ShEx! This isn't a critical bug for us or anything, just something I though I'd point out.
Suppose I have a schema made of two EachOf expressions:
... this parses into
But if I validate against
shex.js produces
The second EachOfSolution (the nested one) has an array of three expressions, where one is a TripleConstraintSolutions with predicate
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
- which is copied/duplicated from the first EachOf expression (the outer / not nested one).In fact the referenced objects are the same:
result.solution.solutions[0].expressions[0] === result.solution.solutions[0].expressions[1].solutions[0].expressions[0]
.If another solution to the nested EachOf is added - like validating against
then only the first nested EachOfSolution has three expressions, and the second nested EachOfSolution has just the two expected expressions.
Is this correct? I would have expected the expression tree in results to match the expression tree of the schema.
Complete demo code is here. Thanks again for all the work on ShEx! This isn't a critical bug for us or anything, just something I though I'd point out.