为什么不能导入APOC导出的cyshell文件?

时间:2019-07-23 20:09:24

标签: neo4j cypher neo4j-apoc cypher-shell

在我的AWS托管Neo4j服务器上,我摄取了一个大数据集。使用的版本是 neo4j:3.5.5-enterprise apoc-3.5.0.4 。我想在笔记本电脑上检查数据集的一个子集,所以我想导出该子集并创建我的data.cypher文件,如下所示:

call apoc.export.cypher.query(
"
MATCH (a:Author {name: '$NAME'})
WITH a
OPTIONAL MATCH (u:UnknownAuthor)-[:MAYBE]-(a)
WITH collect(u)+collect(a) AS authors
UNWIND authors as a
MATCH (a)-[:WROTE]-(p:Paper)
WITH a, p
OPTIONAL MATCH (p)-[]-(n)
return *
",
'/data.cypher',{format:'cypher-shell'});

AWS和我的本地Neo4j都在Docker容器中运行。所以我从Docker容器中检索了它

docker cp neo4j:/var/lib/neo4j/import/data.cypher data.cypher

然后我将data.cypher文件下载到我的笔记本电脑上,并尝试将其摄取到我的本地空Neo4j容器中:

docker cp data.cypher neo4j:/var/lib/neo4j/import/data.cypher

echo "starting cypher shell"
docker exec -it neo4j \
    sh -c 'cat /var/lib/neo4j/import/data.cypher | /var/lib/neo4j/bin/cypher-shell --format plain'

不幸的是,这不起作用,并且我收到以下错误消息:

Invalid input '}': expected whitespace, comment or a property key name (line 2, column 61 (offset: 61))
"UNWIND [{id:"3647617", properties:{name:"Allen Macpherson", }}, {id:"47022847", properties:{name:"Julia E. Anderson", }}, --- REST OMITTED ---] as row"
                                                              ^

如何导入此文件?

0 个答案:

没有答案