query-0053cc926fd7c26ed1630bfc3bcf7303

rq turtle/ttl

Example query and click on Execute query:https://query.wikidata.orgCopy the following text to

Use at

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 ?item ?itemLabel ?itemDescription ?sister_city ?sister_cityLabel WHERE {
  ?item wdt:P31 wd:Q493522.         # municipality of Belgium
  ?item wdt:P190 ?sister_city.      # sharing boarder
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
  FILTER(NOT EXISTS {
    ?sister_city wdt:P190 ?item
  })  
 }
 ORDER BY ?itemDescription

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v1("?itemDescription"):::projected v2("?sister_city"):::projected c5(["bd:serviceParam"]):::iri c3(["wd:Q493522"]):::iri c7(["nl"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P190"--> e0v2 e0v2("?item"):::projected e0v1("?sister_city"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 v2 --"wdt:P190"--> v3 v3 --"wdt:P31"--> c3 v3 --"wdt:P190"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end