Nodes are not creating in neo4j

cypher

(Babu Ganesh0708) #1

Hi All,

I am trying to create a node in neo4j browser and however I am not able to create nodes,

Below is the query I executed,

LOAD CSV WITH HEADERS FROM "file:///email_logs.csv" AS row
MERGE (p1:Username {mail_id: row.sender})
MERGE (p2:Username {mail_id: row.recipient})
MERGE (p3:Topic {topic: row.keywords})
MERGE (p4:Subject {subject: row.message})
WITH p1, p2, p3, p4, row, COUNT(*) AS count
MERGE (p1)-[rel:sent]->(p2) ON CREATE SET rel.timestamp = row.date_time
MERGE (p1)-[int:interest]->(p3)<-[:interest]-(p2) ON CREATE SET int.Topic = row.keywords
MERGE (p1)-[sub:subject]->(p4)<-[:subject]-(p2) ON CREATE SET sub.subject = row.message
SET rel.count = count

After executing the query, In neo4j browser "Subject" node is not created and there is no error and below is the response I got,

Please correct me If I am doing anything wrong in the cypher query.

Thanks,
Ganeshbabu R


(Andrew Bowman) #2

What happens if you run this?

MATCH (s:Subject)
RETURN count(s)

Also that load is taking a long time. Have you created indexes or unique constraints on the various label/properties to speed up those merges?


(Michael Hunger) #3

Please also share an EXPLAIN of your query and the first few lines of your CSV file.

e.g.

LOAD CSV WITH HEADERS FROM "file:///email_logs.csv" AS row
RETURN row limit 5

(Babu Ganesh0708) #4

I created indexes on the labels and then I tried uploading the data to neo4j and got succeeded.. Now all the labels with properties are created.

Regards,
Ganeshbabu R