User:Daniel Mietchen/FSCI 2018

From Wikidata
Jump to navigation Jump to search
A Wikidata query that was developed during the course. See #Map of institutions where Canadian citizens got their PhD for details.
Selection of Wikidata-related activities for coursework. See #Tailoring educational workflows for details.


This page is auxiliary to two summer courses taking place in the framework of the FORCE11 Scholarly Communication Institute (FSCI) 2018 in July/ August 2018:

Both parts are suitable for people who have no prior experience with Wikidata. In Part 2, participants of Part 1 will provide the necessary background about Wikidata to those who are new to the topic.


Prior to the start of their course, participants are expected to


Besides seats, tables and power outlets for everyone in the room, a stable WiFi would be needed, and for the speaker a projector and a stable Ethernet connection. Since Daniel will attend remotely via Zoom, access to an A/V system would be needed.


The Monday-Tuesday team
The Wednesday-Thursday team

Please sign and date your post (by typing *Four-tildes.png or clicking the signature icon: Insert-signature.png in the edit toolbar).



Introductions to Wikidata[edit]

Wikimania 2018 overview of Wikidata progress over the last year




Wikidata URIs for different formats

Example queries[edit]

Institutions around the globe where people who have/ had a doctoral advisor have been educated[edit]

The following query uses these:

Features: Map (Q24515275)  View with Reasonator View with SQID

 1 #defaultView:Map
 2 SELECT ?academics ?academicsLabel ?geoloc ?institution ?institutionLabel ?image WHERE {
 3   ?academics wdt:P31 wd:Q5 . # instances (P31) of humans (Q5)
 4   ?academics wdt:P184 ?advisor . # PhD supervisor (P184)
 5   # possible other route to identify people with PhD: Property:P512 (academic degree): Q752297
 6   ?academics wdt:P69 ?institution . # educated at
 7   ?academics wdt:P18 ?image . #image
 8   #?institution wdt:P17 wd:Q16 . # institution is in Canada
 9   ?institution wdt:P625 ?geoloc . #gets the geolocation of the institution
10   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
11 }
12 LIMIT 100

Map of institutions where Canadian citizens got their PhD[edit]

The following query uses these:

Features: Map (Q24515275)  View with Reasonator View with SQID

 1 #defaultView:Map
 2 SELECT DISTINCT ?institution ?institutionLabel ?academics ?academicsLabel ?degree ?degreeLabel ?geoloc  ?image WHERE {
 3   ?academics wdt:P31 wd:Q5 ; # instances (P31) of humans (Q5)
 4              wdt:P27 wd:Q16 ; # country of citizenship
 5              p:P69 ?statement . # check for an "educated at" (P69) statement
 6   OPTIONAL { ?academics wdt:P18 ?image }. #image
 8   ?statement ps:P69 ?institution . # get value of the "educated at" statement, i.e. the institution
 9   ?institution wdt:P625 ?geoloc . # get the geolocation of the institution
11   ?statement pq:P512 ?degree . # get qualifier "academic degree" (P512) 
12   ?degree wdt:P31*/wdt:P279* wd:Q849697 . # filter for doctoral degrees
14   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
16 }

Maps based on Wikidata queries[edit]

Disasters by location and disaster type[edit]

The following query uses these:

Features: Map (Q24515275)  View with Reasonator View with SQID

1 #defaultView:Map{"layer":"?typeLabel"}
2 SELECT ?item ?itemLabel ?geo ?type ?typeLabel (SAMPLE(?_image) AS ?image) WHERE {
3   ?type wdt:P279* wd:Q3839081 .
4   ?item wdt:P31 ?type ;
5         wdt:P625 ?geo .
6   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
7   OPTIONAL { ?item wdt:P18 ?_image }
8 }
9 GROUP BY ?item ?itemLabel ?geo ?type ?typeLabel
Disasters by location and disaster type, with number of casualties[edit]

The following query uses these:

Features: Map (Q24515275)  View with Reasonator View with SQID

 1 #defaultView:Map{"layer":"?typeLabel"}
 2 SELECT ?item ?itemLabel ?geo ?type ?typeLabel ?casualties (SAMPLE(?_image) AS ?image) WHERE {
 3   ?type wdt:P279* wd:Q3839081 .
 4   ?item wdt:P31 ?type ;
 5         wdt:P1120 ?casualties ;
 6         wdt:P625 ?geo .
 7   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 8   OPTIONAL { ?item wdt:P18 ?_image }
 9 }
