how to do something equivalent to SQARQL OPTIONAL in datomic?
[(get-else $ ?e ?attr ?non-nil-sentinel-value) ?captured-value]
or (or-join [?e ?v] [?e ?a ?v] (and (not [?e ?a]) [(ground "non-nil-sentiel") ?v))
for more complex cases
or use rules and make sure one implementation always matches and one never does
(for any given thing you are checking)
note unfortunately you can’t safely have nil values in your intermediate result sets so you usually have to replace it with some non-nil sentinel value
namespaced-keywords work well IME
and then postprocess the query result back to nil if you need it