Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-08-2018 05:29 PM
I am trying to make a word-pair frequency query
I'm getting this error:
Neo.ClientError.Statement.SemanticError: Cannot merge node using null property value
I tried to fix it with
where not text.content is null
But then I get a syntax error
Here is my code:
USING PERIODIC COMMIT
LOAD CSV FROM "file:///check.csv" AS text
FIELDTERMINATOR ' '
UNWIND range(0,size(text)-2) AS i
MERGE (w1:Word)
where not text.content is null
ON CREATE SET w1.content=text[i]
ON CREATE SET w1.count=1
ON MATCH SET w1.count=w1.count+1
MERGE (w2:Word)
where not text.content is null
ON CREATE SET w2.content=text[i+1]
ON CREATE SET w2.count=1
ON MATCH SET w2.count=w2.count+1
MERGE (w1)-[r:NEXT]->(w2)
ON CREATE SET r.count=1
ON MATCH SET r.count=r.count+1
RETURN text
Solved! Go to Solution.
10-20-2018 04:53 AM
09-09-2018 08:24 AM
You need to use this syntax: MERGE (node:Label {key: value})
where key-value are your merge attributes that identify your nodes uniquely.
So in your case:
USING PERIODIC COMMIT
LOAD CSV FROM "file:///check.csv" AS text
FIELDTERMINATOR ' '
WITH text where not text.content is null
UNWIND range(0,size(text)-2) AS i
MERGE (w1:Word {content:text[i]})
ON CREATE SET w1.count=1
ON MATCH SET w1.count=w1.count+1
MERGE (w2:Word {content:text[i+1]})
ON CREATE SET w2.count=1
ON MATCH SET w2.count=w2.count+1
MERGE (w1)-[r:NEXT]->(w2)
ON CREATE SET r.count=1
ON MATCH SET r.count=r.count+1
RETURN text
09-19-2018 01:24 AM
i had tried with above code with my data set ,but i am facing this error can you please tell me the solution.
.
09-19-2018 12:17 PM
Can you put the CSV file (with dummy values if it's sensitive data) somewhere so that I can try to reproduce it?
10-20-2018 04:53 AM
That worked, thank you!
09-24-2018 11:40 AM
Perhaps you have certain entries where your row has fewer entries?
All the sessions of the conference are now available online