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.
I guess attached picture is the required graph. How is the graph looks like in current scenario?
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.
As per I understood from above is:
You have graph with 4M nodes (merge nodes and relationship are all done)
and need to create a sub graph from it to query?
I need the sub graph for backing up and restoring data for a tenant as my graph contains data for multiple tenants (tenant isolation done using tenant labels on nodes). I don't want the rest of the graph to be disturbed while backing up and restoring sub graph for a tenant.
Sorry, I can not know anyway to solve your problem but can you help me ? I have a project that related to your work, how can you present your word with sentence like picture above. Thanks for your help
Check this article by Michael Hunger:
Thanks. I hope you keep your healthy up