gpt4 book ai didi

c# - JanusGraph.net C#

转载 作者:行者123 更新时间:2023-12-04 01:28:40 24 4
gpt4 key购买 nike

嘿,谁能帮我弄清楚如何使用 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")

最佳答案

DriverRemoteConnection 可以采用除 GremlinClient 参数之外的另一个参数:

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

请注意,远程遍历不会绑定(bind) Graph 实例。它们针对 GraphTraversalSource 进行绑定(bind),因此您必须将“graphTraversalSourceName”更改为服务器上已配置对象之一的名称。当您不提供此参数时,它只是默认为“g”。另外,请注意可以找到 .NET API 文档 here .

关于c# - JanusGraph.net C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61393535/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com