Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-02-2021 06:41 AM
Hi, I'm trying to solve a problem of having files that doesn't have the same name convention for the headers. For example, the user wrote a column name in two ways: SNIRH
and snirh
. It's possible to convert the property label to something uniform using toLower()?
The solution that I'm approaching is testing those possibilities, but it's not optimal and doesn't solve the problem for all cases.
WITH $json as list
UNWIND list as obj
MATCH (n:QualityStation) WHERE (obj.SNIRH CONTAINS n.snirh) OR (obj.snirh CONTAINS n.snirh) OR (n.id = obj.id)
...
At the same topic, it's possible on SET
to load all properties except some in especific? My current version add all, but the problem starts again with the name convention. The file can have either Name
or name
MERGE (f:GISFeature {Name: features.properties.Name, type: features.type})
SET f += features.properties
04-02-2021 07:59 AM
As you state the problem stems from the fact that the CSV files dont have the same headers and relative to case. If thats the case, rather than to get Cypher to work with this why not simply have some bash/sed like script to simply read the 1st line of any/all CSV and thus covert all headers to lowercase
04-02-2021 12:36 PM
Thank you @dana.canzano for your answer. I'm now parsing the data via a middleware before uploading data to neo4j.
All the sessions of the conference are now available online