query-43db8c3a43666518d820abae5d0c1cf9

rq turtle/ttl

TODO

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 ?country1Label ?country2Label
WHERE {
  ?item wdt:P31 wd:Q16970 ; wdt:P17 ?country1, ?country2 .
  FILTER ( ?country1 != ?country2 ) .
  MINUS { ?country1 wdt:P47 ?country2 } .
  MINUS { ?country2 wdt:P47 ?country1 } .
  MINUS { ?country1 wdt:P576 [] } .
  MINUS { ?country2 wdt:P576 [] } .
  FILTER( STR( ?country1 ) < STR( ?country2 ) ) .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?country1") v2("?country2") v3("?item"):::projected a1((" ")) a2((" ")) c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q16970"]):::iri f0[["str(?country1) < str(?country2)"]] f0 --> v1 f0 --> v2 f1[["?country1 != ?country2"]] f1 --> v1 f1 --> v2 v3 --"wdt:P31"--> c2 v3 --"wdt:P17"--> v1 v3 --"wdt:P17"--> v2 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P47"--> v2 end subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P47"--> v1 end subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P576"--> a1 end subgraph minus5["MINUS"] style minus5 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P576"--> a2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end