Fork me on GitHub
#datahike
<
2022-01-31
>
denik02:01:23

what’s the best way to find orphan entities, i.e. entities without existing `db.type/ref` relationships?

Björn Ebbinghaus09:01:15

You can query for them. 🙂 Something like:

:where
[?e _ ?possible-ref]
(not [?possible-ref])
(Did it on the go. Maybe this is not entirely correct, but I guess it's close enough)

Björn Ebbinghaus10:01:04

Hm.. No. My query above would query for entities, that do not have a ref to other entities.

:where
(not [_ _ ?your-entity])
That would do it.