Cannot insert edges between existing nodes with mandatory properties (original) (raw)

Consider the following trivial DDL:

-- NODES CREATE VERTEX TYPE Node IF NOT EXISTS; CREATE PROPERTY Node.id IF NOT EXISTS STRING (MANDATORY TRUE, READONLY TRUE);

-- EDGES CREATE EDGE TYPE Edge IF NOT EXISTS; CREATE PROPERTY Edge.id IF NOT EXISTS STRING (MANDATORY TRUE, READONLY TRUE);

With two nodes inserted already:

MERGE (a: Node {id : "a"}) MERGE (b: Node {id : "b"})

A traditional, by the books Cypher query to create an edge between these nodes does not exist, no matter whether merge/create is used, etc.

MATCH (a: Node {id : "a"}), (b: Node {id : "b"}) CREATE (a)-[e: Edge {id : "e"}]->(b) RETURN e

...always leads to a transaction commit error:

Error executing Cypher command: MATCH (a: Node {id : "a"}), (b: Node {id : "b"}) CREATE (a)-[e: Edge {id : "e"}]->(b) RETURN e -> The property 'Edge.id' is mandatory, but not found on record: V(#19:0)->[E?]->V(#19:1)

I guess edge types just can't have mandatory properties?