Hi all,
I'm struggling for days on a strategy for bulk creation of relationships on existing nodes. I have a set of nodes already in Neo4j and an external base of relationships in a dict (or dataframe):
{('A', 'B'): {
'sim1': 0.2943630213889271,
'sim2': 0.4710701248095422,
'sim3': 0.5337783469032883,
'composed_sim': 0.45043293483711544},
That is, the key is a tuple of the nodes to be related and sim1, sim2,..., are properties for this relation.
I can merge this relationships flawlessly iterating in a for loop with apoc.merge.relationship
, however, for millions of relationships, this strategy is unfeasible.
I've been reading about apoc.periodic.iterate() but I got confused about how this kind of external data is supposed to be loaded (my Neo4j instance runs on a remote container and I'm using py2neo to interact with it) and how to build the mappings for the batch operation.
Could someone please clarify how can I use apoc to accomplish this bulk relationship creation?
Thanks in advance.