0
votes

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 I am running Neo4J 4.1.0

Can you please help?

2

2 Answers

0
votes

This was happening because the db had 0 nodes. The gds.graph.create.cypher function actually does not CREATE the nodes. So this question is answered. Thanks.

0
votes

#Check for appropriate version for neo4j and GDS library from that git file

https://github.com/neo4j/graph-data-science

# first create a node and relationship

create (:Person{name:"Oliver Stone"})-[:LIKE]->(:Person{name:"Karan Kajrolkar"})

#Then try to create native projection

CALL gds.graph.create( 'my-native-graph', 'Person', 'LIKE' ) YIELD graphName, nodeCount, relationshipCount, createMillis;

#O/P

graphName|nodeCount|relationshipCount|createMillis|

"my-native-graph"|2 |1|51|