Off the top of my head: yes. That’s the only way I can think of. The error with your last transact is correct, but I should provide an error description that explains why it’s wrong. This makes me think that it could help to have an API for removing entire entities. Of course, it would just be code that identifies all the triples involved and retract them all, but that would be helpful for users.
On second thought, it wouldn’t be a bad idea for this case of an update to allow an empty set (or nil).
Updates (identified by the ' annotation on a property) are performed by doing:
• a query to find the current value/values of a property
• retractions of all existing values found in the previous step
• Additions of all the new values
You’re just trying to do the first 2 steps and not do anything for the third.
The current error is due to having a subject/predicate, with no objects, which means no triples. But triples are expected, since after all, you’ve defined ⅔ of a triple.
I see, thank you.
For my case, having an API for steps 1+2, as well as having one to retract whole entities, would both be useful. Currently I have implemented both using graph and the triplets search. (Though my code only generates the retraction transaction, i.e. [[:db/retract ..], .. ] , which I only transact later.)