I am new to NEO4j and have been getting many errors and trouble while trying to learn cypher.
How can I learn cypher properly?
I have been facing error while trying to load a csv file can anyone tell me what i have been doing wrong?
LOAD CSV WITH HEADERS FROM "file:///C:/Users/sitas/AppData/Local/Neo4j/Relate/Data/dbmss/dbms-a5c6a64c-958c-47c9-9068-d1e74d5258ca/import/Experiment_Design.csv" AS line with line merge(Aid:AIdNode{Name:line.analytical_sample external_id}) merge(Sid:SIdNode{Name:line.subject external_id}) merge(g2:G2Node{Name:line.grouping2}) merge(g1:G1Node{Name:line.grouping1}) merge(Bid:BIdNode{Name:line.biological_sample external_id});
Error:
Invalid input 'x': expected 'n/N' (line 1, column 227 (offset: 226))
"LOAD CSV WITH HEADERS FROM "file:///C:/Users/sitas/AppData/Local/Neo4j/Relate/Data/dbmss/dbms-a5c6a64c-958c-47c9-9068-d1e74d5258ca/import/Experiment_Design.csv" AS line with line merge(Aid:AIdNode{Name:line.analytical_sample external_id}) merge(Sid:SIdNode{Name:line.subject external_id}) merge(g2:G2Node{Name:line.grouping2}) merge(g1:G1Node{Name:line.grouping1}) merge(Bid:BIdNode{Name:line.biological_sample external_id}) ;"
A great way to learn Cypher is to take the free online Graph Academy courses. They can take you all the way from the fundamentals to advanced modeling techniques. Well worth the time.
For your particular query, the error is pointing to the letter 'x' in this part of your query...
The parser is confused by external_id. You may be missing a property name and full reference to the input. Guessing, it could be something like EID assigned to a value line.external_id from the CSV...
Spotting those errors can be tricky with a long line of text. If you're using Neo4j Browser, you can switch into multi-line mode by pressing <shift-return> where you'd like to have a line break. Once you're in multi-line mode, pressing <return>will just add newlines. To run the query you'd need to either type <cmd-return> or click on the "play" button.