If I understand what do you want to do, I suggest something like this:
LOAD CSV WITH HEADERS FROM 'file:///fileName.csv' AS line FIELDTERMINATOR '|'
MATCH (r:Regulon{Regulon_ID: line.Regulon_ID}), (s:SelfSufficiencyInGrowthSignals{name: 'SelfSufficiencyInGrowthSignals'}), (i:InsensitivityToAntigrowthSignals{name: 'InsensitivityToAntigrowthSignals'})
CREATE (r)-[:HAVE {value: line.SelfSufficiencyInGrowthSignals}]->(s)
CREATE (r)-[:HAVE {value: line.InsensitivityToAntigrowthSignals}]->(i)
Your requirement is not very clear. However if you looking just one relationship then try
LOAD CSV WITH HEADERS FROM 'file:///fileName.csv' AS line
create (r:Regulon{Regulon_ID: line.Regulon_ID})
create (s:Mark{name: line.SelfSufficiencyInGrowthSignals})
create (i:Mark{name: line.InsensitivityToAntigrowthSignals})
MATCH (m:Mark)
WITH m.name as name, collect(m) as nodes
CALL apoc.refactor.mergeNodes(nodes, {properties: "combine"}) YIELD node
RETURN node;
Instead of creating nodes and immediately merging, you can create the node in one instance;
merge (r:Regulon{Regulon_ID: line.Regulon_ID})
merge (s:Mark{selfsufficieny: line.SelfSufficiencyInGrowthSignals, insensitivity: line.InsensitivityToAntigrowthSignals})
merge (r:Regulon)-[:HAVE ]->(m:Mark)
LOAD CSV WITH HEADERS FROM 'file:///Lin.csv' AS line
MATCH (r:regulons)
WHERE r.Regulon_ID=line.Regulon_ID
MATCH (h:marks) WHERE (h.hallmark = 'SelfSufficiencyInGrowthSignals')
FOREACH (ignoreMe in CASE
WHEN exists(h.hallmark) THEN [line.SelfSufficiencyInGrowthSignals]
ELSE [line.InsensitivityToAntigrowthSignals] END| CREATE (r)-[:REGULON_TO_HALLMARK { value1:line.SelfSufficiencyInGrowthSignals
}]->(h))
I made this relationship but this relationship is only for SelfSufficiencyInGrowthSignals i want to add InsensitivityToAntigrowthSignals also in this relationship .so how will i be able to do this???
Please try this
MATCH (h:marks) WHERE (h.hallmark = 'SelfSufficiencyInGrowthSignals')
FOREACH (ignoreMe in CASE
WHEN h.hallmark = 'SelfSufficiencyInGrowthSignals' CREATE (r)-[:REGULON_TO_HALLMARK { value1:line.SelfSufficiencyInGrowthSignals
}]->(h)
When h.hallmark = 'InsensitivityToAntigrowthSignals' CREATE (r)-[:REGULON_TO_HALLMARK { value1:line.InsensitivityToAntigrowthSignals
}]->(h) END)
I DID THE QUERY WHICH WORKED FOR ME
LOAD CSV WITH HEADERS FROM 'filename' AS line
MATCH (r:regulons)
WHERE r.Regulon_ID=line.Regulon_ID
MATCH (h:marks) WHERE (h.mark <> keys(line))
FOREACH (ignoreMe in CASE
WHEN exists(h.mark) AND line[h.mark] THEN [line]
ELSE END | CREATE (r)-[:REGULON_TO_MARKS{value:line[h.mark]}]->(h))
WHICH WILL CREATE ONE RELATIONSHIP and TAKE VALUE of it in edge