简体   繁体   English

neo4j-我们可以在具有相同关系类型但具有不同值的相同节点之间创建多重关系吗?

[英]neo4j - can we create the multiple relationship between same nodes with same relationship type but with different values?

we are trying to achieve something similar- but i just taking a general example below: 我们正在努力实现类似的目标-但我仅在下面列举一个一般示例:

  1. (A) - [r:ACT_IN {role:'main actor'}]->(m:movie) (A)-[r:ACT_IN {角色:'主要演员'}]->(m:电影)
  2. (A) - [r:ACT_IN {role:'side actor'}]->(m:movie) (A)-[r:ACT_IN {角色:'side actor'}]->(m:movie)

Is it possible to create such scenarios? 是否可以创建这样的方案? because when i tries to add the second row it doesn't add anything. 因为当我尝试添加第二行时,它不会添加任何内容。

Thanks, Pk! 谢谢,Pk!

It is certainly possible. 当然有可能。 You did not provide your exact Cypher queries, so it is not clear where you went wrong. 您没有提供确切的Cypher查询,因此不清楚您出错的地方。

However, here is a working example (assuming that the DB already contains those Actor and Movie nodes): 但是,这是一个有效的示例(假设数据库已经包含那些ActorMovie节点):

MATCH (a:Actor {name: 'Keanu Reeves'}), (m:Movie {title: 'The Matrix'})
CREATE
  (a)-[r1:ACT_IN {role:'main actor'}]->(m),
  (a)-[r2:ACT_IN {role:'side actor'}]->(m);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring Data Neo4j 4.0.0:无法在具有相同标签的节点之间创建关系 - Spring Data Neo4j 4.0.0: Can't Create Relationship Between Nodes with the Same Label 在Neo4J中创建两个节点之间的关系,但如果其中一个节点不存在则在同一个调用中创建它 - In Neo4J create relationship between two nodes, but if one of nodes don't exists create it in the same call 在neo4j中创建多个节点之间的多重关系 - Create multiple relationship between multiple nodes in neo4j 在neo4j中创建节点之间的关系 - Create relationship between nodes in neo4j 在与neo4j中其他节点具有相同关系的节点之间创建链接列表关系 - Create linked list relationship between nodes having same relation to other nodes in neo4j Neo4j和Spring Data中具有相同类型的两个节点之间的关系的映射异常 - Mapping Exception with a relationship between two nodes of the same type in Neo4j and Spring Data Neo4j:在具有相同标签的两个或更多节点之间创建关系 - Neo4j : create relationship between two or more nodes having the same Label Neo4j图表显示了相同节点之间的多个关系 - Neo4j graph showing multiple relationship between same nodes on top of each other Neo4j spring - 在相同类型的实体之间创建双向关系 - Neo4j spring - Create a 2 way relationship between same type of entities neo4j:使用neo4j-restclient向多个节点创建相同的关系 - neo4j: creating the same relationship towards multiple nodes using neo4j-restclient
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM