| tw_query | R Documentation |
This function aims to facilitate only the most basic type of queries: return which items have the following property pairs. For more details on Wikidata queries, the examples in the official documentation.
tw_query(
query,
fields = c("item", "itemLabel", "itemDescription"),
language = tidywikidatar::tw_get_language(),
return_as_tw_search = TRUE,
user_agent = tidywikidatar::tw_get_user_agent()
)
query |
A list of named vectors, or a data frame (see example and readme). |
fields |
A character vector of Wikidata fields. Ignored if
|
language |
Defaults to language set with |
return_as_tw_search |
Logical, defaults to |
user_agent |
Defaults to a combination of |
Consider tw_get_all_with_p() if you want to get all items with a given
property, irrespective of the value.
A data frame
if (interactive()) {
query <- list(
c(p = "P106", q = "Q1397808"),
c(p = "P21", q = "Q6581072")
)
tw_query(query)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.