lvaudor / glitter

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

drop blaLabel #118

Closed maelle closed 1 year ago

maelle commented 1 year ago

I thought we had an issue about this but I can't find it. It'd be nice to not have variable and variableLabel, but instead only variable (with the content of variableLabel, so the readable one)?

lvaudor commented 1 year ago

Maybe yes, sometimes we just look at xxxLabel and not xxx.

We definitely need to be able to keep xxx too from time to time though. For instance xxx corresponds to links so we can just click on the element to get the url to open in the web browser (according to how you display the table) and I think this is a nice feature for exploration. Besides, for complex/long queries that will be run in two stages (1) get item identifiers and then 2) carry out a query on each of these identifiers iteratively) the identifiers are key...

Maybe have an argument .onlyLabel AND keep .label at the same time so that

lvaudor commented 1 year ago

or ".asLabel" rather than ".onlyLabel"?

maelle commented 1 year ago

@lvaudor do you think there should be an .overwrite argument to ̀spq_label()?

lvaudor commented 1 year ago

hmm, you mean, one could call spq_label() multiple times for a single query? for instance if one wants a label in a particular language for a variable x and another language for variable y? Is labelling language defined globally (for all variables) currently? If so, I'd rather send a warning that the labelling language mentioned in the last call to spq_label() prevails. In the other case (= labelling language relative to each variable) then I would not overwrite (or allow to overwrite).

I mean, something like ((please pardon the vagueness and wrongness of my pseudo-glitter) :

spq_init() %>%
  spq_add("gnagna x") %>%
  spq_add("gnagna y") %>%
  spq_label(language="en") %>%
  spq_add("gnagna z") %>%
  spq_label(language="fr")

would imply that x and y labels are in English and z labels are in French.

maelle commented 1 year ago

no I mean replacing a variable with its label.

The language can be different for each variable.

lvaudor commented 1 year ago

hehe I was so inspired but so misleaded ;-). Yes, there should be an .overwrite argument!

maelle commented 1 year ago

ok, let's tackle it after the current PR (which is big enough :sweat_smile: )