query-ab8975527652a3e53826f494f4fb5863
- Looking at older MPsSo far we have been concentrating on current MPs. But we can try to find all MPs in a broader period. A simple approach would be to look at the current Parliament.
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 DISTINCT ?person ?personLabel ?seatLabel ?partyLabel ?start ?electionLabel ?end ?causeLabel WHERE
{
?person wdt:P31 wd:Q5 . ?person p:P39 ?ps . ?ps ps:P39 wd:Q126063447 .
?ps pq:P580 ?start . ?ps pq:P4100 ?party . ?ps pq:P768 ?seat .
OPTIONAL { ?ps pq:P2715 ?election } .
OPTIONAL { ?ps pq:P582 ?end } .
OPTIONAL { ?ps pq:P1534 ?cause } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?cause")
v6("?election")
v7("?end"):::projected
v4("?party")
v1("?person"):::projected
v2("?ps")
v5("?seat")
v3("?start"):::projected
c15(["en"]):::literal
c5(["wd:Q126063447"]):::iri
c13(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
v1 --"p:direct/P31"--> c2
v1 --"p:P39"--> v2
v2 --"p:statement/P39"--> c5
v2 --"p:qualifier/P580"--> v3
v2 --"p:qualifier/P4100"--> v4
v2 --"p:qualifier/P768"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P2715".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P582".-> v7
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P1534".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end