query-760da0a52767ef58d2293e954a0fa338

rq turtle/ttl

Chief ministers of territoriesI feel like I just made two significant changes, so should report it somewhere in case I stuffed up. . I changed them both. (Q1670755)chief minister of (P279)subclass of didn't include the territories as their chief ministers were (Q43376318)head of government of an Australian state or territory I was trying to query across all the premiers and state ministers, but only had six current ones, not eight. It turned out that My complete query now gets the dates of birth of the eight current premiers and chief ministers:

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 ?premier ?premierLabel ?roleLabel ?date_of_birth ?endtime WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?role (wdt:P279*) wd:Q43376318.
  ?premier p:P39 ?stmt.
  ?stmt ps:P39 ?role.
  FILTER(NOT EXISTS { ?stmt pq:P582 ?end. })
  OPTIONAL { ?premier wdt:P569 ?date_of_birth. }
}
ORDER BY (?date_of_birth)
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?date_of_birth"):::projected v3("?end") v5("?premier"):::projected v4("?role") v2("?stmt") c7(["wd:Q43376318"]):::iri c3(["bd:serviceParam"]):::iri c5(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0v2 e0v2("?end"):::projected e0v1("?stmt"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 v2 --"p:qualifier/P582"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c3 --"wikibase:language"--> c5 end v4 --"p:direct/P279"--> c7 v5 --"p:P39"--> v2 v2 --"p:statement/P39"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P569".-> v1 end