reco4php icon indicating copy to clipboard operation
reco4php copied to clipboard

How to import users and items using PHP?

Open elfeffe opened this issue 9 years ago • 3 comments

In testing it's ok to import it manually, but how to import and update data automatically with code?

elfeffe avatar May 20 '17 15:05 elfeffe

Can you elaborate a bit more your question ?

ikwattro avatar May 22 '17 18:05 ikwattro

The documentation shows how to import the CSV using Cypher

LOAD CSV WITH HEADERS FROM "file:///Users/ikwattro/dev/movielens/movies.csv" AS row WITH row MERGE (movie:Movie {id: toInt(row.movieId)}) ON CREATE SET movie.title = row.title WITH movie, row UNWIND split(row.genres, '|') as genre MERGE (g:Genre {name: genre}) MERGE (movie)-[:HAS_GENRE]->(g)

This is not very clear that you can do the same using a normal "insert", I got confused because other systems use some API for inserts, but this is a normal insert or save in Neo4j

elfeffe avatar May 22 '17 18:05 elfeffe

Doing continuous imports of new data can be done with plain cypher using only the driver . You will have to code it depending your domain.

ikwattro avatar May 23 '17 05:05 ikwattro