简体   繁体   中英

If I have a Neo4j graph database, can I build relationships between the sub-nodes of the two main nodes?

I have a graph database that has currently 3 nodes in it. The 3 nodes have various other nodes attached to them and I was wondering if there was any way I can build relationships between the nodes attached to my 3 nodes. So a node from the base node A would have a relationship with a node from the other node B which is the second node of the three main nodes. I'm new to Neo4j so please excuse the terminology. Thanks.

If "a node from node A" means "a node that is connected to node A by a relationship" (that is, a node that is neighbor of A), then it seems your question is very basic.

For example, the following Cypher query will create a BAR relationship between the neighbors of a and b :

MATCH (a {id: 1})--(aa), (b {id: 2})--(bb)
CREATE (aa)-[:BAR]->(bb)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM