適用対象: ✅Microsoft Fabric✅Azure データ エクスプローラー✅Azure Monitor✅Microsoft Sentinel
graph-to-table演算子は、ノードまたはエッジをグラフからテーブルにエクスポートします。
構文
ノード
G|graph-to-tablenodes [ with_node_id=ColumnName ]
エッジ
G|graph-to-tableedges [ with_source_id=ColumnName ] [ with_target_id=ColumnName ] [ asTableName ]
ノードとエッジ
G|graph-to-tablenodesasNodesTableName [ with_node_id=ColumnName ],edgesasEdgesTableName [ with_source_id=ColumnName ] [ with_target_id=ColumnName ]
パラメーター
| 名前 | タイプ | 必須 | 説明 |
|---|---|---|---|
| G | string |
✔️ | 入力グラフ ソース。 |
| NodesTableName | string |
エクスポートされたノード テーブルの名前。 | |
| EdgesTableName | string |
エクスポートされたエッジ テーブルの名前。 | |
| ColumnName | string |
指定された列名を使用して、ノード ハッシュ ID、ソース ノード ハッシュ ID、またはターゲット ノード ハッシュ ID をエクスポートします。 |
返品ポリシー
ノード
graph-to-table演算子は、各行がソース グラフのノードに対応する表形式の結果を返します。 返される列はノードのプロパティです。
with_node_idを指定すると、ノード ハッシュ列はlong型になります。
エッジ
graph-to-table演算子は表形式の結果を返し、各行はソース グラフのエッジに対応します。 返される列はノードのプロパティです。
with_source_idまたはwith_target_idを指定すると、ノード ハッシュ列はlong型になります。
ノードとエッジ
graph-to-table演算子は、前の説明と一致する 2 つの表形式の結果を返します。
例示
次の例では、 graph-to-table 演算子がグラフからテーブルにエッジをエクスポートする方法を示します。
with_source_idパラメーターとwith_target_id パラメーターは、各エッジのソース ノードとターゲット ノードのノード ハッシュをエクスポートします。
let nodes = datatable(name:string, type:string, age:long)
[
"Alice", "Person", 23,
"Bob", "Person", 31,
"Eve", "Person", 17,
"Mallory", "Person", 29,
"Trent", "System", 99
];
let edges = datatable(source:string, destination:string, edge_type:string)
[
"Alice", "Bob", "communicatesWith",
"Alice", "Trent", "trusts",
"Bob", "Trent", "hasPermission",
"Eve", "Alice", "attacks",
"Mallory", "Alice", "attacks",
"Mallory", "Bob", "attacks"
];
edges
| make-graph source --> destination with nodes on name
| graph-to-table edges with_source_id=SourceId with_target_id=TargetId
アウトプット
| SourceId | ターゲットID | ソース | 目的地 | edge_type |
|---|---|---|---|---|
| -3122868243544336885 | -7133945255344544237 | アリス | ボブ | communicatesWith |
| -3122868243544336885 | 2533909231875758225 | アリス | トレント | 信頼 |
| -7133945255344544237 | 2533909231875758225 | ボブ | トレント | hasPermission |
| 4363395278938690453 | -3122868243544336885 | 前夜祭 | アリス | 攻撃 |
| 3855580634910899594 | -3122868243544336885 | Mallory | アリス | 攻撃 |
| 3855580634910899594 | -7133945255344544237 | Mallory | ボブ | 攻撃 |
ノードを取得する
次の例は、 graph-to-table 演算子がグラフからテーブルにノードをエクスポートする方法を示しています。
with_node_id パラメーターは、ノード ハッシュをエクスポートします。
let nodes = datatable(name:string, type:string, age:long)
[
"Alice", "Person", 23,
"Bob", "Person", 31,
"Eve", "Person", 17,
"Trent", "System", 99
];
let edges = datatable(source:string, destination:string, edge_type:string)
[
"Alice", "Bob", "communicatesWith",
"Alice", "Trent", "trusts",
"Bob", "Trent", "hasPermission",
"Eve", "Alice", "attacks",
"Mallory", "Alice", "attacks",
"Mallory", "Bob", "attacks"
];
edges
| make-graph source --> destination with nodes on name
| graph-to-table nodes with_node_id=NodeId
アウトプット
| NodeId | 名前 | 種類 | 年齢 |
|---|---|---|---|
| -3122868243544336885 | アリス | 人 | 23 |
| -7133945255344544237 | ボブ | 人 | 31 |
| 4363395278938690453 | 前夜祭 | 人 | 十七 |
| 2533909231875758225 | トレント | システム | 九十九 |
| 3855580634910899594 | Mallory |
次の例では、 graph-to-table 演算子を使用して、グラフからテーブルにノードとエッジをエクスポートします。
let nodes = datatable(name:string, type:string, age:long)
[
"Alice", "Person", 23,
"Bob", "Person", 31,
"Eve", "Person", 17,
"Trent", "System", 99
];
let edges = datatable(source:string, destination:string, edge_type:string)
[
"Alice", "Bob", "communicatesWith",
"Alice", "Trent", "trusts",
"Bob", "Trent", "hasPermission",
"Eve", "Alice", "attacks",
"Mallory", "Alice", "attacks",
"Mallory", "Bob", "attacks"
];
edges
| make-graph source --> destination with nodes on name
| graph-to-table nodes as N with_node_id=NodeId, edges as E with_source_id=SourceId;
N;
E
出力テーブル 1
| NodeId | 名前 | 種類 | 年齢 |
|---|---|---|---|
| -3122868243544336885 | アリス | 人 | 23 |
| -7133945255344544237 | ボブ | 人 | 31 |
| 4363395278938690453 | 前夜祭 | 人 | 十七 |
| 2533909231875758225 | トレント | システム | 九十九 |
| 3855580634910899594 | Mallory |
出力テーブル 2
| SourceId | ソース | 目的地 | edge_type |
|---|---|---|---|
| -3122868243544336885 | アリス | ボブ | communicatesWith |
| -3122868243544336885 | アリス | トレント | 信頼 |
| -7133945255344544237 | ボブ | トレント | hasPermission |
| 4363395278938690453 | 前夜祭 | アリス | 攻撃 |
| 3855580634910899594 | Mallory | アリス | 攻撃 |
| 3855580634910899594 | Mallory | ボブ | 攻撃 |
関連コンテンツ
- Graph 演算子の
- make-graph 演算子 を
する