Australian Federal MPs in Wikidata
I’m doing some work at the moment for the RAPID-CDL project, documenting the context of Commonwealth Hansard. As a result I’ve been poking around in various sources of related data, such as the Parliamentary Handbook and Wikidata. I was surprised how much data was now available in the Parliamentary Handbook – not just about parliamentarians, but about parties, elections, electorates, and more. It’s a really rich source for understanding how the composition of the Australian parliament has changed over time. Even better, if you look under the hood you’ll see there’s an API that makes all the data available in machine-readable form. For example, this url retrieves summary information about all parliamentarians in JSON format: https://handbookapi.aph.gov.au/api/individuals/.
If you inspect an individual entry in the JSON, you’ll see each MP has a unique identifier in the PHID field. These identifiers are also used to identify speakers in Hansard, so it’s possible to make links between the text of Hansard and the biographical details in the Handbook.
This same identifier is used in the P10020 property on people records in Wikidata. However, when I ran a query to find records with this property, only about 800 of the 1,881 parliamentarians showed up. The people were in there, but not all of their records included the identifier.
To fix this, I downloaded the data about parliamentarians from the Handbook and loaded it in to OpenRefine. I then reconciled the Handbook and Wikidata entries, using a slightly normalised version of the name and the PHID. As I worked through the options returned by the reconciliation process, I checked the Wikidata entries and made some manual edits, such as adding in parliamentary service dates. Once the two datasets were reconciled, I generated a set of QuickStatements to add the P10020 property where it was missing, setting the value to match the PHID identifier in the Handbook.
The result is that all the records for Australian federal politicians in Wikidata are now linked to the Parliamentary Handbook and Hansard. This query finds all 1,881 records with the P10020 property.
Now that they’re linked, I should probably do some more checking to see if there is other data from the Handbook that could be added. There’s a WikiProject page that provides a useful overview of Wikidata’s coverage of Australian politicians.