Assume we have following 2 source csv files with below structure:
CSV file#1 = stores details of all unique entities.
ID, NAME
1, A
2, B
3, C
4, D
5, E
6, F
CSV file#2 = stores details of complex relationship and type of relationship between these entities.
StartID, EndID, Type
1,2, is_x
2,3, is_y
1,4, is_z
1,3, is_y
2,4, is_z
4,5, is_x
3,5, is_z
3,6, is_y
How to process/store/visualize above data into a “Tree” like hierarchy structure along with their relationship type for each.
The tree should show both upward and downward paths i.e. its ancestors/parent node path and descendants/child node paths.
For example, in the above sample data, if we search for node=2(B) ; then it should show all its paths in entirety i.e. (1>2>3)/(A>B>C) but also be able to traverse both upward and downward the tree. i.e. 2->1 (B->A), 2->4 (B->D) and 2->3 (B->C).
Similarly, if we search for node=3 then its entire flow path should show as (A>B>C) and when search for upward i.e. 3->1 (C>A), 3->2->1 (C>B>A) and downward/same level i.e. 3->5 (C>E) and 3->6 (C>F).