When executing the query CREATE (p:Person)-[s:SPEAKS]-(l:Language) RETURN p, s, l;
, you get the following error:
Error: Query failed: Bidirectional relationship are not supported when creating an edge
If you use MERGE
instead of CREATE
, the relationship is created:
MERGE (p:Person)-[s:SPEAKS]-(l:Language) RETURN p, s, l;
I ran those same queries in Neo4j and they produce the same results as memgraph does - CREATE
fails, MERGE
succeeds. The cypher spec also says that in case of MERGE
, a direction is picked even if none was specified.
To quote the spec: "A property graph may be defined in graph theoretical terms as a directed, vertex-labeled, edge-labeled multigraph with selfedges, where edges have their own identity." - so, from this point it makes sense that CREATE behaves like it does.