A SEARCH expression creates a set of nodes, and a LOOKUP makes a set with just one node in it. With that set, a query can TRAVERSE from each of the nodes to a new set of related nodes. The format of a TRAVERSE expression is
The WHERE clause allows the new set to be further filtered.
For example, to find all software instances that are running on Linux hosts:
As with key expressions, elements of the traversal can be omitted as a wildcard mechanism. All matching relationships are followed, so this example finds software running on Linux hosts, and virtual machine software containing the hosts:
Adding some filtering:
The attributes that are accessed in the
WHERE clause are attributes of the nodes that have been traversed to, not attributes of the original nodes. The original nodes have been discarded from the set.
Traversals can be chained, so we can now find any business application instances related to the software instances:
At each stage, the result of a traversal is a set, so each node appears only once in the set, even if it is reached via relationships from more than one node.
TRAVERSE clause performs one single traverse from each node in the current set. Sometimes it is useful to repeatedly traverse to find all the nodes that can be reached via particular relationships, using an
EXPAND clause. This is useful for finding all applications that depend on a particular other application, for example:
The set now contains the original nodes, plus all the nodes that depend upon them, via any number of intermediate dependencies. The
EXPAND keeps performing traversals until no more nodes are found. The
EXPAND always keeps the original set. If you want to
EXPAND but not keep the original set, use a
TRAVERSE followed by an
Just like a
TRAVERSE clause, an
EXPAND can have a
WHERE clause. The filtering of the
WHERE clause happens once the
EXPAND has completed, not on every traversal iteration (since if it did it every iteration, it might never complete).
EXPAND move from one set of nodes to another set of nodes. Sometimes, you want to stop off at a relationship along the way. This is achieved with STEP IN, which replaces the set of nodes with a set of relationships. Given a set of relationships, you can STEP OUT to another set of nodes. To find critical Dependency relationships:
To find the BusinessApplicationInstances that have a critical dependency to the ones matched in the WHERE clause: