Reputation: 1
Im trying to import relationships from a tsv file into neo4j with about 1,000,000+ rows. I was able to successfully import the node file with 23,000 nodes in a matter of seconds. Nonetheless when I try importing the tsv relationship file neo4j takes a long time computing this file (several hrs) just for it to say "no changes made no relationships created". I don't know if I'm doing this properly because I'm pretty new to neo4j.
Im using the neo4j community edition.
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.
Upvotes: 0
Views: 141
Reputation: 1097
With
USING PERIODIC COMMIT you should specify a value
That value depends on the RAM avail for Neo4j. This value can be set in neo4j.conf
Also, do you have unicity constraints on name for myNodes ?
I'd advise to run your import not from the webapp, but from the CLI. And run the server standalone (not desktop) if you RAM is limited
Running another tool to see the RAM load, CPU load, disk load can help you find the right setting for your import.
Upvotes: 0