Malline:Kuntavaalit 2012 äänestysprosentti

<mapframe>: JSONin Kontrollimerkissä on virhe; se saattaa olla väärin koodattu jäsentäminen epäonnistui
 
75-100%
 
70-75%
 
65-70%
 
60-65%
 
55-60%
 
50-55%
 
tuntematon
SELECT ?id (?item as ?election)
(SAMPLE(?img) as ?img) 
(SAMPLE(?fill) as ?fill) 
(concat('[[',substr(str(?link),31,100),  ' | ', ?cityLabel, ']]') as ?title)
(concat('[[File:', substr(str(?img), 52, 100), '|200px]]') as ?description)
WHERE {
  ?item wdt:P361 wd:Q640715.
  ?item wdt:P1867 ?tyypit.
  ?item wdt:P1697 ?aktiiviset.
  ?item wdt:P1001 ?id .
  BIND (100*?aktiiviset/?tyypit AS ?prosentti) .
  BIND(if(?prosentti >= 75, '#610604', if(?prosentti >= 70, '#994910', if(?prosentti >= 65, '#D0B01F', if(?prosentti >= 60, '#CBF13F', if(?prosentti >= 55, '#ABF97A', if(?prosentti >= 50, '#B1FFB3', '#a6a6a6')))))) as ?fill).
  OPTIONAL { ?id wdt:P94 ?img . }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language 'fi' .
    ?id rdfs:label ?cityLabel .
    }
  ?link schema:about ?id .
  ?link schema:isPartOf <https://fi.wikipedia.org/> .
} GROUP BY ?id ?cityLabel ?link ?item

Kokeile