This search returns only items, use tw_search_property()
for properties.
tw_search_single(
search,
type = "item",
language = tidywikidatar::tw_get_language(),
response_language = tidywikidatar::tw_get_language(),
limit = 10,
include_search = FALSE,
cache = NULL,
overwrite_cache = FALSE,
cache_connection = NULL,
disconnect_db = TRUE,
wait = 0
)
A data frame (a tibble) with three columns (id, label, and description), and as many rows as there are results (by default, limited to 10). Four columns when include_search
is set to TRUE.
A string to be searched in Wikidata
Defaults to "item". Either "item" or "property".
Language to be used for the search. Can be set once per session with tw_set_language()
. If not set, defaults to "en". For a full list, see https://www.wikidata.org/wiki/Help:Wikimedia_language_codes/lists/all
Language to be used for the returned labels and descriptions. Corresponds to the uselang
parameter of the MediaWiki API: https://www.wikidata.org/w/api.php?action=help&modules=wbsearchentities. Can be set once per session with tw_set_language()
. If not set, defaults to "en". For a full list, see https://www.wikidata.org/wiki/Help:Wikimedia_language_codes/lists/all
Maximum numbers of responses to be given.
Logical, defaults to FALSE. If TRUE, the search is returned as an additional column.
Defaults to NULL. If given, it should be given either TRUE or FALSE. Typically set with tw_enable_cache()
or tw_disable_cache()
.
Defaults to FALSE. If TRUE, overwrites cache.
Defaults to NULL. If NULL, and caching is enabled, tidywikidatar
will use a local sqlite database. A custom connection to other databases can be given (see vignette caching
for details).
Defaults to TRUE. If FALSE, leaves the connection to cache open.
In seconds, defaults to 0. Time to wait between queries to Wikidata. If data are cached locally, wait time is not applied. If you are running many queries systematically you may want to add some waiting time between queries.
tidywikidatar:::tw_search_single(search = "Sylvia Pankhurst")
Run the code above in your browser using DataLab