All Wikidata items for UK Parliamentary Constituencies (current and historic) should have a P1410 "number of representatives in legislature" claim (currently this is always 1, but historically some had more than this). The main statement generally exists, but in the vast majority of cases (2136) it is missing the required qualifier to say which legislature this applies to, and in 17 of the ones with the qualifier, it's pointing at Parliament rather than the House of Commons.
fix-constituency-body-uk.rb
:
SELECT DISTINCT ?reps
WHERE {
?item wdt:P31 wd:Q27971968 ; p:P1410 ?reps .
?reps pq:P194 wd:Q11010 .
}
Run as:
wd sparql fix-constituency-body-uk.rb | awk '{ print $1, "P194 Q11010 Q11005" }' |
wd uq --batch --summary "Migrate body to HoC"
-> https://tools.wmflabs.org/editgroups/b/wikibase-cli/aa0f5efe99424
add-constituency-body-uk.rb
:
SELECT DISTINCT ?reps
WHERE {
?item wdt:P31 wd:Q27971968 ; p:P1410 ?reps .
FILTER NOT EXISTS { ?reps pq:P194 [] }
}
Run as:
wd sparql add-constituency-body-uk.rb | awk '{ print $1, "P194 Q11005" }' |
wd aq --batch --summary "Add missing 'body' qualifier for HoC constituencies"
-> https://tools.wmflabs.org/editgroups/b/wikibase-cli/1ef613d11db
89 constituencies don't have a "number of respresenatives" claim at all: https://w.wiki/a8t