App-wdq
view release on metacpan or search on metacpan
wdq 'SELECT * WHERE { ?c wdt:P361 wd:Q544 }' # equivalent
wdq < queryfile
=head2 lookup
Read Wikidata entity ids, URLs, or Wikimedia project URLs from STDIN or
arguments. Result fields are C<label>, C<description>, and C<id>:
wdq Q1
wdq lookup Q1 # equivalent
echo Q1 | wdq lookup # equivalent
wdq http://de.wikipedia.org/wiki/Universum # same result
=encoding utf8
=head2 search / psearch
Search for items or properties. Result fields are C<label>, C<id>,
C<description>, and possibly matched C<alias>. Search and result language is
read from environment or option C<--language>/C<-g>:
wdq search -g sv Pippi LÃ¥ngstrump
Default output format in search mode is C<text>.
=head1 OPTIONS
=over
=item --query|-q QUERY
Query or query file (C<-> for STDIN as default)
=item --format|-f FORMAT|TEMPLATE
Output format or string template. Call C<wdq help formats> for details.
=item --export EXPORTER
Use a L<Catmandu> exporter as output format.
=item --no-header|-H
Exclude header in CSV output or other exporter.
=item --enumerate|-e
Enumerate results by adding a counter variable C<n>
=item --limit INTEGER
Add or override a LIMIT clause to limitate the number of results. Single-digit
options such as C<-1> can also be used to also set a limit.
=item --ids|-i
Abbreviate Wikidata identifier URIs as strings.
=item --language|-g
Language to query labels and descriptions in. Set to the locale by default.
This option is currentl only used on lookup mode.
=item --count|-c VARS
Prepend SPARQL QUERY to count distinct values
=item --label|-l VARS
=item --description|-d VARS
=item --text|-t VARS
Add label, description, or both. Adds C<label>/C<description> for variable C<id>
or C<xLabel>/C<xDescription> for any C<x>.
=item --ignore
Ignore empty results instead of issuing warning and exit code.
=item --color|-C
By default output is colored if writing to a terminal. Disable this with
C<--no-color>, C<--monochrome>, or C<-M>. Force color with C<--color> or C<-C>.
=item --api URL
SPARQL endpoint. Default value:
C<https://query.wikidata.org/bigdata/namespace/wdq/sparql>
=item --no-mediawiki|-m
Don't query MediaWiki API to map URLs to Wikidata items.
=item --no-execute|-n
Don't execute SPARQL queries but show them in expanded form. Useful to
validate and pretty-print queries. MediaWiki API requests may be
=item -N
Don't execute any queries. Same as C<--no-mediawiki --no-execute>.
=item --help|-h|-?
Show usage help
=item --ontology
Show information about the Wikidata Ontology
=item --no-default-prefixes
Don't add default namespace prefixes to the SPARQL query
=item --man
Show detailled manual
=item --version|-V
( run in 1.502 second using v1.01-cache-2.11-cpan-ceb78f64989 )