Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-27-2019 02:29 AM
Hello Everyone,
I can't figure out what I am doing wrong.
I am attempting to create the following import but receive the following error (see attachment):
CALL apoc.load.json("file:/users/james/Desktop/desktop/keepa/Product_Finder.2019_10_12_Cleaned.json") YIELD value
WITH value AS v
MERGE(t:Toy {ASINnr:v.ASIN})
SET t.ProductName = v.Title,
t.Height = v.'Item: Height (cm)',
t.Length = v.'Item: Length (cm)',
t.Width = v.'Item: Width (cm)',
t.Dimension = v.'Item: Dimension (cm³)',
t.modelNr = v.Model,
t.Category = "Toys & Games",
t.SalesRank = v.'Sales Rank: Current',
t.Weight = v.'Item: Weight (g)',
t.Brand = v.Brand
RETURN t
10-27-2019 07:23 AM
does it work if you use subscript notation:
....
t.Length = v['Item: Length(cm)'],
...
(of course for all accesses on v
) ?
10-27-2019 07:30 AM
Hello Stefan,
I tried as you said and got the exact same error.
Also where can read more about subscript notations in Neo4j?
I am new to Neo4j (3-4 months)
Thank you for responding.
Kind regards
10-28-2019 06:59 AM
Can you try replaced the single quotes with back ticks?
CALL apoc.load.json("file:/users/james/Desktop/desktop/keepa/Product_Finder.2019_10_12_Cleaned.json") YIELD value
WITH value AS v
MERGE(t:Toy {ASINnr:v.ASIN})
SET t.ProductName = v.Title,
t.Height = v.`Item: Height (cm)`,
t.Length = v.`Item: Length (cm)`,
t.Width = v.`Item: Width (cm)`,
t.Dimension = v.`Item: Dimension (cm³)`,
t.modelNr = v.Model,
t.Category = "Toys & Games",
t.SalesRank = v.`Sales Rank: Current`,
t.Weight = v.`Item: Weight (g)`,
t.Brand = v.Brand
RETURN t
10-28-2019 07:16 AM
Hello Mark,
You are razor sharp!!!!!
It worked. I just learned about using back ticks, and thought I used it, but as you clearly realized, those were single quotes. This lesson I will always remember for the rest of my career every time I use them, as I suspect it will often be the case whilst pulling in json from sites.
Hats off to you Mark.
I'm new to Neo4j, just started learning it earlier this year.
Many, many thanks.
Greetings
10-29-2019 06:10 AM
No worries - the error message is not particularly helpful in that respect unfortunately.
Cool, hope you're enjoying the journey so far!
10-29-2019 06:27 AM
Hello Mark,
Yes, I am definitely enjoying the journey. I am coming from the world of Relational Databases, so it is mind blowing how more efficient cypher and graphs are. Just having to get use to the syntax.
I have another question. Here is the link to the post. Maybe you know how to solve this issue.
In all the tutorials I have looked at to date from people importing data, know one has ever "clean up" data . It is always imported as is, which is almost never the case in real world.
Thanks in advance.
10-29-2019 06:37 AM
Just replied to that one, but I'm not sure that I did anything different to what you already did!
All the sessions of the conference are now available online