query-0e4937f61192ab9d9b673064ae285404

rq turtle/ttl

Border cities of the world Border cities of the world Border cities of the world Hraniční města světa Border cities of the world Grenzstädte weltweit Border cities of the world Border cities of the world Border cities of the world Ciudades fronterizas del mundo Border cities of the world Villes frontalières du monde ערי ספר בעולם Border cities of the world Border cities of the world Città di confine del mondo Border cities of the world 국경에 걸쳐있는 도시들 찾아보기 Border cities of the world Border cities of the world Border cities of the world Grenssteden van de wereld Border cities of the world Border cities of the world Border cities of the world Пограничные города мира Border cities of the world Gränsstäder i världen Border cities of the world Dünyadaki sınır şehirleri Прикордонні міста світу Border cities of the world 世界上的边境城市

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# To filter by country add FILTER (?country = wd:Qxx)
#defaultView:Map
# To show the cities of several countries use FILTER (?country IN (wd:Qxx, wd:Qyy))
# To obtain cities that are part of a particular continent or territory ?country
# should not be optional and add "?country wdt:P361 wd:Qxx ."

SELECT ?border_city ?border_cityLabel ?countryLabel ?coords
WHERE {
  ?border_city wdt:P31 wd:Q902814.
  OPTIONAL { ?border_city wdt:P17 ?country. }
  OPTIONAL { ?border_city wdt:P625 ?coords. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en".
                         ?border_city rdfs:label ?border_cityLabel.
                         ?country rdfs:label ?countryLabel.}
}
GROUP BY ?border_city ?border_cityLabel ?countryLabel ?coords
ORDER BY ?countryLabel ?border_cityLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?border_city"):::projected v2("?border_cityLabel"):::projected v5("?coords"):::projected v4("?country") v1("?countryLabel"):::projected c6(["bd:serviceParam"]):::iri c2(["wd:Q902814"]):::iri c8(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal v3 --"wdt:P31"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P17".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P625".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 v3 --"rdfs:label"--> v2 v4 --"rdfs:label"--> v1 end