query-de0a3011c9fcedfdbb7cb42aa49fbb20
SPARQL query
Use at
- https://query.wikidata.org/sparql
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/>
SELECT DISTINCT ?id ?party ?constituency WHERE {
?id wdt:P31 wd:Q5 ; p:P39 ?ps .
?ps ps:P39 wd:Q61659950 .
OPTIONAL { ?ps pq:P4100 ?party }
OPTIONAL { ?ps pq:P768 ?constituency }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?constituency"):::projected
v1("?id"):::projected
v3("?party"):::projected
v2("?ps")
c2(["wd:Q5"]):::iri
c5(["wd:Q61659950"]):::iri
v1 --"p:direct/P31"--> c2
v1 --"p:P39"--> v2
v2 --"p:statement/P39"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P4100".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P768".-> v4
end