CALL apoc.periodic.iterate( " MATCH (ya:YoutubeAsset)-[:APPEARS_IN_VIDEO]->(:Video) WHERE NOT (ya)<-[:REPRESENTS]-(:GlobalSoundRecording) MATCH (gsr:GlobalSoundRecording {isrc: ya.isrc}) RETURN ya, gsr ", " WITH *, 'python-neo4j-cypher-scheduler/augment-metadata/missing-youtube-asset-gsr-link' AS by MERGE (ya)<-[r:REPRESENTS]-(gsr) ON CREATE SET r.createdAt = datetime(), r.createdBy = by ", {batchSize:100, iterateList:true, parallel:false} ) YIELD total, failedOperations, errorMessages CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)]) RETURN total;