我有一个Person标签,并且有两个人之间的关系:父亲和:母亲,所以我试图从neo4j获得一个家谱,例如
{
'PersonName': 'John',
'PersonsAncestors':
[
{
'MotherName': 'someName',
'MotherAncestors:
[
{
'MotherName': 'someName',
'MotherAncestors: [...]
},
{
'FatherName': 'someName',
'FatherAncestors: [...]
}
]
},
{
'FatherName' 'someName',
'FatherAncestors:
[
{
'MotherName': 'someName',
'MotherAncestors: [...]
},
{
'FatherName': 'someName',
'FatherAncestors: [...]
}
]
}
]
}
甚至可能吗?
尝试类似的东西
MATCH tree = (mother:Person)<-[:Mother|:Father*0..2]-(rootPerson:Person {uuid: '50d89cbd-15f6-11e6-ac0e-005056b316bf'})RETURN nodes(tree)
也许我可以循环结果并创建某种集合?