query-054fd9655b146bd211708f996084c1f6

rq turtle/ttl

TODO

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 ?item ?itemLabel ?birth_date ?death_date ?first_parliamentLabel ?start_time WHERE {
   {
  SELECT ?item (MIN(?start) AS ?start_time) {
    ?item p:P39 [pq:P580 ?start; ps:P39 [p:P279*/ps:P279* wd:Q16707842]] . 
    FILTER(!isBLANK(?start))
  }
  GROUP BY ?item 
}  ?item p:P39 [pq:P580 ?start_time; ps:P39 ?first_parliament] .
  OPTIONAL { ?item wdt:P569 ?birth_date }
  OPTIONAL { ?item wdt:P570 ?death_date }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?start_time ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?birth_date"):::projected v7("?death_date"):::projected v5("?first_parliament") v4("?item"):::projected v2("?itemLabel"):::projected v3("?start") v5("?start_time"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) c10(["bd:serviceParam"]):::iri c4(["wd:Q16707842"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["not isBlank(?start)"]] f0 --> v3 a1 --"p:qualifier/P580"--> v3 a2 --"p:P279"--> a3 a3 --"p:statement/P279"--> c4 a1 --"p:statement/P39"--> a2 v4 --"p:P39"--> a1 bind2[/"min(?start)"/] v3 --o bind2 bind2 --as--o v5 a4 --"p:qualifier/P580"--> v5 a4 --"p:statement/P39"--> v5 v4 --"p:P39"--> a4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P569".-> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P570".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end