Skip to contents

find_item and find_property allow you to retrieve a set of Wikidata items or properties where the aliases or descriptions match a particular search term. As with other WikidataR code, custom print methods are available; use str to manipulate and see the underlying structure of the data.

Usage

find_item(
  search_term,
  language = "en",
  limit = 10,
  response_language = "en",
  ...
)

find_property(
  search_term,
  language = "en",
  response_language = "en",
  limit = 10
)

Arguments

search_term

A term to search for.

language

The language to return the labels and descriptions in; this should consist of an ISO language code. Defaults to "en".

limit

The number of results to return; set to 10 by default.

\dots

further arguments to pass to dehttr:ink[httr::GET]GET.

Value

A list containing the result of the query.

See also

get_random for selecting a random item or property, or get_item for selecting a specific item or property.

Examples


#Check for entries relating to Douglas Adams in some way
adams_items <- find_item("Douglas Adams")

#Check for properties involving the peerage
peerage_props <- find_property("peerage")