Issue occurs when the following sequence is followed:
- Create a node at /parent
- Add rdf:type indexing:indexable to the /parent node
- Create a child node at /parent/child
- Add rdf:type indexing:indexable to the /parent/child node
(now the triplestore has entries for both /parent and /parent/child)
- Update some property on /parent (e.g. dc:title)
(now the triples for /parent/child are gone)
For this, I used the updated message-consumer.
If you look at https://github.com/fcrepo4/fcrepo-message-consumer/blob/master/fcrepo-message-consumer-core/src/main/java/org/fcrepo/indexer/sparql/SparqlIndexer.java#L122
You will see that when /parent is updated, if any triples have an object with a URI that starts with the /parent URI, that, too, is added to DELETE statement.