JanusGraph .net C#

3

嘿,有人能帮我解决如何使用 C# JanusGraph.net 连接远程的 JanusGraph 服务器,并查询指定名称的图形吗?服务器上托管了多个图形。

我可以连接到服务器,但无法查询特定的图形。

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

我们如何在JanusGraph.net中实现ConfiguredGraphFactory.create("graphName")或ConfiguredGraphFactory.open("graphName")?

1个回答

4
DriverRemoteConnection可以在GremlinClient参数之外再添加一个参数:
var c = JanusGraph.Net.JanusGraphClientBuilder.BuildClientForServer(server).Create();
var connection = new DriverRemoteConnection(c, "graphTraversalSourceName");
var g = Traversal().WithRemote(connection);

请注意,远程遍历不会绑定到 Graph 实例上,而是会绑定到一个 GraphTraversalSource 上。因此,您必须将 "graphTraversalSourceName" 更改为服务器上配置的其中一个对象的名称。当您没有提供此参数时,默认值为 "g"。此外,请注意,可以在此处找到 .NET API 文档。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接