Merging two graphs.


Gwiz <feed...@...>
 

Hello,

I have an in-memory Janusgraph instance and I would like to merge that with my Cassandra/ES based graph. What is the best (efficient) way to do this?

When I merge, I don't need to insert the vertices that are already in my Cassandra/ES based graph. I know which vertices in the in-memory graph exists in the Cassandra/ES based graph. 

I don't see any Java API to take a Vertex (or list of Vertices) from one Janusgraph instance and add them to another. All I see is the following:
  • addVertex(String)
  • addVertex(Object... objects)
My original plan is to insert the new vertices from in-memory graph into my Cassandra/ES based graph, get the IDs back and use them to insert Edges.

I appreciate any help.

Thanks.


Jason Plurad <plu...@...>
 

You could use some of the methods from TinkerPop's ElementHelper to help copy over properties.
http://tinkerpop.apache.org/javadocs/3.2.3/full/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.html

The element ids will be different between your 2 JanusGraph instances, so as you've noted, you'll either have to track the ids or have sufficient indexes configured to do lookups.


On Wednesday, July 19, 2017 at 10:37:28 AM UTC-4, Gwiz wrote:
Hello,

I have an in-memory Janusgraph instance and I would like to merge that with my Cassandra/ES based graph. What is the best (efficient) way to do this?

When I merge, I don't need to insert the vertices that are already in my Cassandra/ES based graph. I know which vertices in the in-memory graph exists in the Cassandra/ES based graph. 

I don't see any Java API to take a Vertex (or list of Vertices) from one Janusgraph instance and add them to another. All I see is the following:
  • addVertex(String)
  • addVertex(Object... objects)
My original plan is to insert the new vertices from in-memory graph into my Cassandra/ES based graph, get the IDs back and use them to insert Edges.

I appreciate any help.

Thanks.