如何在 Amazon Neptune 中使用 gremlin 计算 PageRank 和最短路径算法?

问题描述 投票:0回答:1

有没有办法在 Amazon Neptune 中使用 gremlin 计算

PageRank
Shortest Path
算法? 正如 gremlin 文档中所述
PageRank centrality can be calculated with Gremlin with the pageRank()-step which is designed to work with GraphComputer (OLAP) based traversals

我尝试通过以下代码使用 gremlinpython 创建遍历:

g = graph.traversal().withComputer().withRemote(remoteConn)
但我收到了此错误:
GremlinServerError: 499: {"code":"UnsupportedOperationException","requestId":"4493df8b-b09f-47b1-b230-b83cfe1afa76","detailedMessage":"Graph does not support graph computer"}

那么是否可以在 Amazon Neptune 中使用 GraphComputer 遍历?

gremlin amazon-neptune gremlinpython
1个回答
1
投票

Amazon Neptune 目前不支持 Apache TinkerPop GraphComputer 接口。您有几个选择。

  1. 在某些情况下,可以使用 Gremlin Recipes 文档中的示例查询来计算连接组件等。
  2. 使用 Neptune Export 工具导出数据,并使用 Spark 运行您需要执行的分析(Glue 和 EMR 是不错的选择)。这在今天很常见。
  3. 对于中等大小的数据集,您可以将数据导入 NetworkX 并从 Jupyter Notebook 运行分析。

更新2024-01-29

2023 年 12 月,Neptune Analytics 发布。它支持内置算法,包括 PageRank 和最短路径计算。算法的文档位于here

© www.soinside.com 2019 - 2024. All rights reserved.