# Help converting examples to GDS library

**URL:** <https://community.neo4j.com/t/help-converting-examples-to-gds-library/16650>\
**Category:** Graph Data Science / Graph Analytics\
**Created:** [April 3, 2020, 5:54pm UTC](https://community.neo4j.com/t/help-converting-examples-to-gds-library/16650 "2020-04-03T17:54:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![janekdb](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/janekdb/32/10278_2.png) [@janekdb](https://community.neo4j.com/u/janekdb)\
**Post date:** [April 3, 2020, 5:54pm UTC](https://community.neo4j.com/t/help-converting-examples-to-gds-library/16650/1 "2020-04-03T17:54:15Z")

</div>

How can I find out how to convert the Cypher examples using the Graph Algorithms library to using the new GDS library?

So far I have the GDS library installed in Neo4j 3.5.17 using Neo4j Desktop 1.2.6. I could not figure out how to install GDS with Neo4j 4.0.3. Reading through the discussions here makes me think I should be moving forward with the Graph Data Science library instead of trying to solve the library installation problem I have with the earlier Graph Algorithms library.

When I try this example from the book with my own guesswork conversion to use GDS,

```auto
MATCH (source:Place {id: "Amsterdam"}), (destination:Place {id: "London"})
CALL gds.alpha.shortestPath.stream(source, destination, null) YIELD nodeId, cost
RETURN gds.getNodeById(nodeId).id AS place, cost

```

I get this error,

```auto
Procedure call provides too many arguments: got 3 expected no more than 2.

Procedure gds.alpha.shortestPath.stream has signature: gds.alpha.shortestPath.stream(graphName :: ANY?, configuration = {} :: MAP?) :: nodeId :: INTEGER?, cost :: FLOAT?
meaning that it expects at least 1 argument of type ANY?
Description: The Shortest Path algorithm calculates the shortest (weighted) path between a pair of nodes using the Dijkstra algorithm. (line 1, column 81 (offset: 80))
"MATCH (source:Place {id: "Amsterdam"}),
(destination:Place {id: "London"})
CALL gds.alpha.shortestPath.stream(source, destination, null) YIELD nodeId, cost
RETURN gds.getNodeById(nodeId).id AS place, cost"

```

I am sure I will get better at understading Cypher error messages but until then if anyone can suggest what I need to do or understand to use GDS that would be great!

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/7/71953765ea25bfa0f379360135b302b273bd190f.png)

---

<div class="post-metadata">

**Author:** ![alicia.frame](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/alicia.frame/32/4507_2.png) [@alicia.frame](https://community.neo4j.com/u/alicia.frame)\
**Post date:** [April 3, 2020, 8:12pm UTC](https://community.neo4j.com/t/help-converting-examples-to-gds-library/16650/2 "2020-04-03T20:12:48Z")

</div>

We have a migration guide here: [Migration from Graph Data Science library Version 1.x - Neo4j Graph Data Science](https://neo4j.com/docs/graph-data-science/current/appendix-b/)

It explains how to convert the syntax from the graph algorithms library over to the GDS.

For the book specifically, the fabulous @tomaz.bratanic published a blog post that detailed converting the graph algorithms from the book to GDS: [Preview of the Neo4j Graph Data Science plugin with examples from the “Graph Algorithms: Practical Examples in Apache Spark and Neo4j” book | by Tomaz Bratanic | Towards Data Science](https://towardsdatascience.com/introducing-the-neo4j-graph-data-science-plugin-with-examples-from-the-graph-algorithms-19b831f66f2)

---

<div class="post-metadata">

**Author:** ![janekdb](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/janekdb/32/10278_2.png) [@janekdb](https://community.neo4j.com/u/janekdb)\
**Post date:** [April 5, 2020, 9:25pm UTC](https://community.neo4j.com/t/help-converting-examples-to-gds-library/16650/3 "2020-04-05T21:25:19Z")

</div>

Many thanks! Tomaz's article looks very useful.

---

<div class="post-metadata">

**Author:** ![timkofu](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/timkofu/32/9239_2.png) [@timkofu](https://community.neo4j.com/u/timkofu)\
**Post date:** [August 19, 2020, 12:13pm UTC](https://community.neo4j.com/t/help-converting-examples-to-gds-library/16650/4 "2020-08-19T12:13:12Z")

</div>

Are there plans for a Neo4j only GDS version of the book?

---

<div class="post-metadata">

**Author:** ![alicia.frame](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/alicia.frame/32/4507_2.png) [@alicia.frame](https://community.neo4j.com/u/alicia.frame)\
**Post date:** [August 19, 2020, 5:23pm UTC](https://community.neo4j.com/t/help-converting-examples-to-gds-library/16650/5 "2020-08-19T17:23:29Z")

</div>

We've just recently updated the book so it uses the Syntax from the GDS library -- you should be able to download an updated copy here: [Neo4j Graph Data Science | Graph Algorithms and ML | Graph Analytics](https://neo4j.com/graph-algorithms-book/)
