Skip to content

Instantly share code, notes, and snippets.

@hroptatyr
Created April 14, 2023 09:04
Show Gist options
  • Save hroptatyr/56b95d12f7141b59a5c245db2085cca0 to your computer and use it in GitHub Desktop.
Save hroptatyr/56b95d12f7141b59a5c245db2085cca0 to your computer and use it in GitHub Desktop.
sparql mimicking shacl
PREFIX pav: <http://purl.org/pav/>
PREFIX : <http://example.com/test#>
CONSTRUCT {
:cons.underived.rpt
a sh:ValidationReport ;
sh:conforms false ;
sh:result [
a sh:ValidationResult ;
sh:focusNode ?this ;
sh:resultMessage ":Event without derivation source" ;
sh:resultSeverity sh:Violation ;
sh:sourceShape :cons.underived ;
] .
}
WHERE {
?this a :Event .
FILTER NOT EXISTS {
?this pav:derivedFrom ?some
}
}
LIMIT 10000
@hroptatyr
Copy link
Author

Corresponds to

@prefix sh: <http://www.w3.org/ns/shacl#>
@prefix : <http://example.com/test#>

:Event-shape a sh:NodeShape ;
        sh:targetClass :Event ;
        sh:property [
                sh:path pav:derivedFrom ;
                sh:minCount 1
        ] .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment