Fork me on GitHub
#datomic
<
2022-04-15
>
nottmey15:04:05

[:find ?e ?a ?v
 :in $ [?a ...]
 :where
 [?e ?a ?v]
 [(missing? $ ?e :simple1/match)]]
works fine
[:find ?e ?a ?v
 :in $ [?a ...]
 :where
 [?e ?a ?v]
 (or
   [(missing? $ ?e :simple1/match)]
   [(missing? $ ?a :simple1/match)])]
throws > Execution error at datomic.core.datalog/compile-expr-clause (datalog.clj:1206). > Unable to resolve symbol: $ in this context Is there a way to make this work?

1
favila15:04:10

($ or …)?

nottmey15:04:12

seems to do something, but now i get > Execution error (AssertionError) at datomic.core.datalog/unifying-vars (datalog.clj:899). > Assert failed: All clauses in ‘or’ must use same set of vars, had [#{?e} #{?a}] > (apply = uvs)

nottmey15:04:32

I guess, I need to use or-join?

nottmey15:04:07

yep, works

nottmey15:04:57

thank you @U09R86PA4 🎉 that does not seem to be documented or did I miss it?

favila15:04:50

It’s documented. It’s how you use a different data source for a rule

favila15:04:30

The surprising thing here is that $ isn’t always the symbol for the rule’s data source if you don’t override

👍 1
nottmey15:04:22

Ah found it, the overwrite part is “hidden” in the syntax description here: https://docs.datomic.com/cloud/query/query-data-reference.html#using-rule