Skip to content

Instantly share code, notes, and snippets.

@mhl
Last active November 20, 2017 09:44
Show Gist options
  • Save mhl/f0a93a8e02471ec920c72799b754c3a9 to your computer and use it in GitHub Desktop.
Save mhl/f0a93a8e02471ec920c72799b754c3a9 to your computer and use it in GitHub Desktop.

Turn on KeyShortcuts

Turn on checkConstraints

This is very helpful, but will produce lots of warnings that you can ignore, in particular:

  • the inception date of positions

Make sure every item items won’t just get deleted

To do this, you should make sure that the item has at least one of the following:

  • An associated Wikipedia page
  • A property with an external identifier
  • Some external (i.e. non-Wikipedia) reference URL

Make sure every statement has a ‘reference URL’ (P854)

Make sure the legislator position item exists

Make sure it has a ‘instance of’ P31 ‘position’ Q4164871

Make sure it’s a ‘subclass of’ P279 a ‘legislator’ Q4175034 (or a subclass thereof)

There might already be an appropriate subclass of ‘legislator’ to use; for example, for the United Kingdom there is ‘member of parliament’ Q486839, which is a subclass of ‘legislator’. We don’t recommend extending the subclass hierarchy under ‘legislator’ Q4175034 unnecessarily, though.

Makes sure it has a ‘part of’ P361 back to the legislature / house item

Make sure the ‘applies to jurisdiction’ P1001 statement exists

This should be the same as for the house item.

Make sure the ‘country’ P17 statement exists

Again, this should be the same as for the house item.

Pick a legislature to work on

Make sure the legislature item exists

Make sure the legislature item says what country it’s in (‘country’ P17)

For most countries this should be straightforward, but sometimes you’ll have to be careful about cases like Denmark vs Kingdom of Denmark. (For subnational legislatures, just copy what the national level legislatures use.)

Make sure the legislature item says what admin territory (‘applies to jurisdiction’ P1001)

For national level legislatures, this will be the whole country (the same one as the P17 typically) but for subnational legislatures (e.g. Brandenburg Landtag Q521764) that would be Brandenburg (Q1208).

At this point you should also make sure that the place item you’ve used as the value here also has a ‘legislative body’ (P194) statement back to this legislature item.

Make sure it has an ‘instance of’ P31

Depending on whether it’s unicameral or bicameral this will be one of:

‘unicameral legislature’ Q37002670

‘bicameral legislature’ Q189445

For each of the houses of a bicameral legislature:

Make sure the item for that house exists

… with the same properties as above.

Make sure it has a ‘instance of’ P31

This should be either to:

  • ‘lower house’ Q375928
  • or ‘upper house’ Q637846

Make sure that it is ‘part of’ P361 the bicameral legislature

Make sure it has minimal labels

At least this should include:

A label in English

A label in each of the country’s native languages

FIXME: note that we still need to settle on how to model names for display. For example, we might want to use the property called something like “name in a particular source”, so we could say “this is how they’re referred to in the Scottish Parliament” / “this is how they’re referred to in the House of Lords.

Now check the following for each house

If this is a unicameral legislature, the only house will usually be the item for the legislature, otherwise you need to take these steps for each house in the bicameral legislature.

Make sure the seat count (‘number of seats’) P1342 is correct

Often, particularly for subnational legislatures, this will need to be added.

If there is one there that’s out of date (now different) then:

Set an ‘end date’ P582 qualifier on that existing P1342

Add a new P1342 for the new seat count with a ‘start date’ P580

Make sure that the current P1342 claim (and only that one) is marked as preferred

In the simple case, the seat count will have never changed, or have been the same for a long time.

Make sure the ‘number of constituencies’ (P4253) is correct

This should be done in the same manner as making sure the ‘number of seats’ P1342 is correct.

Make sure the legislator position item exists

For example, this might be ‘Member of Parliament in the United Kingdom’ Q16707842. If you need to create this, follow the guide in file:wikidata-legislator-position-guide.org

Make sure the house item ‘has part’ (P527) the legislator position item

[optional, but helpful] ‘image’ P18

This has to be an image on Wikimedia commons

[optional, but helpful] ‘official website’ P856

You can add multiple language links, each with a language qualifier where there different URLs for different languages.

Make sure parliamentary terms exist

n.b. This only applies if the legislature is term-based!

For each term you’ll be adding membership data for, you need to:

Make sure the item exists

For example, ‘57th United Kingdom Parliament’ Q29974940.

Make sure that the item is an ‘instance of’ (P31) ‘legislative term’ (Q15238777)

This P31 statement should have the following qualifiers:

‘of’ (P642) the associated legislature

This might be to a bicameral legislature as a whole, if both houses use the same terms, or to a single house if they’re not in sync.

‘series ordinal’ (P1545)

For example, the 57th Parliament of the United Kingdom should have a ‘series ordinal’ of 57 on the P31. In countries that don’t number their terms, this shouldn’t be added.

Make sure that the item has an ‘inception’ (P571)

This should be the date that that parliamentary term started. (Note that only rarely would this be the election date: usually the inauguration of the parliament is on a different day, and that’s the date that should be used.)

If this is a historic parliamentary term, add ‘dissolved’ (P576)

If there’s been a previous term, add ‘replaces’ (P1365)

