Resolve a node_id that may be a `$variable` reference. If it starts with `$`, look up the binding and extract node IDs. Otherwise return it as-is.
(id: &str, bindings: &HashMap<String, Vec<KgNode>>)
| 379 | /// If it starts with `$`, look up the binding and extract node IDs. |
| 380 | /// Otherwise return it as-is. |
| 381 | fn resolve_node_ids(id: &str, bindings: &HashMap<String, Vec<KgNode>>) -> Vec<String> { |
| 382 | if let Some(var_name) = id.strip_prefix('$') { |
| 383 | bindings |
| 384 | .get(var_name) |
| 385 | .map(|nodes| nodes.iter().map(|n| n.id.clone()).collect()) |
| 386 | .unwrap_or_default() |
| 387 | } else { |
| 388 | vec![id.to_string()] |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | /// Resolve a source path that may be a `$variable` reference. |
| 393 | /// |