无法使用 Tinkerpop gremlin 驱动程序 3.3.1 通过 websocket 连接向 Janusgraph (cql-es) 添加边
Unable to add edges to Janusgraph (cql-es) over websocket connection using Tinkerpop gremlin driver 3.3.1
添加、删除、更新顶点没问题,但在尝试添加边时出现以下异常,说明不支持添加边。谁能建议在使用远程客户端时如何添加边缘?提前致谢。
java.lang.IllegalStateException: 在 org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.edgeAdditionsNotSupported(Vertex.java:175) 在 org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex.addEdge(参考文献Vertex.java: 47)
Link 编码:
https://gist.github.com/ptclarke/45472fa5c268a6e8441e4c35615194aa
从远程请求返回的 Vertex
对象与图形分离并且是不可变的,因此如果您尝试这样做:
Vertex v = g.V(id).next()
v.addEdge(...)
它会失败,因为您试图将边添加到与远程图没有连接的不可变对象。您应该使用 Gremlin 添加边缘而不是直接对返回的对象进行操作:
g.V(id).addE(...).to(...)
添加、删除、更新顶点没问题,但在尝试添加边时出现以下异常,说明不支持添加边。谁能建议在使用远程客户端时如何添加边缘?提前致谢。
java.lang.IllegalStateException: 在 org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.edgeAdditionsNotSupported(Vertex.java:175) 在 org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex.addEdge(参考文献Vertex.java: 47)
Link 编码: https://gist.github.com/ptclarke/45472fa5c268a6e8441e4c35615194aa
从远程请求返回的 Vertex
对象与图形分离并且是不可变的,因此如果您尝试这样做:
Vertex v = g.V(id).next()
v.addEdge(...)
它会失败,因为您试图将边添加到与远程图没有连接的不可变对象。您应该使用 Gremlin 添加边缘而不是直接对返回的对象进行操作:
g.V(id).addE(...).to(...)