How to query the associated topology related to a node? #4357
Unanswered
groobyming
asked this question in
Q&A
Replies: 1 comment
-
Did you ever figure this out? Its something im interested in as well |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In this scenario, we need to query an A node instance and its associated entire topology graph. We can use the Cypher query language of the Neo4j graph database to implement this requirement. Suppose we have the following nodes and relationships:
1、A node instance (e.g., AInstance)
2、B node instances associated with the A node instance (e.g., BInstance)
3、C node instances associated with the B node instance (e.g., CInstance)
The relationships between nodes can be represented as:
1、AInstance --(Relationship1)--> BInstance
2、BInstance --(Relationship2)--> CInstance
We can use the following Cypher query to search for an A instance that meets the given conditions and return its associated entire topology graph:
MATCH (a:AInstance {property: 'value'})-[:Relationship1]-(b:BInstance)-[:Relationship2]-(c:CInstance)
RETURN a, b, c;
My questions are as follows:
Beta Was this translation helpful? Give feedback.
All reactions