Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(glue)
- library(WikidataQueryServiceR) #library to send SPARQL queries to wikidata
- #great for building SPARQL queries
- #escape braces with double braces
- #instert paramters directly with braces
- query <- glue(
- "SELECT ?human ?VIAF WHERE", "{{",
- "?human wdt:P106 wd:", "{occupation_id}.",
- "?human wdt:P214 ?VIAF .",
- "}}"
- )
- #now we can query wikidata
- query_wikidata(query)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement