Skip to main content

Traversee du Graphe

Traverses the ontology graph starting from an entity by following relationships. Returns the complete path and visited nodes.

Parameters

ParameterTypeRequiredVariableDescription
startEntityIddynamic valueYesYesStarting entity identifier for the graph traversal.
maxDepthnumberNoNoMaximum traversal depth (1 to 5). (Default: 3, min 1, max 5)
directionchoice (outbound, inbound, any)NoNoTraversal direction: outbound, inbound, or any. (Default: "outbound")
edgeTypesarrayNoNoFilter by edge types to follow (empty = all).
modechoice (bfs, dfs)NoNoTraversal algorithm: breadth-first (BFS) or depth-first (DFS). (Default: "bfs")
pathModechoice (all, shortest, weighted)NoNoPath finding mode: all paths, shortest, or weighted.
maxPathsnumberNoNoMaximum number of paths to return. (min 1, max 100)
detectCyclesbooleanNoNoEnable cycle detection in the graph. (Default: false)
includeEdgeDatabooleanNoNoInclude edge data in the results. (Default: false)
outputVariabletextNoNoOutput variable name containing the traversal results.

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

Output

Output variable : traversalResult

{
"path": [],
"nodes": []
}

Example

Traverse the graph from a supplier.

Input :

{"startEntityId": "supplier-123"}

Output :

{"path": ["supplier-123", "contract-1", "project-A"], "nodes": [{"id": "supplier-123"}, {"id": "contract-1"}, {"id": "project-A"}]}
Tip

{{traversalResult.path}} is an ordered array of IDs. maxDepth limits the depth (default 3). Useful for impact analysis and dependencies.