shex-test
Version:
Shape Expressions library tests.
103 lines (95 loc) • 3.18 kB
text/turtle
PREFIX sx: <http://www.w3.org/ns/shex#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
[] a sx:Schema ;
sx:shapes (<http://a.example/A> <http://a.example/B> <http://a.example/C> <http://a.example/D> <http://a.example/E>) .
<http://a.example/A> a sx:ShapeDecl ;
sx:abstract true ;
sx:shapeExpr [ a sx:ShapeAnd ;
sx:shapeExprs (
[ a sx:NodeConstraint ;
sx:pattern "sA..........$"
]
[ a sx:Shape ;
sx:expression [ a sx:TripleConstraint ;
sx:predicate <http://a.example/p> ;
sx:valueExpr [ a sx:NodeConstraint ;
sx:values (0 1 2 3 4 5 6 7 8 9)
];
sx:min 1;
sx:max -1
]
]
)
] .
<http://a.example/B> a sx:ShapeDecl ;
sx:abstract true ;
sx:shapeExpr [ a sx:ShapeAnd ;
sx:shapeExprs (
[ a sx:Shape ; sx:extends ( <http://a.example/A> ) ]
[ a sx:NodeConstraint ;
sx:pattern "s.B.........$"
]
[ a sx:Shape ;
sx:expression [ a sx:TripleConstraint ;
sx:predicate <http://a.example/p> ;
sx:valueExpr [ a sx:NodeConstraint ;
sx:values (0 1 3 4 5 6 7 8 9)
];
sx:min 1;
sx:max -1
]
]
)
] .
<http://a.example/C> a sx:ShapeDecl ; sx:shapeExpr [ a sx:ShapeAnd ;
sx:shapeExprs (
[ a sx:NodeConstraint ;
sx:pattern "s..C........$"
]
[ a sx:Shape ;
sx:expression [ a sx:TripleConstraint ;
sx:predicate <http://a.example/p> ;
sx:valueExpr [ a sx:NodeConstraint ;
sx:values (0 1 2 4 5 6 7 8 9)
];
sx:min 1;
sx:max -1
]
]
) ] .
<http://a.example/D> a sx:ShapeDecl ;
sx:abstract true ;
sx:shapeExpr [ a sx:ShapeAnd ;
sx:shapeExprs (
[ a sx:Shape ; sx:extends ( <http://a.example/B> ) ]
<http://a.example/C>
[ a sx:NodeConstraint ;
sx:pattern "s...D.......$"
]
[ a sx:Shape ;
sx:expression [ a sx:TripleConstraint ;
sx:predicate <http://a.example/p> ;
sx:valueExpr [ a sx:NodeConstraint ;
sx:values (0 1 2 3 5 6 7 8 9)
];
sx:min 1;
sx:max -1
]
]
)
] .
<http://a.example/E> a sx:ShapeDecl ; sx:shapeExpr [ a sx:ShapeAnd ;
sx:shapeExprs (
[ a sx:NodeConstraint ;
sx:pattern "s....E......$"
]
[ a sx:Shape ;
sx:extends (<http://a.example/D>) ;
sx:expression [ a sx:TripleConstraint ;
sx:predicate <http://a.example/p> ;
sx:valueExpr [ a sx:NodeConstraint ;
sx:values (2)
]
]
]
) ] .