Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-04-2020 04:15 AM
Hello,
i'm in a situation where i have graph of 300 000 nodes where such pattern occurs:
(A:Human)-[R:Has]-(B:Car)-[P:Stolen]-(C:Human)
i would like to create a new "extrapolated" edge:
(A)-[X:ExtrapolatedConnection]-(C)
(in order to be able to find all shortest paths between humans while understanding and assuming the above connection as direct),
however, when i try simply:
MATCH (A:Human)-[R:Has]-(B:Car)-[P:Stolen]-(C:Human)
MERGE (A)-[X:ExtrapolatedConnection]-(C)
the Execution failed
and Java heap space error
is returned after a while. I guess it's all wrong?
thank you
Solved! Go to Solution.
07-05-2020 02:05 PM
Hello @ldpubsec and welcome to the Neo4j community
The dirty solution is to directly increase the heap size of your database in the neo4j.conf file.
The second option is to modify a bit your query like this (it requires APOC plugin):
CALL apoc.periodic.iterate('MATCH (A:Human)-[:Has]-(:Car)-[:Stolen]-(C:Human) RETURN A, C', 'MERGE (A)-[X:ExtrapolatedConnection]-(C)', {batchSize:1000})
Or you can do both
Regards,
Cobra
07-05-2020 02:05 PM
Hello @ldpubsec and welcome to the Neo4j community
The dirty solution is to directly increase the heap size of your database in the neo4j.conf file.
The second option is to modify a bit your query like this (it requires APOC plugin):
CALL apoc.periodic.iterate('MATCH (A:Human)-[:Has]-(:Car)-[:Stolen]-(C:Human) RETURN A, C', 'MERGE (A)-[X:ExtrapolatedConnection]-(C)', {batchSize:1000})
Or you can do both
Regards,
Cobra
All the sessions of the conference are now available online