Open lilactown opened 2 years ago
Since this is generating the triples to be removed, it belongs in asami.entities.writer
There are 2 conditions here: top-level-entities and sub-entities. The latter may not be necessary, but I'm going to assume that they are useful.
For a top-level entity:
:db/id
(I'll call this the node
)[node :tg/owns ?s]
. This returns the sub-entity node list.[?e ?a node]
. Add these to the list of statements to remove.[node ?a ?v]
. Add these to the list of statements to remove. The set of ?v
values contains the referenced data.For an entity that isn't top-level:
:db/id
[?p :tg/owns node]
. This is the parent.[parent :tg/owns ?s]
. This returns the sub-entity node list of the parent.This second process should recurse down, matching the things owned by the same parent, but should not affect siblings/cousins/etc.
Provide the capability to retract all the attributes of an entity and any references to it.
https://docs.datomic.com/cloud/transactions/transaction-functions.html