How to find entities with one of several attributes in Datomic -
this seemed use case or clause:
'[:find ?e1 :where (or [?e1 :a ?e2] [?e1 :b ?e2] [?e1 :c ?e2]) [?e2 :x "x"]]
but fails unable resolve symbol: ?e1 in context
.
something should work
(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))
Comments
Post a Comment