My data looks like this:
predecessor,successor
AAMBD01P.ACCOUNT_ANALYTICAL_BALANCE,DIMS32P.NHJ_DEPOSIT
AAMBD01P.CUSTOMER_ACCOUNT_REL,DIMS32P.NHJ_DEPOSIT
AAMBD01P.CUSTOMER_SUB_DETAIL2_BBKKA,DIMS32P.NHJ_DEPOSIT
AAMBD01P.CUSTOMER_BBKKA_DETAIL,DIMS32P.NHJ_DEPOSIT
AAMBD08P.CUSTOMER_DETAIL2_FULL,DIMS32P.NHJ_DEPOSIT
AAMBD08P.ACC_CURR_DEP_STAT_HIST,DIMS32P.NHJ_DEPOSIT
MISV19P.V_CUSTOMER_SEGM,DIMS32P.NHJ_DEPOSIT
I'm trying to load it into my Neo4J instance but I get this error:
neo4j.exceptions.CypherSyntaxError: {code: Neo.ClientError.Statement.SyntaxError} {message: Query cannot conclude with LOAD CSV (must be RETURN or an update clause) (line 1, column 1 (offset: 0))
"LOAD CSV WITH HEADERS FROM 'file:///data.csv' AS line"
^}
My code:
from neo4j import GraphDatabase
driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "187179"))
def add_data(tx):
tx.run("LOAD CSV WITH HEADERS FROM 'file:///data.csv' AS line")
tx.run("MERGE (s:src {id: line.source})")
tx.run("MERGE (d:dst {id: line.destination})")
tx.run("CREATE (s)-[:FEEDs_INTO]->(d)")
with driver.session() as session:
session.write_transaction(add_data)
driver.close()