# Apoc.periodic.iterate - syntax error or something more fundamental?

**URL:** <https://community.neo4j.com/t/apoc-periodic-iterate-syntax-error-or-something-more-fundamental/7111>\
**Category:** Procedures & APOC\
**Tags:** apoc\
**Created:** [May 3, 2019, 3:41pm UTC](https://community.neo4j.com/t/apoc-periodic-iterate-syntax-error-or-something-more-fundamental/7111 "2019-05-03T15:41:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![douglasf001](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/douglasf001/32/2730_2.png) [@douglasf001](https://community.neo4j.com/u/douglasf001)\
**Post date:** [May 3, 2019, 3:41pm UTC](https://community.neo4j.com/t/apoc-periodic-iterate-syntax-error-or-something-more-fundamental/7111/1 "2019-05-03T15:41:35Z")

</div>

Dear all,  
I have a script that intends to score the similarity between nodes and then, using apoc.peridoc.iterate, create a relationship between each pair of nodes where the relationship has a property of the Jacquard similarity score.

I am getting a syntax error message for an unexpected apostophe but, because I can't fix it, can't help but think that there is something fundamentally wrong with the script and my newbie grasp of Cypher and interpreting supporting documentation.  
Here is the script I am using...  
\<CALL apoc.periodic.iterate("  
Match (p1:Logical\_Business\_Process)-[:read|:write|:read\_write]-(e1:Entity\_Type)  
WITH p1, collect(id(e1)) AS p1entity\_type  
MATCH (p2:Logical\_Business\_Process)-[:read|:write|:read\_write]-(e2:Entity\_Type) WHERE p1 \<\> p2  
WITH p1, p1entity\_type, p2, collect(id(e2)) AS p2entity\_type  
RETURN p1.Name AS from,  
p2.Name AS to,  
algo.similarity.jaccard(p1entity\_type, p2entity\_type) AS similarity  
","  
CREATE (p1:Logical\_Business\_Process)-[r:has\_similarity\_with {Name: p1 + ‘-\>’ + p2.Name, Jacquard\_similarity\_score: similarity}]-\>(p2:Logical\_Business\_Process) RETURN r.Name, r.Jacquard\_similarity\_score  
",  
{batchSize:10000, parallel:true}  
)\>

The ultimate goal is that I am wanting to be able to create a visual of clusters of nodes (the nodes represent business processes) that have a high Jaccard Similarity score in order that I can scope a suite of projects according to similarity of business processes. Would this be a suitable topic for the "Projects & Collaboration" board? I didn't spot anything similar there.

Kind regards, Douglas

---

<div class="post-metadata">

**Author:** ![ryan.boyd](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ryan.boyd/32/60_2.png) [@ryan.boyd](https://community.neo4j.com/u/ryan.boyd)\
**Post date:** [May 4, 2019, 11:56pm UTC](https://community.neo4j.com/t/apoc-periodic-iterate-syntax-error-or-something-more-fundamental/7111/2 "2019-05-04T23:56:47Z")

</div>

Hi Douglas,

Love the idea! Definitely welcome to post it in your projects and collaboration category, but suggest writing up a bit more about the business value you're looking to accomplish with the clustering and how you'll test, etc.

It looks like you're using straight double quotation marks, but curly/smart quotes for your single quotes. That's likely the cause of the syntax error and something I've experienced a few times myself, especially when copying and pasting from a text editor.

Cheers,  
-Ryan

---

<div class="post-metadata">

**Author:** ![ryan.boyd](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ryan.boyd/32/60_2.png) [@ryan.boyd](https://community.neo4j.com/u/ryan.boyd)\
**Post date:** [May 4, 2019, 11:57pm UTC](https://community.neo4j.com/t/apoc-periodic-iterate-syntax-error-or-something-more-fundamental/7111/3 "2019-05-04T23:57:33Z")

</div>

Also would be great if you'd introduce yourself @douglasf001 - [Introduce-Yourself - Neo4j Online Community](https://community.neo4j.com/c/general/introduce-yourself)

---

<div class="post-metadata">

**Author:** ![douglasf001](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/douglasf001/32/2730_2.png) [@douglasf001](https://community.neo4j.com/u/douglasf001)\
**Post date:** [May 6, 2019, 4:22pm UTC](https://community.neo4j.com/t/apoc-periodic-iterate-syntax-error-or-something-more-fundamental/7111/4 "2019-05-06T16:22:25Z")

</div>

Thanks for the advice. I have now introduced myself and teed up the topic for collaboration.

![](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/2/2485d26919316b1d80aa60f5ca8e2cb5bc0275fe.jpeg)
