query-44fcd1379bf216526c86588ab5573960
Things that are "located in" cities, but very far from those cities
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 DISTINCT ?thing ?thingLabel ?city ?cityLabel ?distnum WHERE {
?thing wdt:P131 ?city; wdt:P625 ?thingloc.
?city wdt:P31 wd:Q515; wdt:P625 ?cityloc.
BIND(geof:distance(?thingloc, ?cityloc) AS ?distnum)
FILTER (?distnum > 60)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?distnum)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?city"):::projected
v5("?cityloc")
v6("?distnum"):::projected
v2("?thing"):::projected
v4("?thingloc")
c7(["bd:serviceParam"]):::iri
c5(["wd:Q515"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?distnum > '60^^xsd:integer'"]]
f0 --> v6
v2 --"wdt:P131"--> v3
v2 --"wdt:P625"--> v4
v3 --"wdt:P31"--> c5
v3 --"wdt:P625"--> v5
bind1[/"http://www.opengis.net/def/function/geosparql/distance(?thingloc,?cityloc)"/]
v4 --o bind1
v5 --o bind1
bind1 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end