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.

java.lang.IllegalArgumentException error

kanranmm
Node Link

I am trying to run the following code.

CALL gds.graph.create.cypher(
    'my-cypher-graph',
    'MATCH (n:Person) RETURN id(n) AS id',
    'MATCH (a:Person)-[:LIKES]->(b:Person) RETURN id(a) AS source, id(b) AS target'
)
YIELD graphName, nodeCount, relationshipCount, createMillis;

But I got this error: Neo.ClientError.Procedure.ProcedureCallFailed

Failed to invoke procedure gds.graph.create.cypher: Caused by: java.lang.IllegalArgumentException: Node-Query returned no nodes

Can you please help?

1 ACCEPTED SOLUTION

It's in the error message: your first query doesn't contain any nodes. Try running MATCH (n:Person) RETURN COUNT(n) to double check your cypher.

View solution in original post

2 REPLIES 2

It's in the error message: your first query doesn't contain any nodes. Try running MATCH (n:Person) RETURN COUNT(n) to double check your cypher.

kanranmm
Node Link

Thanks Alicia. You are right. This was happening because the db had 0 nodes. The gds.graph.create.cypher function actually does not CREATE the nodes.