py2neo return number of nodes and relationships created
问题 I need to create a python function such that it adds nodes and relationship to a graph and returns the number of created nodes and relationships. I have added the nodes and relationship using graph.cypher.execute(). arr_len = len(dic_st[story_id]['PER']) for j in dic_st[story_id]['PER']: graph.cypher.execute("MERGE (n:PER {name:{name}})",name = j[0].upper()) #creating the nodes of PER in the story print j[0] for j in range(0,arr_len): for k in range(j+1,arr_len): graph.cypher.execute("MATCH