query-b2b8981739385820070a03adf226e9ac
Timeline of Finnish elections
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 bd: <http://www.bigdata.com/rdf#>
#defaultView:Timeline
SELECT DISTINCT ?item ?itemLabel ?year ?pic ?time
WHERE
{
VALUES ?election { wd:Q10638581 wd:Q2112448 wd:Q18693936 wd:Q15154951 }
?item wdt:P31 ?election.
OPTIONAL { ?item wdt:P585 ?time .}
OPTIONAL { ?item wdt:P580 ?time .}
BIND(YEAR(?time) as ?year)
OPTIONAL { ?item wdt:P18 ?pic }
FILTER NOT EXISTS { ?item wdt:P1001 ?alue. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "fi" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?alue")
v3("?election")
v1("?item"):::projected
v6("?pic"):::projected
v4("?time"):::projected
v5("?year"):::projected
c7(["bd:serviceParam"]):::iri
c9(["fi"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P1001"--> e0v2
e0v2("?alue"):::projected
e0v1("?item"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"wdt:P1001"--> v2
bind1[/VALUES ?election/]
bind1-->v3
bind10(["wd:Q10638581"])
bind10 --> bind1
bind11(["wd:Q2112448"])
bind11 --> bind1
bind12(["wd:Q18693936"])
bind12 --> bind1
bind13(["wd:Q15154951"])
bind13 --> bind1
v1 --"wdt:P31"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P585".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P580".-> v4
end
bind2[/"year-from-dateTime(?time)"/]
v4 --o bind2
bind2 --as--o v5
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end