Is it possible to insert only one edge between every distinct pair of matched vertexes?
Consider the following simple graph:
(A)-[r1]->(B)-[r2]->(C)
(A)-[r3]->(D)-[r4]->(C)
I would like to insert an edge between nodes n1 and n2 that satisfy this match pattern (n1)->()->(n2) without duplication of edges. So in the example, I would like to insert only one edge between A and C even if the path A->C is matched two times evaluating the pattern.
Making an analogy to Cypher query language, is there a way of expressing “ON CREATE” and “ON MATCH” clauses in a “MATCH … MERGE … ON CREATE … ON UPDATE …” statement?
Studying pypgx interface, there exists the method simplify that removes duplicates edges. However it does not guarantee any control over the deletion procedure, it applies to the whole graph and it is unclear how it deals with oriented relations.