我跟随此guide创建图表数据集。现在我必须在Neo4j中导入一个CSV文件。为此,我使用此script,我只编辑了CSV文件的路径。
当我在Neo4j shell中执行它时,我收到此错误:
TabItem
此外,这些行标有下划线,错误:
无关输入
Neo.ClientError.Statement.SyntaxError: Invalid input 'R': expected 'e/E'
(line 23, column 2 (offset: 1116))
"DROP CONSTRAINT ON (a:PERSON) ASSERT a.number IS UNIQUE;"
相反,此行会收到以下错误消息:
缺少';'在DROP
ON CREATE SET a.first_name = line.FIRST_NAME, a.last_name = line.LAST_NAME,
a.full_name = line.FULL_NAME
ON MATCH SET a.first_name = line.FIRST_NAME, a.last_name = line.LAST_NAME,
a.full_name = line.FULL_NAME
...
ON CREATE SET c.start = toInt(line.START_DATE), c.end= toInt(line.END_DATE),
c.duration = line.DURATION
MERGE (d:LOCATION {cell_tower: line.CELL_TOWER})
ON CREATE SET d.address= line.ADDRESS, d.state = line.STATE, d.city =
line.CITY
...
答案 0 :(得分:2)
首先,您应该将CSV文件放在Neoj4导入目录中。如果您使用的是Windows桌面社区版,则此目录为%APPDATA%\Neo4j Community Edition\import
(请参阅file location docs)。
然后将您的LOAD CSV
声明更改为:
LOAD CSV WITH HEADERS FROM "file:///call_records_dummy.csv" AS line
答案 1 :(得分:0)