Neo4j 属性错误:';遍历描述';对象没有属性';评估者';
我正在尝试使用Neo4j 属性错误:';遍历描述';对象没有属性';评估者';,neo4j,Neo4j,我正在尝试使用 from neo4jrestclient.client import GraphDatabase G = GraphDatabase("http://localhost:7474/db/data/") # G is generated here in my program but for space purpose I removed these steps traverser = G.traversal().evaluator(my_evaluator).traverse(ro
from neo4jrestclient.client import GraphDatabase
G = GraphDatabase("http://localhost:7474/db/data/")
# G is generated here in my program but for space purpose I removed these steps
traverser = G.traversal().evaluator(my_evaluator).traverse(root)
我从stackoverflow借用了我的_evaluator函数,它是
def my_evaluator(path):
# Filter on end node property
if path.end['value'] == 105:
return Evaluation.INCLUDE_AND_CONTINUE
# Filter on last relationship type
if path.last_relationship.type.name() == 'edge':
return Evaluation.INCLUDE_AND_PRUNE
# You can do even more complex things here, like subtraversals.
return Evaluation.EXCLUDE_AND_CONTINUE
当我试图执行代码时,我收到以下错误消息:
回溯(最近一次呼叫最后一次):
文件“C:\Users\firas\Desktop\ACO_neo4j.py”,第747行,在
traverser=G.traversal().evaluator(my_evaluator).traverse(根)
AttributeError:“TraversalDescription”对象没有属性“evaluator”
你能帮我做这件事吗。谢谢
Firas您始终可以使用密码查询来实现相同的查询 这里的问题是
evaluator
函数可能是嵌入式Python驱动程序Neo4j guys从本机驱动程序借用的。到目前为止,使用neo4rest客户端
traversals遍历图形存在一些限制。因为它下面使用的是REST接口,所以编写计算器的唯一方法是编写Javascript函数AFAIK