DELETE all relationships before creating new ones

Do you use a driver to send queries to your database?

UNWIND $events as event
MATCH (p:Person {id: event.id})-[r:LIKES]->(s)
DELETE (r)
UNION
UNWIND $events as event
FOREACH (song IN event.songdata |
    CREATE (p)-[:LIKES]->(s:Song {title: k.title}))