query-0a547fcaf19b5ac1f842543dd5270ba1
specify senators who served in a particular legislative term? 19:10, 18 March 2021 (UTC)) talk (M2545)? Advice would be much appreciated! Thank you. -- W. Bazinet. Example: other legislatures (but who served as senators during house members. There should only be 40 senators in the list. How to exclude the people who served in the 1929-1930 legislature as 11 extra names for Massachusetts senators who served in the 1929-1930 legislature returns Listerabot queryThis ⟩ (Q96050576)1929-1930 Massachusetts legislature ⟨ (P2937)parliamentary term ⟩ (Q20058776)member of the State Senate of Massachusetts ⟨ (P39)position held ⟩?item⟨ : I don’t know why you want to exclude this specific legislature, but here we go by filtering out those with a statement like M2545@
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 schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT distinct ?item ?linkcount where
{
{ select ?item where
{
?position wdt:P279* wd:Q20058776 .
?item p:P39 [ps:P39 ?position
; pq:P2937 ?leg
; wikibase:rank ?rank
] . # position held: Massachusetts state senator
filter ( ?leg not in (wd:Q96050576)) .
filter (?rank != wikibase:DeprecatedRank)
} } FILTER NOT EXISTS { # has no en.wikipedia sitelink
?wen schema:about ?item .
?wen schema:isPartOf <https://en.wikipedia.org/> .
}
?item wdt:P793 wd:Q96050576 . # significant event: 1929 legislature
?item wdt:P31 wd:Q5 . # human
OPTIONAL {?item wikibase:sitelinks ?linkcount .} # count of sitelinks
}