template.dscore.rul Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of corese-core Show documentation
Show all versions of corese-core Show documentation
Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1
Query and Update.
template sh:not (?shape, ?sh, ?cst, ?vis, ?ls) {
sh:safe(?shape, ?sh, ?suc)
}
where {
values ?s { unnest(?ls) }
bind (! sh:testShapeCore(?shape, ?cst, ?s) as ?suc)
bind (st:report(sh:not, ?sh, ?shape, ?s, st:null, ?s, ?suc, ?vis) as ?b)
}
]]>
template sh:or (?shape, ?sh, ?or, ?vis, ?ls) {
sh:safe(?shape, ?sh, ?suc)
}
where {
values ?s { unnest(?ls) }
bind (sh:or(?or, ?s, ?shape) as ?count)
bind (! bound(?count) AS ?failure) .
bind (IF (?failure, false, ?count) as ?suc)
bind (st:report(sh:or, ?sh, ?shape, ?s, st:null, ?s, ?suc, ?vis) as ?b)
}
]]>
template sh:xone (?shape, ?sh, ?or, ?vis, ?ls) {
sh:safe(?shape, ?sh, ?suc)
}
where {
values ?s { unnest(?ls) }
bind (sh:xone(?or, ?s, ?shape) as ?count)
bind (! bound(?count) AS ?failure) .
bind (IF (?failure, false, ?count) as ?suc)
bind (st:report(sh:xone, ?sh, ?shape, ?s, st:null, ?s, ?suc, ?vis) as ?b)
}
]]>
template sh:and (?shape, ?sh, ?and, ?vis, ?ls) {
sh:safe(?shape, ?sh, ?suc)
}
where {
values ?s { unnest(?ls) }
bind (sh:and(?and, ?s, ?shape) as ?count)
bind (! bound(?count) AS ?failure) .
bind (IF (?failure, false, ?count) as ?suc)
bind (st:report(sh:and, ?sh, ?shape, ?s, st:null, ?s, ?suc, ?vis) as ?b)
}
]]>
template (?shape, ?sh, ?vis, ?list) {
sh:safe(?shape, ?sh, ?suc)
}
where {
graph ?shape {
?sh sh:property ?cst
?cst sh:path ?p
filter not exists { ?cst sh:deactivated true }
# use case: sh:property [ sh:path p ; sh:property pp ]
# filter not exists { ?sh sh:path ?pp }
}
bind (sh:path(?shape, ?cst, ?vis, ?list, ?p) as ?suc)
}
]]>
template (?shape, ?sh, ?vis, ?list) {
sh:safe(?shape, ?sh, ?suc)
}
where {
graph ?shape {
?sh sh:path ?p
filter not exists { ?sh sh:deactivated true}
}
bind (sh:path(?shape, ?sh, ?vis, ?list, ?p) as ?suc)
}
]]>
template (?shape, ?sh, ?vis, ?ls) {
sh:safe(?shape, ?sh, ?suc)
}
where {
graph ?shape { filter not exists { ?sh sh:path ?ppp } }
bind (sh:hasConstraint(?shape, ?sh, ?vis, ?ls) as ?suc)
}
]]>
template (?shape, ?sh, ?vis, ?ls) {
st:call-template(?bool, ?shape, ?sh, ?cst, ?vis, ?ls)
}
where {
graph ?shape {
values ?bool { sh:and sh:or sh:xone sh:not }
?sh ?bool ?cst
}
}
]]>
template (?shape, ?sh, ?vis, ?ls) {
sh:safe(?shape, ?sh, ?suc)
}
where {
graph ?shape {
?sh sh:closed true
optional { ?sh sh:ignoredProperties ?skip }
}
values ?s { unnest(?ls) }
?s ?p ?o
bind (
exists { graph ?shape { ?sh sh:property [ sh:path ?p ]} }
||
(bound(?skip) && exists { graph ?shape { ?skip rdf:rest*/rdf:first ?p } })
as ?suc)
bind (st:report(sh:closed, ?sh, ?shape, ?s, ?p, ?o, ?suc, ?vis) as ?b)
}
]]>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy