Send SPARQL query to endpoint and get tibble as a result

send_sparql(query, endpoint = "Wiki")

Arguments

query

a string corresponding to a SPARQL query

Examples

metro_query='SELECT ?item ?itemLabel ?coords { ?item wdt:P361 wd:Q1552; wdt:P625 ?coords. OPTIONAL{?item wdt:P1619 ?date.} SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ?itemLabel ' send_sparql(query=metro_query)
#> # A tibble: 46 x 3 #> item itemLabel coords #> <chr> <chr> <chr> #> 1 http://www.wikidata.org/entit… Q55598901 Point(4.8041 45.71409) #> 2 http://www.wikidata.org/entit… Q56300135 Point(4.8049 45.6966) #> 3 http://www.wikidata.org/entit… Ampère - Victor Hugo Point(4.829182 45.7530… #> 4 http://www.wikidata.org/entit… Bellecour Point(4.83405 45.75795… #> 5 http://www.wikidata.org/entit… Brotteaux Point(4.859433 45.7671… #> 6 http://www.wikidata.org/entit… Charpennes - Charles … Point(4.863119 45.7705… #> 7 http://www.wikidata.org/entit… Cordeliers Point(4.835894444 45.7… #> 8 http://www.wikidata.org/entit… Croix-Paquet Point(4.836366666 45.7… #> 9 http://www.wikidata.org/entit… Croix-Rousse Point(4.83205 45.7748) #> 10 http://www.wikidata.org/entit… Cuire Point(4.83293 45.7855) #> # … with 36 more rows