I create a couple of simple graphs:
127.0.0.1:6379> GRAPH.QUERY test “CREATE (:T1 {name: ‘Node A’})-[:R1]->(:T2 {name: ‘Node B’, prop1: ‘XYZ’})-[:R2]->(:T3 {name: ‘Node C’})”
-
(empty list or set)
-
- “Labels added: 3”
-
“Nodes created: 3”
-
“Properties set: 4”
-
“Relationships created: 2”
-
“Query internal execution time: 2.923728 milliseconds”
127.0.0.1:6379> GRAPH.QUERY test “CREATE (:T1 {name: ‘Node D’})-[:R1]->(:T2 {name: ‘Node E’, prop1: ‘123’})-[:R2]->(:T3 {name: ‘Node F’})”
-
(empty list or set)
-
- “Nodes created: 3”
-
“Properties set: 4”
-
“Relationships created: 2”
-
“Query internal execution time: 0.397805 milliseconds”
I then attempt to create a new relationship linking nodes of type T1 (l) and T3 (n) using a property taken from T2 (m) to assign to the new relationship (R3):
127.0.0.1:6379> GRAPH.QUERY test “MATCH (l:T1)-[:R1]->(m:T2)-[:R2]->(n:T3) CREATE (l)-[:R3 {prop1: m.prop1}]->(n)”
(error) Syntax error at offset 67 near ‘m’
but this fails with a Syntax error - this works in neo4j
Such a query works fine with if no property or a fixed property (ie. no reference to existing nodes) is used:
127.0.0.1:6379> GRAPH.QUERY test “MATCH (l:T1)-[:R1]->(m:T2)-[:R2]->(n:T3) CREATE (l)-[:R3]->(n)”
-
(empty list or set)
-
- “Relationships created: 2”
-
“Query internal execution time: 0.388876 milliseconds”
Is this a limitation with the current redisgraph opencypher implementation?
Thanks,
Stu