Wikidata talk:WikiProject British Politicians/Archive 1

From Wikidata
Jump to navigation Jump to search

Additional MP related properties

Additional MP related properties have been added: Wikidata:Property proposal/Authority control#British political IDs. I'm not sure about the Hansard one as the Formatter URL hardcodes the 2013-14 session. That was the primary problem which prompted the activity on en:Template:UK MP links which in turn prompted the addition of these properties. There's currently a wikidata driven version of the template in its sandbox. Bazj (talk) 19:29, 12 October 2015 (UTC)

Oh, great, thanks; hadn't realised these were live yet. I'll add these to the stats table once I've done the next code update - currently trying to make it only display figures for the relevant periods, eg parliament.uk for the last two terms only. Andrew Gray (talk) 19:39, 12 October 2015 (UTC)

Wikimania 2016

Only this week left for comments: Wikidata:Wikimania 2016 (Thank you for translating this message). --Tobias1984 (talk) 12:02, 25 November 2015 (UTC)

Identifiers for MPs

I'm a bit puzzled by the properties we have for current MPs:

Relatively few members have P2170.

Is there a way to improve this? It seems that both sites can be accessed by merely using the digits from P1996. Maybe we could place it in a new property or remove the redundant part of P1996.
--- Jura 11:09, 1 July 2016 (UTC)

Jura1, there are now three overlapping sites involved. The parliamentary record, Hansard, is now split over:
The first & last work equally over the Commons & the Lords, while the second has different URLs for each. All three are required for a complete historical record. An examination of an MP's membership (using the Qq listed at Wikidata:WikiProject British Politicians#United Kingsom) is needed to check which Hansards are relevant to a given MP/Lord.
P2170 is definitely no longer the "Hansard (current session) ID".
A discussion started at en:Template talk:UK MP links:Hansard... again. For (;;) (talk) 05:07, 15 August 2016 (UTC)
Thanks for your feedback. I updated the label of P2170 to remove "(current session)".
--- Jura 17:17, 15 August 2016 (UTC)

These days we keep getting MPs ..
--- Jura 13:50, 14 August 2016 (UTC)

Connecting Party and legislative membership?

Currently member of political party (P102) is simply related to the person, not to any of the position held (P39) memberships. This is usually fine, as (at least within a UK context) people tend to change Party fairly infrequently, and when they do it's "all or nothing", and what Party someone was part of during any parliamentary term can be derived fairly easily from the dates on P102. However, this falls down where someone has been a member of multiple parties simultaneously, for example in the case of a dual mandate. Whilst this is a little more rare these days, prior to the 2009 elections, MPs could simultaneously be MEPs. So, for example, we need to have a way to say that John Hume (Q193630) was a Social Democratic and Labour Party (Q175443) member in respect of his Westminster / NI positions, but a Party of European Socialists (Q220945) member of the European Parliament (Q27169). I have also come across examples where someone has been removed from their parliamentary party in one setting, but whilst sitting as an Independent there continues to be part of the party group in a different context — e.g. in a regional assembly or city council. Any thoughts on the best way to handle this? My suspicion is that there should be a qualifier to P39, similar to the addition for parliamentary term (P2937), though perhaps a qualifier on member of political party (P102) could work too. (The ideal version would also work in countries where there is a much stronger distinction between a plain membership of a political party vs a membership of the parliamentary faction — e.g. in Germany, where MPs seem to be currently modelled with a plain affiliation (P1416) to their Bundestag parliamentary group (Q1509758) (e.g. Angela Merkel (Q567)) --Oravrattas (talk) 08:32, 29 December 2016 (UTC)

@Oravrattas: been a long while coming, but I finally overhauled this - thoughts? Basically, everything in as qualifiers under P39, and multiple P39s for break of service / change of party / change of seat. Party is member of political party (P102) rather than affiliation (P1416), thouh.
One aspect also worth noting is that member of political party (P102) doesn't automatically imply sitting on behalf of that party - so someone who's had the whip suspended is probably still a member of the party in their personal capacity, and it should be left in place as a primary property. Andrew Gray (talk) 19:55, 18 February 2017 (UTC)
@Oravrattas: If we're talking about John Hume (Q193630) it may be more meaningful to say that John Hume (Q193630) member of political party (P102) Social Democratic and Labour Party (Q175443) and Social Democratic and Labour Party (Q175443) member of (P463) Party of European Socialists (Q220945).
Similarly, for a current Labour MEP, I see we have Judith Kirton-Darling (Q16563740) member of political party (P102) Labour Party (Q9630) and Labour Party (Q9630) member of (P463) Party of European Socialists (Q220945) (and then the PSE is in turn manifests itself in the EP as Progressive Alliance of Socialists and Democrats (Q507343))
This is a better structure for searching, because political parties can and do change their group affiliations in Brussels -- indeed some groups have only come into being after a tricky wrangling period several weeks after the election.
Fundamentally the John Hume was in the PSE group was that that was the SDLP's affiliation -- so (IMO) it's better to mark him as a member of the SDLP (only). Jheald (talk) 20:32, 18 February 2017 (UTC)

Replaced and replaces

I've been wondering about these two qualifiers on position held (P39). They work fine for single-member seats but don't really make sense for people in multi-member constituencies. We should also be able to reconstruct them with a query easily enough assuming dates and constituencies are in place (which they should be). Should we leave them out of the recommended properties? (ping Oravrattas) Andrew Gray (talk) 19:12, 18 May 2017 (UTC)

@Andrew Gray: I've always been a little hesitant about those as well, though for a slightly different reason. In cases where there are separate position held (P39) entries for distinct consecutive memberships(*), the replaces (P1365) and replaced by (P1366) aren't relevant. I think it's useful to have them where they make sense (and the 'double-entry' nature of the data being available directly or deduced from the other people's data gives a useful sanity check for possibly incorrect or inconsistent information), but I agree that they should be optional rather than mandatory.
* the current specification here says that these can be rolled together but (a) in lots of other countries, each term/mandate gets a separate P39, so the same issue applies with these; (b) having multiple parliamentary term (P2937)s and elected in (P2715)s that don't really match each other on a single P39 seems wrong to me. it certainly makes the data easier to enter than a single position held (P39) for each term, but I fear that it'll confuse a lot of queries (and, in the UK at least, is strictly inaccurate, as the position does actually cease between terms (like at present)). So even if we allow people to take the short-cut initially, I expect that over-time a lot of the entries will end up getting split-out.)
--Oravrattas (talk) 08:24, 19 May 2017 (UTC)
Fair enough - I'll make the changes and note it as optional-but-not-necessary. Modelling the gaps between parliaments is going to be more complicated and I'm not going to touch that just yet :-) Andrew Gray (talk) 12:15, 21 May 2017 (UTC)

