Home > Blockchain >  Cypher can't take all properties from CSV
Cypher can't take all properties from CSV

Time:12-19

I try to create relations from a CSV, but I've got an error

Cannot merge the following relationship because of null property 
value for 'timestamp': (u)-[:WATCHED {timestamp: null}]->(m)

I don't understand, the CSV doesn't miss any property

My code:

LOAD CSV WITH HEADERS FROM 
'https://www.dropbox.com/s/vmtjxr22q4fflr1/u.data.csv?dl=1' AS line 
FIELDTERMINATOR '|' MATCH(u:User{id:toInteger(line.id_user)}), 
(m:Movie{id:toInteger(line.id_item)}) WITH u,m, line MERGE (u)- 
[r:WATCHED{rating:toInteger(line.rating), 
timestamp:toInteger(line.timestamp)}]->(m)

Could you help me?

CodePudding user response:

I downloaded your CSV. Its header is the following:

id_user|id_item|rating|timestamp 

Note that it has an extra space character at the end of the line. This causes the property to be called timestamp , therefore, timestamp will be null.

  • Related