
An Ambitious Wikidata Tutorial [pdf] - amirouche
https://upload.wikimedia.org/wikipedia/commons/3/3f/An_Ambitious_Wikidata_Tutorial.pdf
======
emw
Author here, ask me anything! Slides are also available at
[http://www.slideshare.net/_Emw/an-ambitious-wikidata-
tutoria...](http://www.slideshare.net/_Emw/an-ambitious-wikidata-tutorial).

~~~
amirouche
Are they any open experiments to integrate wikidata with AI systems of any
kind?

~~~
emw
Yes. Kian and WikiBrain are two such projects. Kian is an artificial neural
network designed to serve Wikidata, e.g. for classifying humans based on
content in Wikipedia [1, 2]. WikiBrain uses Wikidata to recognize the type of
relationships or connections between Wikipedia concepts [3, 4].

I suspect larger applications of Wikidata in AI will follow. For example, as
of 2010, IBM Watson acquired at least some of its content from DBpedia and
YAGO [5], which ultimately derive much of their content from scraping
Wikipedia's infoboxes and category system. Now, come 2015, Wikidata is
supplying data for some Wikidata infoboxes, and the proportion of infoboxes
that pull from structured data in Wikidata will increase over time. And I
expect Wikipedia's category system will gradually be supplanted by Wikidata's
more expressive property system over time.

Thus, I imagine Wikidata will form a semantic backbone for Q&A systems like
Watson in the future.

The Wikidata development team's work is funded through donations by the Allen
Institute of Artificial Intelligence, Google, the Gordon and Betty Moore
Foundation, and Yandex [6]. So organizations with an interest in AI see
potential in Wikidata.

1\. [https://github.com/Ladsgroup/Kian](https://github.com/Ladsgroup/Kian)

2\. [http://ultimategerardm.blogspot.com/2015/09/wikidata-ten-
que...](http://ultimategerardm.blogspot.com/2015/09/wikidata-ten-questions-
about-kian.html)

3\. [https://github.com/shilad/wikibrain](https://github.com/shilad/wikibrain)

4\.
[http://conservancy.umn.edu/bitstream/handle/11299/163269/Und...](http://conservancy.umn.edu/bitstream/handle/11299/163269/Undergrad%20Symposium%20Poster_Toby.pdf)

5\.
[http://www.aaai.org/Magazine/Watson/watson.php](http://www.aaai.org/Magazine/Watson/watson.php)

6\.
[http://cacm.acm.org/magazines/2014/10/178785-wikidata/fullte...](http://cacm.acm.org/magazines/2014/10/178785-wikidata/fulltext)

~~~
Tpt
There is also Platypus that is a small query answering engine based on
Wikidata: [http://askplatyp.us](http://askplatyp.us)

------
dylanwenzlau
Good tutorial! Wikidata is an awesome initiative for Wikimedia and I would
love to see all Wikipedia's structured data powered by wikidata. Wikidata is
much easier to interface with than wikipedia infoboxes!

~~~
amirouche
IIRC infoboxes should be powered by wikidata at some point.

------
emw
Wikidata's new SPARQL service is probably the most useful topic in this
tutorial for software developers and anyone interested in the Semantic Web. It
allows one to query the vast, free knowledgebase that backs Wikipedia --
almost 15 million entities and over 70 million statements.

Example queries:

* Politicians who died of cancer (of any type): [https://query.wikidata.org/#PREFIX%20wikibase%3A%20%3Chttp%3...](https://query.wikidata.org/#PREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%20%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0A%0ASELECT%20%3Fpolitician%20%3Fcause%20%3Fpolitician_label%20%3Fcause_of_death_label%20WHERE%20{%0A%20%20%20%3Fpolitician%20wdt%3AP106%20wd%3AQ82955%20.%20%20%20%20%23%20find%20items%20that%20have%20%22occupation%20%28P106%29%3A%20politician%20%28Q82955%29%22%0A%20%20%20%3Fpolitician%20wdt%3AP509%20%3Fcause%20.%20%20%20%20%20%20%20%23%20with%20a%20P509%20%28cause%20of%20death%29%20claim%0A%20%20%20%3Fcause%20wdt%3AP279*%20wd%3AQ12078%20.%20%20%20%20%20%20%20%20%23%20...%20where%20the%20cause%20is%20a%20subclass%20of%20%28P279*%29%20cancer%20%28Q12078%29%0A%20%20%20%23%20%3Fpolitician%20wdt%3AP39%20wd%3AQ11696%20.%20%20%20%23%20Uncomment%20this%20line%20to%20include%20only%20U.S.%20Presidents%0A%20%20%0A%20%20%20OPTIONAL%20{%3Fpolitician%20rdfs%3Alabel%20%3Fpolitician_label%20filter%20%28lang%28%3Fpolitician_label%29%20%3D%20%22en%22%29%20.}%20%0A%20%20%20OPTIONAL%20{%3Fcause%20rdfs%3Alabel%20%3Fcause_of_death_label%20filter%20%28lang%28%3Fcause_of_death_label%29%20%3D%20%22en%22%29.}%0A}%0AORDER%20BY%20ASC%20%28%3Fpolitician%29)

* Who discovered the most planets? [https://query.wikidata.org/#PREFIX%20wikibase%3A%20%3Chttp%3...](https://query.wikidata.org/#PREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%20%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0A%0ASELECT%20%3Fdiscoverer%20%3Fname%20%28COUNT%28DISTINCT%20%3Fplanet%29%20as%20%3Fcount%29%0A%20WHERE%20{%0A%20%20%20%3Fppart%20wdt%3AP279*%20wd%3AQ634%20.%0A%20%20%20%3Fplanet%20wdt%3AP31%20%3Fppart%20.%0A%20%20%20%3Fplanet%20wdt%3AP61%20%3Fdiscoverer%20.%0A%20%20SERVICE%20wikibase%3Alabel%20{%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%0A%20%20%20%20%3Fdiscoverer%20rdfs%3Alabel%20%3Fname%0A%20%20%20}%0A%20}%0A%20GROUP%20BY%20%3Fdiscoverer%20%3Fname%0A%20ORDER%20BY%20DESC%28%3Fcount%29%0A%20LIMIT%2010)

* Largest cities with a female mayor: [http://query.wikidata.org/#PREFIX%20wikibase%3A%20%3Chttp%3A...](http://query.wikidata.org/#PREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%20%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX%20p%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2F%3E%0APREFIX%20q%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fqualifier%2F%3E%0APREFIX%20v%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fstatement%2F%3E%0A%0ASELECT%20DISTINCT%20%3Fcity%20%3FcityLabel%20%3Fmayor%20%3FmayorLabel%20WHERE%20%7B%0A%20%20%3Fcity%20wdt%3AP31%2Fwdt%3AP279%2A%20wd%3AQ515%20.%20%20%23%20find%20instances%20of%20subclasses%20of%20city%0A%20%20%3Fcity%20p%3AP6%20%3Fstatement%20.%20%20%20%20%20%20%20%20%20%20%20%20%23%20with%20a%20P6%20%28head%20of%20goverment%29%20statement%0A%20%20%3Fstatement%20v%3AP6%20%3Fmayor%20.%20%20%20%20%20%20%20%20%20%20%20%23%20...%20that%20has%20the%20value%20%3Fmayor%0A%20%20%3Fmayor%20wdt%3AP21%20wd%3AQ6581072%20.%20%20%20%20%20%20%20%23%20...%20where%20the%20%3Fmayor%20has%20P21%20%28sex%20or%20gender%29%20female%0A%20%20FILTER%20NOT%20EXISTS%20%7B%20%3Fstatement%20q%3AP582%20%3Fx%20%7D%20%20%23%20...%20but%20the%20statement%20has%20no%20P582%20%28end%20date%29%20qualifier%0A%20%0A%20%20%23%20Now%20select%20the%20population%20value%20of%20the%20%3Fcity%0A%20%20%23%20%28wdt%3A%20properties%20use%20only%20statements%20of%20%22preferred%22%20rank%20if%20any%2C%20usually%20meaning%20%22current%20population%22%29%0A%20%20%3Fcity%20wdt%3AP1082%20%3Fpopulation%20.%0A%20%20%23%20Optionally%2C%20find%20English%20labels%20for%20city%20and%20mayor%3A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%0A%20%20%7D%0A%20%7D%20ORDER%20BY%20DESC%28%3Fpopulation%29%20LIMIT%2010)

More Wikidata SPARQL query examples:
[https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Quer...](https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples).

