Skip to main content

Module relations

Module relations 

Source
Expand description

Multi-operation relation traversal / result assembly โ€” a port of python/graphddb_runtime/relations.py.

resultPath grammar: $ (root) or $ + .-separated tokens. A trailing items token means the write target is a hasMany connection ({items, cursor}) and the token before it is the property name; otherwise the final token is the property name for a single-value relation. items tokens in the interior iterate into connection elements.

The runtime works on the assembled tree as a serde_json::Value (the same shape the output boundary uses), so parent collection walks JSON.

Functionsยง

collect_parents_mut
Navigate parent_tokens from root to the list of parent nodes (mutable), expanding items tokens into connection elements and skipping null nodes. Returns mutable references so an operation can write onto each parent.
parse_result_path
Split a resultPath into (parent_tokens, write_key, is_connection).
relation_path
The relation path (ctx.relationPath) for a fan-out op: the non-items tokens of its resultPath.