Callidon / sparql-engine

🚂 A framework for building SPARQL query engines in Javascript/Typescript
https://callidon.github.io/sparql-engine
MIT License
99 stars 14 forks source link

Bugfix for the bound join algorithm #48

Closed Callidon closed 4 years ago

Callidon commented 4 years ago

This PR fixes a bug with the Bound Join operator. Basically, this join algorithm cannot work when joining with a BGP which no longer contains variables after we bound it. As the algorithm relies on variables renaming to track which set of bindings connect to which parts of the UNION, the bound join no longer works in this case.

To solve this, I implemented the following strategy: if some subset of the bucket of bindings can be evaluated under a bound join, then we process them with the bound join algorithm. The remaining set of bindings is processed using the regular Index Join algorithm.

This PR also adds two new unit tests that highlight this situation.