sttl.datashape.main.target.rq 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.
#
# Select target nodes
# for each shape ?sh, aggregate target nodes in ?list
# call sh:hasShape for each shape ?sh with list of target nodes ?list
#
prefix sh:
template (?shape) {
?suc
}
where {
{
select ?s ?shape ?sh (aggregate(distinct ?s) as ?list)
where {
{graph ?shape {
?sh sh:targetSubjectsOf ?p
filter not exists { ?sh sh:deactivated true} }
?s ?p ?o}
union
{graph ?shape {
?sh sh:targetObjectsOf ?p
filter not exists { ?sh sh:deactivated true} }
?x ?p ?s}
union
{graph ?shape {
?sh sh:targetClass ?c
filter not exists { ?sh sh:deactivated true} }
?s rdf:type/rdfs:subClassOf* ?c}
union
{graph ?shape {
?sh a sh:NodeShape, rdfs:Class
filter not exists { ?sh sh:deactivated true} }
?s rdf:type/rdfs:subClassOf* ?sh}
union
{graph ?shape {
?sh sh:targetNode ?s
filter not exists { ?sh sh:deactivated true} }
}
} group by ?sh
}
#filter xt:display("target: ", ?list)
filter (xt:size(?list) > 0)
bind (sh:hasShape(?shape, ?sh, true, ?list) as ?suc)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy