Wikidata:WikidataCon 2017/Notes/wikidata-cli demo: read and write Wikidata from the command-line!
Title: wikidata-cli demo: read and write Wikidata from the command-line!
Speaker(s) edit
Name or username: Maxime Lathuilière (User:Maxlath)
Useful links:
Abstract edit
Introduction to wikidata-cli, the command-line interface (Q189053) for Wikidata. This demo is for you if:
- you don't know all the Q ids by heart yet, and need a quick way to know what an id stands for.
- you don't know all the properties by heart yet, and would enjoy having the list at hand in the terminal to grep on it, or whatever
- you like the idea of setting labels, adding claims, or running SPARQL queries from the terminal. More generally, you take for obvious that the command-line interfaces are in many cases way more efficient than graphic interfaces
- you do not, but want to learn
Collaborative notes of the session edit
based on two libraries (both based on JavaScript)
https://github.com/maxlath/wikidata-sdk (for reading) https://github.com/maxlath/wikidata-edit (for editing, needs login)
by default
Example queries
wd search
search for text, e.g. wd search wikidatacon specifiy language with parameter "-l <XX>", e.g. wd search wikidatacon -l fr
wd label
show label of item e.g. wd label Q42
wd claims Q1 #show claims about Universe
wd claims Q1 P18 #show images about the Universe
output also possible as JSon with parameter -j