Top Banner
An Ambious Wikidata Tutorial Emw WikiConference USA Washington, D.C. 2015-10-10 (Updated 2015-10-13)
52

An Ambitious Wikidata Tutorial

Apr 21, 2017

Download

Data & Analytics

EMW
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An Ambitious Wikidata Tutorial

An Ambitious Wikidata Tutorial

EmwWikiConference USA

Washington DC2015-10-10 (Updated 2015-10-13)

Wikidata is a free knowledge base that can be read and edited by

humans and machines

Wikidatas goals

Centralize interwiki links Centralize infoboxes Provide an interface for rich queries

Structure the sum of all human knowledge

What youll learn from this talk

How to edit Wikidata

Projects built with Wikidata

Wikidata API programming

Ontologies

Wikidata vocabulary

Where to find things

Querying with SPARQL etc

RDF and OWL exports

Elements of a Wikidata statement

Example Washington DC (Q61)

Items and properties

Each item and property has its own page

Itemsndash Represent subjects Barbara McClintock Challenger disasterndash Have identifiers like Q199654 Q921090ndash 14875838 items as of 2015-10-05

Propertiesndash Represent attribute names occupation cause ofndash Have identifiers like P106 P828ndash 1805 properties as of 2015-10-05

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 2: An Ambitious Wikidata Tutorial

Wikidata is a free knowledge base that can be read and edited by

humans and machines

Wikidatas goals

Centralize interwiki links Centralize infoboxes Provide an interface for rich queries

Structure the sum of all human knowledge

What youll learn from this talk

How to edit Wikidata

Projects built with Wikidata

Wikidata API programming

Ontologies

Wikidata vocabulary

Where to find things

Querying with SPARQL etc

RDF and OWL exports

Elements of a Wikidata statement

Example Washington DC (Q61)

Items and properties

Each item and property has its own page

Itemsndash Represent subjects Barbara McClintock Challenger disasterndash Have identifiers like Q199654 Q921090ndash 14875838 items as of 2015-10-05

Propertiesndash Represent attribute names occupation cause ofndash Have identifiers like P106 P828ndash 1805 properties as of 2015-10-05

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 3: An Ambitious Wikidata Tutorial

Wikidatas goals

Centralize interwiki links Centralize infoboxes Provide an interface for rich queries

Structure the sum of all human knowledge

What youll learn from this talk

How to edit Wikidata

Projects built with Wikidata

Wikidata API programming

Ontologies

Wikidata vocabulary

Where to find things

Querying with SPARQL etc

RDF and OWL exports

Elements of a Wikidata statement

Example Washington DC (Q61)

Items and properties

Each item and property has its own page

Itemsndash Represent subjects Barbara McClintock Challenger disasterndash Have identifiers like Q199654 Q921090ndash 14875838 items as of 2015-10-05

Propertiesndash Represent attribute names occupation cause ofndash Have identifiers like P106 P828ndash 1805 properties as of 2015-10-05

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 4: An Ambitious Wikidata Tutorial

What youll learn from this talk

How to edit Wikidata

Projects built with Wikidata

Wikidata API programming

Ontologies

Wikidata vocabulary

Where to find things

Querying with SPARQL etc

RDF and OWL exports

Elements of a Wikidata statement

Example Washington DC (Q61)

Items and properties

Each item and property has its own page

Itemsndash Represent subjects Barbara McClintock Challenger disasterndash Have identifiers like Q199654 Q921090ndash 14875838 items as of 2015-10-05

Propertiesndash Represent attribute names occupation cause ofndash Have identifiers like P106 P828ndash 1805 properties as of 2015-10-05

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 5: An Ambitious Wikidata Tutorial

Elements of a Wikidata statement

Example Washington DC (Q61)

Items and properties

Each item and property has its own page

Itemsndash Represent subjects Barbara McClintock Challenger disasterndash Have identifiers like Q199654 Q921090ndash 14875838 items as of 2015-10-05

Propertiesndash Represent attribute names occupation cause ofndash Have identifiers like P106 P828ndash 1805 properties as of 2015-10-05

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 6: An Ambitious Wikidata Tutorial

Example Washington DC (Q61)

Items and properties

Each item and property has its own page

Itemsndash Represent subjects Barbara McClintock Challenger disasterndash Have identifiers like Q199654 Q921090ndash 14875838 items as of 2015-10-05

Propertiesndash Represent attribute names occupation cause ofndash Have identifiers like P106 P828ndash 1805 properties as of 2015-10-05

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 7: An Ambitious Wikidata Tutorial

Items and properties

Each item and property has its own page

Itemsndash Represent subjects Barbara McClintock Challenger disasterndash Have identifiers like Q199654 Q921090ndash 14875838 items as of 2015-10-05

Propertiesndash Represent attribute names occupation cause ofndash Have identifiers like P106 P828ndash 1805 properties as of 2015-10-05

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 8: An Ambitious Wikidata Tutorial

Statements and claims Claims

ndash Claims are ldquotripletsrdquo

Formally subject predicate object In Wikidata item property value Example Barbara McClintock occupation scientist

Statements

ndash A claim is only part of a statement

ndash Statements also include

References Ranks

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 9: An Ambitious Wikidata Tutorial

Qualifiers ranks references

Qualifiersndash Qualifiers are properties used on claims rather than itemsndash ldquoBethesda population 56527 point in time (P585) 1960rdquo

Ranksndash Preferred normal deprecatedndash Useful to mark outdated claims

Referencesndash Source of claim provenancendash ldquo stated in (P248) 1960 United States Censusrdquo

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 10: An Ambitious Wikidata Tutorial

More on Wikidata vocabulary

httpswwwwikidataorgwikiWikidataGlossary

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 11: An Ambitious Wikidata Tutorial

Wikipedia articles have a Wikidata item link in the left navigation panel

Wikidata link on Wikipedia

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 12: An Ambitious Wikidata Tutorial

Getting to Wikidata from Wikipedia

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 13: An Ambitious Wikidata Tutorial

Instant search suggests items that have labels or aliases matching your keyword

Wikidata search

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 14: An Ambitious Wikidata Tutorial

Search by label

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 15: An Ambitious Wikidata Tutorial

Search by alias ldquoflurdquo -gt influenza

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 16: An Ambitious Wikidata Tutorial

Finding properties

Is there a property for ldquonumber of windowsrdquo What was the ID of that property again

Searchndash In main site search box prefix search term with ldquoPrdquondash ldquoPnumber ofrdquo ldquoPoccupationrdquondash Instant search doesnt work for properties only items

Browsendash httpswwwwikidataorgwikiWikidataList_of_properties

^ bookmark this

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 17: An Ambitious Wikidata Tutorial

Lets edit Wikidata

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 18: An Ambitious Wikidata Tutorial

Barbara McClintock

httpswwwwikidataorgwikiQ199654

employer (P108) Cold Spring Harbor Laboratory

start time (P580) December 1941

member of (P463)

National Academy of Sciencesstart time (P580) 1944

American Academy of Arts and Sciencesstart time 1959

Royal Societystart time 1989

award received (P166)Nobel Prize in Physiology or Medicine

for work (P1686) mobile genetic elements

National Medal of Sciencepoint in time (P585) 1971

birth name (P1477) Eleanor McClintock

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 19: An Ambitious Wikidata Tutorial

Area Height GDP per capita

Quantities with units recently made possible

area (P2046) height (P2048) mass (P2067) cost (P2130) GDP per capita (P2132) total debt (P2133)

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 20: An Ambitious Wikidata Tutorial

Quantities Lots of low-hanging fruit

Not yet on Wikidata

ndash Area of Washington DC

ndash Height of Abraham Lincoln

ndash Height of United States Capitol

ndash Length of Mississippi River

ndash GDP per capita of the United States of America

^ Add these

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 21: An Ambitious Wikidata Tutorial

Built on Wikidata

Histropedia 300000 timelines and 15 million eventshttphistropediacomtimeline1fr22b0p8sEmpires

ReasonatorWikidata knowledge tailored for readersJS Bach httptoolswmflabsorgreasonatorq=Q1339

Gene Wiki Every human gene is now on Wikidatahttpblogwikimediade20141022establishing-wikidata-as-the-central-hub-for-linked-open-life-science-data(More info today in Open Biomedical Knowledge session at 215 PM)

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 22: An Ambitious Wikidata Tutorial

Histropedia

httphistropediacomtimeline1fr22b0p8sEmpires

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 23: An Ambitious Wikidata Tutorial

Toolsndash Wikidata API

httpswwwwikidataorgwapiphp

ndash Querying Autolist

httptoolswmflabsorgautolistautolist1html Wikidata Query Service (new)

httpsquerywikidataorg

ndash Software framework Wikidata Toolkit httpswwwmediawikiorgwikiWikidata_Toolkit httpsgithubcomWikidataWikidata-Toolkit

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 24: An Ambitious Wikidata Tutorial

Wikidata API

Quick Python demo

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 25: An Ambitious Wikidata Tutorial

Querying in Wikidata

List of politicians who died of cancer

Pseudo-query

occupation politician AND cause of death cancer

occupation P106

politician Q82955

cause of death P509

cancer Q12078

Wikidata query in Autolist

claim[10682955] AND claim[50912078]

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 26: An Ambitious Wikidata Tutorial

httptoolswmflabsorgautolistautolist1htmlq=claim[10682955]20AND20claim[50912078]

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 27: An Ambitious Wikidata Tutorial

Only 56 politicians have died of cancer

Seems rather low

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 28: An Ambitious Wikidata Tutorial

Classification on Wikidata

Taxonomy of knowledge

Enables powerful inference novel applications

Interesting philosophical design and engineering issues

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 29: An Ambitious Wikidata Tutorial

Tree of Porphyry

UserVoiceOfTheCommons CC-BY-SA 30

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 30: An Ambitious Wikidata Tutorial

Classes and instances

Plato is a human is a animal

Plato instance of human subclass of animal

Instance concrete object individual

Class abstract object

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 31: An Ambitious Wikidata Tutorial

Classification on Wikidata

instance of (P31)ndash rdftype in RDF and OWLndash Most popular Wikidata property

subclass of (P279)ndash ldquoall instances of A are also instances of Brdquondash rdfssubClassOf in RDF and OWL

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 32: An Ambitious Wikidata Tutorial

Examples USS Nimitz instance of Nimitz-class aircraft carrier

Nimitz-class aircraft carrier subclass of aircraft carrier

2012 Cannes Film Festival instance of Cannes Film Festival

Cannes Film Festival subclass of film festival

an individual charm quark instance of charm quark

charm quark subclass of quark^ Many ldquoleaf nodesrdquo in Wikidatas taxonomic hierarchy are not instances (There are no items about individual quarks on Wikidata)

httpswwwwikidataorgwikiHelpBasic_membership_properties

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 33: An Ambitious Wikidata Tutorial

Bad smells

Item has many instance of or subclass of claims

Items typically satisfy a huge number of instance of claims Fido instance of dog Fido instance of English Pointer Fido instance of faithful animal hellip

Solution use one class for instance of put other class knowledge into normal properties

Fido instance of dog Fido breed English Pointer Fido known for faithfulness

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 34: An Ambitious Wikidata Tutorial

Bad smells

subclass of claim that is nonsensical when interpreted as ldquoAll instances of A are also instances of Brdquo

Exampledog subclass of pet

But not all dogs are pets

feral dog subclass of dog trueferal dog subclass of pet false dog subclass of pet false

Solution put ldquopetrdquo knowledge about dogs into claim that does not apply to all instances of dog Eg ldquodog has role petrdquo (Has role would not be transitive)

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 35: An Ambitious Wikidata Tutorial

Classification on Wikidata

Last but not least part of (P361)ndash Third basic membership propertyndash Top-level ldquopart-wholerdquo relation

subclass of and part of are both transitive instance of is not transitive

Transitive relation

A subclass of B

B subclass of C

A subclass of C

httpswwwwikidataorgwikiHelpBasic_membership_properties

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 36: An Ambitious Wikidata Tutorial

subclass of (P279) enables machines to infer

conceptual hierarchy

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 37: An Ambitious Wikidata Tutorial

Recall

