query-8690ec104ccc6b08d821ce422a098fc5
TODO
Use at
- https://query.wikidata.org/sparql
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 ?pres ?presLabel ?start ?end (MAX(?death) AS ?deathL) WHERE {
?pres wdt:P31 wd:Q5;
p:P39 ?position_held_statement.
?position_held_statement ps:P39 wd:Q60400104.
OPTIONAL { ?position_held_statement pq:P580 ?start. }
OPTIONAL { ?position_held_statement pq:P582 ?end. }
OPTIONAL { ?pres wdt:P570 ?death. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?pres ?presLabel ?start ?end
ORDER BY (?start)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?death"):::projected
v6("?deathL")
v4("?end"):::projected
v3("?position_held_statement")
v2("?pres"):::projected
v1("?start"):::projected
c10(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c5(["wd:Q60400104"]):::iri
c12(["en"]):::literal
v2 --"p:direct/P31"--> c2
v2 --"p:P39"--> v3
v3 --"p:statement/P39"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P580".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P570".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind1[/"max(?death)"/]
v5 --o bind1
bind1 --as--o v6