Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Neo4j Python / Cypher synatax query

Node Link


I just can't get the following. I'm using Google co-lab. The commented out line works as expected but after trying various options from threads I still can't get it.  I'm just trying to pass the entity_type variable in after declaring it.

Also once this works I will then want to pass in the following so I assume it would be the same as the value passed to the get_slot method would also be a string entity_type = tracker.get_slot("entity_type")



Can anyone assist? Thanks.




I don't use the python driver, but from my reading of the documentation, it looks like if you do the following it should work:

result =, entity_type = entity_type)

For production, you may want to look at the managed transactions instead of the auto-commit transactions you are using. 

thanks it now gives me the following when i run that


< object at 0x7f056b850610>


In the above, I meant the string that represents the cypher query for the 'query' parameter.

The 'Result' returned is a list of "Records'  You need extract the data from it.

Thanks - I don't think I'm getting this. I don't use Python regularly. Can you possibly type out what the query should be? The first commented out line gives me what I want so I'm not clear on what I'm meant to type - 



I'm a Java developer, but I tried to provide some guidance.

If you are expecting a single result, you can try this:




You will need to iterate through the records of a result, if the result has more than one record. Something like this.

    definitions = []
        result =, entity_type = entity_type)
        for record in result: