cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Invalid input ')': expected whitespace

ok so im trying to import a large csv into Neo4j, Its full news article and meta data per row

I am trying to get all of this into 1 node on the graph with the article as the primary and then metadata as the properties, in theory i want to NLP the article to get "fact" extraction and have the meta data travel with it.

LOAD CSV WITH HEADERS FROM 'file:///all.csv' AS row

WITH row.raw_text AS article, row.date AS date, row.author AS author, row.description AS description, row.title AS title, row.url AS url, row.tags AS tags, row.sitename AS sitename, row.author AS author,

MERGE (a:article {article: article})

SET a.date = date, a.author = author, a.url = url, a.tags = tags, a.sitename = sitename, a.title = title

LIMIT 5;

Is throwing error

Invalid input ')': expected whitespace or a relationship pattern (line 3, column 36 (offset: 291))
"MERGE (a:article {article: article})"

I have been copy/pasting so i dont know where the formating error could have come from??

1 ACCEPTED SOLUTION

Hi @shiva27shiva !

I think you are missing article on your first WITH.

Another thing, you dont need to open all the properties before the set. You can do something like:

LOAD CSV WITH HEADERS FROM 'file:///all.csv' AS row
WITH row //LIMIT 5
MERGE (a:article {article: row.article})
SET a += row { .date, .author, .url, .tags, .sitename, .title}

Bennu

Oh, y’all wanted a twist, ey?

View solution in original post

2 REPLIES 2

Hi @shiva27shiva !

I think you are missing article on your first WITH.

Another thing, you dont need to open all the properties before the set. You can do something like:

LOAD CSV WITH HEADERS FROM 'file:///all.csv' AS row
WITH row //LIMIT 5
MERGE (a:article {article: row.article})
SET a += row { .date, .author, .url, .tags, .sitename, .title}

Bennu

Oh, y’all wanted a twist, ey?

That got it to load thank you so much for the help. Tune in next week for my next beginner questions

Thanks