Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USING PERIODIC COMMIT 5000 LOAD CSV WITH HEADERS
- FROM 'file:///article.txt' as r FIELDTERMINATOR 't'
- MATCH (a:Article {PMID: toInt(r.PMID)})
- WITH a, toLower(r.ArticleTitle) as text
- WITH a, reduce(t=text, delim in [",",".","!","?",'"',":",";","'","(",")","[","]","{","}"] | replace(t,delim," ")) as text
- WITH a, reduce(t=text, delim in ["/", "\"] | replace(t, delim, " ")) as text with a, filter(w in split(text, " ") where length(w) > 2) as words SET a.words = words;
- MATCH (a:Article) where exists(a.words)
- WITH a
- FOREACH (word in a.words|
- MERGE (w:Word {Name: word})
- MERGE (a) -[r:contains]-> (w)
- ON CREATE SET r.f = 1
- ON MATCH SET r.f = r.f + 1
- )
- CALL apoc.periodic.iterate('MATCH (a:Article) WHERE EXISTS(a.words) RETURN a as art','WITH {art} as a FOREACH (word in a.words | MERGE (w:Word {Name: word}) MERGE (a) -[r:contains]-> (w) ON CREATE SET r.f = 1 ON MATCH SET r.f = r.f + 1)', {batchSize:1000, parallel:true})
- batches total timeTaken committedOperations failedOperations failedBatches retries errorMessages batch operations wasTerminated
- 83 1233 2 573 82 82 0
- {
- }
- {
- "total": 83,
- "committed": 1,
- "failed": 82,
- "errors": {
- "java.lang.NullPointerException": 82
- }
- }
- {
- "total": 1233,
- "committed": 573,
- "failed": 82,
- "errors": {
- }
- }
- false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement