Hi,
I import a .csv file into Neo4j. And there are three columns there: Company_Name, legal_address, and physical_address. And the above picture shows the relationship of these three columns.
My question is: if the legal_address and the physical _address is same for one company, but one is in lower cace, one is in upper case, how to treat these two address nodes as one node for that company? (Like below)
i tired these code below but it does not work:
load csv with header from "..." as line
merge (v1: company{company:line.name})
FOREACH (i in CASE WHEN exists(line.P_ADDR_LN) THEN [1] ELSE [] END |MERGE (v5:address {address:line.P_ADDR_LN}) merge (v1)-[:physically_located_at ]->(v5) set v5.address=toUpper(line.P_ADDR_LN))
FOREACH (i in CASE WHEN exists(line.D_ADDR_LN) THEN [1] ELSE [] END |MERGE (v6:address {address:line.D_ADDR_LN}) merge (v1)-[:LEGAL_located_at ]->(v6) set v6.address=toUpper(line.D_ADDR_LN))
The above code can make the addresses into upper case, but they will be treated as two different nodes like picture 1.
Thanks,
Sharon