threatgrid / asami

A graph store for Clojure and ClojureScript
Eclipse Public License 1.0
634 stars 29 forks source link

Relaxed disjunction #213

Closed noprompt closed 3 years ago

noprompt commented 3 years ago

This patch relaxes the requirement for the operands of a disjunction to have equivalent sets of unbound variables.

Example:

(asami/q '{:find [?name ?e2 ?e3]
           :where [(or [?e2 :name ?name]
                       [?e3 :name ?name])]}
         (asami/db location-conn))
;; =>
(["Falls Church" :tg/node-19487 nil]
 ["Arlington" :tg/node-19486 nil]
 ,,,
 ["Falls Church" nil :tg/node-19487]
 ,,,
 ["Arlington" nil :tg/node-19486])