How can I can get the type of the relationship with a cypher query in py2neo? I have this piece of code that works.
def print_row(row):
a,b = row
print (a["name"] + " " + b["name"])
cypher.execute(graph_db, "START a=node(1) MATCH (a) - [] - (b) RETURN a,b", row_handler=print_row)
This way I can print out the nodes that are connected to my input node (1).
ROCK PAPER
ROCK SCISSORS
However what I would like is to print the type of relationship that these nodes have.
For instance:
ROCK BEATS SCISSORS
ROCK BEATEN_BY PAPER
What I tried (and failed) is as follows:
def print_row(row):
a,b,r = row
print (a["name"] + r["type"] + b["name"])
cypher.execute(graph_db,"START a=node(1) MATCH (a) -[r]->(b) RETURN a,b,r", row_handler=print_row)
How can I do this with py2neo?