I am trying to create a relationship between two nodes using using the below query:
load csv with headers from
"file:C:/Users/abc/Documents/Neo4j/RT__RISK_LOSSEVENT.csv" as risklossevent
match (a: RT__RISK_LOSSEVENT {LossEventId: risklossevent.LOSSEVENT_ID}),
(b: RT_RISK {RiskId: risklossevent.RISK_ID})
create (a)-[ASSOCIATED_WITH]->(b);
It is throwing the an error stating
A single relationship type must be specified for CREATE (line 1, column 236 (offset: 235))
Neo.ClientError.Statement.InvalidSyntax
For creating the two nodes, I have used the below queries:
load csv with headers from
file:C:/Users/abc/Documents/Neo4j/RT__RISK_LOSSEVENT.csv" as risklossevent
create (rle1:RT__RISK_LOSSEVENT {RiskId: risklossevent.RISK_ID, LossEventId: risklossevent.LOSSEVENT_ID});
load csv with headers from "file:C:/Users/abc/Documents/Neo4j/RT_RISK.csv" as risk
create (rle3:RT_RISK {RiskId: risk.RISK_ID, Owner: risk.OWNER, RiskCategory: risk.RISK_CATEGORY, Description: risk.DESCRIPTION});
Anyone knows what wrong with the syntax or the query?
Indeed the exception you get is not really concerning the syntax error you have and thus not meaningful.
You forgot to add a colon
: :
before the relationship type in your query :
create (a)-[:ASSOCIATED_WITH]->(b);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With