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

sttl.navlab.glocate.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
#
# Geolocate resource on a map given lat et long
#
prefix p: 
prefix o: 

template st:glocate {

  st:call-template(st:gmap, ?in, ?lat, ?lon, aggregate(?elem))
  
}
where {
  ?in a o:Place 

  optional { 
    ?in o:place [ 
    p:longitude ?lon ;
    p:latitude  ?lat] } 
    
  optional {
    ?in p:longitude ?lon ;
    p:latitude  ?lat }
       
  # search all other Place resources   
   optional {
      select (xt:list(?res, ?lat, ?lon) as ?elem) ?res
      where {
        bind (st:get(st:dataset) as ?g)
	graph ?g {
	  ?res p:longitude ?lon ; p:latitude ?lat
	}
      }
   }
   filter(! bound(?res) || ?in != ?res)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy