The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catmandu::Importer::Wikidata - Import from Wikidata

VERSION

version 0.3.0

SYNOPSIS

    catmandu convert Wikidata --ids Q1,P227
    catmandu convert Wikidata --site dewiki --title Wahnsinn

    echo Q7 | catmandu convert Wikidata
    echo Wahnsinn | catmandu convert Wikidata --site dewiki
    echo dewiki:Wahnsinn | catmandu convert Wikidata

DESCRIPTION

This Catmandu::Importer queries Wikidata for entities, given by their Wikidata identifier (Q..., P...) or by a title in some know Wikidata site, such as the English Wikipedia (enwiki).

See Catmandu::Wikidata for a synopsis.

By default, the raw JSON structure of each Wikidata entity is returned one by one. Future versions of this module may further expand the entity data to make more easily use of it.

CONFIGURATION

This importer extends Catmandu::Importer::getJSON, so it can be configured with options agent, timeout, headers, proxy, and dry.

api

Wikidata API base URL. Default is http://www.wikidata.org/w/api.php.

ids

A list of Wikidata entitiy/property ids, such as Q42 and P19. Use comma, vertical bar, or space as separator. Read from input stream if no ids, nor titles are specified.

site

Wiki site key for referring to Wikidata entities by title. Default is enwiki for English Wikipedia. A list of supported site keys can be queried as part of https://www.wikidata.org/w/api.php?action=paraminfo&modules=wbgetentities (unless https://bugzilla.wikimedia.org/show_bug.cgi?id=58200 is fixed).

title

Title of a page for referring to Wikidata entities. A title is only unique within a selected site. One can also prepend the site key to a title separated by colon, e.g. enwiki:anarchy for the entity that is titled "anarchy" in the English Wikipedia. Read from input stream if no titles, nor ids are specified.

AUTHOR

Jakob Voß

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Jakob Voß.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.