How would you represent graph of graphs in Graph DB. F.e. mnemonically it may look like this :
((a)->(b))->(c)
((a)->(b))->((c)->(d))
In a sense (a)->(b) for (c) act as a single node, but is internally two linked nodes. And of course you should be able to nest them further.
Is there some graph structure that I can use to represent this.
(a)<-[:1]-(ab)-[:2]->(b)
(ab)<-[:1]-(abc)-[:2]->(c)
???
@bouteillebleu : second variant
(a)-[:fst]->(ab)-[:snd]->(b)
(ab)->(c)
Probably the simplest and most concise way for a node to reference an entire subgraph of any size and complexity would be to store in that node a
cypher
property whose value is a Cypher query string that would produce the desired subgraph.As an example, here's how you might represent the assertion that a specific
subgraph1
contains a givensubgraph2
:If the actual subgraph represented by
subgraph1
consisted of several billion nodes and relationships, there may be no other practical way to represent the subgraph.