query-560ca08707b8e2055f81294b14f40192
Bordered citiesI want to get a list of populated places (not regions!) which share borders but a query always exceeds time limit...
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 DISTINCT ?item1 ?item1Label ?item2 WHERE {
?item1 wdt:P31/wdt:P279* wd:Q486972.
# ?item2 wdt:P31/wdt:P279* wd:Q486972.
?item1 wdt:P47 ?item2.
SERVICE wikibase:label { bd:serviceParam wikibase:language "ru,[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item1"):::projected
v2("?item2"):::projected
a1((" "))
c3(["wd:Q486972"]):::iri
c6(["bd:serviceParam"]):::iri
c8(["ru,#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P47"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end