Hello everyone
I am interacting with neo4j using python with cypher . I have an excel sheet with an uneven number of colum information eg
column Colour: Red,Green,Yellow
column Car: Corolla,Camry,lexus
column Animal: dog,cat,fish,antelope,camel,pidgeon
as a result of column animal having more column info whenever i run my merge command,null nodes are created on column colour and car since they are both short of 3 column data. I have tried running the foreach (ignoreme) command yet null values are still created. I want just 12 nodes created not 14 as the 2 extra are as a result of null values.
for record in data:
colour = record[0]
car= record[1]
animal = record[2]
query = """
Merge(Info:data{colour:{a}})
SET Info.car={b}
SET Info.Animal={c}
MERGE(Animalt:Animal{Animal:{c}})
FOREACH(ignoreMe IN CASE WHEN {colourt:{a}} IS NOT NULL THEN [1] ELSE END |
MERGE(colourt:colour{colour:{a}})
MERGE (colour)-[:Relevance]->(Animal))
"""
how do i go about solving this?