LOAD CSV WITH HEADERS FROM "http://localhost:3333/songs.csv" AS line WITH line
CREATE (s:Song { id: toInt(line.id), title: line.title, url: line.url, image: line.image })
LOAD CSV WITH HEADERS FROM "http://localhost:3333/movies.csv" AS line WITH line
CREATE (m:Movie { id: toInt(line.id), title: line.title, url: line.url, image: line.image })
LOAD CSV WITH HEADERS FROM "http://localhost:3333/books.csv" AS line WITH line
CREATE (b:Book { id: toInt(line.id), title: line.title, url: line.url, image: line.image })
CREATE (u:User { username: 'icaromh' })
MATCH (u:User {username: 'icaromh'}), (m:Movie { id:138409202896344 })
MERGE (u)-[r:WATCHED]->(m)
RETURN u, m
MATCH (u:User {username: 'icaromh'}), (n:Song { id:138409202896344 })
MERGE (u)-[r:LISTENED]->(n)
RETURN u, n
MATCH (u:User {username: 'icaromh'}), (n:Book { id:138409202896344 })
MERGE (u)-[r:READ]->(n)
RETURN u, n
MATCH (u:User {username: 'icaromh'})-[r:WATCHED]->(m:Movie { id:138409202896344 })
DELETE r
RETURN u, m
MATCH
(me)-->(s)<--(p)
WHERE
me.username = 'icaromh'
WITH p, me, count(s) AS c
ORDER BY c DESC
MATCH
(p)--(n)
WHERE
NOT (me)--(n)
AND n:Book
RETURN n
The symbol --
means related to, without regard to type or direction of the relationship.
Third party scripts: