0

I'm trying to figure out if it is possible to create graphs on the server from a java/scala client but I haven't found any examples.

I'm running janusgraph 0.3.1 configured with the configurationManagementGraph with cassandra and solr. The server seems to run correctly.

But I can't figure out how to create a graph from my scala client on the server.

Is this supported? What is the usual way of creating graphs in janusgraph?

1 Answers1

0

This is what works for me in Java

GryoMapper.Builder mapperBuilder = 
GryoMapper.build().addRegistry(JanusGraphIoRegistry.getInstance());
MessageSerializer serializer = new GryoMessageSerializerV3d0(mapperBuilder);

Cluster.Builder clusterBuilder = Cluster.build();
clusterBuilder.addContactPoint("localhost");
clusterBuilder.port(8182);
clusterBuilder.maxContentLength(524288);
clusterBuilder.serializer(serializer);
Cluster cluster = clusterBuilder.create();

try {

    GraphTraversalSource g = EmptyGraph.instance().traversal().withBulk(true)
        .withRemote(DriverRemoteConnection.using(cluster));

    ...

} finally {
    cluster.close();
}
  • by this we wont able to create/open/drop graphs. Your code can be used to get GraphTraversal after a graph is created. The original question was about creating a graph from client (java). – anaray Jul 24 '20 at 19:36