query-88abafdcae0d0a4fe95bcbe825b35766
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 ?person ?personLabel ?start ?end ?partyLabel ?constituency ?constituencyLabel {
?person wdt:P21 wd:Q6581072;
p:P39 ?statement .
?statement ps:P39 wd:Q16707842 .
OPTIONAL { ?statement pq:P580 ?start } .
OPTIONAL { ?statement pq:P582 ?end } .
OPTIONAL { ?statement pq:P768 ?constituency } .
OPTIONAL { ?person wdt:P102 ?party } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
} ORDER BY ?personLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?constituency"):::projected
v5("?end"):::projected
v7("?party")
v2("?person"):::projected
v1("?personLabel"):::projected
v4("?start"):::projected
v3("?statement")
c5(["wd:Q16707842"]):::iri
c13(["en"]):::literal
c2(["wd:Q6581072"]):::iri
c11(["bd:serviceParam"]):::iri
v2 --"p:direct/P21"--> 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".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P768".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P102".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end