get_example | R Documentation |
Gets the specified example(s) from SPARQL query service examples page using Wikidata's MediaWiki API.
get_example(example_name)
example_name |
the names of the examples as they appear on this page |
If you are planning on extracting multiple examples, please provide all the names as a single vector for efficiency.
The SPARQL query as a character vector.
query_wikidata
## Not run:
sparql_query <- extract_example(c("Cats", "Horses"))
query_wikidata(sparql_query)
# returns a named list with two data frames
# one called "Cats" and one called "Horses"
sparql_query <- extract_example("Largest cities with female mayor")
cat(sparql_query)
query_wikidata(sparql_query)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.