banji
banji

Reputation: 29

py2neo.database.ClientError: SemanticError: Cannot merge node using null property value for Country

I am trying to merge the query below to an existing database in Neo4j. I already have a neo4j graph created using the following parameters, which are working fine. This was created using neo4j application.

Name, Entity, Web_Site, Title, Other-names, Active, up, down (8 properties)

I am trying to merge the above-created graph with the query below using python. I am adding extra properties with the below query to the already existing database. When I run the query below it gives me this error:

py2neo.database.ClientError: SemanticError: Cannot merge node using null property value for Country.

How do I make it skip every row or column with null values using the python query?

query = """
           merge(name:name {name: {a},name:{b},Title:{c}, 
                 status:{d},number:{e},Code:{f},Country:{g},Locality:{h},Address:{i}})

                """
    batch.run(query,{"a": name, "b": Type, "c":Title, "d": status, "e":number, "f":Code,
                    "g": Country,"h": Locality,"i":Address})

Upvotes: 0

Views: 479

Answers (1)

cybersam
cybersam

Reputation: 66989

The most efficient (and simplest) approach would be to simply modify your Python code to avoid making the neo4j query if any of the parameter values would be null.

Upvotes: 0

Related Questions