query-e217704d21f23c7d269b797f863c56a7

rq turtle/ttl

title: Belgian public ministries SELECT ?item ?itemLabel WHERE { { ?item wdt:P17 wd:Q31 ; wdt:P361+ wd:Q2746703 . } UNION { ?item wdt:P31/wdt:P279* wd:Q2659904 ; wdt:P17 wd:Q31 ; wdt:P1269 wd:Q2746703 . } UNION { VALUES ?item { wd:Q2746703 } } MINUS{ ?item wdt:P576 [] } SERVICE wikibase:label { bd:serviceParam wikibase:language "nl,fr,de,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 bd: <http://www.bigdata.com/rdf#>
#title: Belgian public ministries
SELECT ?item ?itemLabel WHERE {
  {
    ?item wdt:P17 wd:Q31 ;
          wdt:P361+ wd:Q2746703 .
  }
  UNION
  {
    ?item wdt:P31/wdt:P279* wd:Q2659904 ;
          wdt:P17 wd:Q31 ;
          wdt:P1269 wd:Q2746703 .
  }
  UNION
  {
    VALUES ?item { wd:Q2746703 }
  }
  MINUS{ ?item wdt:P576 [] }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl,fr,de,en". }
} ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v1("?itemLabel"):::projected a2((" ")) a1((" ")) c13(["nl,fr,de,en"]):::literal c2(["wd:Q31"]):::iri c7(["wd:Q2659904"]):::iri c11(["bd:serviceParam"]):::iri c4(["wd:Q2746703"]):::iri 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; bind0[/VALUES ?item/] bind0-->v3 bind00(["wd:Q2746703"]) bind00 --> bind0 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c7 v3 --"wdt:P17"--> c2 v3 --"wdt:P1269"--> c4 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P17"--> c2 v3 --"wdt:P361"--> c4 end union0r <== or ==> union0l end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P576"--> a2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end