I have the following data.
|id | first_comment | second_comment | third_comment|..|n_comment|
|--- | --- | --- | ---|..|---|
| 111|some_comment |some_comment |null |..|null|
|112 |some_comment |some_comment |some_comment |..|null|
|113 |some_comment |some_comment |some_comment |..|some_comment|
the data is in csv format. I want to create a "NEXT" relationship among the comments for each id. Below is the data modelling
for some ids there could be 100 comments populated whereas for some ids there could be just 2 comments. Hence the creation of the relationship has to be dynamic.
I was able to develop the nodes but couldn't figure out to create relationship
load csv with headers from 'filename.csv' as row
merge(f:complaint {id:row.ID})
with row , keys(row) as columns
unwind columns as commentColumn with distinct commentColumn where commentColumn ends with '_comment'
load csv with headers from 'filename.csv' as row
create (c:test_comments {id:row.ID, order: commentColumn, text:row[commentColumn]})
can anyone please suggest how to create dynamic relationship here ?