I'm building an application that sits on a graph data set, and nodes in this graph can be other smaller graphs, in wich the nodes can have connections to the main graph's nodes.
A (badly drawn, sorry :D ) ASCII art to compensate my (bad, sorry :D) english:
// \\BAR
||(x)---(y)||
|| / ||\
|| (z) ||\\
\\ | // \\
// | \\_________
// | \
// | // \ \\
FOO // | ||(harry)---(terry)||
// \\ | || / ||WORLD
||(a)---(b)|| | /|| (jerry) ||
|| \ || | // \\ //
|| (c) || / // \\/
\\ | // / || HELLO ||
\___________/ \\ //
Node x,y and z are nodes of the BAR graph, a,b and c of the FOO graph, same for harry ecc.. and the WORLD graph.
FOO, BAR, WORLD and HELLO are nodes of the main big Graph.
Inside this structure a node of FOO is connected to a node in BAR (c -> z) and, this is the tricky part) a node of WORLD is connected to BAR (harry -> BAR).
I know how to achieve this with Networkx in python, but how can I save this to a db?
I'm thinking of solutions myself but I want to know if there is a theory or some techniques for similar situations.
So far my solution (using neo4j) is label a b and c with the tag "FOO", and making a separate graph that connects FOO to BAR, ecc.. Am I in the right direction? Do you know some smarter solutions?
Thanks
[edit: corrected a name]