Wikidata:EveryPolitician/Documentation/Tools/Harvest Templates/Pakistan

From Wikidata
Jump to navigation Jump to search

Case study: Importing dates of birth for Pakistani Members of the National Assembly 2013-18 from English Wikipedia to Wikidata using Harvest Templates[edit]

This document shows work done together with Saqib to set dates of birth on Pakistani Members of the National Assembly 2013-18 who did not have dates of birth set in Wikidata.

Background[edit]

Harvest Templates helps us to import information into Wikidata from structured information in templates from Wikipedia.

Preparatory work[edit]

  1. Make sure that the data to be harvested is structured in a template in Wikipedia.
  2. Ensure that all of the pages where the property is to be set are in a suitable category in Wikipedia.

Using Harvest Templates[edit]

Note: Any settings not mentioned are left as their default setting.

  1. Go to: https://tools.wmflabs.org/pltools/harvesttemplates/
  2. Set Property number to date of birth (P569). This represents the Wikidata property to be set.
  3. Set Template this is the Wikipedia template from which to import the data. In this case, it’s Birth date and age.
  4. Set the Parameter In this case the Birth date and age template specifies the order in which years, months and days are recorded - first year, then month, then day e.g. 1958|4|26. Leave the box next to Parameter blank and in the three boxes below specify:
    1. Year - enter “1”
    2. Month - enter “2”
    3. Day - enter “3”
  5. Set the Filter. This tells the system only to look for Wikipedia pages in a particular category. In this case, use Pakistani_MNAs_2013–18.
  6. Deselect “don't load items with the property set” (we get an error when we leave this selected).
  7. Hit Get Pages (you may need to wait a while).
  8. Demo the proposed changes. If it is working correctly in this case, you should see a series of green bars with the phrase ‘added value’ followed by the value which has been added.
  9. If that looks right, hit add value.
  10. Check that that did what you were expecting :)

This can be re-run when there are new items in the category or against other categories if the there are multiple categories for which the change is required.