This should have as a value the preceding term.

If this is a historic parliamentary term, add ‘replaced by’ (P1366)

This should have as a value the succeeding term.

Make sure the elections exist

Any election from which the people we’re trying to add should be created. This usually means a general election, but might also mean you have to create by-elections (say) between general elections.

Create an item for the election

Make sure it’s an ‘instance of’ (P31) a subclass of ‘legislative election’ (Q1076105)

In most cases there will a legislature-specific subclass of ‘legislative election’. For example, in the United Kingdom the election item should typically be an instance of either ‘United Kingdom general election’ (Q15283424) or ‘UK Parliamentary by-election’ (Q7864918).

Make sure it has a date (or dates)

If the election takes place on a single day, then use ‘point in time’ (P585). If it takes place over multiple consecutive days, then use ‘start time’ (P580) and ‘end time’ (P582) statements. If it’s on multiple distinct days, then use multiple ‘point in time’ (P585) statements.

Make sure that there is an ‘office contested’ (P541) for the legislator position item

Warning: people commonly misunderstand this; e.g. you might see ‘Prime Minister’ when the election is actually for Members of Parliament. You don’t need to delete this kind of error if you see it, but make sure you add the right statement.

This should have:

a qualifier ‘parliamentary term’ (P2937) with value of the parliamentary term item

Make sure it has a ‘country’ P17 statement

Make sure it has a ‘applies to jurisdiction’ P1001 statement

Make sure the constituencies / electoral districts exist

Make sure that the constituency item exists

Make sure that it has a label and description

Warning: this should be how the constituency would be referred to, even it’s shared with other items. For example, the label for the UK parliamentary constituency of Cambridge should just be ‘Cambridge’. The description, however, should disambiguate it from other items with label ‘Cambridge’, in particular so that you can tell them apart in autocomplete.

Make sure it has an ‘instance of’ (P31) a subclass of ‘constituency’ (Q192611)

In most cases this statment’s value should be a legislature specific subclass of ‘constituency’ (Q192611), like ‘constituency of the Parliament of the United Kingdom’ (Q27971968)

Make sure that it has a ‘country’ (P17) statement

If possible a ‘located in the administrative territorial entity’ (P131)

If there is an existing item representing the highest level administrative subdivision under the areas associated with this chamber overall, then set that as the value of a P131 statement.

FIXME: add guidance on adding boundary data (e.g. shapefiles)

Make sure political groups exist

Make sure there’s an item for the political group

Make sure the item has appropiate labels and description

As before, this should have a label in each official language of the country and one in English.

Make sure the item has an appropriate ‘instance of’ (P31) statement

In this simplest case, this might be an instance of ‘political party’ (Q7278) or ‘parliamentary group’ (Q848197). However, some countries will already be using a country-specific subclass of one of those items, in which case that should be used instead.

A subtlety to be aware of in the modelling of political factions in Wikidata, is that for legislatures, new parliamentary groups will be created for each parliamentary term, even if their makeup is the same as in the previous term.

As another warning, it’s worth taking time to investigate how political parties and parliamentary groups have already been modelled in a particular country or legislature in order to keep consistent with that.

Make sure it has a ‘country’ (P17) statement

Make sure it has a ‘color’ (P462) statement

This is the colour typically associated with this party / group, which is very useful for visualizing the makeup of parliamentary chambers, etc. It’s best for this to be a precise enough colour to be unique among parties likely to be represented concurrently!

Make sure people who are members exist

For each person who is a member of the legislature:

Make sure an item for that person exists

Make sure it has an ‘instance of’ (P31) ‘human’ (Q5)

Make sure it has an ‘occupation’ (P106) ‘politician’ (Q82955)

Ideally, add a ‘date of birth’ (P569) statement

Ideally, add a ‘place of birth’ (P19) statement

Ideally, add ‘sex or gender’ (P21)

If possible, add ‘given name’ (P735) and ‘family name’ (P734)

Ideally, add ‘image’ (P18)

This should be a photograph in Wikimedia Commons.

Ideally, add a property for their ID in the legislature

If a property exists for their membership of the legislature (usually an ID of some kind) that should be added. See file:creating-parliamentary-id-properties.org

Make sure the ‘position held’ P39 statements exist

For each person who is a member of the legislature:

Create a ‘position held’ (P39) to the legislator position item

This should have the following qualifiers: (warning: note that you should create a new P39 statement the value of any of these qualifiers will change)

Make sure it has a ‘parliamentary term’ (P2937) of the parliamentary term item

Make sure it has a ‘parliamentary group’ (P4100) of the political party or parliamentary group

Make sure it has an ‘electoral district’ (P768) of the electoral district item

Make sure it has a ‘start time’ (P580) qualifier

Make sure it has an ‘elected in’ (P2715) of the election item

If appropriate, make sure it has an ‘end time’ (P582) qualifier

This should only be added if their membership has ended, e.g. if it’s historic.

If known, and the membership has ended, ideally add an ‘end cause’ (P1534)

If this is just because the term has ended, this would be ‘dissolution of parliament’ (Q741182) but might also be:

  • ‘leaving party’ (Q30580660)
  • ‘expulsion from party’ (Q30580630)
  • ‘death in office’ (Q5247364)

… or various other events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment