Is there any way to combine these statements into one in Cypher? Another way to ask this is what is the scope of a with statement, when does it end?
I am trying to do a conditional creation of link types from a csv file.
LOAD CSV WITH HEADERS FROM "file:///g:/crs2/DataFlowDB/links.csv" AS row
WITH row WHERE row.type = 'in'
MATCH (start:Actor { key:toInteger(row.from) })
MATCH (end:Actor { key:toInteger(row.to) })
CREATE (start)-[:IN { direction: [row.type]}]->(end)
LOAD CSV WITH HEADERS FROM "file:///g:/crs2/DataFlowDB/links.csv" AS row
WITH row WHERE row.type = 'out'
MATCH (start:Actor { key:toInteger(row.from) })
MATCH (end:Actor { key:toInteger(row.to) })
CREATE (start)-[:OUT { direction: [row.type]}]->(end)