1 of 37

GUIDE �FOR DATA-A-THONS

2 of 37

TABLE OF CONTENTS.

01

02

03

04

05

Understanding Wikidata

​

Structured and Linked Data on Wikidata: The role of unique Identifiers�

Querying Wikidata with SPARQL

​

Resource and Image credits

​

Practical application of Wikidata

3 of 37

Understanding Wikidata

…..

 

4 of 37

Wikidata Hunt…

How did you get to know about Wikidata?

5 of 37

What is Wikidata?

​

  • Acts as central storage for the structured data of its Wikimedia sister projects including Wikipedia, Wikivoyage, Wiktionary, WikiSource, and others.
  • Wikidata project launched on 29th October 2012
  • Knowledge base
  • Linked to other databases
  • Released under public domain (CC0)
  • Based on facts & references
  • Readable by both humans and machines
  • Collaborative edits by Wikidata editors and bots.

​

​

6 of 37

What Wikidata is not;

Wikidata (extensional definition) is not a...

  • Wikipedia, or an encyclopedia
  • dramafest
  • place to put original research
  • place for self-promotion, or advertising/marketing
  • a web hosting service for blogs
  • collection of unverifiable speculation
  • place to put reference data (e.g. digits of pi), listings of statistics, cryptographic material
  • cross-wiki discussion forum.

​

Goals of Wikidata

​

  • Give more people access to more knowledge.
  • Provide a free and common knowledge base that can be accessed and read by both humans and machines.
  • Provide support in and out of Wikimedia Projects.
  • Provide a freely usable repository and hub for linked data.

​

7 of 37

Policies of Wikidata

8 of 37

Challenges of Wikidata

  • Dated Data: lacking triggers, repetitive work
  • Inflexible way of lateral knowledge
  • Lack of data quality
  • Gaps in knowledge, contribution demographics and data ;
  • Assumes literacy in database languages in order to benefit from it ;
  • The African context lacks organised datasets .

​

9 of 37

links for context :Introduction

links for context: General

links for context : Usage

  1. Wikidata : https://wikidata.org
  2. Wikidata Curious Facts : https://www.wikidata.org/wiki/Wikidata:Curious_Facts
  3. Wikidata in one page : https://www.wikidata.org/wiki/Wikidata:In_one_page
  4. Understanding data : https://www.wikidata.org/wiki/Help:About_data

​

  1. Wikidata Top Views : https://tools.wmflabs.org/topviews/
  2. Wikidata Statistics : https://www.wikidata.org/wiki/Special:Statistics
  3. Wikidata Usage Overview : https://stats.wikimedia.org/#/wikidata.org
  4. Wikidata Database Reports : https://www.wikidata.org/wiki/Wikidata:Database_reports

​

​

​

​

10 of 37

Wikidata Practical

On the Wikidata website (if you have not yet)

  • Create your user account and user page

On the Wikimedia Course Outreach dashboard

  • Take the Wikidata self-paced module 1 - Introduction to Wikidata (35 minutes)

​

11 of 37

Structured and Linked Data on Wikidata: The role of unique Identifiers�

12 of 37

DID YOU know Structured Data ?

13 of 37

​

Wikidata & Other Projects:

​

​

​

14 of 37

Role of unique identifiers

  • If you ask a database to find you "The Lion", it will give you a list of all its data pages that contain the alphabetical character sequence "the lion", possibly with variations in spaces and capital letters.
  • If you search for 'The Lion' in Wikidata, it finds books, films, animals, characters,... that are all referred to as 'The Lion' or 'the lion'.
  • The same applies if you do a search on the word "Igbo".
  • To avoid confusing all the entities called for example "The Lion" or "Igbo" in our databases, unique identifiers are used.

​

15 of 37

Practical Applications of Wikidata

16 of 37

Applying Wikidata :Individual engagement

On your own you can:

  • Add descriptions to Wikidata items
  • Add references to properties of items in order to make information more verifiable thus ensuring quality data on Africa

​

  • Add missing information /items about your community and interests to Wikidata in order to fill knowledge and content gaps
  • Correct spellings on Wikidata
  • Add language labels to Wikidata items

​

  • Add missing properties e.g. location, date of inception , image to items in order to make the information about them more discoverable
  • Link Wikidata items to their Wikipedia pages of they exist

​

​

On your own you can:

On your own you can:

17 of 37

OVERVIEW ��Wikidata tools (SPARQL, Wikidata Query Builder, Open Refine etc)��Visualising Wikidata�Gaining new insights from Wikidata through Analysis�

18 of 37

Queries in Wikidata

Queries in Wikidata are request for data or information from a Wikidata base table or combination of tables; precise request for information retrieval made to a Wikidatabase.

​

19 of 37

  • There are different ways to query information in Wikidata. �The simplest way is to search for an entry in Wikidata and looking up all information for that entry, e.g. search for Nnamdi Azikiwe�The real potential of Wikidata as a huge knowledge graph, can be experienced through more advanced querying with the Wikidata query service where the queries have to entered in SPARQL.

