0
votes

Here is the code that loads products for the example Northwind database.

LOAD CSV WITH HEADERS FROM "http://data.neo4j.com/northwind/products.csv" AS row
CREATE (n:Product)
SET n = row,
  n.unitPrice = toFloat(row.unitPrice),
  n.unitsInStock = toInteger(row.unitsInStock), n.unitsOnOrder = toInteger(row.unitsOnOrder),
  n.reorderLevel = toInteger(row.reorderLevel), n.discontinued = (row.discontinued <> "0")

My problem is that if I copy the csv file to mydomain.local, and modify the FROM part of the statement to read http://mydomain.local/products.csv, it won't load. I get a "Couldn't load external resource .." error.

Mydomain.local is served from a virtual machine on my laptop. It is also where neo4j is being served from. I have modified /etc/hosts to point the domain name to the ip address.

I can put the mydomain url in a web browser bar and read the csv no problem, so why can't neo4j find it there?

1
If Neo4j is running on the same VM as your server, why not point it at localhost (localhost/products.csv)? Is your VM serving up on port 80, or something else? And just because it looks odd, should the URl be mydomain.local (note the trailing 'l')?rfestag
Thanks @rfestag, tried localhost (localhost/products.csv), with no success. That raises an interesting point though - I was thinking the url was relative to my client, but it's probably relative to the neo4j host (This is material in this case since only my client's etc host knows where mydomain.local is). VM is serving on port 80. Thanks for picking up the spelling error too...DatsunBing

1 Answers

0
votes

The problem was with the domain routing. I updated the /etc/host file on the neo4j server so that mydomain.local points to the server itself, and it now works fine.

I was mistakenly under the impression that the URL was relative to the browser, but it's obviously not. It's relative to the server.