query-81c5aecce080fa28ece083519bbaef46

rq turtle/ttl

Find all formations that are missing a country statement SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q736917 . FILTER NOT EXISTS { ?item wdt:P17 ?x } . MINUS { ?item a wdno:P17 } . SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } . }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Find all formations that are missing a country statement
SELECT ?item ?itemLabel WHERE {
  ?item wdt:P31 wd:Q736917 .
  FILTER NOT EXISTS { ?item wdt:P17 ?x } .
  MINUS { ?item a wdno:P17 } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v2("?x") c7(["bd:serviceParam"]):::iri c3(["wd:Q736917"]):::iri c9(["en"]):::literal c5(["wdno:P17"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P17"--> e0v2 e0v1("?item"):::projected e0v2("?x"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"wdt:P17"--> v2 v1 --"wdt:P31"--> c3 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v1 --"a"--> c5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end