Skip to contents

Get item definitions by qid_on_wikidata from a Wikibase instance or Wikidata.

Usage

get_wikidata_item(
  qid_on_wikidata,
  language,
  prefix = "http://www.wikidata.org/entity/",
  wikibase_api_url = "https://www.wikidata.org/w/api.php",
  data_curator = NULL,
  title = "Dataset title"
)

Arguments

qid_on_wikidata

A single qid_on_wikidata or a vector of qid_on_wikidatas on a Wikibase instance (or Wikidata itself.)

language

Defaults to c("en", "nl", "hu"). A character string of the languages in which the users wants to receive the labels and descriptions of the property. The vector of languages must use BCP 47-compliant language tags (e.g., "en" for English, "nl" for Dutch and "hu" for Hungarian.)

prefix

The prefix to use before the qid_on_wikidata, for example, defaults to "http://www.wikidata.org/entity/".

wikibase_api_url

Defaults to "https://www.wikidata.org/w/api.php".

data_curator

The name of the data curator who runs the function and creates the log file, created with person.

title

The title of the dataset.

Value

A Returns a dataset_df object with the qid_on_wikidatas, labels, description, and the language codes of the labels and descriptions.

Examples

get_wikidata_item("Q42", language = c("en", "nl"))
#> Downloaded Q42
#> Doe J (2025). "Dataset title."
#>   rowid      qid_on_wikidata label         description                  language
#>   <hvn_lbl_> <hvn_lbl_>      <hvn_lbl_>    <hvn_lbl_>                   <hvn_lb>
#> 1 eg:1       Q42             Douglas Adams English science fiction wri… en      
#> 2 eg:2       Q42             Douglas Adams Engelse schrijver (1952-200… nl