All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sttl.datashape.main.target.rq Maven / Gradle / Ivy

Go to download

Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1 Query and Update.

There is a newer version: 4.6.1
Show newest version
#
# 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