Hi ,
I'm new to cypher. I'm trying to import json data with the format
{
"playlists":[{
"tracks":[
{
"track_name":"name",
"artist_name":"artist_name",
"album_name":"album_name"
},
{
"track_name":"name2",
"artist_name":"name2",
"album_name":"name2"
}]
}]
}
im trying to use a cypher like this
UNWIND ['playlist1.json'] as filename
CALL apoc.load.json(filename) YIELD value AS v
WITH v.playlists as mainlist
UNWIND mainlist as playlist
WITH playlist
MERGE (Playlist:Playlist {name: playlist.name})
FOREACH (track in playlist.tracks | MERGE(track:Track{name:track.name})
| MERGE (Playlist)-[:CONTAINS]->(ar:Artist {name: track.artist_name})
| MERGE (Playlist)-[:CONTAINS]->(al:Album{name:album_name)
| MERGE(track.ar-[:RECORDED_FOR]->track.al))
But i'm unable to create the recorded_for relationship due to error. Can someone help me with teh data import ?