# Apoc.periodic.repeat with node similarity

**URL:** <https://community.neo4j.com/t/apoc-periodic-repeat-with-node-similarity/55782>\
**Category:** Procedures & APOC\
**Created:** [May 5, 2022, 12:06am UTC](https://community.neo4j.com/t/apoc-periodic-repeat-with-node-similarity/55782 "2022-05-05T00:06:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hlow](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/hlow/32/23436_2.png) [@hlow](https://community.neo4j.com/u/hlow)\
**Post date:** [May 5, 2022, 12:06am UTC](https://community.neo4j.com/t/apoc-periodic-repeat-with-node-similarity/55782/1 "2022-05-05T00:06:32Z")

</div>

Hi,  
I'm trying to use apoc.periodic.repeat to recalculate the similarity score everyday, but it doesn't seem to be working. My code works when I don't throw it in apoc though.

Could this be due to an incompatibility issue with apoc and the GDS library?

example:  
step1:  
CALL apoc.periodic.repeat('title', "  
CALL gds.graph.drop('grapheme')  
YIELD graphName, modificationTime  
;  
",60_60_24);

step2:  
CALL apoc.periodic.repeat('title', "

CALL gds.graph.create(  
'grapheme',  
'User',  
{  
RELATIONSHIP: {orientation: 'UNDIRECTED'}}  
)  
;  
",60_60_24);

I can include the rest of the code if needed.  
Thank you!

---

<div class="post-metadata">

**Author:** ![giuseppe\_villan](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/giuseppe_villan/32/11871_2.png) [@giuseppe\_villan](https://community.neo4j.com/u/giuseppe_villan)\
**Post date:** [May 26, 2022, 2:30pm UTC](https://community.neo4j.com/t/apoc-periodic-repeat-with-node-similarity/55782/2 "2022-05-26T14:30:29Z")

</div>

@hlow

It seems the `apoc.periodic.repeat` procedure with a statement containing other procedures (not all anyway), doesn't work if something is returned.

I just created an issue for this [The apoc.periodic.repeat and apoc.periodic.sumbit procedures don't work with some statements which return something · Issue #2942 · neo4j-contrib/neo4j-apoc-procedures · GitHub](https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/2942)

  

However, waiting for the fix, you could use this bad but working workaround,  
that is, by adding `create (n:ToDelete) delete n` to return nothing at the end of the query.

STEP 1 (creation, if not executed):

```auto
CALL gds.graph.create(
'grapheme',
'User',
{RELATIONSHIP: {orientation: 'UNDIRECTED'}}) 

```

  

STEP 2 (apoc.periodic.repeat):

```auto
CALL apoc.periodic.repeat('myJob', "CALL gds.graph.drop('grapheme') 
yield graphName with graphName as ignore // just to concat drop with create
CALL gds.graph.create(
'grapheme',
'User',
{RELATIONSHIP: {orientation: 'UNDIRECTED'}}) yield graphName 
create (n:ToDelete) delete n // to return nothing
", 86400000)

```

  
Note that i joined drop and create into a single statement to avoid potential errors (drop before creation and vice-versa).
