UNPKG

shacl-engine

Version:
43 lines (37 loc) 1.1 kB
@prefix ex: <http://example.org/>. @prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix sh: <http://www.w3.org/ns/shacl#>. @prefix shn: <https://schemas.link/shacl-next#>. @prefix sht: <http://www.w3.org/ns/shacl-test#>. <> a mf:Manifest; mf:entries (<source>). ex:shape a sh:NodeShape; sh:targetNode ex:resource; sh:sparql ex:sparql. ex:sparql sh:select """ SELECT $this WHERE { $this <http://example.org/property> ?a. } """. ex:resource ex:property "1". <source> a sht:Validate; rdfs:label "Test source constraint"; mf:action [ sht:dataGraph <>; sht:shapesGraph <> ]; mf:result [ a sh:ValidationReport; sh:conforms false; sh:result [ a sh:ValidationResult; sh:focusNode ex:resource; sh:resultSeverity sh:Violation; sh:sourceConstraint ex:sparql; sh:sourceConstraintComponent sh:SPARQLConstraintComponent; sh:sourceShape ex:shape; sh:value ex:resource ] ].