Neo4j creating relationships using csv -
I am trying to create a connection between the 2 types of nodes using the loaded csv file. I have already created all the movies and keyword nodes. I also create an index: movie (title) and: keyword (word).
My CSV file looks like this:
"title" | Year | "Word" / / header
"in the wild" | 2007. "1990", // title with title, year and keyword
"in the wild". 2007. "Deleter-Bus" / P>
My query:
with "files: / home / gdidil / temp csv" with loaders cd AS csv FIELDTERMINATOR '|' Match (M: Movie {Title: CSV Tetall, Year: toInt (csv.year)}), (K: Keyword {word: csv.word}) Merge (m) - [: is {weight: 1}] - & Gt; (K);
The query runs for approximately one hour and shows error "unknown error" from whether the unnecessary error details.
I thought it was due to 160 keywords and more than 1m movies and 4M lines in CSV. That's why I reduced CSV to just one line and it's still running for about 15 minutes.
Where's the problem? 2 How to write a query to make a connection between the nodes already created?
I can also remove all the nodes and make my database in another way but it will not be all that good made nodes.
Note: My hardware should not be a problem because I use Super Pc from our faculty.
Ensure that schema is indexed to speed up the initial nodes, do one before importing:
current index: movie (title) index Make: Keywords (words)
Be sure to have indexed populations and online (: schema
Check with the command.).
To use the index, refactor your cipher command in two questions - now only label and one property in an index:
"File: /home/gondil/temp.csv" AS CSV FIELDTERMINATOR '|' Use the permanent frontier load CSV with headquarters to merge (M: Movie {title: csv.title}) Set mear = toInt (csv.year) merge (k: keyword {word: csv.word} )
File to second pass
FILEDTERMINATOR '|' with CD from "File: Home / Gandel / Temp CSV" MATCH (M: Movie {Title: CSV.Tetlet}} Match (K: Keywords (word: csv. Words)) Merge (m) - [: (weight: 1)] -> (K);
Comments
Post a Comment