0

enter image description here

I have data like the above(toy example, let's take the top 3 lines.), for one question there could be multiple answers in the *.CSV file. Because I have the question in only one cell, the remaining cells are created as nodes without names. Is there a way to solve this?

I am expecting something like 1 node with Name as "How are you" and it's connecting nodes will be "Great", "Normal Day", "Bad" and for each of these will have relationship to the response column from csv. Thanks in advance.

Gram
  • 33
  • 3

1 Answers1

1

LOAD CSV processes your data line by line. The easiest fix would be to repeat the question on each line and use

MERGE (q:Question {name:line.name})

to avoid duplication.

BTW : I don't think there is something like "sub-nodes", I would call give them a label 'AnswerOption' ;)

Graphileon
  • 5,275
  • 3
  • 17
  • 31
  • Yeah, sorry not sub-nodes, well connecting nodes or the the nodes it has relation with. – Gram Jul 14 '21 at 08:38