SPARQL | JenaSpatial (replaced geospatial index for jena)
GeoSPARQL.org is based on work by Marco Neumann first published in
"Spatially Navigating the Semantic Web" at the First International Workshop on Semantic Web
and Databases. VLDB 2003
The first public online demostrator for GeoSPARQL was released in January 2008
as part of the geospatialweb project.
For further information on the new OGC GeoSPARQL standard see
OGC GeoSPARQL - A Geographic Query Language for RDF Data
PREFIX co: <http://www.geonames.org/countries/#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX spatial: <http://jena.apache.org/spatial#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX gn: <http://www.geonames.org/ontology#> PREFIX foaf:<http://xmlns.com/foaf/0.1/> PREFIX loticoowl:<http://www.lotico.com/ontology/> PREFIX units: <http://www.opengis.net/def/uom/OGC/1.0/> SELECT ?object WHERE { ?object spatial:nearby(2 1 100 units:kilometer). } LIMIT 10
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX spatial: <http://jena.apache.org/spatial#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?object WHERE { ?object geo:lat ?lat. ?object geo:long ?long. FILTER((xsd:double(?lat)>=40.73) && (xsd:double(?long)>=-74) && (xsd:double(?lat)<=41) && (xsd:double(?long)<=-73.98)) } LIMIT 20