我想在不使用长遍历的情况下修改多个顶点的属性(参见http://tinkerpop.apache.org/docs/current/recipes/#long-traversals)。出于性能原因,我有一个顶点ID的本地缓存。
我想做一个类似(在Tinkerpop3.3.3上)的代码:
var list = [ ["id": 123, "prop": "foo"], ["id": 456, "prop": "bar"] ];
g.inject(list)
.unfold()
.as("map")
.V(__.select("id"))
.property("prop", __.select("map").select("prop"))
.iterate();但我得到了以下异常:
java.lang.IllegalArgumentException: Expected an id that is convertible to Long but received class com.dcbrain.flowengine.dsl.DefaultFlowEngineTraversal
at org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$DefaultIdManager$1.convert(TinkerGraph.java:587)
at org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.lambda$createElementIterator$4(TinkerGraph.java:316)有什么变通的方法吗?或者有没有别的Tinkerpop版本支持?
发布于 2019-06-18 22:36:48
我找到了另一种创建查询的方法:
var map= [ 123 : "foo"], [456 : "bar"];
g.withSideEffect("map", map)
.V(map.keySet().toArray())
.as("id")
.property("prop", __.select("map").select(__.select("id").by(T.id)))
.iterate();https://stackoverflow.com/questions/56650987
复制相似问题