User:Einebillion/Teaching notes

For extensive notes on Wikidata and Open Refine see https://www.wikidata.org/wiki/User:Einebillion/Manual

What is Wikidata? edit

https://w.wiki/jJK

Wikipedia GLAM https://en.wikipedia.org/wiki/Wikipedia:GLAM

Do You Have a Wikidata User Page? edit

Check whether you've created your user page. You should have already created your login but activate your user page and write something about yourself. It's useful to add notes and helps other people connect with you.

How to create a new item edit

There's two steps you need to do to before you create a new item.

  1. Are you sure that the proposed wikidata item doesn't already exist? Search and double check.
  2. You must ensure that the new item meets the notability criteria. The good news is that notability criteria is less that what is expected of a wikipedia article. This is because wikidata is linked open data so the feeling is that the more data linked up the better as more data equals more meaning.
  • If you are entering in items that are referenced to a GLAM database the item will meet the notability criteria as the item will "...be notable, in the sense that it can be described using serious and publicly available references."[1]
  • You'll need to determine which properties you are interested in adding.

Wikidata for the New Beginner edit

Here are a number of useful introductory videos on Wikidata and why it's great. They are ranked by complexity and depth of information.

  1. YouTube video – Wikidata and Why You Should Care. (7 min 37 sec)
  2. YouTube video – How to manually edit Wikidata. (2 min 15 sec)
  3. YouTube video – An Introduction to Wikidata. (22 min 34 sec) and the slide deck from this presentation.
  4. YouTube video – A Gentle Introduction to Wikidata for Absolute Beginners [including non-techies! (3 hrs 4 min 32 sec)
This last video is three hours long so use these time markers to skip to the sections you are interested in.

Latest resource from Open Access Week 2020

Wikidata Extended edit

Videos and other content useful for experienced editors of Wikidata

  1. Mass edits on Wikidata – how to use Google spreadsheets and Quick Statements (9:42)
    1. How to use Google Sheets to Manage Wikidata Coreferencing
    2. How to Add Museum IDs to Wikidata
  2. Asaf Bartov's Beyond the Basics presentation to New Zealand wikidata editors
  3. Open Refine for beginners

Mix'n'Match: Capturing All Possible Matches edit

Mix'n'Match is a wikidata tool that crowd sources data checking. There's only so much a computer can do to successfully match data. Sometimes you need a human to confirm the computer is on the right track. That's what Mix n' Match does. Check it out here: http://tools.wmflabs.org/mix-n-match/ Pick a catalogue to start working on. Here's a catalogue of people names from the Museum of New Zealand Te Papa Tongarewa. https://tools.wmflabs.org/mix-n-match/#/catalog/362 You can see that there is just over 11% of this set fully matched. So humans have got a bit of work to go. Watch this video to find out more about how Mix n' Match works.

There's another way to connect Mix'n'Match values with the Q item. You can add a piece of code to your common.js page and that piece of code will pull up every Mix'n'Match value matched to that Q item for you to check.

To make all the other possible Mix'n'Match authority control id suggestions appear at the top of a Wikidata record for you to review

importScript( 'User:Magnus_Manske/mixnmatch_gadget.js' );

  • then Save.
  • Then refresh the page or clear the cache of your browser.

Examples to use once you have the code added into your common.js page

Google Sheets and the Wikipedia and Wikidata Tools Add on edit

You can add a Wikidata add on to Google sheets that will automatically pull possible Q item values and ids into your dataset. To get the add-on activiated:

  • login to Google (you will need a google account to do this)
  • Open Google Sheets
  • Open an new blank Google Sheet
  • Click on the menu item "Add Ons"
  • The marketplace window will appear
  • In the search bar enter Wikipedia and Wikidata Tools
  • There is one add on with the name "Wikipedia and Wikidata Tools" - select this
  • Give it the permissions it requires and install it.

To watch someone use this functionality in a video see: Mass edits on Wikidata – how to use Google spreadsheets and Quick Statements (9:42)

Here's an example spreadsheet with Wikidata columns in place https://docs.google.com/spreadsheets/d/1JrVXLf5JbzAZ-QFk0IQKTsDvxznA_FsO-zwsQUCn94s/edit#gid=514278031 The spreadsheet shows the name of those participating in the 1865 NZ Exhibition.

  • Q number is the Wikidata item for each individual or company
  • P1344 is the property value for participant of
  • Q39059917 is the Q statement for the 1865 New Zealand Exhibition
  • S = designated for references. You figure out the correct S number by searching for the property you want and then replacing the P with an S. In this case P854 is the property number for "reference URL". So to make it a reference statement use S854
  • Statement numbers = Use S instead of P when you want to use it for a statement reference
  • Date/time has to be specific wikidata date format ie +YYYY-MM-DDT0000:00Z/11

All data statements should be referenced where possible.

Here's an example on how action a search for Wikidata Q items for people in Google Sheets

  • Set up your Sheet with a column named Q ID
  • Set up a second column named People
  • Add the names of people into the second column
  • In the first column, next to the cell naming the first person you want to use the functions statement. To get functions to appear in sheets you need to type in an equals sign.
  • then go to the menu and click on Insert → Function → All → WIKIDATAID
  • Sheets will then prompt you to add a cell reference to search. In this case click on the cell featuring the persons name that is next to the Q ID column. e.g. =WIKIDATAQID(B2) where B2 is the cell that has the persons name inserted.
  • Copy this formula down the sheets page
  • The easiest way to copy the formula down the column is to use the fill handle. Once the formula is in the first cell of your spreadsheet, point your mouse to the lower right corner of the formula cell. The pointer changes into a fill handle (black plus symbol). You can then drag this to the last row and the formula will update itself automatically down the page. If you need to check the formula just click into the cell.
  • Once this is done, the sheet will take a bit of time to process the query by talking with Wikidata and will bring back it's best guess as to the Q number. Obviously double checking will be important - especially with people names as disambiguating people names is a very real challenge in Wikidata. So it's always best to check accuracy before adding any further statements.

Quick Statements Tool edit

To Add Statements to Existing Wikidata Items using Quick Statements edit

Once you have a dataset and you are happy with it in Google sheets you can use Quick Statements to add the data to wikidata To get this spreadsheet information into Quick Statements

  • Go to Quick Statements
  • login
  • Click on New Batch button
  • Copy google spreadsheet from Qnumber column onwards - the columns should be in the order of Item (Qnumber), Property, Value, Reference Property, Reference Value
  • Past into Quick Statements
  • Import V1 commands
  • Then change bottom right number to 100 or to 500 instead of 10
  • Then check and press RUN!

To Create new items in Quick Statements edit

You can create new items by inserting a line consisting only of the word "CREATE". To add statements to the newly created item, use the word "LAST" instead of the Q number, and the statement will be added to the last created item. An example where TAB is the tab space between each value. CREATE LAST TAB Len TAB "[insert Firstname Lastname]" = sets the label. The label must be within quotation marks.

LAST TAB Den TAB "[insert description text]" = sets the description. The description must be within quotation marks

LAST TAB P6683 TAB [insert Alexander Turnbull Library Unique ID] = adds the item number

Wikidata Query on all records with Alexander Turnbull Library IDs edit

In order to use these queries in the Wikidata Query Service, go into edit for this section and then copy from "#" to "#order..." of the query you want to use

First Query edit

  1. Parties with Alexander Turnbull Library ID ordered by label

SELECT ?item ?itemLabel ?AlexanderTurnbullLibraryID WHERE {

?item wdt:P6683 ?AlexanderTurnbullLibraryID . # item includes a property of ATL ID so it can be picked up in the dataset and for ordering purposes       
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC (?itemLabel) #order by item label

Second Query edit

  1. Parties with Alexander Turnbull Library ID ordered by Family Name

SELECT ?item ?itemLabel ?AlexanderTurnbullLibraryID ?familyname ?familynameLabel WHERE {

?item wdt:P6683 ?AlexanderTurnbullLibraryID . # item includes a property of ATL ID so it can be picked up in the dataset and for ordering purposes       
  ?item wdt:P734 ?familyname . # item also includes the value family name so it can be picked up in the dataset and for ordering purposes   
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } 

ORDER BY ASC(?familynameLabel) #order alphabetically by family name label

Downloading data extracted from Wikidata Query Service edit

Once you have an identified Q item for each person that is identified with an ATL ID number, you can search in Wikidata using the Query Service, extract the data, in put it into a spreadsheet and then update the spreadsheet with more information. Once you have the information ready for upload you can then use the Quick Statements to upload the data. For example there is a difference in size between the First and Second Queries. That's because only some of the records with a ATL ID number have a family name property value in Wikidata.

So (as an example) you could

  • Search in Wikidata Query Service using the First Query
  • Extract the data by clicking on Download button which is located to the right side of the screen just above the query search results.
  • To Download choose CSV file as this is easily uploaded into a Sheets
  • Name the download file and save it on your computer where you can find it.
  • Open up a new sheets
  • Click on the menu File → Import → From the window that pops up select the "Import" tab
  • Data will be imported.
  • To remove the Q ID hyperlink click on File → Replace and enter the text http://www.wikidata.org/entity/ and Replace with blank. This will remove the link text: http://www.wikidata.org/entity/
  • To remove the hyperlinks highlight the Column, right click and select "unlink"

Your dataset is ready for cleaning or using to develop new information.

Alternative to using your own sheet = TABernacle edit

https://tools.wmflabs.org/tabernacle/?#/ TABernacle is another Wikidata tool. You can either use a Wikidata Query Service coding or add in Q ids manually.

  • Once you've added in the search criteria then you can decide on the properties you're interested in.
  • Once you've picked them press RUN
  • A tab view of the data will appear and you can add new data into the blank cells. TABernacle will automatically search for values, let you pick the most appropriate and then update Wikidata automatically once you've picked.
  • It's another alternative to Quick Statements. It's particularly useful if the dataset you're interested in is mostly complete but needs a little tending to get it working totally correctly.

e.g.

  • Open TABernacle and log in
  • Get the most accurate list of entries with ATL ids as above (Here's a spreadsheet I prepared earlier: https://docs.google.com/spreadsheets/d/1eMcO0BtzgzIppEsGUfahuFgranfpeXYPDxUmZT0ZQYs/edit#gid=500022981 )
  • Copy the Q ID number
  • Add the Q ID number manually into TABernacle
  • Select the Column values - I picked Label with "en" to reflect the english language label only, P734 Family Name; P569 Date of birth; P570 Date of Death.
  • Then click on the RUN button.
  • A tabular grid will appear
  • Then you can see the gaps and enter the information at will.

References edit

  1. https://www.wikidata.org/wiki/Wikidata:Notability