I’ve been working to better understand graph databases and where they can be useful.
There is a file from Neo4J that comes with the Desktop and contains a data export from Northwind. This looks like this when you open it:
On the page where Neo4j talks about the employee imports, they have this code:
// Create employees
LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/jexp/054bc6baf36604061bf407aa8cd08608/raw/8bdd36dfc88381995e6823ff3f419b5a0cb8ac4f/employees.csv' AS row
MERGE (e:Employee {employeeID:row.EmployeeID})
ON CREATE SET e.firstName = row.FirstName, e.lastName = row.LastName, e.title = row.Title;
This loads fine.
When I run this code, it works. When change to this, it fails. It’s erroring out on my file. I tried moving the file, removing nulls, etc.
LOAD CSV WITH HEADERS FROM 'file:///employees.csv' AS rowMERGE (e:Employee {employeeID:row.EmployeeID})
ON CREATE SET e.firstName = row.FirstName, e.lastName = row.LastName, e.title = row.Title;
Here’s the error in the Neo4j Browser:
I kept editing the file and trying different things. I compared what I had locally with what was on GitHub. Eventually, I realized this is the issue:
{employeeID:row.EmployeeID}
In the GitHub csv, the first row has headers with EmployeeID. In my local file, the header is “employeeID” (lower case). As soon as I edited this, it worked.
THIS IS THE FILE THAT CAME WITH NEO4J DESKTOP.
They make mistakes, just like I do. I hate that there are too many things like that that are care sensitive. I get that sometimes you want data to be in a particular format, but I think in the modern world, making metadata case sensitive isn’t productive.
I’m right their with you on Case Sensitivity. I tell people that ask me about it to NOT make the whole bloody server case sensitive… just the columns that need it, which are far and few between. That does have some ramifications when it comes to TempDB but it’s well worth any brief time on such workarounds compared to having a full case sensitive server.
That’s one of the reasons I hated Oracle. Apparently, it defaults to being case sensitive to “help performance”.
LikeLike
I wish we could have case-sensitive data WITHOUT any code needing to follow, including column names.
LikeLike
I definitely agree that meta data shouldn’t be case sensitive. I guess there are some languages that couldn’t do without it, though.
LikeLike