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.
0
votes
When you say "a node from node A", do you mean "a node with the label A"? And, if not, what exactly do you mean?
- cybersam
Node A was my way of saying node #1. It was just to distinguish between the 3 main nodes that have relationships between each other. What I’m trying to find out is if I can make relationships between nodes of A or #1 and nodes of B or #2
- Tehas
So, "a node from node A" means "a node that is connected to node A by a relationship"?
- cybersam
1 Answers
0
votes
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)