Open labra opened 7 months ago
The following example behaves different than in the shex.js.
base <x:/> <S1> { <p> BNODE {} AND IRI } <S2> BNODE {} AND IRI
In shex-rs parser, the results of the shape expression BNODE {} AND IRI are not flattened, i.e. the results are:
BNODE {} AND IRI
{ "@context": "http://www.w3.org/ns/shex.jsonld", "type": "Schema", "shapes": [ { "type": "ShapeDecl", "id": "x:S1", "abstract": false, "shapeExpr": { "type": "Shape", "expression": { "type": "TripleConstraint", "predicate": "x:p", "valueExpr": { "type": "ShapeAnd", "shapeExprs": [ { "type": "ShapeAnd", "shapeExprs": [ { "type": "NodeConstraint", "nodeKind": "bnode" }, { "type": "Shape" } ] }, { "type": "NodeConstraint", "nodeKind": "iri" } ] } } } }, { "type": "ShapeDecl", "id": "x:S2", "abstract": false, "shapeExpr": { "type": "ShapeAnd", "shapeExprs": [ { "type": "ShapeAnd", "shapeExprs": [ { "type": "NodeConstraint", "nodeKind": "bnode" }, { "type": "Shape" } ] }, { "type": "NodeConstraint", "nodeKind": "iri" } ] } } ], "base": "x:/"
But in shex.js, (try it) the results of the first appearance are flattened:
{ "type": "Schema", "shapes": [ { "type": "ShapeDecl", "id": "x:/S1", "shapeExpr": { "type": "Shape", "expression": { "type": "TripleConstraint", "predicate": "x:/p", "valueExpr": { "type": "ShapeAnd", "shapeExprs": [ { "type": "NodeConstraint", "nodeKind": "bnode" }, { "type": "Shape" }, { "type": "NodeConstraint", "nodeKind": "iri" } ] } } } }, { "type": "ShapeDecl", "id": "x:/S2", "shapeExpr": { "type": "ShapeAnd", "shapeExprs": [ { "type": "ShapeAnd", "shapeExprs": [ { "type": "NodeConstraint", "nodeKind": "bnode" }, { "type": "Shape" } ] }, { "type": "NodeConstraint", "nodeKind": "iri" } ] } } ], "@context": "http://www.w3.org/ns/shex.jsonld" }
I notified Eric Prud'hommeaux and it seems to be a bug in the official test-suite.
The following example behaves different than in the shex.js.
In shex-rs parser, the results of the shape expression
BNODE {} AND IRI
are not flattened, i.e. the results are:But in shex.js, (try it) the results of the first appearance are flattened: