query-4b7b6d0dfdf2faabaca6bf5566c1c8a5
SPARQL query
Use at
- https://query.wikidata.org/sparql
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 ?wikidata ?wikidata_election ?wikidata_area ?wikidata_group WHERE {
?wikidata p:P39 ?statement .
?statement ps:P39 wd:Q21030356 ;
pq:P2937 wd:Q55357134 .
OPTIONAL { ?statement pq:P2715 ?wikidata_election }
OPTIONAL { ?statement pq:P768 ?wikidata_area }
OPTIONAL { ?statement pq:P4100 ?wikidata_group }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?statement")
v1("?wikidata"):::projected
v4("?wikidata_area"):::projected
v3("?wikidata_election"):::projected
v5("?wikidata_group"):::projected
c3(["wd:Q21030356"]):::iri
c5(["wd:Q55357134"]):::iri
v1 --"p:P39"--> v2
v2 --"p:statement/P39"--> c3
v2 --"p:qualifier/P2937"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P2715".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P768".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P4100".-> v5
end