query-5af0fd68ec96abf519672c4435a9064f
Using point with cordinatesThe following query works fine:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place ?placeLabel ?location WHERE {
wd:Q1492 wdt:P625 ?centre. # coordinates
?place wdt:P17 wd:Q29.
?place wdt:P625 ?location.
FILTER(geof:distance(?location, ?centre) < 1). #
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?centre")
v1("?location"):::projected
v3("?place"):::projected
c5(["wd:Q29"]):::iri
c7(["bd:serviceParam"]):::iri
c2(["wd:Q1492"]):::iri
c9(["en"]):::literal
f0[["http://www.opengis.net/def/function/geosparql/distance(?location,?centre) < '1^^xsd:integer'"]]
f0 --> v1
f0 --> v2
c2 --"wdt:P625"--> v2
v3 --"wdt:P17"--> c5
v3 --"wdt:P625"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end