Search code examples
neo4jnode-centrality

Why is Neo4j not recognizing the degree centrality query?


For some reason Neo4j is not recognizing degree centrality on a projection in GDS. I run this query:

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

I then get this error message:

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.

That doesn't make sense to me because Neo4j says in its documentation that's what should be used. GDS is installed, and I've had no problem running other centrality measures -- PageRank, betweenness and closeness. I even tried doing a ctrl-c, ctrl-v right from the Neo4j documentation to ensure I wasn't mistyping something. Are there any other plugins that need to be installed? I have APOC and GDS installed but nothing else.

I realize degree is simple enough I could just do this via regular Cypher, but I'm curious why this isn't working.


Solution

  • What version of GDS do you have installed? The signature of the procedure might not match the documentation you are using. Run this query to check.

    RETURN gds.version()
    

    You can also run this query to see any procedure that you have installed that includes the word degree.

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

    If you have an older version of Neo4j, SHOW PROCEDURES is not supported. Use this query instead.

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

    Degree centrality was promoted to the product tier with GDS version 1.6.0. If you are using an older version of GDS, you should refer to this documentation. https://neo4j.com/docs/graph-data-science/1.1/algorithms/degree-centrality/