Task 4: Check that the data is consistent

Lucy Chambers
mySociety for coders
5 min readJun 5, 2017

Update: 2017–06–05. This mission is now over. But don’t despair, you can still help! There are now more missions like this over on the Wikidata:WikiProject Heads of state and government. Come join us!

Welcome back. You are on post four of five of a quest to get complete information for all heads of government in Wikidata. Once we’ve got it, we’ll be analysing the data and trying to work out “What is the gender breakdown of heads of government across the world?”. You are welcome to start here, or from the beginning (it doesn’t matter which order you do the steps).

Today, we actually have two missions. So far, we have been mainly filling in gaps. We have another gap for you today. By the time we have filled that gap, we will have complete data for all three ways we know about to ask the question. You know what that means: we also have to check whether the data is consistent.

Let’s look at why this is in more detail:

In steps one and two, we made the two hops at the top by asking:

1. “What is the office held by the head of government in each country?”

And then:

2. “Who currently occupies the role of head of government [in a given country]?”

In step three, we asked the question in reverse:

3. “What is this person’s office?”

Some of you may have thought: “That seems unnecessarily complicated, can’t I just add a head of government?”. Well, you would be right — we can add a head of government (P6) statement to a country item. It may look complicated, but it is handy to have multiple ways to ask a question and it allows us to cross-check data (more on this later)…

The full picture. How all of the information relates to other information in Wikidata.

Mission 1: Fill in the gaps & check information is correct

So, now let’s have a look at how complete the information for P6 is. Enter stage left: the Heads of Government report. Here’s a snapshot of what it looks like at time of writing:

As you can see, it’s in pretty good shape (possibly because it is more intuitive to add a head of government to a country page than do the two step process outlined above) but we still have gaps!

To add this information — visit the country page and check whether there is an existing statement for head of government.

If there isn’t, add one. Start typing: head of government.

Note: we are writing this with English as our default language, but you can use Wikidata in your language and search for the equivalent, or just type P6 and you’ll get the right result!

Check whether the current head of government is present in the list. For BONUS POINTS, add the start time as a qualifier on the statement. Adding a start time but no end time shows that this person is the person who is currently in office.

If you want to be a total pro, you can also rank the entry as preferred. (Wikidata documentation on ranks here). This tells Wikidata that this is the most up to date information for this statement. If there are other heads of government listed on the statement you should add an end time and also rank those as normal.

Mission 2: Check information is consistent

As we’ve discussed, the next thing we need to check is that the information from the various routes is consistent. We now have three ways of entering this information, so we need to check they are saying the same thing. Luckily, there’s another report which helps us to do this — the head of government contrast report.

There’s a couple of things we are looking for here:

  • Blanks (like always)
  • Places where the information differs between columns. This shows that there is some kind of inconsistency in one of the three ways to enter the information. That makes clear that one of them is obviously wrong.

This report can’t tell us what data is wrong, just where it is inconsistent, so it is fully possible that you would have to update all three records — because all of them might be wrong! Please do if this happens!

Your mission is to check that the information is present and correct so that it can report for duty in answering the question in our end-goal.

As with before, if the data is wrong and reflects a previous head of government, that is probably because someone has not added an end time on one of the entries. You can probably see now that there are three places that this needs to be added (on the P1308 statement on the office, on the P39 on the person and on the P6 on the country.)

Summary

We now have the full picture of all of the ways we can enter information on head of government into Wikidata, and a mechanism to check that it is internally consistent.

In our final post, we will try to answer the question:

So, what is the gender breakdown of heads of government?

Delhi, near Parliament Building (CC-BY | Kartikeya Kaul)

--

--

Lucy Chambers
mySociety for coders

Plain language talker on tech. Twitter = ⚡️reactions.