query-033c6a1ac1510fdd90feab230e96ecd6
All current members in 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 ?item ?itemLabel ?group ?groupLabel ?district ?districtLabel ?term ?termLabel ?start ?end
WHERE
{
?item p:P39 ?statement .
?statement ps:P39/wdt:P279* wd:Q16707842 ; pq:P580 ?start .
OPTIONAL { ?statement pq:P2937 ?term }
OPTIONAL { ?statement pq:P582 ?end }
OPTIONAL { ?statement pq:P768 ?district }
OPTIONAL { ?statement pq:P4100 ?group }
FILTER(!BOUND(?end)|| ?end > NOW())
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?start ?end
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?district"):::projected
v2("?end"):::projected
v7("?group"):::projected
v3("?item"):::projected
v1("?start"):::projected
v4("?statement")
v5("?term"):::projected
a1((" "))
c4(["wd:Q16707842"]):::iri
c11(["bd:serviceParam"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["(not bound(?end) || ?end > NOW())"]]
f0 --> v2
v3 --"p:P39"--> v4
v4 --"p:statement/P39"--> a1
a1 --"p:direct/P279"--> c4
v4 --"p:qualifier/P580"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P2937".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P582".-> v2
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P768".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P4100".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end