Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-04-2022 05:06 PM
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
;
",606024);
step2:
CALL apoc.periodic.repeat('title', "
CALL gds.graph.create(
'grapheme',
'User',
{
RELATIONSHIP: {orientation: 'UNDIRECTED'}}
)
;
",606024);
I can include the rest of the code if needed.
Thank you!
05-26-2022 07:30 AM
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 procedure doesn't work with some statements which return something · Issue ...
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):
CALL gds.graph.create(
'grapheme',
'User',
{RELATIONSHIP: {orientation: 'UNDIRECTED'}})
STEP 2 (apoc.periodic.repeat):
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)
All the sessions of the conference are now available online