Query reports that only 56 politicians have died of cancer

Problem

Only matches the precise claim ldquocause of death cancerrdquo

Omits results that havendash cause of death lung cancerndash cause of death lymphomandash cause of death leukemia

Solution

Include causes of death that are a subclass of cancerndash In Autolist httptinyurlcomovgjqd8ndash Also possible in SPARQL in new Wikidata Query Service

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 38: An Ambitious Wikidata Tutorial

SPARQL

SPARQL semantic query language for databases

Wikidata recently added official support

ndash Query UI httpsquerywikidataorg

ndash Examples httpswwwmediawikiorgwikiWikibaseIndexingSPARQL_Query_Examples

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 39: An Ambitious Wikidata Tutorial

PREFIX wd lthttpwwwwikidataorgentitygt PREFIX wdt lthttpwwwwikidataorgpropdirectgt

SELECT politician cause politician_label cause_of_death_label WHERE politician wdtP106 wdQ82955 find items that have occupation (P106) politician (Q82955) politician wdtP509 cause with a P509 (cause of death) claim cause wdtP279 wdQ12078 where the cause is a subclass of (P279) cancer (Q12078) politician wdtP39 wdQ11696 Uncomment this line to include only US Presidents OPTIONAL politician rdfslabel politician_label filter (lang(politician_label) = en) OPTIONAL cause rdfslabel cause_of_death_label filter (lang(cause_of_death_label) = en)ORDER BY ASC (politician)

Example SPARQL query

List of politicians who died of cancer

Live demo httptinyurlcomnh7jc2p

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 40: An Ambitious Wikidata Tutorial

httptinyurlcomnh7jc2p

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 41: An Ambitious Wikidata Tutorial

cause wdtP279 wdQ12078

Be sure to add an asterisk () to get the subclass tree

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 42: An Ambitious Wikidata Tutorial

Autolist vs Wikidata Query ServiceAutolist Wikidata Query Service

URL httpstoolswmflabsorgautolist httpsquerywikidataorg

Syntax WDQ (custom but succinct) SPARQL (W3C standard)

Support status Unofficial Official beta

Release date 2013-09-17 2015-09-07

Developer Magnus Manske Stas Malyshev

Source code httpsbitbucketorgmagnusmanskewikidataquery

httpsgithubcomwikimediawikidata-query-rdf

License GPL 2+ Apache 20

Technology C++ Java Blazegraph

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 43: An Ambitious Wikidata Tutorial

How toExplore RDFOWL dumps locally

Get the most recent dumpshttptoolswmflabsorgwikidata-exportsrdf

Small interesting wikidata-taxonomyntgz

Download and install Protegehttpprotegestanfordedu

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 44: An Ambitious Wikidata Tutorial

Protege

httpprotegestanfordedu

The browser of the Semantic Web

Good for small- to medium-sized ontologies

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 45: An Ambitious Wikidata Tutorial

Querying cancer types in wikidata-taxonomyntgz

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 46: An Ambitious Wikidata Tutorial

Open questions Modeling causes

What caused or causes

ndash The Space Shuttle Challenger explosionndash The dinosaurs to diendash Malaria Cancerndash The American Civil War

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 47: An Ambitious Wikidata Tutorial

Causation on Wikidata

httpswwwwikidataorgwikiHelpModeling_causes

has cause (P828) (alias underlying cause) thing that ultimately resulted in the effect

has immediate cause (P1478) thing that proximately resulted in the effect

has contributing factor (P1479) thing that significantly influenced the effect but did not directly cause it

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 48: An Ambitious Wikidata Tutorial

American Civil War (Q8676)

has cause slavery in the United States (Q118382) (preferred rank)states rights (Q48527) (deprecated rank)

has immediate cause Battle of Fort Sumter (Q543165)United States presidential election 1860 (Q698842)

has contributing factor caning of Charles Sumner (Q5032419)Dred Scott v Sandford (Q690462)Bleeding Kansas (Q331377)Uncle Toms Cabin (Q2222)

What caused the American Civil War

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
Page 49: An Ambitious Wikidata Tutorial

Thank you

httpswwwwikidataorgwikiUserEmw

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52