【发布时间】:2015-03-06 12:26:46
【问题描述】:
这是我正在使用的示例代码,但我不知道如何使用此 Pipeline 对象来获取顶点及其属性。
GremlinPipeline pipeline = new GremlinPipeline(vert)
.out("LIVES_IN_CITY").in("LIVES_IN_CITY")
.filter(new PipeFunction<Vertex,Boolean>() {
public Boolean compute(Vertex v){
return v.getProperty("name").equals(city);
}}).back(2).out("LIVES_IN_CITY");
【问题讨论】:
-
我并没有真正按照您的要求进行操作。你能改一下你的问题吗?您是否在问如何从示例代码中显示的管道中获取“结果”?
-
vert 是员工节点,它是起始节点,LIVES_IN_CITY 是员工节点到城市节点的边。我想知道谁是住在同一个城市的其他员工。 gremline 查询可能是: g.V.('id',1234).out('LIVES_IN_CITY').inE.outV 要获得上述结果,我正在使用 gremlinepipeline java api,但我无法正确迭代并获得结果。请建议我如何实现上述结果。
标签: titan tinkerpop tinkerpop-blueprint