gpt4 book ai didi

java - 在java中的gremlin titan中过滤出边数的顶点

转载 作者:行者123 更新时间:2023-11-30 03:57:05 24 4
gpt4 key购买 nike

我想使用java中的gremlin查询和过滤titan中具有超过500个传出边的所有顶点...我该怎么做?我已经开始如下

    pipe=pipe.start(graph.getVertices());

最佳答案

然后你需要一个过滤功能

p.start(
g.getVertices()
.filter(new PipeFunction<Vertex,Boolean>() {
public Boolean compute(Vertex v) {
// write your logic here to count edges on the vertex and
// return true if over 500 and false otherwise
}));

在 Java 中使用 GremlinPipeline 描述更多 here

关于java - 在java中的gremlin titan中过滤出边数的顶点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22896129/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com