Skip to content

Instantly share code, notes, and snippets.

@kendall
Last active August 29, 2015 14:24
Show Gist options
  • Save kendall/b699db38ec4c0034eba2 to your computer and use it in GitHub Desktop.
Save kendall/b699db38ec4c0034eba2 to your computer and use it in GitHub Desktop.
Geospatial query answering in Stardog
prefix geof: <http://www.opengis.net/def/function/geosparql/>
prefix geo: <http://www.opengis.net/ont/geosparql#>
//get locations within 2km of Complexible HQ
select ?name where {
?loc rdfs:label ?name .
?loc geo:hasGeometry ?feature .
?hq geo:hasGeometry ?hqGeo ; rdfs:label "Complexible Headquarters" .
?feature geof:nearby (?hqGeo 2 <http://www.qudt.org/qudt/owl/1.0.0/unit/Instances.html#Kilometer>).
}
// results: `Complexible Headquarters`, `White House`, and `Smithsonian Museum of Natural History`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment