wiki_query: Send queries to Wikidata and receive results as dataframe

Description Usage Arguments Value Examples

View source: R/wiki_query.R

Description

'wiki_query()' sends a SPARQL query to Wikidata and collects the results in a dataframe

Usage

1

Arguments

qry

A character string representing a SPARQL query to be sent to Wikidata

Value

A dataframe of results

Examples

1
2
3
4
5
6
7
# 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)

wikifacts documentation built on April 29, 2021, 5:06 p.m.