When we receive and validate a takedown notice, we need to list the objects that need to be acted upon in response of the takedown request.
When the policy decision is removal of objects, we need to be careful not to remove objects that are referenced from elsewhere in the SWH archive. For instance, in response of a takedown of a repository containing the text of the GPLv3, we must keep that content, which is shared with other repositories, while removing/masking the other objects can be acceptable.
Starting at the affected object (revision, snapshot, origin, content), we need to trace down all its descendants (a subgraph of the archive, rooted at the affected object); For each object we then need to trace its antecedents to see whether some exist outside of the subgraph in question.
We can use swh.graph for some of the queries, but objects with no matches (or with partial matches, e.g. origins) in swh.graph need to be validated using the canonical, up to date archive data.