Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-30-2022 07:44 PM - edited 12-30-2022 07:47 PM
I am unfamiliar with Neo4 and want to find out whether it is the right tool for me.
Is it possible to nest nodes in a hierarchy of subgraphs/clusters as in this GraphViz graph? If so, what would the Cypher query be to create that graph?
12-31-2022 10:09 AM
You surely can create a representation of you nodes in neo4j. Neo4j does not have a 'cluster' concept to group a collection of nodes, but you can implement something to mimic the behavior. One suggestion is to add a label to all the nodes in a cluster with the cluster's name. This would allow you to easily retrieve the nodes for a particular cluster, such as Cluster A1 and A2 in your diagram. You could create a node with the label cluster and create relationships from it to each of the root nodes of individual clusters to group clusters, such as Cluster A in your diagram. This would allow you to get the root nodes for each related cluster associated with a cluster group. You can then get the nodes from each cluster knowing their root node.
Another approach that does not use labels would be to create 'cluster' nodes to and have those nodes related to the root of each cluster and/or to other cluster nodes to group clusters.
As you can see, there are multiple ways to design a domain model. He is one example. From this, you can derive the nodes in each cluster A1 and A2, as well as the clusters comprising group A and all the entities within those clusters.
All the sessions of the conference are now available online