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

How to calculate the PageRank and shortest path algorithm with gremlin in Amazon Neptune?

有什么方法可以在 Amazon Neptune 中使用 gremlin 计算 PageRankShortest 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遍历吗?

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

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