Skip to main content

get_formatted_graph_data

Function get_formatted_graph_data 

Source
pub async fn get_formatted_graph_data(
    graph_db: &dyn GraphDBTrait,
    dataset_id: Uuid,
    user_id: Uuid,
) -> GraphDBResult<Value>
Expand description

Fetch the formatted graph snapshot for a dataset.

§Python parity

The Rust port intentionally omits Python’s set_database_global_context_variables branch — the Rust GraphDBTrait instance is already scoped to the caller’s owner/tenant by construction (per tenants.md §3). The dataset_id and user_id parameters are accepted for API parity with the Python helper but are currently unused in the read path (matching how Python’s helper also relies on the global context, not the parameters, to scope the query).

§Shape

Each node produces:

  • id — string form of the node id
  • labelproperties["name"] if non-empty, else "{type}_{id}"
  • typeproperties["type"]
  • properties — every other property whose value is not null, with id, type, name, created_at, updated_at excluded.

Each edge produces:

  • source, target, label (the relationship name).