Skip to content

Latest commit

 

History

History
80 lines (59 loc) · 3.01 KB

File metadata and controls

80 lines (59 loc) · 3.01 KB
title node_id (graph function)
description This article describes the node_id() function.
ms.topic reference
ms.date 10/29/2025

node_id() (graph function)

[!INCLUDE applies] [!INCLUDE fabric] [!INCLUDE azure-data-explorer]

The node_id function calculates the graph node identifier as it was set by the user either in make-graph or graph model.

Note

This function is used with the graph-match and graph-shortest-paths operators.

Warning

This feature is currently in public preview. Functionality and syntax are subject to change before General Availability.

Syntax

node_id([node])

[!INCLUDE syntax-conventions-note]

Parameters

Name Type Required Description
node string The reference to a graph node variable in a graph pattern.
Don't pass any parameters when used inside all(), any(), and map() graph functions, with inner_nodes().

Returns

Returns the node ID string representation of the input node or of all inner nodes, when used inside all(), any(), and map() functions with inner_nodes().

Example

The following example creates a graph to analyze a hierarchical structure of employees and their managers.

:::moniker range="azure-data-explorer"

[!div class="nextstepaction"] Run the query ::: moniker-end

let employees = datatable(name:string, age:long)
[
"Alice", 32,
"Bob", 31,
"Eve", 27,
];
let reports = datatable(employee:string, manager:string)
[
"Bob", "Alice",
"Chris", "Alice",
"Eve", "Bob",
];
reports
| make-graph employee --> manager with employees on name
| graph-match (employee)-[reports*1..3]->(manager)
    where node_id(employee) startswith "E"
    project manager1 = node_id(manager), manager2 = map(inner_nodes(reports), node_id())

Output

manager_1 manager_2
Bob []
Alice ["Bob"]

Related content