query-1d7e043e16fc5706164a6472dc336aef
TODO
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#https://blog.k-nut.eu/wikidata-parliament-svg, results to be passed to parliament-svg program
#defaultView:BubbleChart
SELECT ?partyLabel ?rgb ?party (COUNT(*) as ?count)
WHERE
{
?politician wdt:P39 wd:Q17781726 .
?politician p:P39 ?membership .
?membership pq:P2937 wd:Q30544760 .
?politician wdt:P102 ?party .
?party wdt:P462 ?color .
?color wdt:P465 ?rgb .
SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
}
GROUP BY ?party ?partyLabel ?rgb
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?color")
v6("?count")
v2("?membership")
v3("?party"):::projected
v1("?politician")
v5("?rgb"):::projected
c12(["de"]):::literal
c10(["bd:serviceParam"]):::iri
c2(["wd:Q17781726"]):::iri
c5(["wd:Q30544760"]):::iri
v1 --"p:direct/P39"--> c2
v1 --"p:P39"--> v2
v2 --"p:qualifier/P2937"--> c5
v1 --"p:direct/P102"--> v3
v3 --"p:direct/P462"--> v4
v4 --"p:direct/P465"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind1[/"count(*)"/]
bind1 --as--o v6