【发布时间】:2020-07-05 16:12:37
【问题描述】:
我是 gremlin 的新手,但我已经成功地拥有了一个 janusgraph dockerized 数据库,并使用 Gremlin.Net 3.4.7 连接到它(感谢在 stackoverflow 上找到的教程 PRACTICAL GREMLIN:D)。 我试试这个:
using (GremlinClient client = new GremlinClient(new GremlinServer("localhost", 8182)))
{
g = AnonymousTraversalSource.Traversal().WithRemote(new DriverRemoteConnection(client));
g.AddV("testV").Iterate();
var vertex = g.V().ToList();
}
连接很好,因为 AddV() 方法成功了。 现在我想将一个graphml文件加载到数据库中,并将数据库内容提取到另一个文件中。 但是当我尝试阅读时:
using (GremlinClient client = new GremlinClient(new GremlinServer("localhost", 8182)))
{
g = AnonymousTraversalSource.Traversal().WithRemote(new DriverRemoteConnection(client));
g.Io<Gremlin.Net.Structure.Vertex>(@"C:\Gremlin\toRead.graphml").Read().Iterate();
var vertex = g.V().ToList();
}
它的返回:“ServerError: C:\Gremlin\toRead.graphml 不存在” 然后写:
using (GremlinClient client = new GremlinClient(new GremlinServer("localhost", 8182)))
{
g = AnonymousTraversalSource.Traversal().WithRemote(new DriverRemoteConnection(client));
g.Io<Gremlin.Net.Structure.Vertex>(@"C:\Gremlin\extract.graphml").Write().Iterate();
var vertex = g.V().ToList();
}
它的回报: "ServerError: 无法检测文件格式 - 明确指定作者或使用标准扩展名重命名文件"
你遇到过这个错误吗?你能看到我错过了什么吗? 感谢您的宝贵时间,
变形
【问题讨论】:
标签: c# janusgraph tinkerpop3 gremlin-server gremlinnet