query-b7cc15d46ed35176a00ecd09e5b88a35
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?countryLabel (sum(?seat) as ?seats) ?population
WHERE
{
?item wdt:P1342 ?seat.
?item wdt:P1001 ?country.
?country wdt:P463 wd:Q1065.
?country wdt:P1082 ?population.
minus {?item wdt:P31/wdt:P279* wd:Q15238777 .} #exclude terms of a legislature
minus {?item wdt:P31 wd:Q189445 .} #exclude items for a bicameral legislature
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?countryLabel ?population order by ?countryLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?country")
v1("?countryLabel"):::projected
v2("?item")
v5("?population"):::projected
v3("?seat"):::projected
v6("?seats")
a1((" "))
c9(["wd:Q189445"]):::iri
c8(["wd:Q15238777"]):::iri
c11(["bd:serviceParam"]):::iri
c4(["wd:Q1065"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P1342"--> v3
v2 --"wdt:P1001"--> v4
v4 --"wdt:P463"--> c4
v4 --"wdt:P1082"--> v5
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c8
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> c9
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
bind3[/"sum(?seat)"/]
v3 --o bind3
bind3 --as--o v6