shacl-engine
Version:
A fast RDF/JS SHACL engine
85 lines (74 loc) • 1.92 kB
text/turtle
#>.
#>.
#>.
#>.
#> .
#>.
shsh:ListShape a sh:NodeShape;
sh:name "List";
sh:property shsh:ListRootShape.
shsh:ListRootShape
sh:name "ListRoot";
sh:path [ sh:zeroOrMorePath rdf:rest ];
sh:hasValue rdf:nil;
sh:node shsh:ListNodeShape.
shsh:ListNodeShape a sh:NodeShape;
sh:name "ListNode";
sh:or (shsh:ListItemShape shsh:ListItemLastShape).
shsh:ListItemShape
sh:name "Item";
sh:not [
sh:name "ListItemShape not nil";
sh:hasValue rdf:nil
];
sh:property [
sh:name "ListItemShape first";
sh:path rdf:first;
sh:maxCount 1;
sh:minCount 1
];
sh:property [
sh:name "ListItemShape rest";
sh:path rdf:rest;
sh:maxCount 1;
sh:minCount 1
].
shsh:ListItemLastShape
sh:name "ListItemLastShape";
sh:hasValue rdf:nil;
sh:property [
sh:name "ListItemLastShape first";
sh:path rdf:first;
sh:maxCount 0
];
sh:property [
sh:name "ListItemLastShape rest";
sh:path rdf:rest;
sh:maxCount 0
].
ex:TestShape a sh:NodeShape;
sh:name "TestShape";
sh:targetNode ex:ValidResource1;
sh:property [
sh:name "TestShape property";
sh:path ex:property;
sh:node shsh:ListShape
].
ex:ValidResource1 a rdfs:Resource;
ex:property ("a" "b").
<> a mf:Manifest;
mf:entries (<list>).
<list> a sht:Validate;
rdfs:label "Test coverage of a list";
mf:action [
sht:dataGraph <>;
sht:shapesGraph <>
];
mf:result [ a sht:Coverage;
sht:coverage """
@prefix ex: <http://example.org/>.
ex:ValidResource1
ex:property ("a" "b").
"""^^sht:Turtle
].