PopIt Coalitions

This morning I finally got around to adding some historic Coalition data to the Eduskunta PopIt.

(For those of you wanting to play along at home, Github has the JSON I used for this, the script I generated that JSON from, and the script I used to upload the JSON to PopIt.)

On the assumption that I got the data format correct (which is a quite big assumption!), it seems that I can do the basic stuff I need OK over the API, but the web interface doesn’t cope with any of this at all.

• These appear successfully in the party’s related Organizations

• However, using the ?at= parameter to restrict those to a specific date doesn’t work. I’m guessing this is because it only looks for dates on the Membership itself, and doesn’t look at the related Organization’s founding/dissolution dates. (I haven’t tested yet if this is also true of a simple Person:Organisation membership.) I could, of course, work around this by duplicating the coalition’s dates of existence into each membership, but I suspect ?at= should simply do the right thing here.

• To get a list of all coalitions a party was part of I can search by member.id:popit.eduskunta/party/kd AND role:government

I didn’t have the ‘role=government’ entry on each Membership to start with, but then added them because I thought I needed them to be able to do queries like this. It turns out that I didn’t actually need to do this, as I can also search by member.id:popit.eduskunta/party/r AND organization.classification:coalition

Leaving the label on the Memberships seems potentially useful though, so for now I’m going to keep it.

(Aside: Needing to search by member.id seems to imply that in other contexts you’d need to know whether a person’s membership was created using person_id or member{@type:person}, both of which should otherwise be identical, in order to be able to query it.)

• To filter those to a specific date, I think I need to search on something like: member.id:popit.eduskunta/party/kd AND organization.classification:coalition AND organization.founding_date:{*+TO+1994-04-11} AND organization.dissolution_date:{1994-04-11+TO+*}

(or, at least, this seemed to work, after discovering that the documentation for date searching was wrong.)

This gets tricky with records that don’t have both of those though, and with partial dates, etc., so ideally PopIt could take care of all this for me.

• I haven’t even tried to work out yet whether there’s a single-query version of “At date X, what party was person Y part of, and were they part of the government coalition?” (which is the main query I need for votes)

However, the UI doesn’t seem to handle Coalition information at all yet:

Viewing the party only shows its MP, not either of the Coalitions they’ve been part of

• Trying to view the Organization page for the Coalition itself gives a 500 error

Leave a Reply

Your email address will not be published. Required fields are marked *