shacl-engine
Version:
A fast RDF/JS SHACL engine
92 lines (90 loc) • 2.33 kB
text/turtle
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
ex:InvalidRectangle1
rdf:type ex:RectangleWithArea ;
ex:height 3 ;
.
ex:InvalidRectangle2
rdf:type ex:RectangleWithArea ;
.
ex:RectangleWithArea
rdf:type rdfs:Class ;
rdf:type sh:NodeShape ;
rdfs:subClassOf rdfs:Resource ;
sh:or (
[
sh:property [
sh:path ex:height ;
sh:minCount 1 ;
] ;
sh:property [
sh:path ex:width ;
sh:minCount 1 ;
] ;
]
[
sh:property [
sh:path ex:area ;
sh:minCount 1 ;
] ;
]
) ;
.
ex:ValidRectangle1
rdf:type ex:RectangleWithArea ;
ex:height 3 ;
ex:width 2 ;
.
ex:ValidRectangle2
rdf:type ex:RectangleWithArea ;
ex:area 6 ;
ex:height 3 ;
ex:width 2 ;
.
ex:ValidRectangle3
rdf:type ex:RectangleWithArea ;
ex:area 6 ;
ex:height 3 ;
.
<>
rdf:type mf:Manifest ;
mf:entries (
<or-001>
) ;
.
<or-001>
rdf:type sht:Validate ;
rdfs:label "Test of sh:or at node shape 001" ;
mf:action [
sht:dataGraph <> ;
sht:shapesGraph <> ;
] ;
mf:result [
rdf:type sh:ValidationReport ;
sh:conforms "false"^^xsd:boolean ;
sh:result [
rdf:type sh:ValidationResult ;
sh:focusNode ex:InvalidRectangle1 ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:OrConstraintComponent ;
sh:sourceShape ex:RectangleWithArea ;
sh:value ex:InvalidRectangle1 ;
] ;
sh:result [
rdf:type sh:ValidationResult ;
sh:focusNode ex:InvalidRectangle2 ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:OrConstraintComponent ;
sh:sourceShape ex:RectangleWithArea ;
sh:value ex:InvalidRectangle2 ;
] ;
] ;
mf:status sht:approved ;
.