cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

It's possible to modify a property label to lower case before doing anything?

bmalbusca
Node Clone

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
2 REPLIES 2

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

bmalbusca
Node Clone

Thank you @dana.canzano for your answer. I'm now parsing the data via a middleware before uploading data to neo4j.