-- Expected results
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
RETURN a,r,b;
a | r | b
------------------------------+-----------------------------+---------------------------------
person[4.517]{"name": "jhs"} | knows[11.15][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
-- If you do not have this part -- AND NOT EXISTS ((a)-[]->(b))
CREATE (a)-[:knows]->(b);
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon' AND NOT EXISTS ((a)-[]->(b))
CREATE (a)-[:knows]->(b)
;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 0)
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
CREATE (a)-[:knows]->(b)
;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 1)
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
CREATE (a)-[:knows]->(b)
;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 2)
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
CREATE (a)-[:knows]->(b)
;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 4)
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
CREATE (a)-[:knows]->(b)
;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 8)
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
CREATE (a)-[:knows]->(b)
;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 16)
agens=# MATCH (a:person)-[r]->(b:person)
WHERE a.name='jhs'
AND b.name = 'hsjeon'
CREATE (a)-[:knows]->(b)
;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 32)
agens=# MATCH (a:person)-[r]->(b:person) WHERE a.name = 'jhs' AND b.name = 'hsjeon' RETURN a,r,b;
a | r | b
------------------------------+-----------------------------+---------------------------------
person[4.517]{"name": "jhs"} | knows[11.15][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.29][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.30][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.31][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.32][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.33][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.34][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.35][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.36][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.37][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.38][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.39][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.40][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.41][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.42][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.43][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.44][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.45][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.46][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.47][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.48][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
person[4.517]{"name": "jhs"} | knows[11.49][4.517,4.546]{} | person[4.546]{"name": "hsjeon"}
....
(64 rows)