如图,想要导入json文件 但总是报这样的错 已经试过这样设置 dbms.security.procedures.unrestricted=apoc.* dbms.security.allow_csv_import_from_file_urls=true apoc.import.file.enabled=true apoc.import.file.use_neo4j_config=true apoc.export.file.enabled=true
而且确定文件是在import目录下的
导入语句如下:
WITH ‘file:///mine.json’ AS url
CALL apoc.load.json(url) YIELD value as test
UNWIND test.data as d
UNWIND d.graph.nodes as nodes
MERGE (n:nodes {id:nodes.id})
ON CREATE SET n.lable=nodes.labels[0],n.name=nodes.properties.name
建立联系语句
WITH ‘file:///mine.json’ AS url
CALL apoc.load.json(url) YIELD value as test
UNWIND test.data as d
UNWIND d.graph.relationships as rel
MATCH (from:nodes{id:rel.startNode}),(to:nodes{id:rel.endNode})
merge (from)-[r:rs{id:rel.id,type:rel.type,name:rel.properties.name}]-> (to)
return r
cql语句是没问题的 亲测 在同桌电脑上跑的溜溜的 就是在我这里不行 怀疑是不是apoc库安装的不正确 求指导
版本是最新的Desktop版 希望有看到的大佬留下您宝贵的指导意见
图片不晓得加不加载的出来 这里复制下错误信息
Neo.ClientError.Procedure.ProcedureCallFailed
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.load.json
: Caused by: java.io.IOException: Cannot open file file:///mine.json from directory import for reading.