Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4j 在Cypher中创建三个表之间的关系_Neo4j_Cypher_Relationship - Fatal编程技术网

Neo4j 在Cypher中创建三个表之间的关系

Neo4j 在Cypher中创建三个表之间的关系,neo4j,cypher,relationship,Neo4j,Cypher,Relationship,是否可以使用表2在表1和表3之间创建关系? 例如: 表1我们有身份证和姓名 表2我们有id、表1ID和表3ID 表3我们有身份证和爸爸的名字 我们需要通过一种关系[:家庭]直接在妈妈和爸爸之间建立关系,而不显示表2节点或关系。这应该可以: MATCH (t1:Table1), (t2:Table2), (t3:Table3) WHERE t1.id = t2.table1ID AND t3.id = t2.table3ID MERGE (t1)-[:family]-(t3) 为了提高性能,

是否可以使用表2在表1和表3之间创建关系? 例如:

  • 表1我们有身份证和姓名
  • 表2我们有id、表1ID和表3ID
  • 表3我们有身份证和爸爸的名字
我们需要通过一种关系[:家庭]直接在妈妈和爸爸之间建立关系,而不显示表2节点或关系。

这应该可以:

MATCH (t1:Table1), (t2:Table2), (t3:Table3)
WHERE t1.id = t2.table1ID AND t3.id = t2.table3ID
MERGE (t1)-[:family]-(t3)
为了提高性能,您可以首先在
:Table1(id)
:Table3(id)
上创建