Search code examples
tinkerpopjanusgraphgremlin-server

How Is it possible to use ferma OGM over Gremlin Server?


Could you tell me - Is it possible to use OGM FERMA framework over Gremlin Server (TinkerPop 3.2.6 with JanusGraphDB on backend)?

For now I use gremlin client for sending queries to G-server in this way:

GryoMapper mapper = GryoMapper.build().addRegistry(JanusGraphIoRegistry.getInstance()).create();
MessageSerializer serializer = new GryoMessageSerializerV1d0(GryoMapper.build().addRegistry(JanusGraphIoRegistry.getInstance()));

/* Create gremlin cluster... */
Cluster cluster = Cluster.build("123.22.22.111").port(8182).serializer(serializer).create();
Client client = cluster.connect();
ResultSet res = client.submit("g.V().label()");

... therefore I have not idea about how could I get graph instance directly (like in the ferma tutorial):

FramedGraph fg = new DelegatingFramedGraph(graph, true, types);

... to use traversal for getting instances of ferma-annotated classes.


Solution

  • Ferma is designed to work with embedded TinkerPop-enabled Graph instances. Therefore, it does not work with graphs hosted in Gremlin Server or remote graph providers like DSE Graph, CosmosDB, Neptune, etc.