comunica / sparqlee

⚙️ SPARQL expression evaluator library - Moved to @comunica/expression-evaluator
https://www.npmjs.com/package/sparqlee
14 stars 7 forks source link

Wrong implementation of substr #114

Closed jitsedesmet closed 3 years ago

jitsedesmet commented 3 years ago

As explained in https://github.com/comunica/sparqlee/pull/112#discussion_r693011659, the implementation of substr is wrong. We should update this and write some tests on this new implementation. This shouldn't be much harder then adding + beginIndex on the endIndex argument of the slice function.

rubensworks commented 3 years ago

This may be the cause of https://github.com/comunica/comunica/issues/460 So when fixing this, we should check if that query works as intended.

jitsedesmet commented 3 years ago

Fixing the implementation provided a different result. The new result is:

a b   k     l       c                                                                 d                                                                               e                                                                                          f                                                                                                              g                                                                                                                                  h                                                                                                                                                      i                                                                                                                                                                          j                                                                                                                                                                                             

Since the issue is titled 'Complex query to reverse a string not working' I don't think this is what was expected. I don't really understand why the query would reverse a string. Maybe you could clarify this?

rubensworks commented 3 years ago

Ok, thanks for checking. There may be multiple causes for this problem.