Our man in Havana (or, Q56761118)

Has it really been a year since I posted here? Oh, dear. Well. So, this Friday/Saturday I went to the FCO’s hackathon event – wonderfully titled “Who Was Our Man In Havana?” – to have a play with a dataset of British diplomats.

My goal was to try and synch this up with Wikidata in some way – there were obviously some overlaps with the MPs project, but given how closely tied the diplomatic service has been into the establishment, it seemed likely there would be a lot of overlap. The objective of the event was to produce some kind of visualisation/interface, so after a bit of discussion with my team-mates we decided to get the data cleaned up, import some into Wikidata, and pull it out again in an enriched fashion.

The data cleaning was a bit of a challenge. Sev and Mohammed, my team-mates, did excellent work hacking away at the XML and eventually produced a nice, elegantly-parsed, version of the source data.

I uploaded this into Magnus’s mix-and-match tool, using a notional ID number which we could tie back to the records. Hammering away at mix-and-match that evening got me about 400 initial matches to work with. While I was doing this, Sev and Mohammed expanded the XML parsing to include all the positions held plus dates, tied back to the notional IDs in mix-and-match.

On Saturday, I wrote a script to pull down the mix-and-match records, line them up with the expanded parsing data, and put that into a form that could be used for QuickStatements. Thankfully, someone had already established a clear data model for diplomatic positions, so I was able to build on that to work out how to handle the positions without having to invent it from scratch.

The upload preparation was necessarily a messily manual process – I ended up compromising with a script generating a plain TSV which I could feed into a spreadsheet and then manually lookup (eg) the relevant Wikidata IDs for positions. If I’d had more time we could have put together something which automatically looked up position IDs in a table and then produced a formatted sheet (or even sent it out through something like wikidata-cli, but I wanted a semi-manual approach for this stage so I could keep an eye on the data and check it was looking sensible. (Thanks at this point also to @tagishsimon, who helped with the matching and updating on mix-and-match). And then I started feeding it in, lump by lump. Behold, success!

While I was doing this, Mohammed assembled a front-end display, which used vue.js to format and display a set of ambassadors drawn from a Wikidata SPARQL query. It concentrated on a couple of additional things to demonstrate the enrichment available from Wikidata – a picture and some notes of other non-ambassadorial positions they’d held.

To go alongside this, as a demonstration of other linkages that weren’t exposed in our tool, I knocked up a couple of quick visualisations through the Wikidata query tool: a map of where British ambassadors to Argentina were born (mainly the Home Counties and India!), or a chart of where ambassadors/High Commissioners were educated (Eton, perhaps unsurprisingly, making a good showing). It’s remarkable how useful the query service is for whipping up this kind of visualisation.

We presented this on Saturday afternoon and it went down well – we won a prize! A bottle of wine and – very appropriately – mugs with the famed Foreign Office cat on them. A great weekend, even if it did mean an unreasonably early Saturday start!

So, some thoughts on the event in conclusion:

  • It was very clear how well the range of skills worked at an event like this. I don’t think any of us could have produced the result on our own.
  • A lot of time – not just our group, but everyone – was spent parsing and massaging the (oddly structured) XML. Had the main lists been available as a CSV/TSV, this might have been a lot quicker. I certainly wouldn’t have been able to get anywhere with it myself.
  • On the data quality note, we were lucky that the names of records were more or less unique strings, but an ID number for each record inserted when the original XML was generated might have saved a bit of time.
  • A handful of people could go from a flat file of names, positions, dates to about a thousand name-position pairs on Wikidata, some informative queries, and a prototype front-end viewer with a couple of days of work, and some of that could have been bypassed with cleaner initial data. This is really promising for

And on the Wikidata side, there are a few modelling questions this has thrown up:

  • I took the decision not to change postings based on the diplomatic rank – eg someone who was officially the “Minister to Norway” (1905-1942) conceptually held the same post as someone who was “Ambassador to Norway” (1942-2018). If desired, we can represent the rank as a qualifier on the item (eg/ subject has role: “chargĂ© d’affaires”). This seemed to make the most sense – “ambassadors with a small ‘a'”.
  • The exception to this is High Commissioners, who are currently modelled parallel to Ambassadors – same hierarchy but in parallel. This lets us find all the HCs without simply treating them as “Ambassadors with a different job title”.

    However, this may not be a perfect approach as some HCs changed to Ambassadors and back again (eg Zimbabwe) when a country leaves/rejoins the Commonwealth. At the moment these are modelled by picking one for a country and sticking to it, with the option of qualifiers as above, but a better approach might be needed in the long run.
  • Dates as given are the dates of service. A few times – especially in the 19th century when journeys were more challenging – an ambassador was appointed but did not proceed overseas. These have been imported with no start-end dates, but this isn’t a great solution. Arguably they could have a start/end date in the same year and a qualifier to say they did not take up the post; alternatively, you could make a case that they should not be listed as ambassadors at all.

Haring about

So, last weekend, wandering through the market and wondering what to make for dinner – venison sausage stew, in the end, which was just as good as you might expect and carried me through to Wednesday – I noticed some recently deceased hares hanging outside one of the butchers; wandering a bit further on, I found some skinned and on sale. I was sorely tempted, but refrained on the ground that a) I had no idea what to do with them, and b) they were certainly too large to cook for myself, unlike a rabbit, which you can just about manage on your own.

Thinking about it afterwards, though, the temptation grew. Some research found recipies; some further questioning found some volunteers to eat it, and so on Thursday I bought a hare, stashed it in the freezer, and began to plot.

