query-6db262a632bdcf3ebce5e30599a26039

rq turtle/ttl

Propertiessubclass of (P279)part of (P361)position held (P39)date of death (P570)

Use at

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 ?parliament ?parliamentLabel ?houseLabel (COUNT(?sen) AS ?members) (COUNT(?death) AS ?dead)
WHERE { 
?parliament wdt:P279 wd:Q486839.
OPTIONAL {?parliament wdt:P361 ?house }
?sen wdt:P39 ?parliament.
OPTIONAL {?sen wdt:P570 ?death}
FILTER (?parliament NOT IN (wd:Q928764, wd:Q1055894, wd:Q928764) )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
GROUP BY ?parliament ?parliamentLabel ?houseLabel
ORDER BY DESC(?members)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?dead") v5("?death"):::projected v3("?house") v6("?members") v2("?parliament"):::projected v4("?sen"):::projected c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q486839"]):::iri f0[["?parliament != 'wd:Q928764'?parliament != 'wd:Q1055894'?parliament != 'wd:Q928764'"]] f0 --> v2 v2 --"wdt:P279"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P361".-> v3 end v4 --"wdt:P39"--> v2 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P570".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind3[/"count(?sen)"/] v4 --o bind3 bind3 --as--o v6 bind4[/"count(?death)"/] v5 --o bind4 bind4 --as--o v6