私信  •  关注

SWilly22

SWilly22 最近创建的主题
SWilly22 最近回复了
7 年前
回复了 SWilly22 创建的主题 » RedisGraph-将多个指令与MERGE结合

我现在看到的唯一选择就是把它分成两个查询, 第一个检查p是否连接到c:

MATCH (p:Initial{state: 'Initial', name: 'Initial'})-[:raw {person_id:'1234', type:'Encounter', code:'abcd'}]->(c:Encounter{code:'abcd', state: 'Encounter', name: 'Encounter1'}) RETURN p,c

如果上述查询返回空,则发出第二个查询以形成关系:

MATCH (p:Initial{state: 'Initial', name: 'Initial'})(c:Encounter{code:'abcd', state: 'Encounter', name: 'Encounter1'}) CREATE (p)-[:raw {person_id:'1234', type:'Encounter', code:'abcd'}]->(c)
7 年前
回复了 SWilly22 创建的主题 » 如何返回redisgraph中的关系?

目前redisgraph不支持混合create和return子句,尽管这项工作正在进行中,应该在几天内可用。

7 年前
回复了 SWilly22 创建的主题 » 如何返回redisgraph中的关系?

pr刚合并到master

127.0.0.1:6379> GRAPH.QUERY G "create (:Entity {id:'foo'}), (:Entity {id:'bar'})"
1) (empty list or set)
2) 1) "Labels added: 1"
   2) "Nodes created: 2"
   3) "Properties set: 2"
   4) "Query internal execution time: 0.536000 milliseconds"

127.0.0.1:6379> GRAPH.QUERY G "MATCH (n1:Entity {id:'foo'}), (n2:Entity {id:'bar'}) CREATE (n1)-[r:areFriends]->(n2) RETURN n1,n2,TYPE(r)"
1) 1) 1) "n1.id"
      2) "n2.id"
      3) "TYPE(r)"
   2) 1) "foo"
      2) "bar"
      3) "areFriends"
2) 1) "Relationships created: 1"
   2) "Query internal execution time: 0.409000 milliseconds"

请注意,此更改将是1.0.12版的一部分

在该版本发布之前,您可以从源代码构建,也可以使用Docker Image Redisplates/Redisgraph:Edge