Multiple Graphs with Embedded JanusGraph
Hello!!
I am using embedded Janusgraph (embedded JanusGraph as a library inside my Java Application). I am trying to figure out if I can write two different named graphs to the same database. I am trying to use https://docs.janusgraph.org/operations/configured-graph-factory/ to create multiple graphs.
I set the name of the graph in
graph.graphname
in my JanusGraph configuration. But I get the following error while opening the graph
But I don't use the gremlin server and I am using embedded janusgraph. Can I create multiple dynamic graphs in the same storage ?5 Replies
A yaml representation of my janusgraph config is
Before you call
ConfiguredGraphFactory...
, do this:
You don't really need gm
instance though - it's designed for JanusGraph server.
Using JanusGraph as a library gives you more flexibility. So alternatively, you could just manage the graphs by yourself and use JanusGraphFactory.open(config)
with different config to open different graphs. ConfiguredGraphFactory
essentially does the same thing, except that it also needs to persist the graph configs.Creating JanusGraphManager this way solved the issue.
I thought that we can create two dynamic graphs in the same keyspace, but that is not the case right ?
Glad to hear it worked. No we don't do that. One graph per keyspace is the way to isolate different graphs.
Thanks for answering, this helped!!