query-ad3a0e48c8689e085accadf798f092be

rq turtle/ttl

title: Query for all Ministries of Bulgaria (should be 20) SELECT DISTINCT ?item ?itemLabel WHERE { ?item p:P31/ps:P31/wdt:P279* wd:Q192350; wdt:P17 wd:Q219. MINUS { ?item wdt:P576 [] } MINUS { ?item wdt:P1366 [] } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?itemLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Query for all Ministries of Bulgaria (should be 20)
SELECT DISTINCT ?item ?itemLabel WHERE {
  ?item p:P31/ps:P31/wdt:P279* wd:Q192350;
         wdt:P17 wd:Q219.
  MINUS { ?item wdt:P576 [] }
  MINUS { ?item wdt:P1366 [] }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?itemLabel"):::projected a3((" ")) a4((" ")) a1((" ")) a2((" ")) c10(["bd:serviceParam"]):::iri c6(["wd:Q219"]):::iri c4(["wd:Q192350"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:P31"--> a1 a1 --"p:statement/P31"--> a2 a2 --"p:direct/P279"--> c4 v2 --"p:direct/P17"--> c6 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P576"--> a3 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P1366"--> a4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end