query-55c689ca1cd04455c9c6f1b2ea9f5616
SPARQL query
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 ?wikidata_id ?dc_id ?party_id ?area_id ?twfy_id
WHERE
{
VALUES ?election { wd:Q30173038 }
?wikidata_id p:P3602 ?ps .
?ps ps:P3602 ?election .
OPTIONAL { ?ps pq:P1268 ?party_id } .
OPTIONAL { ?ps pq:P768 ?area_id } .
OPTIONAL { ?wikidata_id wdt:P6465 ?dc_id }
OPTIONAL { ?wikidata_id wdt:P2171 ?twfy_id }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?area_id"):::projected
v6("?dc_id"):::projected
v1("?election")
v4("?party_id"):::projected
v3("?ps")
v7("?twfy_id"):::projected
v2("?wikidata_id"):::projected
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?election/]
bind0-->v1
bind00(["wd:Q30173038"])
bind00 --> bind0
v2 --"p:P3602"--> v3
v3 --"p:statement/P3602"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P1268".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P768".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P6465".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P2171".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end