JanusGraph .net C# [英] JanusGraph .net C#

查看:198
本文介绍了JanusGraph .net C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,谁能帮助我找出如何连接到托管多个图形的远程JanusGraph服务器并使用C#JanusGraph.net查询特定图形(按图形名称)的方法?

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);

我们如何实现ConfiguredGraphFactory.create( graphName)或ConfiguredGraphFactory.open( graphName)在JanusGrapgh.net

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

推荐答案

DriverRemoteConnection 可以采用其他参数 GremlinClient 参数:

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);

请注意,远程遍历不与 Graph 实例。它们与 GraphTraversalSource 绑定,因此您必须将 graphTraversalSourceName更改为服务器上那些已配置对象之一的名称。如果您不提供此参数,则默认为 g。另外,请注意,可以此处

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.

这篇关于JanusGraph .net C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