query-c9a6b02d2f11bc191e199bfc619a659d

rq turtle/ttl

executive body (P208): "government" or "cabinet"?. (Q640506)cabinet (with individual Cabinets being instances of that), rather than a direct instance of (Q640506)cabinet of subclass), as the item is usually a Wikidata:Database_reports/Constraint_violations/P208#Value_type_Q35798 (as well as most other countries where the Cabinet, rather than the Government is set as the value) fails this check ((Q2578249)cabinet of Israel , and (Q35798)executive branch . However, it also has an "Allowed values" constraint of (Q2578249)cabinet of Israel → (Q801)Israel ) gives as its example Property_talk:P208 ((P208)executive body The documentation for . (Q48525)Federal Government of the United States is a part of (Q639738)United States Cabinet is a part, and (Q112014)Cabinet of the United Kingdom of which (Q6063)Government of the United Kingdom From what I can see, many of these countries don't have a separate item for the national government, distinct from the Cabinet, but some countries do: e.g. the UK has set yet at all, and of those that do, there's a slight preference for the "cabinet" rather than the "government", but the numbers are small enough for it to be inconclusive: (P208)executive body Surveying how this is used generally isn't a lot of help — most countries don't have

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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?country ?countryLabel ?body ?bodyLabel ?parentLabel
WHERE {
  ?country wdt:P31 wd:Q6256 .     # find instances of country
  OPTIONAL {
    ?country p:P208 ?statement .  # with a P208 (government) statement
    ?statement ps:P208 ?body .    # which we assign as ?body
    FILTER NOT EXISTS { ?statement pq:P582 ?end_date }  # with no P582 (end date) qualifier
    OPTIONAL { ?body wdt:P279 ?parent } # and set ?parent based on either subclass
    OPTIONAL { ?body wdt:P31 ?parent }  #                          or instance of
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ?countryLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?body"):::projected v4("?country"):::projected v1("?countryLabel"):::projected v3("?end_date") v6("?parent") v2("?statement") c8(["bd:serviceParam"]):::iri c10(["en"]):::literal c3(["wd:Q6256"]):::iri v4 --"p:direct/P31"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:P208".-> v2 v2 --"p:statement/P208"--> v5 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P279".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P31".-> v6 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end