query-20a1e1c2ed0bcec5854e5debe9facfdc
TODO
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#>
SELECT ?city ?citizens ?city_coord ?place ?place_coord ?distance_from_city
WHERE
{
?city wdt:P31 / wdt:P279 * wd:Q42744322 .
?city wdt:P1082 ?citizens .
FILTER (?citizens >= 40000 && ?citizens <= 60000)
?city wdt:P625 ?city_coord .
SERVICE wikibase:around
{
?place wdt:P625 ?place_coord .
bd:serviceParam wikibase:center ?city_coord .
bd:serviceParam wikibase:radius "10" .
bd:serviceParam wikibase:distance ?distance_from_city.
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?citizens"):::projected
v2("?city"):::projected
v3("?city_coord"):::projected
v6("?distance_from_city"):::projected
v4("?place"):::projected
v5("?place_coord"):::projected
a1((" "))
c5(["wd:Q42744322"]):::iri
c9(["bd:serviceParam"]):::iri
c12(["10"]):::literal
f0[["?citizens >= '40000^^xsd:integer'?citizens <= '60000^^xsd:integer'"]]
f0 --> v1
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c5
v2 --"wdt:P1082"--> v1
v2 --"wdt:P625"--> v3
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v4 --"wdt:P625"--> v5
c9 --"wikibase:center"--> v3
c9 --"wikibase:radius"--> c12
c9 --"wikibase:distance"--> v6
end