query-65d889f3be091cc4bd5a7585682e3f35

rq turtle/ttl

Military occupations with dodgy countries

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 DISTINCT ?item ?itemLabel ?country ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
  {
    SELECT DISTINCT ?item ?country WHERE {
      ?item wdt:P31/wdt:P279* wd:Q645883.
      ?item wdt:P17 ?country.
      MINUS {{?country wdt:P31/wdt:P279* wd:Q1048835} UNION {?country wdt:P31/wdt:P279* wd:Q164950}
             UNION {?country wdt:P31/wdt:P279* wd:Q170156} UNION {?country wdt:P31/wdt:P279* wd:Q1620908}}
    }
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?country"):::projected v1("?item"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) a5((" ")) c12(["wd:Q1620908"]):::iri c4(["en-gb,en,mul"]):::literal c10(["wd:Q164950"]):::iri c2(["bd:serviceParam"]):::iri c7(["wd:Q645883"]):::iri c9(["wd:Q1048835"]):::iri c11(["wd:Q170156"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c7 v1 --"wdt:P17"--> v2 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a5 a5 --"wdt:P279"--> c12 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a4 a4 --"wdt:P279"--> c11 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a3 a3 --"wdt:P279"--> c10 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c9 end union0r <== or ==> union0l end end