Linking elections and parliamentary terms

We currently have a full set (at least for 1801 onwards) of both Westminster legislative terms and elections (eg/ 21st Parliament of the United Kingdom (Q21084438) & 1874 United Kingdom general election (Q918351)), but no clear way to link them. The most logical would seem to be 21st Parliament of the United Kingdom (Q21084438) : elected in (P2715) 1874 United Kingdom general election (Q918351), but I'm not sure if there is a more elegant way of representing it. P2715 is notionally only as a qualifier on P39, but this could always be adjusted. Andrew Gray (talk) 19:52, 18 May 2017 (UTC)

@Andrew Gray: Yes, this has been bugging me for a while too. I tend to connect them up the other way around at the minute: e.g.
but it would certainly be useful to be able to link directly to the Term from the Election. --Oravrattas (talk) 08:34, 19 May 2017 (UTC)
I'll go ahead and do this. On the other approach, it seems a bit odd to say the election is for office:MP - I agree it's a sensible way to represent it, but it just feels a bit weird to me. Not quite sure why :-). I take it we'd do the same for by-elections but add an additional constituency qualifier, as in 2016 Richmond Park by-election (Q28100207)?
Incidentally, I've noticed quite a few general elections use "office contested: Prime Minister" with the "winner" being the PM who follows - probably because they're in the enwp infoboxes. This *definitely* feels wrong and I feel we ought to remove them - thoughts? Andrew Gray (talk) 12:13, 21 May 2017 (UTC)
Saying that an election is for the PM is one of those things that is strictly incorrect (in the UK at least), though I can see why people do it. I've always been a bit reluctant to remove it, so I tend to just add that it's really for the MPs. It doesn't seem odd to me at all to say that the office contested in 2015 United Kingdom general election (Q3586935) was "MP for the 56th Parliament", so I'm definitely interested if you can probe any deeper into why it seems weird to you! (and, yes, for by-elections, I've been qualifying it with the constituency as well) --Oravrattas (talk) 12:14, 23 May 2017 (UTC)

@Andrew_Gray: Currently it looks like it's suggested to use Q5188683 as a qualifier on elected in (P2715) — as done on Winston Churchill (Q8016). This seems wrong to me, as really all values for P2715 should be an instance of public election (Q40231). I think it would be cleaner to use this with a end cause (P1534) qualifier on the preceding membership instead (as I've added to his 1900-1904 P39), with the elected in (P2715) on the membership explicitly set to no value instead (which I haven't done yet) --Oravrattas (talk) 06:50, 11 June 2017 (UTC)

Yes, this makes sense. Andrew Gray (talk) 10:27, 11 June 2017 (UTC)
Great. I've updated the documentation, and set the relevant position held (P39) on Winston Churchill (Q8016) --Oravrattas (talk) 13:10, 11 June 2017 (UTC)

End dates on current P39s?

@Andrew Gray: you currently suggest than end time (P582) be set to novalue on a still-current position held (P39). This seems slightly wrong to me, as that seems to be saying that it will never end. If we need to have a value here, I suspect unknown value might be slightly, although my personal preference would be to simply omit end time (P582) unless/until there actually is one. I'm certainly open to my understanding here being wrong though — the documentation doesn't really cover these sorts of cases. --Oravrattas (talk) 13:19, 11 June 2017 (UTC)

Yes, you're correct - I'll fix it. Andrew Gray (talk) 13:26, 11 June 2017 (UTC)
unknown value says "this has ended, but we don't know when that happened". Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:51, 11 June 2017 (UTC)
@Pigsonthewing: is the correct thing then to simply omit the qualifier? (PS is there better documentation for this than the quite vague version at Help:Statements?) --Oravrattas (talk) 16:17, 11 June 2017 (UTC)
Yes, I'd just omit it. AS for the documentation, I think it's OK - have you seen the Shakespeare example? But feel free to make improvements! Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:29, 11 June 2017 (UTC)

Dates for P39

On a position held (P39):Member of Parliament (Q16707842) pair, what dates should we use for the start time (P580) and end time (P582) qualifiers?

  • start time (P580) options
    • the date of the election
    • the date the result of the election is announced
    • the date they are sworn in to Parliament
  • end time (P582) options -
    • date of dissolution [date they officially stopped being an MP]
    • date of next election [ie when the next one is elected]

My feeling is that the most practical approach is, barring special cases:

  • start time (P580): date of the election (use "last day of polling" for pre-1910 elections if exact polling day not known)
  • end time (P582): date of dissolution, resignation, or death

This seems broadly consistent with most of what's currently out there. Thoughts? Andrew Gray (talk) 14:37, 11 June 2017 (UTC)

I'd personally lean more towards the date of announcement than the date of election, but I'm not sure what's strictly correct, and don't have a particularly strong opinion on it. NB: We can also use oath of office date (P1734) as a modifier if we want to capture that separately (ad it might actually be worth explicitly setting that 'no value' for the Sinn Féin (Q76382) MPs) --Oravrattas (talk) 16:15, 11 June 2017 (UTC)
I'll put down "date of election" & we can always fix it later if needed. If nothing else, it means everyone has a consistent date and we don't have it smeared over two days with three people in Sunderland followed by everyone else. Andrew Gray (talk) 16:29, 11 June 2017 (UTC)
ITYM "Newcastle" [1] ;-) Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:38, 11 June 2017 (UTC)

Country of Constituency?

I wanted to run reports based on which MPs were elected to constituencies in Scotland, Wales, Northern Ireland, or England, but I'm not so sure we actually have that information.

Only 57 of the constituencies have a located in the administrative territorial entity (P131) set on them (with wildly inconsistent types of entry where it is set):