First discovery: it takes longer to thaw out a hare than you might think. Second discovery: ditto dismantling. I think I finally had it butchered about 1am on Saturday morning, with the kitchen looking like something of a charnel house. (Who would have thought the old man to have had so much blood in him?) Net product, two thighs (large), two forelegs (skinny), and a pile of chopped bits of meat. This is, I think, the first time I’ve dealt with the carcass of something wild rather than farmed – the prominent gunshot wound through the ribcage was a bit of a giveaway. An interesting, if messy, experience.

The reason I was butchering it the night before was in order to marinade it; a bottle or so of red wine, some wine vinegar, garlic, a chopped onion, some chopped carrots, and a handful of peppercorns, cloves, and a bouquet garni, something I always worry I will mistake for a teabag at the wrong moment. Stick it in the fridge (needing to rearrange the fridge in the process) and leave overnight.

Saturday, into town in the morning for some groceries, and then to work. Empty out the bowl, meat to one side, straining out the onion and carrot from the liquid; keep the marinade or discard it and start again with fresh wine, as you see fit. (I did the latter, partly because of an oversupply of cooking wine…). Fry the meat to brown it; the problem is, of course, that it has marinaded overnight in red wine, and so is somewhere between purple and black, so identifying “browned” is a bit tricky. Give it a shot.

I was aiming to feed five, so three duck legs to go with it – partly because duck would add some fat to the stew, and partly because I wasn’t sure quite how far the hare would go, and having one large leg per person seemed wise. Put all the meat into a large pot, cover with the strained marinade (or fresh wine) and some stock, begin simmering.

I ate the first of the hare at this point, one of the smaller pieces – it was cooked through – and it was… unexpectedly strong. I mean, I’d been expecting strong, but stronger than that; much more removed from rabbit than I’d expected.

The other elements were fairly simple, as well; some butter beans and a handful of carrots, which always stew up beautifully, plus the onions and carrot from the marinade, fried with a little bacon and then thrown in. Cover the pot and keep on a low heat for two hours, or longer. I served it with boiled potatoes, which were lovely, and some green beans, which were perhaps superfluous and could easily have been set aside in favour of more carrots (which were meltingly lovely).

So, the verdict? Interesting. Very strong; not unpleasant, but sharp and gamey, a bit more so than I’m normally comfortable with. I’m not sure the marinade really offset it much; I think I might try a different composition next time, and see if that helps. The other possibility is roasting it rather than stewing it – with a lot of additional fat – which does seem quite interesting but means I’d have to put a lot more effort in, and I’m not sure how the flavours would come out that way. My grandmother tells me that in the thirties she used to get hare soup after her father’s friends went shooting, which seems like it would work – the flavour would carry very well.

An interesting meal and worth it as an experiment, but I think I might stick with rabbit until I’ve had a chance to eat hare prepared by someone else and see what they do with it!

Somehow, this does not surprise me

From the Guardian yesterday, a letter from Kettering:

As chair of Kettering’s Muslim Association and incumbent of the largest Anglican parish in the town centre, we were struck by the irony of our MP’s plans to refuse to meet any of his constituents who wear a veil. Such a form of dress is not, to our knowledge, worn by anyone in the local community. Not a single Muslim female has visited Mr Hollobone, veiled or unveiled, since he was elected. Our town has its share of social challenges, but it is plain to us that none of them relate to problems that can be linked to any religious issues. In the past Mr Hollobone has expended great energy on issues that genuinely affect his constituents. It is our hope that he might refocus his priorities to the benefit of those whom he has been elected to serve.

Dominic Barrington Priest-in-charge, Ss Peter & Paul, Kettering
Inam Khan Chair, Muslim Community Association, Kettering

OpenOffice silliness

OpenOffice has an autocorrect function – so, if you type shcool, it will silently fix it to “school”. No big deal, there.

It also has an option to select local language variant – so you can autocorrect honour to honor or vice versa.

It then turns out it does it with vocabulary. Um.

Set it to UK English, start writing in an American register, and “sidewalk” becomes “pavement”. “Zip code” becomes “postcode”. Thankfully these are the only two examples I’ve found, but – really. Who on earth though that was a sensible idea to implement? If someone’s writing with American vocabulary as opposed to simply spellings, despite having a different dictionary set, they probably mean to do so…

Thought for the day

The lowest vote share a party has taken in a general election and still held a majority is 38% – the Conservatives in 1923. Labour formed a minority government in 1929 on the back of 37.1% of the vote share; and a minority government again in February 1974 on the back of 37.2% of the vote. …35.3%, in 2005. Goodness, do I feel a bit silly for missing that one – thanks cim for spotting it.

It’s likely that whatever result we get on Thursday, we’re going to break that record; barring a sudden Conservative surge, a hypothetical narrow-majority government will have the lowest share of the electorate’s support any majority government has ever had. A minority Conservative government – if the Lib Dems pass up coalition – would quite possibly, again, have the lowest level of support recorded for a sole party in power.

Reassessing: on current polling, it’s likely the Conservatives will either form a majority government on slightly above the 2005 vote-share, or potentially a minority government – if a Lib-Lab coalition fails – on slightly below it. Not the best of omens for making sweeping changes, but it’s remarkable to see the dramatic difference – in seat numbers and in general perceptions of strength – between what the Conservatives would get with 36% tomorrow, and what Labout got with 36% half a decade ago.