You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @jaw111! Interesting issue, I don't think we've ever come across this sort of use case before. We've been thinking for a while that the variable replacement code should be upgraded, to overcome issues such as #230, so maybe this is something to be taken into account as well.
The only thing that I can think of, is to do string replacement, starting from the longest variable name (?__label2 in your example above). So something along these lines should do the trick:
@c-martinez I like your suggestion, it's nice and simple :)
My other thought was that, as the query is being translated into the SPARQL Algebra Expression with rdflib, it should be possible to programmatically manipulate that expression to replace the variable by the RDF term and reserialize back to text. That might be more complex than manipulating the query text as a string, but should be a more robust approach.
Another approach would be to construct a VALUES clause with the bindings for the relevant variables and simply append that to the query text as suggested in #332.
Given a query like where a variable is a substring of another variable name
If the request URL includes the
label
parameter e.g.?label=foo
then the resulting query is invalid. Whereby the string?__label
is replaced by"foo"
:The logic for rewriting the queries should be more robust than simply replacing strings in the query text to account for this.
The text was updated successfully, but these errors were encountered: