JanusGraph .net C#

前提是你 提交于 2020-05-09 05:32:32

问题


Hey Can anyone help me figure out how I can connect to remote JanusGraph server hosting several graphs and query a specific graph (by graph name) using C# JanusGraph.net ?

I can connect to the server but I can't query a specific graph.

var c = JanusGraph.Net.JanusGraphClientBuilder.BuildClientForServer(server).Create();
var connection = new DriverRemoteConnection(c);
var g = Traversal().WithRemote(connection);

How we can implement ConfiguredGraphFactory.create("graphName") or ConfiguredGraphFactory.open("graphName") in JanusGrapgh.net


回答1:


DriverRemoteConnection can take another parameter in addition to the GremlinClient argument:

var c = JanusGraph.Net.JanusGraphClientBuilder.BuildClientForServer(server).Create();
var connection = new DriverRemoteConnection(c, "graphTraversalSourceName");
var g = Traversal().WithRemote(connection);

Note that remote traversals do not bind against Graph instances. They bind against a GraphTraversalSource, so you must change "graphTraversalSourceName" to the name of one of those configured objects on the server. When you don't supply this argument, it just defaults to "g" by the way. Also, please note that .NET API documentation can be found here.



来源:https://stackoverflow.com/questions/61393535/janusgraph-net-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!