wiki_query {wikifacts} | R Documentation |
'wiki_query()' sends a SPARQL query to Wikidata and collects the results in a dataframe
wiki_query(qry)
qry |
A character string representing a SPARQL query to be sent to Wikidata |
A dataframe of results
# 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)