For further information on the new 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/> SELECT ?object WHERE { ?object spatial:nearby(40.74 -73.989 1 'mi'). ?object rdfs:label ?label } 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