0

嗨,我是 neo4j 和 cypher 的新手。我已经建立了我的数据库,以便您可以从图表中的多个深度开始。在我的示例中,图是一棵树,根节点是索引,第 4 级的节点是索引。我正在使用 py2neo 开发图形,并根据以下内容使用 get_or_create_indexed_node 方法:py2neo 文档

patient_node = graph_db.get_or_create_indexed_node('patients', 'name',
patients[patient_id])

但是当我运行我的密码查询以使我降落在索引节点上时,我只能获取 id。例如,当我这样做时:

start n=node:rootnode(name='root'), p=node:patients('name:*')
match n-[:chrm]-()-[:pos]-()-[:patient]-p-[:variant]->vars 
where (has(vars.mutations))  return p.name"

我收到错误消息:节点上不存在属性“名称”[84361]

我究竟做错了什么?

4

1 回答 1

1

您还没有提到要向从返回的节点添加任何属性get_or_create_indexed_node。函数是get_or_create_indexed_node(index, key, value, properties=None),所以您提供的值只是索引名称、键和值。

您需要像这样创建节点:

node = graph_db.get_or_create_indexed_node('patients', 
                                           'name', patients[patient_id], 
                                           patient_properties)
于 2013-05-12T17:53:32.643 回答