I am very new to Neo4j and am struggling with an error.
I am trying to import a CSV file which has NULL values.
When I enter the Cypher, I get this error: Cannot merge the following node because of null property value for 'Name':
Alternatively, I have tried doing this, which hasn't worked either.
LOAD CSV WITH HEADERS from 'file:///tree.csv' as row with row where row.single_trunk_circumference is not null AND where row.branch_number is not null AND where row.multiple_trunk_diameter is not null AND where row.multiple_trunk_circumference is not null
I just noticed in the records you are showing, that no row has all four attributes as not null, so the WHERE clause will be false for the rows shown (1-26).
Perhaps the data model is not correct. Are each column supposed to be a separate entity, or are some attributes of an aggregate entity, as "Tree?" The attributes in columns F-L would be attributes of a Tree node that has id = tree_id. No?
Yes that is correct. No row has all four attributes as not null.
You are also correct. Each columns are attributes of an entity Tree (of individual tree_id).
Does that mean that I am supposed to use OR ?
Just as a reminder, I am required to represent everything from the basis of the company (which company owns which tree and all their attributes).
This is exactly what I need.
Once I have this, how do I import all the attributes (from f to l) of the tree in the node? As in, how to I set multiple labels on the tree?
I would want Company -> Country -> Tree_ID (with all the labels: creation date, height etc.).
@ameyasoft provide a solution. I would just recommend using HAS_COMPANY, HAS_PLOT, and HAS_TREE for the relationship types. Also, eliminate the Plot node if you don't want it; merging Company to Tree directly.
The relationships seem odd to me. I read it as stating a 'tree has a country and a country has a company.' Is it not more like 'a country has a company and a company has a tree?'
The query looks correct. Does your data have a second country in the csv file? If so, is the country on all rows that have tree_id that is null, so it is getting filtered out?