sttl.navlab.glocate.rq Maven / Gradle / Ivy
#
# 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
{select * where {
# let o:place first because limit 1
{ ?in o:place [
p:longitude ?lon ;
p:latitude ?lat]
}
union
{?in p:longitude ?lon ;
p:latitude ?lat }
} limit 1}
# 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