SELECT ?item ?itemLabel ?territory ?territoryLabel {
  ?item wdt:P31 wd:Q27971968 .
  FILTER NOT EXISTS { ?item wdt:P576 [] }
  OPTIONAL { ?item wdt:P131 ?territory }
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
ORDER BY ?itemLabel
Try it!

Is there a different route that I'm overlooking, or do we need to go through and set that property on all of these?

(NB: there also only 590 results from this query, which means we also need to track down 60 missing ones too. My bet is that many of these are going to be constituencies that were reconstituted after having previously been abolished. Arfon (Q750978), for example, had an inception date of 2010 but a dissolution date of 1918… This won't affect this query in practice, as we'd be doing it on the constituency attached to a P39 in a term, rather than filtering based on dates, but it would be useful to fix these all up at some point.)

--Oravrattas (talk) 21:59, 11 June 2017 (UTC)

here's some candidates for that, where the inception (P571) is later than the dissolved, abolished or demolished date (P576):
SELECT ?item ?itemLabel ?start ?end {
  ?item wdt:P31 wd:Q27971968 ;  wdt:P571 ?start ; wdt:P576 ?end .
  FILTER (?start > ?end)
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
ORDER BY DESC(?start)
Try it!
--Oravrattas (talk) 22:03, 11 June 2017 (UTC)
I've cleaned up the items that were a mixture of a current constituency and a historic one — which now leaves us with 662 active. I'm going to hope for now that there are simply 12 needing a dissolution date, and all 650 are actually included there. Once we get all the P39s correctly set, then we can cross-reference with these to look for the extras or missing ones. --Oravrattas (talk) 08:42, 12 June 2017 (UTC)
  • On territorial area, I think we'll have to set these manually. I don't know offhand what the best set to use is, though - country is sensible but it might be worth using the first-level regions such as East of England (Q48006) in England. In Scotland and Wales, Holyrood/Assembly constituencies could be listed as inside the electoral regions, since linking those together makes a lot of sense. Andrew Gray (talk) 21:25, 12 June 2017 (UTC)

represented by (P1875) on a constituency page?

Most of the UK constituency pages have a represented by (P1875) entry on them: e.g.

⟨ Rhondda (Q1032058)  View with Reasonator View with SQID ⟩ represented by (P1875) View with SQID ⟨ Chris Bryant (Q266146)  View with Reasonator View with SQID ⟩
member of political party (P102) View with SQID ⟨ Labour Party (Q9630)  View with Reasonator View with SQID ⟩

That's certainly an interesting idea, but it's currently a violation of a constraint on that property (only a human can have a representative), as it seems it's meant to be used for agents in the acting/modelling/etc sense. Should we (a) simply delete all these? (b) widen the scope of the property? (c) use a more appropriate property for this? (d) live with the constraint violation warnings for now? (e) something else? If we're going to want to keep this information on the constituency pages in some way, then we're going to need to update the ones who now have a new MP. If we do want to keep this, I think I could fairly easily write a report page that highlights inconsistencies between this and any active P39 for the constituency, similar to the Head of Government one --Oravrattas (talk) 08:32, 12 June 2017 (UTC)

I'm ambivalent about a vs. b (generally, we have too many inverse statements, contravening the DRY principle; and too often we let constraints drive things, rather than serving us), but b is better than c or d. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 08:54, 12 June 2017 (UTC)
I have been removing these when I spot them - it's much better to do this inversely through properties on the MP. There used to be a property explicitly intended for this (can't find it now; possibly deleted) but that was hardly ever used. And, as you say, it's very much a hostage to fortune if we use it as a "current MP" value. Andrew Gray (talk) 19:25, 12 June 2017 (UTC)
AIUI, the main value of having it on the constituency item itself is that it makes the "who is the current MP for this constituency?" query significantly easier, particularly from the Wikipedia page (where it's a simple direct call, rather than a complex query). I'm not really a Wikipedian though, so I don't know how much of an issue that is. Keeping them in sync definitely has issues, but it's not insurmountable if this is actually a use case we need to be considering, and the "double entry" nature of it can actually provide a useful check in cases where the P39 data is incorrect/out of date too. --Oravrattas (talk) 19:43, 12 June 2017 (UTC)
I guess one risk with this is that there's no real reason it has to be limited to the current MP - so you get into the potential for a long list of past members, and an exponentially growing set of data to keep synchronised. Potentially a lot of maintenance work there. On the other hand, as you say, it does allow for some error-correction and quick querying. Andrew Gray (talk) 20:16, 12 June 2017 (UTC)
Yep, though that's true for any use of officeholder (P1308)-esque properties, including things like the direct head of government (P6) on cities, states, regions, cities, etc. I agree that in an ideal world, Wikidata would be able to derive these sorts of things automatically, or have a way to automatically keep them in sync, but for now the general approach seems to be to assume that the community will do this. Generating reports that check if they actually are in sync is fairly simple though: I have a bunch in my watchlist now, and it's quite simple to notice when someone updates one and not the other. --Oravrattas (talk) 06:47, 13 June 2017 (UTC)

Cabinet Modelling

This evening I updated a bunch of information relating to the new Cabinet. Second May ministry (Q30178117) had already been created, with lots of information on it already, so I added the has part(s) of the class (P2670) entries for what all of the current cabinet positions are, and then made sure that each of those had a officeholder (P1308). Many of them are also missing a organization directed by the office or position (P2389), which I'll try to work through over the next day or two.

The current grid of that is at https://www.wikidata.org/wiki/Wikidata:EveryPolitician/Report:Q30178117/P1308

Next I'll make sure that everyone has up-to-date position held (P39) records, and that the previous ones are given an end time (P582). I'll also put together a few checks to make sure that all the offices have the correct applies to jurisdiction (P1001), and have part of (P361): Cabinet of the United Kingdom (Q112014) etc.

I'm not 100% convinced that this is the optimal way to model all these, as there's a bit of a mismatch between what goes on Second May ministry (Q30178117) vs Cabinet of the United Kingdom (Q112014), but I think I need to try doing this for a few historic cabinets, and for a few other countries, before it becomes clearer what a better way might be. I'm very open to suggestions, though!

--Oravrattas (talk) 18:51, 13 June 2017 (UTC)

One of the things on my long-term to-do list is sorting out ministerial posts - some of the older imports went a bit weird and because Wikipedia lumps many different instances of the same post together and renames them when we have a reshuffle, we have some very anachronistic names in the distant past. But that's for later :-)
My guess would be that the Cabinet article should list all the posts which are/were cabinet rank, with appropriate date qualifiers ("this post was in the Cabinet until 1953"); this makes it a sort of index to the "platonic cabinet".
The ministry... it's less clear to me what we should do. In general, the Ministry is not just Cabinet posts - you have Cabinet posts, but you also have junior ministers (which sometimes have items for the position) and Under-Secretaries of State (which all? don't). You also have a few ministers who are not formally Cabinet posts but attend Cabinet. But when we say "the May ministry", we usually mean the Cabinet. Hmm. Andrew Gray (talk) 20:47, 13 June 2017 (UTC)
The distinction between the Cabinet and the Ministry, whether a new Ministry is formed after re-relection, or the previous one continues, and whether a new one is automatically formed with a change of Prime Minister, all seem to be quite contentious questions (witness, for example, the long-running renaming debate at w:Talk:Cameron–Clegg coalition. For now I think we should go for usefulness rather than pedantic precision, and see how it evolves over time. For now I think that means treating Second May ministry (Q30178117) (and equivalents) as being the Cabinet, until such time as we have a separate item for the wider ministry. I think it would be also useful to have items for each of the junior minister and Under-Secretary-of-State positions — one of the things I expect that this data will all be very useful for once it's mostly complete, is to track career histories: are there certain junior positions that lead more often to higher office vs being a career dead-end etc. There are definitely some of the under-secretary posts already in place: Parliamentary Under-Secretary of State for Culture, Media and Sport (Q26205903), Under-Secretary of State for War and the Colonies (Q7883051), Under-Secretary of State for Commonwealth Affairs (Q7883044), Under-Secretary of State for India (Q3965295), though, as ever, those are an awkward mix of the actual position and being a Wikimedia list article (Q13406463) --Oravrattas (talk) 08:25, 14 June 2017 (UTC)
How to handle the position names changing over time has also come up at Wikidata:Project chat#Ministers of EU countries --Oravrattas (talk) 08:27, 14 June 2017 (UTC)

National or Regional Party?

An inconsistency I noticed in the current data, is which version of a party we should be using in (a) as qualifiers on position held (P39) records; and/or (b) as plain member of political party (P102) on a person.

The one that's always been slightly complicated is Labour Co-operative (Q6467393), but Scottish Conservatives (Q3243587) are also more prominently separate this time around. AIUI the candidates actually stand for separate regional versions of all the main parties, though it's a little unclear to me what their parliamentary status then is, and whether the UK actually does have an even greater distinction between the party you stand as and the party you sit as than I realised (as is so in many other national legislatures). If that is the case, then that gives us even more impetus to solve the outstanding issue around the use of member of political party (P102) as a qualifier, and whether we want a separate property here that would, for example, let us say that someone is member of (or stood for election as) Scottish Liberal Democrats (Q3250438), but sits as Liberal Democrats (Q9624) (and similarly reflect the party vs faction/group/club split in many other countries). --Oravrattas (talk) 22:18, 11 June 2017 (UTC)

Short answer, honestly don't know. Longer answer, have started aggregating this sort of question on the main page and will speak to the Parliament data people about it... Andrew Gray (talk) 20:45, 12 June 2017 (UTC)
After a bit more research, I think that the situation is that, with respect to national elections:
  • the "Conservative and Unionist Party" is a single entity with multiple different names and emblems: http://search.electoralcommission.org.uk/English/Registrations/PP52 — the Scottish / Welsh "parties" are really just designations, rather than separate parties
  • Likewise for the LibDems: http://search.electoralcommission.org.uk/English/Registrations/PP90
  • Scottish Green Party (Q1256956) is separate party from Green Party of England and Wales (Q9669) (they split in 1990).
  • Labour and Co-operative are more complicated. They're two entirely separate parties, but (unlike most other parties) don't have a policy of exclusivity — their members, and indeed MPs, can be members of only a single party, or of both. They have both registered the designation of "Labour and Co-operative" with the Electoral Commission, so that that can appear on the ballot papers for members of either party. My understanding is that if someone is solely a Co-operative Party candidate, or a joint Co-operative + Labour Party candidate, they will use this designation, whereas a solely Labour Party candidate will use one of the plain Labour Party designations, which might be "Scottish Labour" or "Welsh Labour" (http://search.electoralcommission.org.uk/English/Registrations/PP53). As far as I can tell, there is no separate Scottish or Welsh "Labour and Co-operative" designation — their candidate in Edinburgh North and Leith (Q3138439), for example, appeared in the same manner as English candidates. I'm not sure it's possible to tell whether a "Labour and Co-operative" candidate is solely a member of the Co-operative Party, or is also a member of the Labour Party.
This means that with respect to Parliamentary Memberships:
In practice I think this means that we should change any position held (P39) qualifiers that are Scottish Conservatives (Q3243587) to Conservative Party (Q9626) (and other similar cases). If the Scottish Conservatives were to actually split into a separate parliamentary party, I think that strictly that would require a new position held (P39), though I suspect in practice we might decide to simply say they were always Scottish Conservatives (Q3243587) in this term.
What we do with Co-operative Party MPs is still an open question, I fear, so I'll be interested to hear what the Parliament Data People say about it.
--Oravrattas (talk) 18:41, 13 June 2017 (UTC)
One complication I've just spotted is this news story - it suggests that for MEPs, the Scottish Conservatives not central office are the "registered party". All a bit confusing! Andrew Gray (talk) 08:59, 21 June 2017 (UTC)

Start and End of Terms

The documentation for terms currently recommends start time (P580) and end time (P582). Some other countries prefer inception (P571) and dissolved, abolished or demolished date (P576) for these, which as far as I can tell, is strictly more correct. I'm not 100% convinced I understand the distinct well enough though. However, even if both approaches are viable, it would be good to standardise on which should generally be used with a legislative term (Q15238777). --Oravrattas (talk) 11:47, 16 June 2017 (UTC)

I've always been a little hazy on the distinction here as well. If you feel inception etc is better, please feel free to switch. Andrew Gray (talk) 21:33, 20 June 2017 (UTC)

State Opening of Parliament

We currently suggest adding a qualifier to the start of a term with a significant event (P793) of State Opening of Parliament (Q1550193). As that's usually just to the generic event, rather than one on a specific date, perhaps we should also add a date of official opening (P1619)? --Oravrattas (talk) 11:50, 16 June 2017 (UTC)

Didn't realise we had that property... it seems a bit of duplication if we're already using "official opening" as the start date. Andrew Gray (talk) 15:25, 18 June 2017 (UTC)
Ah, I hadn't paid enough attention to realise that that was what we were using a start date. As I think an MP actually takes office as soon as they're elected, I had assumed we were using the general election date as the start of the term, which would then let us set date of official opening (P1619) as the State Opening of Parliament (Q1550193). --Oravrattas (talk) 16:32, 18 June 2017 (UTC)
State opening was the recommendation I had from the PDS people, so that was what I went with :-). We can always alter it later if needed. Andrew Gray (talk) 21:32, 20 June 2017 (UTC)

Prime Minister of Great Britain?

I spent a while this morning tidying up the list of people who have been Prime Minister of the United Kingdom (Q14211):

SELECT DISTINCT ?person ?personLabel ?start_date ?end_date ?prev ?prevLabel ?next ?nextLabel ?office ?officeLabel 
WHERE { 
  wd:Q145 wdt:P1313 ?office .
  ?person p:P39 ?posn ; wdt:P31 wd:Q5 .
  ?posn ps:P39 ?office .
  OPTIONAL { ?posn pq:P580 ?start_date }  
  OPTIONAL { ?posn pq:P582 ?end_date }  
  OPTIONAL { ?posn pq:P1365 ?prev }  
  OPTIONAL { ?posn pq:155 ?prev }  
  OPTIONAL { ?posn pq:P1366 ?next }  
  OPTIONAL { ?posn pq:P156 ?next }  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY DESC(?start_date)
Try it!

(The problems were mostly to do with people who held the office twice only being listed once, although William Ewart Gladstone (Q160852) was a bit of a mess as his four terms were squashed into one position held (P39) with multiple dates)

I have now hit William Pitt the Younger (Q128902) transitioning from Prime Minister of Great Britain to Prime Minister of the United Kingdom. At the moment, Wikidata doesn't have a separate entry for the earlier position, and assigns all of the previous people to Q14211 (which in turn has a inception (P571) of 1721 (following the infobox on w:Prime Minister of the United Kingdom). But as we have a separate Member of Parliament of Great Britain (Q18015642), I suspect we should probably split all the other positions too, and correct the P39 on the earlier people. Thoughts? --Oravrattas (talk) 08:06, 19 June 2017 (UTC)

I've spent a day wondering about this. I think you can make a reasonable case for having the office carry through from 1721 to now for the PM and for most of the ministries then in existence - it's the way every source seems to handle it. Pitt would have seen himself as in the same position just responsible for more things. For some others, however (eg Chancellor) you have a more pressing case to use seperate items - there was an Irish chancellor and a British chancellor, then after 1801 they were merged. Andrew Gray (talk) 21:49, 20 June 2017 (UTC)

One P39 per parliament versus one P39 per held seat

@Oravrattas:. We talked a bit a while ago about how best to represent "terms" in Parliament - the current recommendation, which I picked fairly arbitrarily, is to lump it all together as long as they were representing the same party in the same seat over multiple elections. As we're now getting to the point of adding a lot of data, and getting some experience, I'm wondering if this is the best solution.

The current guidance is "When an MP is re-elected without changing party or constituency, and with no break in service, continue to use the same entry." The major advantage of this is that for an MP with a long and relatively uneventful career (same seat, same party) it means we can just have one position held (P39) entry and represent their service as an unbroken run. Kenneth Clarke (Q271889), for example, would show up as representing the same seat continually from June 1970 until now, with one start date and no end date. However, this would require having thirteen parliamentary term (P2937) and elected in (P2715) qualifiers.

The alternative is to split into one P39 entry for each parliamentary term (plus splitting within a parliamentary term if they change party, or seat, or quit and are reelected). This would mean thirteen entries for Clarke, but each one would have a single consistent pair of parliamentary term (P2937) and elected in (P2715). (Strictly speaking we wouldn't even need them both - P2937 logically follows from the election - but it makes it easier for queries to leave them in).

The second approach is more robust and allows us to do things like represent someone's majority as a qualifier on the P39, which could be very interesting. It will also make it a bit easier to look for gaps. On the other hand, the multiple start-end dates will cause us to report that they weren't MP for the few weeks of the election campaign. This is strictly accurate, but also potentially a bit confusing to reusers - more or less every source, given this situation, would describe it as an unbroken period, "they were MP for Loamshire West between 1954 and 1973". We'll want to have some consistent rules on what we use for start and end dates.

However, I think it's probably more sustainable in the long run to go with the "splitter" approach of one P39 per parliamentary term.

One complication with this is historic MPs. Before the 1920s, every ministerial appointment led to a by-election, often unopposed. If we break up P39s each time someone had a ministerial by-election, this is going to get very fragmented... Andrew Gray (talk) 11:35, 11 June 2017 (UTC)

@Andrew Gray: I'm definitely in favour of splitting them up. It makes more sense from a data POV, and it's consistent with how parallel projects do it (e.g. Wikidata:WikiProject France/Politicians/Properties "P39: répéter pour chaque mandat" (emphasis theirs)). It requires a bit more work to enter the data, but that's a one time cost — being easier to use the data is generally more valuable over time. And, as you say, it lets us represent more details on each P39 which I think could become increasingly more useful, as we find ways of making the data richer.
I'm not hugely worried about the 'breaks' in this: the only scenario I can think of where that might be an issue is if someone is writing a query that wants to list all MPs on a given date, and happens to pick one when there were none. But as you say, that's actually accurate anyway, and as long as we're aiming for consistency on this, then I don't think that's going to be a major issue. Calculating the effective service dates of long-sitting MPs can be done relatively simply (with suitable handwaving as to exactly how, but again that's something we only need to work out once) by taking the earliest start and latest end of any series of consecutive terms.
I wasn't aware of the pre-1920s approach. What was the reasoning there, and how did it actually work? Did they have to resign as an MP whilst the by-election was happening? Is there somewhere I can read more about this? --Oravrattas (talk) 13:05, 11 June 2017 (UTC)
One other thought here is that if we really want to capture the nuance entirely, we could add a qualifier of end cause (P1534): dissolution of parliament (Q741182) on each extant membership at the end of a term. --Oravrattas (talk) 13:22, 11 June 2017 (UTC)
Okay! This looks good. I'll start spinning up some automatic imports now for P39:P2937 pairs (we can do this with a Wikipedia import) and then we can populate the details and run queries to see what's missing...
The pre-1920s thing is because ministerial appointments carried a salary, so they were deemed "offices of profit under the Crown" (compare the Chiltern Hundreds method for resigning these days) and you needed to re-stand so your electors could approve your move & that you hadn't just been bought off by the Crown. Details at w:Ministerial by-election; until 1867 it was all Ministerial appointments; then gradually watered down until abolished. They were often pro-formas, uncontested and hardly campaigned, but there were some which became serious by-elections with actual reversals (eg Churchill's by-election defeat in 1908). I guess we'll just model them as any other by-election, with an appropriate end cause (P1534) qualifier on the previous term to say why they quit - they represent about 15-20% of post-Reform Act by-elections, probably a higher proportion in earlier years, but it's not an insurmountable volume.
Regarding end cause (P1534) in general, I think this seems sensible - in an ideal world we'd want every item with an end date to also have a reason for end. Andrew Gray (talk) 13:26, 11 June 2017 (UTC)
Regarding the extra work; maybe somebody could put together a script, like the DuplicateReferences gadget, but such that it enters the values and leaves them unsaved, ready for editing? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:53, 11 June 2017 (UTC)
  • Ugh. QuickStatements turns out (as I think I knew but had forgotten...) to fall over when adding values with qualifiers when an item was already there. Let's see what else I can come up with. Andrew Gray (talk) 15:58, 11 June 2017 (UTC)


@Andrew Gray: I have a proposal for how a slight tweak to our modelling here could bring QuickStatements back into play: Wikidata:EveryPolitician/Proposal:Term Membership Items (that's a side-effect of the change, which would make a few other things simpler/better too, rather than the direct impetus for it, but this would certainly be a very useful bonus as well) --Oravrattas (talk) 11:10, 23 June 2017 (UTC)

2017 report

Okay, here's some reports to work through 2017, based on the ones at Wikidata:Request a query#New UK MPs. We should have 650 members elected in this round - every seat was contested, none were delayed, and all returned a member.

In both of these, MPs with more than one "elected in" or "term" on the same item will have duplicated lines. The reports also show whether or not core metadata (seat, party, date) is present.

Once we've got 2017 in shape we can start looking at backfilling, but pending working out a way to do this with scripts, it'll take a while... Andrew Gray (talk) 16:48, 11 June 2017 (UTC)

For making sure that all new members have enough data set, I've been using:

SELECT ?item ?itemLabel ?givenNameLabel ?genderLabel ?partyLabel ?constituencyLabel ?replacesLabel {
 ?item p:P39 ?positionStatement .
 ?positionStatement ps:P39 wd:Q16707842; pq:P2937 wd:Q29974940 .
 MINUS { ?item p:P39 [ ps:P39 wd:Q16707842; pq:P2937 [ ^(wdt:P155+) wd:Q29974940 ] ] . }
 OPTIONAL { ?item wdt:P21 ?gender . }
 OPTIONAL { ?item wdt:P735 ?givenName . }
 OPTIONAL { ?positionStatement pq:P768 ?constituency . }
 OPTIONAL { ?positionStatement pq:P102 ?party . }
 OPTIONAL { ?positionStatement pq:P1365 ?replaces . }
 SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
Try it!

I've added all the missing constituency, party, and gender info, and am slowly working through the missing replaces (P1365) entries. --Oravrattas (talk) 21:10, 11 June 2017 (UTC)

Nice! I'll keep plugging away at getting valid P39s for the returning 2017 members. One thing that strikes me is that you have 88 names in that report - there were apparently 87 new MPs this year. I wonder who the extra one is? Andrew Gray (talk) 21:24, 11 June 2017 (UTC)
Looks like it's Chris Ruane (Q479188) who returned after an absence. I've cleaned up his history now, which should take care of that --Oravrattas (talk) 21:45, 11 June 2017 (UTC)

Another useful one to catch the electoral district (P768) being set to something that isn't a UK constituency:

SELECT ?item ?itemLabel ?constituencyLabel ?cisaLabel ?cisa {
  ?item p:P39 [ ps:P39 wd:Q16707842; pq:P2937 wd:Q29974940 ; pq:P768 ?constituency  ] .
  ?constituency wdt:P31 ?cisa FILTER NOT EXISTS { ?constituency wdt:P31 wd:Q27971968 } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
Try it!

--Oravrattas (talk) 21:48, 11 June 2017 (UTC)

Great. I've just run a script to put a useful description on the constituencies without any (and standardise some of the others) so hopefully this will help avoid too many being misidentified in future. Andrew Gray (talk) 22:17, 11 June 2017 (UTC)

Members of the 57th Parliament

To help us track down which MPs still don't have a position held (P39) with parliamentary term (P2937): 57th Parliament of the United Kingdom (Q29974940), I've built a report based on all active constituencies: Wikidata:WikiProject British Politicians/Report:Q29974940

(The count is slightly wrong, implying at least 4 historic constituencies don't have a dissolved, abolished or demolished date (P576) yet either. It's also possible that there are more false positives than that, and we're also missing some current constituencies from the list)  – The preceding unsigned comment was added by Oravrattas (talk • contribs) at 12:07, 20 June 2017‎ (UTC).

I think I've done these all now - ended up pulling out a WP list of names and the Wikidata report and doing a diff on them to see what was what... Andrew Gray (talk) 11:46, 21 June 2017 (UTC)
Ooh, excellent. Yep, we definitely now have 650 active constituencies. Now to just make someone has a current membership of them… (Only 396 still to go!) --Oravrattas (talk) 21:48, 21 June 2017 (UTC)
I've added a consistent located in the administrative territorial entity (P131) to all 650 constituencies for the UK region they're part of:
SELECT ?territory ?territoryLabel (COUNT(?constituency) AS ?constituencies) {
  ?constituency wdt:P31 wd:Q27971968 .
  FILTER NOT EXISTS { ?constituency wdt:P576 [] }
  OPTIONAL { ?constituency wdt:P131 ?territory }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?territoryLabel ?territory
Try it!
I wasn't 100% sure whether those should point at the NUTS region (e.g. North East England (Q47983)) or the EU Parliament area (e.g. North East England (Q7055193)). These have identical geography (other than Gibraltar being part of South West England (Q2973373) but not South West England (Q48026)), but I chose the EU Parliament regions on the basis that those are explicitly kept in step with the UK Parliament regions (if there's a boundary change in one it will also happen in the other), whereas I'm not entirely sure whether that's necessarily true for the NUTS region (though I suspect in practice it probably is). It's also pretty simple to change them with QuickStatements (Q20084080) if we want the other one — I figured simply getting them modelled consistently was most useful for now, so we can start to do things like compare the gender breakdown, or average age of MPs, across different geographical parts of the UK (or in one region over time) … or at least we'll be able to once we get all the P39s set up correctly! (Though that becomes a little less overwhelming when we can break the TODO list up like this too — e.g. the MPs for Welsh constituencies:
SELECT ?item ?itemLabel ?person ?personLabel {
  ?item wdt:P31 wd:Q27971968 ; wdt:P131 wd:Q7961747
        FILTER NOT EXISTS { ?item wdt:P576 ?end } .
  OPTIONAL { 
     ?person p:P39 ?positionStatement .
     ?positionStatement ps:P39 wd:Q16707842; pq:P2937 wd:Q29974940 ; pq:P768 ?item .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
ORDER BY ?itemLabel
Try it!
--Oravrattas (talk) 10:57, 23 June 2017 (UTC)

Scottish Parliament

Building on the proposal at Wikidata:EveryPolitician/Proposal:Term Membership Items, I've set up this "term-based P39" approach for all MSPs. A couple of notes for tidying up in future:

Bot is now running to import all 684 member-term-affiliation sets (for 299 MSPs). Andrew Gray (talk) 10:16, 25 June 2017 (UTC)

Woot!
  • Are the Presiding Officer issues going to be the same for Speaker of the House of Commons (Q464103), or are there important differences between those?
  • Is it worth having an explicit 'no value' on elected in (P2715)? (again, presumably we'd need to add those manually, but it might be worth differentiating that they were explicitly appointments)
  • An option for independents might be to use independent politician (Q327591) as the party value. (In some countries that will actually _need_ to be the case, as everyone must form part of some parliamentary group.)
--Oravrattas (talk) 12:36, 25 June 2017 (UTC)
POs are similar to Speakers so I guess some of the same issues will arise - one key difference is that every PO so far has served one term. There isn't the concept of a re-elected Speaker as there is at Westminster.
Novalue versus placeholder values for non-election and independent is a bit of an open question - I can see arguments either way. independent politician (Q327591) seems a good approach, though. Andrew Gray (talk) 16:08, 25 June 2017 (UTC)
  • Doing a bit of tidying tonight and found half a dozen people who were missing the new-style P39 entries as MSPs - all look to have been name-mismatch issues - and fixed all the ones for some reason were missed out in the removal batch on Tuesday. I've put together a composite report for all five parliamentary terms; note a few still need filling in. I'm not sure if I'll have time to get to these this weekend but at least we have the gaps indexed! Andrew Gray (talk) 21:01, 14 July 2017 (UTC)
    • yay! The P279 version of that SPARQL would be:
    • SELECT DISTINCT ?item ?itemLabel ?givenNameLabel ?constituencyLabel ?partyLabel ?start ?electionLabel ?end ?causeLabel {
        ?item p:P39 ?positionStatement .
        ?positionStatement ps:P39 [ wdt:P279 wd:Q1711695 ] . 
       OPTIONAL { ?item wdt:P735 ?givenName . }
       OPTIONAL { ?positionStatement pq:P768 ?constituency . }
       OPTIONAL { ?positionStatement pq:P4100|pq:P102 ?party . }
       OPTIONAL { ?positionStatement pq:P580 ?start . }
       OPTIONAL { ?positionStatement pq:P2715 ?election . }
       OPTIONAL { ?positionStatement pq:P582 ?end . }
       OPTIONAL { ?positionStatement pq:P1534 ?cause . }
       SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
      }
      ORDER BY ?start
      
      Try it!
    • There was a bit of a mismatch as Presiding Officer of the Scottish Parliament (Q3567536) was also defined as being a subclass of Member of the Scottish Parliament (Q1711695). I can see an argument for that one going either way, but for now I've simplified things by removing it. If we reinstate it we'll need a better way of separating those two concepts. --Oravrattas (talk) 08:11, 15 July 2017 (UTC)

"Wikifying Westminster" workshop

Hi @Andrew Gray, Oravrattas:

I see there's to be a "Wikifying Westminster" workshop at Newspeak House this Saturday.

Does anyone know what the plan is for it, or whether there are any particular sets of items or properties that it will be most focussing on?

I won't be able to be there except -- possibly -- for the very last hour. But it would be useful to know what's intended, and whether there's any particular data that's planned to be worked on; or any that should be pushed their way (eg data anomalies, that it might be worth mapping out beforehand).

Any knowledge about this? Jheald (talk) 17:45, 14 August 2017 (UTC)

WMUK also tweeted this link today: Useful UK Politics Datasets, so I don't know whether there's anything there that may be useful, or would benefit from having any links or properties set up before Saturday.
Also, whether anyone has prepared any demo queries for the event ? Jheald (talk) 17:59, 14 August 2017 (UTC)
There was a post to the Wikidata Community facebook group from Fedia Chambers (User:Lucyfediachambers) announcing the event. She's been a data journalist and OKFN staffer, contracted by MySociety since March to "help on their project to integrate EveryPolitician more closely with Wikidata": (My Society bio, a couple of 2012 Guardian show-and-tells, twitter: twitter @lucyfedia Jheald (talk) 19:39, 14 August 2017 (UTC)
There's more about where MySociety are coming from with this in this grant proposal on meta: m:Grants:Project/mySociety/EveryPolitician (which, from the comments, it seems everyone apart from me has already seen!)
It seems at this stage they may be particularly interesting in the data modelling; the integrity of how well the data is following that modelling; presumably how close it corresponds to the modelling of their existing EveryPolitician database; as well as current data completeness within that model. Jheald (talk) 20:39, 14 August 2017 (UTC)
I've now found d:Wikidata:EveryPolitician and its talk page and see you already knew all that. Ah well, there you go. Jheald (talk) 21:25, 14 August 2017 (UTC)
  • Hi Jheald. As you've seen, yeah, I'm aware of it; I've been working quite closely with Lucy and Tony over the past few weeks, plus also the Parliament Digital people, to make sure we're all going in the right direction :-). I've been working on some suitable queries as demonstrations of what we can do (let me know if you'd like to see the spreadsheet) and we've been working to get solid "new-style" metadata in place for the last few parliaments so we have something for people to play with. At the moment we now have solid data for all MPs back to 2001 and we may get 1997 in place before the weekend.
In terms of what I've done with them so far, we've overhauled the data model to the term-based items now coming into place, standardised a set of appropriate qualifiers, and started rolling that out more broadly and consistently by importing EP data and synchronising it with what we hold in Wikidata/Wikipedia - unsurprisingly there are a few things we model in subtly different ways or to subtly different levels of detail, but basically it aligns well. MySociety are doing some work on reports to make sure we match up with EveryPolitician's database, and vice versa - so once this is up and running it can keep polling the two, flagging up any discrepancies from Wikidata alterations or detected by their website scrapers.
As you say, data modelling is one of the big issues - it would be great for ourselves & for reusers if we can work towards all countries using a broadly similar data model with comparable items and qualifiers and so on. I think this is where EP are likely to have a major effect, if the project comes off well - some legwork on the dull aspects of synchronisation and cross-checking can pay real dividends.
Look forward to seeing you on Saturday! If you can't make it, let me know and we can meet for a chat some evening - happy to catch you up on what we've been doing. Andrew Gray (talk) 22:12, 14 August 2017 (UTC)
Hi Andrew Gray. Thanks! Saturday's a terrible day for me, but I'll try to get along if at all possible -- however, doubt I can make it even as a best case before 5pm if at all. But good to know you're on the case, and let me know if there's anything I can help with beforehand. Jheald (talk) 22:20, 14 August 2017 (UTC)

Constituencies

I'm sure I passed a holding header somewhere for data modelling about constituencies. (That one could at least have hung "Needs development" under). But I can't find it now.

Anyway, here are queries for:

Jheald (talk) 08:16, 19 August 2017 (UTC)

@Andrew Gray: Just flagging this, in case anyone wants to work on it today. Jheald (talk) 09:40, 19 August 2017 (UTC)

Dropped out in the last cleanup! Still considering how best to handle constituencies - the Wikipedia entries for them are conceptually a bit weird, and often have two or three "distinct" constituencies with the same name but different time periods. So it's going to need a little work. Thanks for these - I'll work through them in a bit. Andrew Gray (talk) 14:39, 19 August 2017 (UTC)
  • @Jheald, Oravrattas: So, now we're ready to import the pre-1997 Historic Hansard material, I've been looking at constituencies again. I think we're going to have to break these items up if multiple constituencies existed in different periods with the same name - eg Horsham (Q1075944), which existed up to 1918; then 1945-1974; and finally 1983 to date. If we don't do this, then the dates on constituencies won't make much sense (they'll either have to have multiple start-end dates, or dates that imply they were still in existence without any members in the middle periods). It may also make it a bit easier to assign meaningful boundaries to them once we get a good way of indicating areas up and running, if they shifted over time (many did). Does this sound like a reasonable solution? There are a very few cases where they are already split by period (eg Mid Kent (Q6840966) & Mid Kent (Q6840968), but they're few and far between)
My current plan is to go through every import as I do it, look for the constituencies with mismatched dates (ie any seat that did not come into existence until after election day), create new items for them accordingly, and update the list on M&M. The import script pulls down that list each time, so any changes will come through in the next round.
Based on the number of constituency items we have already, and the number of duplicated item names, we should only need to create between 150 and 300 new items. As we have 50-odd Parliaments to import, that isn't unworkable. Andrew Gray (talk) 20:33, 13 October 2017 (UTC)
Hi @Andrew Gray:. Just sent you Vision of Britain unit ID (P3615) identifiers for the constituencies on the Vision of Britain site. Will be interesting to see how closely (or not) they reflect the names & the spans of dates from Historic Hansard.
Interested that you want to do this through MnM. I tend to see it as a tool of last resort, for use when all other attempted matchings have been exhausted. But perhaps if you've got it configured the way you want, it can actually be quite an efficient tool for the job? Jheald (talk) 23:35, 13 October 2017 (UTC)

Next steps (Aug-Sep 2017)

So, after some conversations yesterday at the MySociety event, here's my plan for the next few weeks:

  • Finish the import of parliamentary data for the last Northern Irish MLAs (@Oravrattas: is working on this) and any consequential tidying up needed.
  • Import parliamentary data for Welsh AMs for @Sannita (MySociety): - this will need to be done manually but should only be about a day's work.
  • Update all reports and queries to use the "?item p:P39 ?positionStatement" form, as this seems to avoid some problems with people who have other P39 marked as preferred
    On that note - document recommended queries, query fragments, etc.
  • Work out whether we can use the MySociety parlparse data to add parliamentary data to all 1803-1997 MPs (derived ultimately from Historic Hansard, and will need some manual cleanup) - @Mhl20: is looking into this.
  • Work out the best way to add party data to these records (possibly semi-manual using Wikipedia lists)

Some of this will of course take more than a month to do, but I'll at least try and make a start on it. Andrew Gray (talk) 12:51, 20 August 2017 (UTC)

re: MLAs, I've added the first term, and am running cleanups for the missing end cause (P1534) entries. One side-effect of this is that anywhere we've previously split a combined P39 (for someone with multiple memberships in the same term) will get messed up again. But I think we can find all of those by searching by memberships with more than one start date:
SELECT ?mem (COUNT(?start) AS ?memberships)
WHERE 
{
  ?item p:P39 ?mem .
  ?mem ps:P39 [ wdt:P279 wd:Q3272410 ] ; pq:P580 ?start .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?mem
HAVING (COUNT(?start) > 1)
Try it!
--Oravrattas (talk) 06:45, 21 August 2017 (UTC)
October update
  • YesY MLAs almost finished, a little tidying needed.
  • YesY Welsh AMs underway but no import yet.
  • YesY All reports/queries updated
  • YesY Still need to document query fragments
  • YesY Bypassed the MySociety data and wrote my own parser - but it works. 1992-97 imported, and the script is able to generate the rest. I'll just start working through it.
  • YesY No solution yet for party affiliations pre-1997
  • YesY Old-style entries not yet replaced but I may do this soon, before importing all the HH data.
  • YesY Gradual removal of old P463 underway; P39 staying for the moment.

So not bad, but a lot of work needed. Andrew Gray (talk) 20:38, 13 October 2017 (UTC)

Historic Hansard matching update

I did another push on these last night and we're now back to 1950. Assuming we use Historic Hansard for 1832 onwards and History of Parliament before that, that means our status is -

  • 11th-38th (28) still to import from Historic Hansard
  • 39th-51st (13) imported from Historic Hansard and still need party affiliation and general tidying
  • 52nd-57th (6) imported from MySociety and pretty good

The more recent parliaments tended to have party switches and so on actually coded into Historic Hansard - two seperate memberships even if the actual affiliation isn't there. Before 1974, this seems only to happen for the Speaker (and not always then). On the other hand, in 1974 and earlier, Historic Hansard is definitely missing some people. So far we have been able to backfill almost all of these by comparing Wikidata to the relevant Wikipedia category, but this approach will break down sometime around the turn of the century when we can no longer reliably assume we have a Wikipedia article for them.

For the record, my methodology for import is:

  • Run import script offline (takes five minutes), process through QuickStatements2 (takes an hour or two, go and do something else)
  • Do a quick check for any MPs with double term values, as these will have imported badly, and break them out. (These are rare in pre-1974 parliaments). Also check that everyone has a start/end date (the script should always provide one).
  • Run a constituency report to find any which have matched to constituencies which were not yet created or had previously been dissolved. Create new items where necessary, update the MPs, and also update the Hansard constituencies match on mix-and-match. Where Hansard has a single entry for a constituency which we would otherwise subdivide (this is annoyingly common), relink it to the one most appropriate for the current matching round. This is a lot of work for the parliament just before a boundary change, fairly quick otherwise.
  • Find missing MPs. First, run a petscan check for any MPs in the relevant enwiki category who don't have the appropriate P39 value - and manually confirm they are correctly categorised, and should not be merged into an existing Wikidata item. Then copy this over into Wikidata. This may not always be perfect (note the gap in 1964-66) so I'm looking for other ways of identifying a gap in the data here.
  • Run the constituency report again after this import in case of mismatches.
  • Quick sanity-check for completeness - do we have the right number of distinct constituencies reported in this time period?
  • Update the tracker, update the import script values, and start over again.

It takes two or three hours to do a parliament (a bit more for complex ones like the one with the mass Labour to SDP defections). However, it's trotting along nicely, and I am hopeful we can get back to 1832 by early next year. Andrew Gray (talk) 12:57, 13 November 2017 (UTC)