query-182eac6b2d4e314303859dbfa727f52c
Oravrattas
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 ?senator ?senatorLabel ?termLabel ?partyLabel ?districtLabel ?posheld WHERE {
?senator p:P39 ?posheld;
wdt:P31 wd:Q5.
?posheld ps:P39/wdt:P279* wd:Q4416090;
pq:P2937 ?term;
pq:P580 ?assumedOffice.
OPTIONAL { ?posheld pq:P768 ?district;
pq:P4100 ?party.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY (?senatorLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?assumedOffice")
v6("?district")
v7("?party")
v3("?posheld"):::projected
v2("?senator"):::projected
v1("?senatorLabel"):::projected
v4("?term")
a1((" "))
c12(["bd:serviceParam"]):::iri
c6(["wd:Q4416090"]):::iri
c3(["wd:Q5"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:P39"--> v3
v2 --"p:direct/P31"--> c3
v3 --"p:statement/P39"--> a1
a1 --"p:direct/P279"--> c6
v3 --"p:qualifier/P2937"--> v4
v3 --"p:qualifier/P580"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P768".-> v6
v3 --"p:qualifier/P4100"--> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end