为什么 Neo4j 无法识别度中心性查询?

Why is Neo4j not recognizing the degree centrality query?

出于某种原因,Neo4j 无法识别 GDS 中投影的度中心性。我 运行 这个查询:

CALL gds.degree.stream('influence_graph', { relationshipWeightProperty: 'score' })
YIELD nodeId, score
RETURN gds.util.asNode(nodeId).name AS name, score AS followers
ORDER BY followers DESC, name DESC

然后我收到此错误消息:

There is no procedure with the name `gds.degree.stream` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.

这对我来说没有意义,因为 Neo4j 在其 documentation 中说这是应该使用的。 GDS 已安装,运行我没有遇到其他中心性度量的问题——PageRank、介数和紧密度。我什至尝试直接从 Neo4j 文档中按 ctrl-c、ctrl-v 来确保我没有输入错误。还有其他插件需要安装吗?我安装了 APOC 和 GDS,但没有安装其他东西。

我知道学位很简单,我可以通过普通的 Cypher 来完成,但我很好奇为什么这不起作用。

您安装的是什么版本的 GDS?该过程的签名可能与您使用的文档不匹配。 运行 这个查询要检查。

RETURN gds.version()

您还可以 运行 此查询来查看您安装的任何包含单词 degree 的程序。

SHOW PROCEDURES YIELD name 
WHERE name CONTAINS 'degree'
RETURN name
ORDER BY name

如果您使用的是旧版本的 Neo4j,则不支持 SHOW PROCEDURES。请改用此查询。

CALL dbms.procedures() YIELD name
WHERE name CONTAINS 'degree'
RETURN name
ORDER BY name

在 GDS 版本 1.6.0 中,度中心性提升到了产品层级。如果您使用的是旧版本的 GDS,则应参考此文档。 https://neo4j.com/docs/graph-data-science/1.1/algorithms/degree-centrality/