python操作neo4j出现错误:AttributeError: ‘NoneType‘ object has no attribute ‘get_dictionary‘

错误描述:

python操作neo4j出现错误:AttributeError: ‘NoneType‘ object has no attribute ‘get_dictionary‘

在从neo4j中读取数据的时候,出现这个错误。数据库是有数据,但是一直都是读不到。关系和end结点都是none

python操作neo4j出现错误:AttributeError: ‘NoneType‘ object has no attribute ‘get_dictionary‘

但是实际数据库是有数据的:

python操作neo4j出现错误:AttributeError: ‘NoneType‘ object has no attribute ‘get_dictionary‘

这个里面的relationship是数据库中的关系类型,name是关系名。

python操作neo4j出现错误:AttributeError: ‘NoneType‘ object has no attribute ‘get_dictionary‘

最好换了一种取数据的方式,得到了下面的数据

python操作neo4j出现错误:AttributeError: ‘NoneType‘ object has no attribute ‘get_dictionary‘

from py2neo import Graph, Node, Relationship
neo_graph = Graph("http://127.0.0.1:7474/browser/", username="neo4j", password="ddd")
find_rela = neo_graph.run("MATCH (na:my_entity{name:'吉利远景'})-[re1:relationship{name:'最高时速'}]->(nb:my_entity)  "
                          "return na,re1,nb")
for i in find_rela:
    print(i)

 

参考的是https://blog.csdn.net/qq_38486203/article/details/79826028这篇文章里面的方法。