wiki_query {wikifacts} | R Documentation |
Send queries to Wikidata and receive results as dataframe
Description
'wiki_query()' sends a SPARQL query to Wikidata and collects the results in a dataframe
Usage
wiki_query(qry)
Arguments
qry |
A character string representing a SPARQL query to be sent to Wikidata |
Value
A dataframe of results
Examples
# List five diseases
query <- 'SELECT ?itemLabel WHERE {
?item wdt:P31 wd:Q12136. #instance of disease
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 5'
wiki_query(query)
[Package wikifacts version 0.4.2 Index]