cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Measure Degree Centrality

Hello everybody,

I am fairly new to neo4j and created a first dataset with two types of nodes and various edges. Now I am trying to measure the degree centrality but I am not able to run the query from the guide. I am using version 4.4.5 and have these plugins isntalled and activated: APOC 4.4.0.6; Graph Data Science Library 2.0.3; Neo4jStreams 4.1.2, and Neosemantics (n10) 4.4.01.

I tried to run the follwoing query:

CALL gds.degree.stream(
graphName: String,
configuration: Map
) YIELD
nodeId: Integer,
score: Float

and I got the following error:

Neo.ClientError.Statement.SyntaxError

Invalid input ':': expected
  ","
  "AS"
  "CALL"
  "CREATE"
  "DELETE"
  "DETACH"
  "FOREACH"
  "LOAD"
  "MATCH"
  "MERGE"
  "OPTIONAL"
  "REMOVE"
  "RETURN"
  "SET"
  "UNION"
  "UNWIND"
  "USE"
  "WHERE"
  "WITH"
  <EOF> (line 5, column 9 (offset: 82))
"  nodeId: Integer,"
         ^

I would by grateful for any help or link to a step-by-step tutorial. I only found some tutorials for other algorythms (algo), which are not supported by my version.

Thanks in advance for any help.

2 REPLIES 2

The code you executed is not valid cypher.  It is defining the syntax of the command. ‘GraphName:String’ is stating the first parameter is named ‘grapgString’ and its type is a string. The second parameter is defined as a map. The values following ‘yield’ are defying the outputs of the procedure. 

it looks like that example is showing the syntax. I guess the intent is for you to be able to copy and paste it as your staring point. 

CA1162D7-7771-4263-A765-34560B078543.jpeg

Look further down the page for a concrete example. 

4DC29794-0DE9-48D1-8027-134EC1417F3C.jpeg

https://neo4j.com/docs/graph-data-science/current/algorithms/degree-centrality/#algorithms-degree-ce...

Thank you! I have looked it up and now it is working.

The problem was the wrong command as you pointed out and that I did not creat e a graph.project before using the command.