【问题标题】:How to add bidirectional edge using Rexster?如何使用 Rexster 添加双向边缘?
【发布时间】:2016-05-17 19:03:22
【问题描述】:
我正在使用 Rexster 使用 HTTP POST 方法在两个顶点之间创建边。
/graphs/<graph>/edges/3?_outV=<id>&_label=friend&_inV=2&<key>=<key'>
我指的是链接:
Rexster HTTP
这里我需要提供出顶点(即_outV)和顶点(即_inV),这是一个单向边。如何使用 Rexster 创建双向边缘。
【问题讨论】:
标签:
graph
gremlin
titan
edges
rexster
【解决方案1】:
TinkerPop 不支持双向边缘类型作为Blueprints(或TinkerPop 3.x)的一部分。您必须通过在两个单独的请求中添加相反方向的边来模拟双向性。
/graphs/<graph>/edges/3?_outV=<id>&_label=friend&_inV=2&<key>=<key'>
/graphs/<graph>/edges/2?_outV=<id>&_label=friend&_inV=3&<key>=<key'>