Fix for subobjects for RDF stores

> PS I did a manual check.
PSS: Probably want to write a test.

I wrote a test that simulates the behaviour where a container with a `SOBJ` annotation is queried and after the update loses its references to the `SOBJ` and the TDB is purged for this entity.