Skip to content

nichtich/wdq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

App::wdq - command line access to Wikidata Query Service

STATUS

Build Status Coverage Status Kwalitee Score

DESCRIPTION

The command line script wdq, included in CPAN module App::wdq, provides a tool to access Wikidata Query Service. It supports formulation and execution of SPARQL SELECT queries to extract selected information from Wikidata or other Wikibase instances.

INSTALLATION

Either install from CPAN with all dependencies:

cpanm App::wdq

or install dependencies as prebuild packages (for instance Debian) and copy the wdq script to some place in your $PATH:

sudo apt-get install libhttp-tiny-perl librdf-query-perl
wget https://github.com/nichtich/wdq/raw/master/bin/wdq
chmod  x wdq

The latter method will not install this documentation.

USAGE

Get a documented list of all command line options:

wdq --help

EXAMPLES

# get all parts of the solar system
wdq -q '{ ?c wdt:P361 wd:Q544 }'

# get all references used at an item
wdq -q '{ wd:Q1 ?prop [ prov:wasDerivedFrom ?ref ] }'

# print expanded SPARQL query 
wdq -n -q '{ ?c wdt:P361 wd:Q544 }'

# execute query and return tab-separated values
wdq -f tsv < query

# execute query, abbreviate Wikidata identifier, emit simple JSON
wdq -f simple --ids < query

# print result as Markdown Table (requires Catmandu::Exporter::Table)
wdq --export Table < query

COPYRIGHT AND LICENSE

Copyright Jakob Voss, 2015-

GPL 2.0

About

Command line interface to Wikidata Query Service

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages