Catmandu::Importer::Wikidata(3pm)

Catmandu::Importer::Wikidata3pm

Import from wikidata

Usage

    catmandu convert Wikidata --ids Q1,P227
    catmandu convert Wikidata --site dewiki --title Wahnsinn
    echo Q1 | catmandu convert Wikidata
    echo Wahnsinn | catmandu convert Wikidata --site dewiki
    echo dewiki:Wahnsinn | catmandu convert Wikidata
    echo Q1 | catmandu convert Wikidata --fix 'retain_field("labels")'

Version

version 0.06

Overview

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"). The entities are either specified as options ("ids", "site", and/pr "title") or as line-separated input values. By default, the raw JSON structure of each Wikidata entity is returned one by one. Entities not found are returned with the "missing" property set to 1 like this:

    { "id": "Q7", "missing": "1" }

To further process the JSON structure Catmandu::Wikidata contains several Catmandu fixes, e.g. to only retain a selected language.

Configuration

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

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.

Releases

6 releases since Debian 8 (Jessie); the text changed 3 times.

  1. 8–10
  2. 11
  3. 12
  4. 13

Author

Jakob Voß

From libcatmandu-wikidata-perl 0.06-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.