Queries in Wikidata

20 of 37

Why query Wikidata?

Querying Wikidata can :

  • Help analyse data for researchers and other users in order to come to meaningful conclusions ;
  • Reveal information gaps thus prompting action ;
  • Queries can answer questions
  • Find specific quickly data by filtering on specific criteria (conditions)
  • Aid research and discoverability of resources

​

​

​

21 of 37

Potential uses for Wikidata queries

Queries and their results can help :

  • Pre-drafting a spreadsheet of entities for use in an assignment or edit-a-thon
  • Check a dataset to ensure that results are accurate and complete
  • Compare and contrast against another SPARQL result set from another knowledgebase
  • Build a map to display to visualize geographic data
  • Generating a CSV, TSV or JSON file to export to another system or program, such as Open Refine, Open Street Map, Tableau, Gephi etc

​

22 of 37

Querying Wikidata with SPARQL

23 of 37

  • Wikidata Query Service (WDQS) is an advanced query tool.�It constructs queries using a structured language called SPARQL (SPARQL Protocol and RDF Query Language) that can ask questions from knowledge databases and return large sets of results.�WDQS is accessible via the left side menu on any Wikidata item.�

Ways to use the Wikidata Query Service

https://query.wikidata.org/

24 of 37

What the WDQS looks like�(Tip : Use the Query Builder to help at this point since you may not be that conversant with SPARQL)

25 of 37

  1. Use the drop-down boxes to select properties and values
  2. Add conditions to limit the results set.
  3. Click on and/or to expand or restrict results.
  4. Click the blue arrow to run the query.

This query asks for the names of women

(gender = female)

whose

(occupation = librarian) who

(have been educated at = University of Ibadan)

26 of 37

This query asks for the names of women

(gender = female)

whose

(occupation = librarian) who

(have been educated at = University of Ibadan)

​

Results download and

other editing options are on a pop-out right sidebar.

​

Click on “Show Query in the Query Service” to access the same query showing the SPARQL Code.

27 of 37

Writing & Understanding Queries in SPARQL

  1. SELECT fetches the values of specific fields in the database
  2. List the columns that you would like to see in your result table

​

  1. WHERE puts restrictions or conditions on the values to be retrieved
  2. Item has a property (P#) equal to a value (Q#)

​

  1. FILTER filters for items with a specific value
  2. FILTER on a condition/mathematical expression (=, !=, <, >, etc.) – useful for equal/unequal
  3. FILTER NOT EXISTS – no property linked to that item – useful for missing properties/images

​

  1. Boolean operators can be used to restrict or expand search results
  2. AND – Restricts the result set (Must contain Value A AND B) = IMPLICIT
  3. UNION - Expands the results set (Can contain either Value A OR B) = “OR”

28 of 37

Writing & Understanding Queries in SPARQL (cont’d)

  1. SERVICE – The service will return labels for the properties requested
  2. wikibase:label – returns the label of the entity, or name
  3. #defaultView – Sets the default view of the results, e.g., List or Map
  4. #defaultView:Map requires coordinates to be selected in the query
  5. LIMIT – Places a limit on the number of results returned; helps to avoid timeouts
  6. ORDER BY – Orders the result set by a specific field value
  7. ASC (?parameter) for ascending
  8. DESC (?parameter) for descending

29 of 37

Query #1 : Presidents of Sierra Leone

Asks for the names (itemLabel) of people

[instanceOf (P31) = human (Q5)] who have ([held the Position(P39)] of President of Sierra Leone (Q890010))

and returns a list ordered alphabetically by

label (first name first)

30 of 37

Results #1 - Presidents of Sierra Leone

​

Results list ordered

alphabetically by

label (first name

first). Can be

downloaded in

various formats.

31 of 37

Query #2 : Presidents of Sierra Leone without images

Asks for the names (itemLabel) of people

[instanceOf (P31) = human (Q5)] who have ([held the Position(P39)] of President of Sierra Leone (Q890010))

but whose Wikidata items have no image (P18) attached to them

32 of 37

Results #2 : Presidents of Sierra Leone without images

33 of 37

Key statements for People

​

  • instance of (P31) - human (Q5)
  • sex or gender (P21)
  • country of citizenship
  • occupation (Q12737077)
  • educated at (P39)
  • position held (P166)
  • image (P18)

​

34 of 37

Key statements for Institutions and Organisations

  • instance of (P31)
  • Organization
  • Institution
  • inception (P571)
  • country (P17)
  • Uganda(Q1036)
  • headquarters location (P159)
  • coordinate location (P625)
  • official website (Q22137024)

​

35 of 37

How to save your results

  • Click the Download button

below the query pane and

choose the appropriate file

type.

  • TSV or CSV files are most

useful to open with programs

such as Excel, Google Sheets,

Numbers, OpenRefine, etc.

36 of 37

Resource and Image credits

Further readings:

​

37 of 37

THANK YOU!

Do you have any questions?

Name: Bukola James

Email: bukolajames2017@gmail.com

Username: {{User:Bukky658}}�

​