Hello,
How would I go about creating a cypher query that imports and merges Nodes which are inside json of type:
groups -> groups .. * .. groups
groups within groups within groups
groups may also be shared amongst other groups
all of the same type
all of the same relationship
The nesting can be 'n' deep so a fixed number of UNWIND/FOREACH isn't possible.
sample json:
{
"ID": "ROOT",
"groups": [
{
"ID": "GROUP_A6",
"groups": [
{
"ID": "GROUP_B6"
}
]
},
{
"ID": "GROUP_A5",
"groups": [
{
"ID": "GROUP_X2",
"groups": [
{
"ID": "GROUP_C1",
"groups": []
}
]
}
]
},
{
"ID": "GROUP_A1",
"groups": [
{
"ID": "GROUP_B1",
"groups": [
{
"ID": "GROUP_C1",
"groups": []
}
]
}
]
},
{
"ID": "GROUP_A2",
"groups": [
{
"ID": "GROUP_B2",
"groups": [
{
"ID": "GROUP_C1",
"groups": []
},
{
"ID": "GROUP_C2",
"groups": []
},
{
"ID": "GROUP_D2",
"groups": []
}
]
},
{
"ID": "GROUP_E2",
"groups": [
{
"ID": "GROUP_F2",
"groups": []
},
{
"ID": "GROUP_G2",
"groups": [
{
"ID": "GROUP_F2",
"groups": []
}
]
}
]
}
]
},
{
"ID": "GROUP_A4"
},
{
"ID": "GROUP_A3",
"groups": [
{
"ID": "GROUP_X2",
"groups": [
{
"ID": "GROUP_C1",
"groups": []
}
]
}
]
}
]
}