如何在 Datomic 中查找具有多个属性之一的实体

How to find entities with one of several attributes in Datomic

这似乎是 or 子句的用例:

'[:find ?e1
  :where (or [?e1 :a ?e2]
             [?e1 :b ?e2]
             [?e1 :c ?e2])
         [?e2 :x "X"]]

但是它失败了Unable to resolve symbol: ?e1 in this context

像这样的东西应该可以工作

(let [rules '[(orclause ?e1 ?e2) [?e1 :a ?e2]
              (orclause ?e1 ?e2) [?e1 :b ?e2]
              (orclause ?e1 ?e2) [?e1 :c ?e2]]
      dbval (d/db conn)]
  (d/q '[:find ?e1
         :in $ ?e2 %
         :where (orclause ?e1 ?e2)]
       dbval "X" rules))

原来我只是使用了一个过时的版本,or-clauses 是在 0.9.5130 中引入的。