Probing Parliament(s) with Wikidata

Wikidata has entries for Members of Parliament and for constituencies, although at the moment the two sets of data are not linked together. Still, I’m interested in what we can do with the biographical data about MPs.

Let’s start by looking at the Parliament of the United Kingdom (other parliaments come later). MPs have the property position held (P39) -> Member of Parliament in the United Kingdom (Q16707842). Right now 10,708 items in Wikidata have this property (covering current and former MPs).

MPs also have the property educated at (P69) which connects them to schools and universities. So we can ask for a list of educational establishments, with the number of MPs (living or dead) who attended them. We can put this into a bubble chart.

Places of education of British MPs (current or past)

The above is a static screenshot: if you go to the interactive display (or download it as an SVG file), the names of the institutions appear as you mouse over each circle. This link takes you to the query.

As you might expect, the most visible places are public schools (in the British sense) and Oxbridge colleges. There are a lot of entries for which Wikidata has place of education as Oxford or Cambridge, but does not have the college, so numbers for Oxbridge colleges are generally underestimates.

It would be interesting to highlight constituencies that have only ever been represented by an Oxbridge graduate, or restrict the query to current MPs, or those in specific roles like the Cabinet, but the data are not available in Wikidata yet.

If we replace Member of the Parliament of the United Kingdom with United States Senator (Q13217683), we get the same query for the US Senate which, unsurprisingly, is dominated by the Ivy League.

Places of education of US Senators (present or part)

Again, go to the live query for the interactive version where the names of the institutions appear on mouse-over.

Another kind of biographical data connects people to jobs. There are multiple ways to express a job in Wikidata. We can say that someone was employed by (P108) a particular organisation in a particular capacity or we can link a particular role via position held (P39). Here, I’m not interested in the specific job role, but in the career someone was known for, like soldier, doctor, or banker. For this, we can use occupation (P106).

Everyone who has served as an MP will hopefully have the property occupation (P106) politician (Q82955). So we exclude those properties and find the most commons jobs for MPs.

Non-politician jobs held by MPs of the United Kingdom

Again, go to the interactive version to mouse over the labels, or go direct to the Wikidata query.

Interesting to see the prominence of cricketer (153 MPs), especially versus association football player (22 MPs) and rugby union player (10 MPs). Presumably other parliaments haven’t had so many cricketers? Let’s substitute the US senate again.

Non-politician jobs held by US Senators.

Here’s the interactive bubble chart, and the query code.

That’s very different! It looks like the path to power in the Senate, for most of its history, has been via the courts (after the Ivy League). This is one illustration of the differing nature of political elites in the two countries.

Clearly there are many more houses of parliament. How many parliaments does Wikidata know about, and how many members does it have for each? We can ask for each type of parliamentarian, then use the property part of (P361) to get the parliament of each. It turns out there are 261 of these.

Query results and query code.

The most common occupation for the US Senate is lawyer. For the European Parliament, it’s journalist. Can we get the most common occupation for each of the 261 parliaments on the list?

This query was a bit beyond my present skill, involving what’s called a named subquery, and I had to ask for help, but fortunately Wikidata’s community was very helpful.

Extract from the results table for most common job for 261 parliaments

Here are the live results and the query code.

Most parliaments have lawyer as their most-common job, but not all. Among the exceptions, the Parliament of Norway has farmer; the Chamber of Deputies of the Parliament of the Czech Republic has educationalist; the Seimas of the Republic of Lithuania has university teacher; the Senate of Ancient Rome has soldier.

The number of UK MPs with a scientific background has long seemed to me to be shockingly small. It would be straightforward to adapt this query to rank parliaments by the number (or better still, proportion) of scientists, and if the data were richer, to rank particular sessions of parliament, eg. the 56th Parliament of the United Kingdom. We could define “scientists” by qualifications, by profession, or both.

Here we’ve really only looked at two pieces of biographical data, but there is a lot they can reveal, and Wikidata queries and visualisations give a much more immediate way to explore this information than clicking endless links in Wikipedia.