Wikidata:EveryPolitician/Report:National Legislatures/membership items
Jump to navigation
Jump to search
Try it!
This is a list of every national legislature, along with the item representing membership of it. This checks both for a has part(s) (P527) on the legislature pointing at a subclass of legislator (Q4175034) (the ?part column), and for any member of parliament (Q486839) item with this legislature as its part of (P361) (the ?mp column). The correct membership item should be returned by both of these methods.
This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!
WDQS | PetScan | TABernacle | Find images | Recent changes | Query:SELECT DISTINCT ?country ?item ?part ?mp WHERE { ?country wdt:P31 wd:Q6256 . OPTIONAL { VALUES ?type { wd:Q10553309 wd:Q37002670 } ?item wdt:P31/wdt:P279* ?type ; wdt:P1001 ?country . FILTER NOT EXISTS { ?item wdt:P576 [] } . # no end date OPTIONAL { ?item wdt:P527 ?part . ?part wdt:P279* wd:Q4175034 } OPTIONAL { ?mp wdt:P279* wd:Q4175034 ; wdt:P361 ?item } FILTER NOT EXISTS { ?part wdt:P279* wd:Q1758037 } FILTER NOT EXISTS { ?mp wdt:P279* wd:Q1758037 } } }
End of automatically generated list.
The underlying query behind this report is:
SELECT DISTINCT ?country ?countryLabel ?item ?itemLabel ?part ?partLabel ?mp ?mpLabel
WHERE {
?country wdt:P31 wd:Q6256 .
OPTIONAL {
VALUES ?type { wd:Q10553309 wd:Q37002670 }
?item wdt:P31/wdt:P279* ?type ; wdt:P1001 ?country .
FILTER NOT EXISTS { ?item wdt:P576 [] } . # no end date
OPTIONAL { ?item wdt:P527 ?part . ?part wdt:P279* wd:Q4175034 }
OPTIONAL { ?mp wdt:P279* wd:Q4175034 ; wdt:P361 ?item }
# Don't include the Speaker
FILTER NOT EXISTS { ?part wdt:P279* wd:Q1758037 }
FILTER NOT EXISTS { ?mp wdt:P279* wd:Q1758037 }
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY ?countryLabel ?itemLabel