welfare-state-analytics / riksdagen-corpus

Swedish parliamentary proceedings - Riksdagens protokoll 1867-today
Other
26 stars 5 forks source link

Unit test that dates are consistant in the MP database #372

Closed MansMeg closed 4 months ago

MansMeg commented 11 months ago

We should probably add a unit test on birthdate, dearhdate and mandate periods when we get the mandate period dates up to date. Eg no one should start a mandate before they are born.

BobBorges commented 11 months ago

Absolutely!

BobBorges commented 11 months ago

Do we have a rule of thumb for youngest allowed MP? I checked birth year < mandatae start year -15. And aside from the guy I posted about yesterday, there's this fella who was apparently in FK as a 14yo.

https://www.wikidata.org/wiki/Q117018060

Otherwise, we're pretty good about birth and start dates. Will check the death/end tomorrow & add a unit test for this.

MansMeg commented 11 months ago

Have you checked this in the biobooks? Seem strange, ie probably an error in wikidata.

fredrik1984 commented 11 months ago

His birth/death dates are correct, it was the chamber dates that were wrong. I changed that now in Wikidata. These dates will be more correct when Lotta and Mattias finish their work with bio books 3–5 (this person was in bio book 5)

Regarding how young one can be to be elected to the riksdag it is roughly like this:

First chamber: 36 years old (1867–1911) Second chamber: 21 years old (1867–1911)

1911: 24 years old 1919: 23 years old 1945: 21 years old 1965: 20 years old 1969: 19 years old 1975: 18 years old

MansMeg commented 11 months ago

Boom! Please add this as a unit test (with a comment with a reference if Fredrik has such a reference).

fredrik1984 commented 11 months ago

Ok! If we are going to use that as a unit test then we need to check the historical process more. I realized that I confused the right to vote and the right to be elected. I went back to Nils Stjernquist's book about the bicameral riksdag from 1966 and 1996, and to be honest this was quite confusing to me. The first and second chamber have different rules, and it was difficult for me to follow actually. Perhaps @Lottabrorsson can help out with this later (not super urgent). But I think any MP under 24 years old before 1970 should be red-flagged...

BobBorges commented 11 months ago

if I do birth year < (mandate start year - 24) I get 56 hits. I'll check these carefully.

fredrik1984 commented 11 months ago

Put this on hold for now. Lotta and Mattias will go through specific start/end dates in the bio books/Wikidata and then some of these will be solved. After they have done their work with bio book 3–5 we can test this again.

Another related test would be to red-flag MPs that sat in the riksdag longer than e.g. 40 years.

Lottabrorsson commented 11 months ago

Ok! If we are going to use that as a unit test then we need to check the historical process more. I realized that I confused the right to vote and the right to be elected. I went back to Nils Stjernquist's book about the bicameral riksdag from 1966 and 1996, and to be honest this was quite confusing to me. The first and second chamber have different rules, and it was difficult for me to follow actually. Perhaps @Lottabrorsson can help out with this later (not super urgent). But I think any MP under 24 years old before 1970 should be red-flagged...

@fredrik1984 Yes, I can take a look.

BobBorges commented 4 months ago

this is checked in riksdagen-records/test/mp.py