Neo4j:获取索引属性';名称';在cypher查询中作为返回值

Neo4j:获取索引属性';名称';在cypher查询中作为返回值,neo4j,cypher,py2neo,Neo4j,Cypher,Py2neo,嗨,我是neo4j和cypher的新手。我已经建立了我的数据库,这样你就可以从图中的多个深度开始。在我的示例中,图是一棵树,根节点是索引,级别4的节点是索引。我正在使用py2neo开发图形,我使用get_或_create_indexed_node方法,符合以下要求: 但当我运行我的密码查询,使我的土地上的索引节点,我只能得到id。例如,当我这样做: start n=node:rootnode(name='root'), p=node:patients('name:*') match n-[:ch

嗨,我是neo4j和cypher的新手。我已经建立了我的数据库,这样你就可以从图中的多个深度开始。在我的示例中,图是一棵树,根节点是索引,级别4的节点是索引。我正在使用py2neo开发图形,我使用get_或_create_indexed_node方法,符合以下要求:

但当我运行我的密码查询,使我的土地上的索引节点,我只能得到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]上不存在属性“name”


我做错了什么?

您没有提到要向从
get\u或\u create\u index\u节点返回的节点添加任何属性。函数是
get\u或\u create\u index\u node(index,key,value,properties=None)
,因此您提供的值只是索引名称、键和值

您需要像这样创建节点:

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