Hi,
I have to calculate the shortest path between 2 Nodes. I'm using Neo4J
2.2.5 from within Spring Data.
This is my code:
PathFinder<WeightedPath> finder = GraphAlgoFactory
.dijkstra(PathExpanders.forTypeAndDirection(RelationshipTypes.SEM_SIM,
Direction.BOTH),
Constants.ADVERTISED_COST);
WeightedPath path = finder.findSinglePath(startVertexNode, goalVertexNode);
The issue is how to get the Nodes. If I execute the query below:
Map<String, Object> params = new HashMap<String, Object>();
params.put( "id", 0 );
String query = "MATCH n WHERE id(n) = {id} RETURN n";
org.neo4j.ogm.session.result.Result result =
this.neo4jOperations.query(query, params);
I get to the correct data but how can I convert the Result into a Node? Or
is there a more elegant way to get to the Node parameters needed for the
finder.findSinglePath method?
Thanks in advance for helping me out!
Kind regards,
Johan,
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.