SyntaxException with Neo4j LOAD command

这一生的挚爱 提交于 2019-12-10 20:42:41

问题


I'm using neo4j 2.1.2 for windows I was attempting to use Neo4j's load csv command but I get the following error...

neo4j-sh (?)$ load csv with headers "file:../test/unclaimed.csv" AS csvLine
 MERGE (o:Original_Transaction_Number { value: csvLine.OTN })
 MERGE (i:Institution {name: csvLine.Institution })
 MERGE (i)<-[:TRANSACTION_OF]-(o)
 ;


SyntaxException: Invalid input 'l': expected <init> (line 1, column 1)
"load csv with headers "file:../test/unclaimed.csv" AS csvLine"
 ^

infact I get the same error by just entering load

neo4j-sh (?)$ load ;
==> SyntaxException: Invalid input 'l': expected <init> (line 1, column 1)
==> "load "
==>  ^

Could anyone explain what's happening?

(EDIT:)->(FIXED)->(THE PROBLEM)

Combination of issues here.

  1. I had earlier tried upgrading to 2.1.2 be simply extracting files to 2.0.3 folder - fixed - thanks @Stefan

  2. Fixing 1. and prefixing with "cypher 2.1" (thanks @Michael) gave more informative error "SyntaxException: Invalid input '"': expected whitespace, comment or FROM (line 1, column 23) - I was missing the FROM keyword

  3. After getting many "LoadExternalResourceException: Couldn't load the external resource at: file:../test/unclaimed.csv" and many variants of "file://c:/nosql/test/" etc i finally figured that the syntax for accessing a local file on windows is simply "file:c:/nosql/test/unclaimed.csv" and not file:// as might be inferred from examples on http://neo4j.com/docs/2.1.2/cypherdoc-importing-csv-files-with-cypher/ or anyone familiar with URI schema

Thanks folks

来源:https://stackoverflow.com/questions/24431937/syntaxexception-with-neo4j-load-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!