glitter
glitter copied to clipboard
an R package which writes SPARQL queries
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...
When working on "combined queries" I often need to replace URIs with their abbreviated versions for use in spq_set(). For instance, I run a first query that returns a list...
`call = rlang::caller_env()` to be used in `cli::cli_abort()` see https://www.njtierney.com/post/2023/12/06/long-errors-smell/
- what is glitter goal (as in README) - good to know - #73 @lvaudor let's store ideas here
I think the way we're supposed to add property qualifiers is not intuitive. Indeed, we're supposed to put it that way: ``` stations_metro_Lyon=spq_init() %>% spq_add("?station wdt:P16 wd:Q1552") %>% # ?station...
E.g. Fictional characters whose birth/death date is in the current decade ```sparql SELECT DISTINCT ?character ?characterLabel ?birth ?death WITH { # Fictional character subclasses as a named subquery SELECT ?fictiontype...
https://www.w3.org/TR/sparql11-query/#having * A parameter of `spq_group_by()`? * A "mode" of `spq_filter()`, that only operates after a `spq_group_by()` has been applied?
- FILTER in OPTIONAL is something we'll need for `spq_label()`. - should there be a way to say a triple is optional when creating it via `spq_mutate()`/`spq_filter()`. - should there...
Hi, For sequins I have been working on a get_label() function: ``` #' This function takes a component of a triple pattern as input and returns (if it exists) a...