【发布时间】:2020-02-23 01:24:32
【问题描述】:
我正在尝试将 tsv 文件中的关系导入到 neo4j 中,其中包含大约 1,000,000 多行。我能够在几秒钟内成功导入包含 23,000 个节点的节点文件。尽管如此,当我尝试导入 tsv 关系文件时,neo4j 需要很长时间来计算这个文件(几个小时),只是为了说“没有更改没有创建任何关系”。我不知道我是否正确执行此操作,因为我对 neo4j 还很陌生。
我使用的是 neo4j 社区版。
The node file that is imported into neo4j looks like this:
id name kind
Anatomy::UBERON:0000002 uterine cervix Anatomy
Anatomy::UBERON:0000004 nose Anatomy
Anatomy::UBERON:0000006 islet of Langerhans Anatomy
The relationship file looks like:
source metaedge target
Gene::801 GiG Gene::7428
Gene::5987 GiG Gene::9412
Gene::5747 GiG Gene::79738
//how im trying to link the relationships
using periodic commit
LOAD CSV WITH HEADERS FROM 'file:///edges.tsv' as edges FIELDTERMINATOR'\t'
MATCH (a:myNodes{name:edges.source})
MATCH(b:myNodes{name:edges.target})
CREATE (a)-[:CONNECTED{metaedge:edges.metaedge}]->(b)
Don't know how to make this work and speed up the process as well.
【问题讨论】: