Skip to contents

See MediaWiki API help

See MediaWiki API help

Usage

add_id_statement(
  qid,
  pid,
  o,
  wikibase_type = "external-id",
  wikibase_api_url = "https://reprexbase.eu/demowiki/api.php",
  csrf
)

add_item_statement(
  qid,
  pid,
  o,
  wikibase_type = "item",
  wikibase_api_url = NULL,
  csrf
)

add_statement(
  qid,
  pid,
  o,
  wikibase_type,
  wikibase_api_url = "https://reprexbase.eu/demowiki/api.php",
  csrf
)

Arguments

qid

The QID of the item in the Wikibase instance that you use.

pid

The PID of the equivalent Wikidata (or reference Wikibase) URI.

o

The object of the semantic statement.

wikibase_type

A 'item', 'numeric', or 'string'.

wikibase_api_url

The full URL of the Wikibase API, which is the address that the wbdataset R client sends requests to when interacting with the knowledge base. For example, 'https://reprexbase.eu/demowiki/api.php'. The URL must end with api.php.

csrf

The CSRF token of your session, received with get_csrf.

Value

A data.frame with four columns: id containing the statement ID, qid with the QID, o with the PID, and p with the wikidata_uri.