How can I create relationships between existing nodes in a neo4j database using py2neo in Python?

54 views Asked by At

I need to create relationships between existing nodes in a neo4j database. My nodes have only one property which is a material identification number. I also have a pandas dataframe that specifies the parent and the child. There are around 500000 relations that should be created

I tried using the create_relationship method from py2neo bulk but it does not do anything in the data base

relationships=[]

for index,row  in RelDf[:10].iterrows():
    rows=(row.MATNR,{},row.IDNRK)
    relationships.append(rows)

for i in range(len(relationships)):
    create_relationships(graph.auto(),relationships,"CONTAINS"\
                    ,start_node_key=("Material",relationships[i][0]),end_node_key=("Material",relationships[i][1]))

0

There are 0 answers