CALL apoc.periodic.iterate("
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/iamvarol/blogposts/main/medium/tennis/data.csv' AS row
WITH row, split(row.score, ' ') AS matchSets
WITH *, size(matchSets) AS setSize,
row.tourney\_name + '\_' + row.tourney\_year + '\_' + 'WTA' AS tournament\_id,
row.tourney\_name + '\_' + row.tourney\_year + '\_' + 'WTA' + '\_' + row.match\_num AS matchId
RETURN *
"
,
"
MERGE (t:Tournament {id: tournament_id})
ON CREATE SET t.name = row.tourney_name,
t.year \= toInteger(row.tourney\_year),
t.type \= 'wta'
MERGE (m:Match {id: matchId})
ON CREATE SET m.round = row.round,
m.score \= row.score,
m.year \= toInteger(row.tourney\_year)
MERGE (p1:Player {id: row.winner_id})
ON CREATE SET p1.name = row.winner_name,
p1.gender \= 'Female',
p1.hand \= row.winner\_hand,
p1.ioc \= row.winner\_ioc
MERGE (p2:Player {id: row.loser_id})
ON CREATE SET p2.name = row.loser_name,
p2.gender \= 'Female',
p2.hand \= row.loser\_hand,
p2.ioc \= row.loser\_ioc
MERGE (p1)-[:MATCH_WINNER]->(m)
MERGE (p2)-[:MATCH_LOSER]->(m)
MERGE (m)-[:IN_TOURNAMENT]->(t)
WITH *
UNWIND range(0, setSize-1) AS setNumber
FOREACH (set IN matchSets |
MERGE (s:Set {id: matchId + '\_' + setNumber + 1})
ON CREATE SET s.score \= matchSets\[setNumber\],
s.number \= setNumber +1
MERGE (s)-\[:IN\_MATCH\]->(m)
)
"
,
{batchSize:100, parallel:false}
)
Neo.ClientError.Procedure.ProcedureNotFound
There is no procedure with the name `apoc.periodic.iterate` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.