# SyntaxError: Unknown function 'algo.asNode'

**URL:** <https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668>\
**Category:** Graph Data Science / Graph Analytics\
**Tags:** cypher, knowledge-base\
**Created:** [April 17, 2019, 9:53am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668 "2019-04-17T09:53:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sucheta](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sucheta/32/4444_2.png) [@sucheta](https://community.neo4j.com/u/sucheta)\
**Post date:** [April 17, 2019, 9:53am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/1 "2019-04-17T09:53:36Z")

</div>

Hi,

While implementing this particular query from Jaccard Similiarity algorithm -

> MATCH (p:Organization)-[\*]-\>(cuisine)  
> WITH {item:id(p), categories: collect(id(cuisine))} as userData  
> WITH collect(userData) as data  
> CALL algo.similarity.jaccard.stream(data)  
> YIELD item1, item2, count1, count2, intersection, similarity  
> RETURN algo.asNode(item1).name AS from, algo.asNode(item2).name AS to, intersection, similarity  
> ORDER BY similarity DESC

```auto
Neo.ClientError.Statement.SyntaxError: Unknown function 'algo.asNode' (line 6, column 8 (offset: 251))
"RETURN algo.asNode(item1).name AS from, algo.asNode(item2).name AS to, intersection, similarity"

```

Please guide.

---

<div class="post-metadata">

**Author:** ![dominicvivek06](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dominicvivek06/32/5034_2.png) [@dominicvivek06](https://community.neo4j.com/u/dominicvivek06)\
**Post date:** [April 17, 2019, 10:09am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/2 "2019-04-17T10:09:00Z")

</div>

have you installed the library ?  
A detailed installation for Neo4j Desktop and Server is available in

[Algorithms Installation](https://neo4j.com/docs/graph-algorithms/current/introduction/#_installation)

---

<div class="post-metadata">

**Author:** ![sucheta](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sucheta/32/4444_2.png) [@sucheta](https://community.neo4j.com/u/sucheta)\
**Post date:** [April 17, 2019, 10:24am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/3 "2019-04-17T10:24:09Z")

</div>

I have added the Graph algorithms in my Neo4j desktop . And when i run -  
CALL algo.list()

I get the list but it doesn't have algo.asNode .

Error -

> Neo.ClientError.Statement.SyntaxError: Variable `asNode` not defined (line 1, column 16 (offset: 15))  
> "CALL algo.list(asNode)"

---

<div class="post-metadata">

**Author:** ![dominicvivek06](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dominicvivek06/32/5034_2.png) [@dominicvivek06](https://community.neo4j.com/u/dominicvivek06)\
**Post date:** [April 17, 2019, 10:33am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/4 "2019-04-17T10:33:54Z")

</div>

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

also, did you restart after installation ?

can you post the full query and schema ?

---

<div class="post-metadata">

**Author:** ![sucheta](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sucheta/32/4444_2.png) [@sucheta](https://community.neo4j.com/u/sucheta)\
**Post date:** [April 17, 2019, 11:19am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/5 "2019-04-17T11:19:16Z")

</div>

Hi,

The **dummy schema** is -\>

> //Company
> 
> CREATE (ic:Company { name: "IC", dealing: "Banking" })
> 
> //Department  
> Match (ic:Company) WHERE ic.name="IC"  
> Create (it:Department {name:"IT", company:"IC"}),  
> (ic)-[:Department]-\>(it)
> 
> //System  
> Match (it:Department) WHERE it.name="IT"  
> Create (mobile:System {name:"Mobile", company:"IC"}),  
> (it)-[:System]-\>(mobile)

And **Query** is -

`MATCH (p)-[*]->(ic) WITH {item:id(p), categories: collect(id(ic))} as userData WITH collect(userData) as data CALL algo.similarity.jaccard.stream(data) YIELD item1, item2, count1, count2, intersection, similarity RETURN algo.asNode(item1).name AS from, algo.asNode(item2).name AS to, intersection, similarity ORDER BY similarity DESC `

**Image -**

 ![asNode](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/8/83aa72b21a6ca47f465670b66773bf0a6804fe4a.png)

---

<div class="post-metadata">

**Author:** ![andrew\_bowman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andrew_bowman/32/73_2.png) [@andrew\_bowman](https://community.neo4j.com/u/andrew_bowman)\
**Post date:** [April 17, 2019, 2:20pm UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/6 "2019-04-17T14:20:13Z")

</div>

Which version of Neo4j and which version of the Graph Algo library do you have installed? It could be that you are using a version before this function was added.

---

<div class="post-metadata">

**Author:** ![sucheta](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sucheta/32/4444_2.png) [@sucheta](https://community.neo4j.com/u/sucheta)\
**Post date:** [April 18, 2019, 12:19pm UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/7 "2019-04-18T12:19:00Z")

</div>

Thanks Andrew !. I replaced the  
[1]  
apoc and graph algorithm jars from plugins folder of neo4j and even made changes in the

[2] neo4j config file - neo4j.conf -

```auto
dbms.security.procedures.unrestricted=algo.*,apoc.*

```

---

<div class="post-metadata">

**Author:** ![ameyasoft](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ameyasoft/32/32639_2.png) [@ameyasoft](https://community.neo4j.com/u/ameyasoft)\
**Post date:** [April 19, 2019, 8:28pm UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/8 "2019-04-19T20:28:49Z")

</div>

I also see that algo.asNode is missing in the algorithms library. Checked versions 3.5.0.1 and 3.5.4.0. Desktop version 1.1.21 and browser 3.2.19. Please let us know which algorithms version has algo.asNode(s).  
Thanks

---

<div class="post-metadata">

**Author:** ![sucheta](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sucheta/32/4444_2.png) [@sucheta](https://community.neo4j.com/u/sucheta)\
**Post date:** [April 20, 2019, 4:07am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/9 "2019-04-20T04:07:14Z")

</div>

Hey ameya,

Graph Algorithm version - 3.5.4.0

Apoc Algorithm version - 3.5.0.3

has algo.asNode

---

<div class="post-metadata">

**Author:** ![ameyasoft](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ameyasoft/32/32639_2.png) [@ameyasoft](https://community.neo4j.com/u/ameyasoft)\
**Post date:** [April 20, 2019, 4:41am UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/10 "2019-04-20T04:41:34Z")

</div>

Thanks for the info.

---

<div class="post-metadata">

**Author:** ![strato.bayitaa](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/strato.bayitaa/32/134_2.png) [@strato.bayitaa](https://community.neo4j.com/u/strato.bayitaa)\
**Post date:** [May 28, 2019, 2:40pm UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/11 "2019-05-28T14:40:07Z")

</div>

Hello @sucheta can you assist me with the detailed information on the exact changes you made? For example which version of apoc and graphalgorithm jars did you replace with the previous ones in the plugins folder. I am facing the same problem and using Neo4j Desktop 1.1.10, existing Apoc (apoc-3.4.0.1), GraphAlgorithm (graphAlgorithms-3.4.0.0), GraphQL (graphQL-3.4.0.1). Thanks in anticipation.

---

<div class="post-metadata">

**Author:** ![andrew\_bowman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andrew_bowman/32/73_2.png) [@andrew\_bowman](https://community.neo4j.com/u/andrew_bowman)\
**Post date:** [May 28, 2019, 9:29pm UTC](https://community.neo4j.com/t/syntaxerror-unknown-function-algo-asnode/6668/12 "2019-05-28T21:29:35Z")

</div>

Since you're using Neo4j Desktop, you should be able to go to the Plugins tab of the database instance in question, uninstall with a click the previously installed plugins, then the install button will install the latest version of the plugin that is correct for your version of Neo4j. If it doesn't install a new enough version, then the version of Neo4j you're using for that db instance is too old, and you'll want to either use a database instance with a newer Neo4j version (or upgrade your current version to a newer version) which will allow you to install newer versions of the plugins.
