lvaudor / glitter

an R package which writes SPARQL queries
https://lvaudor.github.io/glitter
44 stars 5 forks source link

spq_set(var) and spq_label(var, .overwrite=TRUE) cannot work together #215

Open lvaudor opened 8 months ago

lvaudor commented 8 months ago

For instance:

country_id="wd:Q148" 
result=spq_init() %>%
    spq_set(country=country_id) %>% 
    spq_add("?country wdt:P37 ?language_official") %>% 
    spq_add("?language_official wdt:P424 ?language_official_code") %>% 
    spq_label(country,language_official, .overwrite=TRUE) %>% 
    spq_perform(replace_prefixes=TRUE) 

result has 0 rows

whereas the same query, without the .overwrite=TRUE option does return a result (1 row). Maybe just thow a warning when using spq_set(var) + spq_label(var, .overwrite=TRUE)?