gpt4 book ai didi

gremlin - 我们能否在 JanusGraph 中找到图中可用的所有标签?

转载 作者:行者123 更新时间:2023-12-02 15:01:05 25 4
gpt4 key购买 nike

我想获取图表中所有可用标签的列表,但我不知道架构。有没有办法找出所有标签的列表?

我尝试了以下方法:

g.V().Label().values()
g.V().hasLabel().values()

但它们不起作用。

最佳答案

在 Gremlin 中你会做:

g.V().label().dedup()

但这需要扫描图中的所有顶点,这会很昂贵。 JanusGraph 具有您可以使用 JanusGraphManagement 类查询的架构。

JanusGraphManagement mgmt = graph.openManagement();
Iterable<VertexLabel> labels = mgmt.getVertexLabels();

关于gremlin - 我们能否在 JanusGraph 中找到图中可用的所有标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49400799/

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