query-bf810c633eee31426fb1758363f5dfd2
List all wiki elements with coordinates, close to a geographic center of a an element
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 bd: <http://www.bigdata.com/rdf#>
#defaultView:List
SELECT ?place ?placeLabel ?location
WHERE
{
wd:Q940798 wdt:P625 ?centerLoc .
SERVICE wikibase:around {
?place wdt:P625 ?location .
bd:serviceParam wikibase:center ?centerLoc .
bd:serviceParam wikibase:radius "250" .
} .
MINUS { ?place wdt:P17 wd:Q142 }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?centerLoc")
v3("?location"):::projected
v2("?place"):::projected
c4(["bd:serviceParam"]):::iri
c1(["wd:Q940798"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c7(["250"]):::literal
c9(["wd:Q142"]):::iri
c1 --"wdt:P625"--> v1
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v3
c4 --"wikibase:center"--> v1
c4 --"wikibase:radius"--> c7
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P17"--> c9
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c12
end