query-5f54381f071174a637f3805a06f0229d

rq turtle/ttl

SPARQL query

Use at

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 ?data ?elected_in ?district ?group WHERE {
    ?data p:P39 ?statement .
    ?statement ps:P39 wd:Q21030356 ;
    pq:P2937 wd:Q6105441 .
    OPTIONAL { ?statement pq:P2715 ?elected_in }   
    OPTIONAL { ?statement pq:P768 ?district }
    OPTIONAL { ?statement pq:P4100 ?group }
    }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?data"):::projected v4("?district"):::projected v3("?elected_in"):::projected v5("?group"):::projected v2("?statement") c3(["wd:Q21030356"]):::iri c5(["wd:Q6105441"]):::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