Java 小精灵获得每个循环的第一个顶点
我在这样的图中循环: 像这样的小精灵,宽度第一Java 小精灵获得每个循环的第一个顶点,java,gremlin,Java,Gremlin,我在这样的图中循环: 像这样的小精灵,宽度第一 pipe.start(unProcessed) .as("x") .bothE() .as("existingEdge") .bothV() .hasNot("processed",true) .loop("x", new PipeFunction<Lo
pipe.start(unProcessed)
.as("x")
.bothE()
.as("existingEdge")
.bothV()
.hasNot("processed",true)
.loop("x", new PipeFunction<LoopPipe.LoopBundle<Vertex>, Boolean>() {
public Boolean compute(LoopPipe.LoopBundle<Vertex> loopBundle) {
return true;
}
}, new PipeFunction<LoopPipe.LoopBundle<Vertex>, Boolean>() {
public Boolean compute(LoopPipe.LoopBundle<Vertex> loopBundle) {
return true;
}
})
.as("newVertex")
.select(Arrays.asList("x","newVertex"));
我想要的是循环迭代开始时的顶点,以及下一个顶点。所以我想看到的结果是
A、 B
公元前
B、 D
B、 E
C、 F
D、 F
然而,我得到的是:
A、 B
A、 C
A、 D
A、 E
A、 F
A、 F
看起来管道中的x总是管道中的第一个顶点,而不是循环迭代中的第一个顶点,这就是我想要的
看起来这应该很容易,我缺少一些简单的东西,但我找不到。需要的是一个uu或identitype
.as("x")
._()
.as("firstVertex")
这就是我的工作