10 GROUP BY ?item ?itemLabel ?geo ?type ?typeLabel ?casualties

Wikidata-powered infoboxes[edit]


Wikidatacon 2017. Wikidata-powered infoboxes (demo pages for Catalan, Basque, English)

Examples for Wikidata-driven infoboxes[edit]

Technical details[edit]

Wikimania2018 CommonsInfobox
Wikidata-enabled Infobox Workshop


Lifting a veil on the sources of free knowledge a WikiCite workshop

More on Wikidata:Scholia[edit]

University of California at San Diego[edit]



Starting points[edit]



Ideas for Wikidata-related activities that could be made part of coursework[edit]

FSCI Doathon[edit]


Ideas about what to work on[edit]

Background reading[edit]

Some more practice[edit]

Set up a new lexeme[edit]

Set up a new item for a publication[edit]

  • Pick a DOI or PMCID
  • Enter it into SourceMD
  • Check and run

Annotate some publication items as to what they are about[edit]

Some further customization of our Wikidata user interface[edit]
Geolocated topics of scholarly articles[edit]

The following query uses these:

Features: Map (Q24515275)  View with Reasonator View with SQID

 1 #source:
 2 #defaultView:Map{"layer":"?topicsBin"}
 3 SELECT ?topic ?topicLabel ?geoloc ?topicsBin ?topicCitations
 5    BIND(
 6       IF(?topicCitations < 10, "Log < 1",
 7             IF(?topicCitations < 100, "Log < 2",
 8                 IF(?topicCitations < 1000, "Log < 3",
 9                     "Log >= 3")))
10     AS ?topicsBin)
12   {
13   SELECT ?topic ?geoloc (count(?topic) as ?topicCitations) 
15   WHERE {
17   ?paper wdt:P921 ?topic ; 
18          wdt:P31 wd:Q13442814 .
19   ?topic wdt:P625 ?geoloc.
20   } 
22   GROUP BY ?topic ?geoloc
25   }
26   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
27 }
Scaling this up[edit]
List of publications with a certain string in the title that have not been tagged as being about a topic described by the string[edit]

The following query uses these:

  • Properties: main subject (P921)  View with Reasonator View with SQID
     1 SELECT DISTINCT ?item ?itemLabel 
     2 WHERE {
     3   hint:Query hint:optimizer "None".
     4   SERVICE wikibase:mwapi {
     5     bd:serviceParam wikibase:api "Search";
     6                     wikibase:endpoint "";
     7                     mwapi:srsearch "\"data sharing\" haswbstatement:P31=Q13442814" .
     8     ?title wikibase:apiOutput mwapi:title.
     9   }
    10   BIND(IRI(CONCAT(STR(wd:), ?title)) AS ?item)
    11   FILTER NOT EXISTS { ?item wdt:P921 wd:Q5227350. }
    12   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    13 }
    14 # LIMIT 10000
Tool: QuickStatements[edit]
Tool: Mix'n'Match[edit]

Tailoring educational workflows[edit]

By the kind of involvement of Wikidata[edit]

  • Building generic Wikidata-based modules that can be inserted into coursework on a broad range of subjects with minimal customization
  • Adding a Wikidata component to existing courses that involve Wikipedia or some other Wikimedia-related activity
  • Building a largely Wikidata-based curriculum for data science or other data-centric fields

By age group[edit]

  • K-12
  • Secondary
  • Tertiary
  • Professional education
  • Seniors

By level of knowledge or skills[edit]

  • Beginner
  • Intermediate
  • Experienced
  • Expert
Dimensions of knowledge/ skills[edit]
  • Domain knowledge
  • Wikidata knowledge
  • Language skills
  • Software development skills
  • Design skills
  • Communication skills

By field of knowledge[edit]

  • Art history
  • Epidemiology
  • Linguistics
  • Goats

By jurisdiction[edit]

  • California
  • France
  • Kerala

Course summary[edit]

This will be presented on Friday in the summary plenary session.

See also[edit]

Wikidata's data model
Wikidata - A Gentle Introduction for Complete Beginners
An overview of Wikidata as given at Wikimania 2017
Wikidata Query Service in Brief
Wikidata introduction - Celtic Knot Conference 2018
Topics co-occurring with 'Zika virus', as per Wikidata
Querying Wikidata with SPARQL for Absolute Beginners
Structured Data on Wikimedia Commons - what is happening