You should let Neo assign the ID's and keep a mapping between your domain id's and the Neo4j internal ID in a efficient dictionary/map.
Also you don't configure and memory configuration when creating the batch-insert, so it will go with the default memory config, see: http://neo4j.com/docs/stable/configuration-io-examples.html#configuration-batchinsert <http://neo4j.com/docs/stable/configuration-io-examples.html#configuration-batchinsert> http://neo4j.com/docs/stable/batchinsert-examples.html <http://neo4j.com/docs/stable/batchinsert-examples.html> You can already use neo4j-import of 2.2.RC01 (at least for testing) Cheers, Michael > Am 12.03.2015 um 20:55 schrieb Alberto Jesús Rubio Sánchez > <[email protected]>: > > Hi Michael! > > This is an example of the code I use: > > import org.neo4j.unsafe.batchinsert.BatchInserter; > import org.neo4j.unsafe.batchinsert.BatchInserters; > > BatchInserter batchInserter = BatchInserters.inserter(DB_PATH); > batchInserter.createDeferredSchemaIndex(NODE_LABEL).on("id").create(); > batchInserter.createNode(ID, properties, NODE_LABEL); > > The data would have the following structure: > > chembl_activity:CHEMBL_ACT_102540 bao:BAO_0000208 bao:BAO_0002146 . > chembl_document:CHEMBL1129248 cco:hasActivity > chembl_activity:CHEMBL_ACT_102551 . > chembl_activity:CHEMBL_ACT_102540 cco:hasDocument > chembl_document:CHEMBL1129248 . > > Each line corresponds with a relationship between two nodes and we could see > that the node chembl_activity:CHEMBL_ACT_102540 is duplicated. > > I wanted to save as id the hashcode of the node name but that hashcode is a > very large number that slows the process. So I could check for ids to only > create the relationship and not the nodes. > > The new neo4j-import tool could help me? When the next release will appear? > > Thanks for all! :) > > Regards, > Alberto. > > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
