Makes a POST request to Wikidata Query Service SPARQL endpoint.
query_wikidata(sparql_query, format = c("simple", "smart"))
SPARQL query (can be a vector of queries)
"simple" uses CSV and returns pure character data frame, while
"smart" fetches JSON-formatted data and returns a data frame with datetime
columns converted to POSIXct
A tibble data frame
There is a hard query deadline configured which is set to 60 seconds. There are also following limits:
One client (user agent + IP) is allowed 60 seconds of processing time each 60 seconds
One client is allowed 30 error queries per minute See query limits section in the WDQS user manual for more information.
# NOT RUN {
sparql_query <- "SELECT
?softwareVersion ?publicationDate
WHERE {
BIND(wd:Q206904 AS ?R)
?R p:P348 [
ps:P348 ?softwareVersion;
pq:P577 ?publicationDate
] .
}"
query_wikidata(sparql_query)
# }
# NOT RUN {
query_wikidata(sparql_query, format = "smart")
# }
Run the code above in your browser using DataLab