My neo4j graph has a common subgraph shared across all tenants. Each tenant has their own document nodes. Documents are related to multiple page nodes (referring to pages inside the document) which are then related to sentence nodes (referring to sentences in a page). These sentences will be then connected to the shared subgraph nodes based on the info they have. The places and firm nodes are common for instance in the bottom snapshot. To achieve multi-tenancy, I am maintaining tenant labels on documents (for ex: tenant1 documents will have label document and tenant1). I want to know what will be the easiest way for me to extract (backup) and restore a tenant-specific subgraph (subgraph should include tenant documents, pages, sentences and nodes in direct relation with sentence nodes).
PS: I want MERGE operations to happen while restoring based on ids (explicit) of all nodes.
Hey Vivek, the graph right now is having over 4 million nodes. The attached picture shows how one document is connected to the common graph. All the nodes at the end of MENTIONS relationnship are common. I want to extract subgraph for a tenant which will have multiple documents having a tenant label (like tenant1 in the above picture) including pages, sentences and immediate neighbours of the sentences (common nodes connected to sentences). I want to know what will be the most efficient way to do that keeping in mind that later when I restore the extracted subgraph it shouldn't affect the rest of the graph.