Search code examples
graphgremlintitanedgesrexster

How to add bidirectional edge using Rexster?


I'm using Rexster To Create edge between two vertex using the HTTP POST Method.

/graphs/<graph>/edges/3?_outV=<id>&_label=friend&_inV=2&<key>=<key'>

I'm referring link :

Rexster HTTP

Here I need to provide out vertex (i.e _outV ) and in vertex (i.e _inV), which is a single direction edge. How can I create a bi-directional edge using Rexster.


Solution

  • TinkerPop doesn't support a bi-directional edge type as part of Blueprints (or TinkerPop 3.x). You'd have to simulate bi-directionality by adding the edge in the opposing direction in two separate requests.

    /graphs/<graph>/edges/3?_outV=<id>&_label=friend&_inV=2&<key>=<key'>
    /graphs/<graph>/edges/2?_outV=<id>&_label=friend&_inV=3&<key>=<key'>