【发布时间】:2018-12-04 21:34:33
【问题描述】:
我正在调用 JanusGraph 远程,它默认返回 ReferenceVertex。为了也检索属性,我使用了 valueMap(),它适用于简单的查询。
但是,在我的用例中,我需要构建一个连接,它基于 ReferenceVertex 运行良好,如下所示:
// select t1.table2_ID, t2.table2_ID from table1 as t1 inner join table2 as t2 on t1.table2_ID = t2.table2_ID
GraphTraversal<?, ?> t1 = __.start().as("table1").out("relatesTo").hasLabel("table2").as("table2");
GraphTraversal<?, ?> t2 = g.V().hasLabel("table1").match(t1).select("table1", "table2");
List<?> l = t2.toList();
将 valueMap 添加到遍历以检索其失败的属性时。我想包括以下特定属性:
// select t1.column1, t2.column2 from table1 as t1 inner join table2 as t2 on p.table2_ID = c.table2_ID
GraphTraversal<?, ?> t1 = __.start().as("table1").out("relatesTo").hasLabel("table2").valueMap(true, "column2").as("table2");
GraphTraversal<?, ?> t2 = g.V().hasLabel("table1").valueMap(true, "column1").match(t1).select("table1", "table2");
List<?> l = t2.toList();
-> java.util.HashMap 不能转换为 org.apache.tinkerpop.gremlin.structure.Element
我是否构建了错误的遍历,或者这是 Tinkerpop 中的限制/错误?
谢谢
【问题讨论】:
标签: gremlin tinkerpop janusgraph gremlin-server