neo4j / graph-data-science

Source code for the Neo4j Graph Data Science library of graph algorithms.
https://neo4j.com/docs/graph-data-science/current/
Other
618 stars 161 forks source link

Error finding shortest path using gds.alpha.shortestPath.stream #68

Closed nslayer closed 4 years ago

nslayer commented 4 years ago

I have neo4j-graph-data-science-1.2.2-standalone.jar in the plugins folder. I am not sure if I am missing any other plugins.

I am running the following code on cypher-shell from the Graph Algorithms book.

MATCH (source:Place {id: "Amsterdam"}),
(destination:Place {id: "London"})
CALL gds.alpha.shortestPath.stream({
startNode: source,
endNode: destination,
nodeProjection: "*",
relationshipProjection: {
all: {
type: "*",
orientation: "UNDIRECTED"
}
}
})
YIELD nodeId, cost
WITH collect(gds.util.asNode(nodeId)) AS path
UNWIND range(0, size(path)-1) AS index
WITH path[index] AS current, path[index+1] AS next
WITH current, next, [(current)-[r:EROAD]-(next) | r.distance][0] AS distance
WITH collect({current: current, next:next, distance: distance}) AS stops
UNWIND range(0, size(stops)-1) AS index
WITH stops[index] AS location, stops, index
RETURN location.current.id AS place,
reduce(acc=0.0,
distance in [stop in stops[0..index] | stop.distance] |
acc + distance) AS cost;

get this error: Failed to invoke proceduregds.alpha.shortestPath.stream: Caused by: java.lang.ClassNotFoundException: org.neo4j.kernel.extension.KernelExtensionFactory

vnickolov commented 4 years ago

Hi @nslayer thank you for reporting this.

Please note that the GDS version you are using - 1.2.2 does not support Neo4j 4.1. There is upcoming 1.3.0 with added support for Neo4j 4.1, preview release (RC) can be found at the Neo4j Download center.

vnickolov commented 4 years ago

@nslayer the 1.3.0 versions has just been released, it should be available for Neo4j 4.1.0 in Neo4j Desktop.

Also can be downloaded here: https://neo4j.com/download-center/

Can you please give it a try and let us know if the issue still exist.

nslayer commented 4 years ago

works fine with 1.3.0 jar. thanks