Hey, in reading through the docs I cam across the following regarding the use of open-q and was confused:
Note that results are returned as bags, not sets, so you may wish to deduplicate consecutive identical result tuples (e.g. using clojure.core/dedupe or similar).
Under what circumstances will results from open-q be duplicated?
What’s the recommended deduplication strategy?
Why is there a discrepancy between xt/q and xt/open-q beyond how the results are consumed/processed?
Why is there a discrepancy between xt/q and xt/open-q
The behaviour of xt/q is “correct” in the sense that Datalog always operates (and returns results) in terms of sets. xt/open-q exposes some of the implementation detail of how Datalog queries are executed, but it also enables various opportunities for lazy consumption and implementing complex algorithms efficiently, beyond the context of single query.