Open labra opened 2 years ago
The 2.2 version removes all the labeled* shapeExprs (and therefor has a simpler API):
Schema {
"@context":"http://www.w3.org/ns/shex.jsonld"?
imports:[IRIREF+]?
startActs:[SemAct+]? start:shapeExprOrRef? shapes:[ShapeDecl|ShapeExternal+]?
}
ShapeDecl { id:shapeExprLabel abstract:BOOL? specializes:[IRIREF+]? shapeExpr:shapeExpr }
ShapeExternal { id:shapeExprLabel }
// Shape Expressions
shapeExpr = ShapeOr | ShapeAnd | ShapeNot | NodeConstraint | Shape;
shapeExprOrRef = shapeExpr | shapeExprRef;
ShapeOr { shapeExprs:[shapeExprOrRef{2,}] }
ShapeAnd { shapeExprs:[shapeExprOrRef{2,}] }
ShapeNot { shapeExpr:shapeExprOrRef }
shapeExprRef = shapeExprLabel ;
shapeExprLabel = IRIREF | BNODE ;
NodeConstraint { nodeKind:("iri"|"bnode"|"nonliteral"|"literal")? datatype:IRIREF? xsFacet* values:[valueSetValue+]? }
{ "type": "Schema",
"shapes": [
{ "type": "ShapeDecl", "id": "S1", "shapeExpr": {
"type": "Shape", "expression": {
"type": "TripleConstraint", "predicate": "http://example.org/name"
} } },
{ "type": "ShapeExternal", "id": "S2" }
]
}
Associated shexTest branch extends_top-level-ShapeDecl passes all JSG tests.
One feature that will be useful for ShEx is to have top-level shape definitions which refer to other shapes. For example:
This change would imply to add more ceremony to the ShExJ. For example:
The changes for the ShExJ would look like:
The old ShExJ would represent it like this:
2.1
The new ShExJ would look like:
2.2
This is related with this PR: https://github.com/shexSpec/shexTest/pull/49
In order to kepp backwards compatibility we may allow the old ShExJ in version 2.2 marking it as deprecated and adding it as an annex.