Skip to main content

normalize

Function normalize 

Source
pub fn normalize(schema: &Schema) -> Schema
Expand description

Collapse ref-chains in a schema into direct edges.

For every path A -> R1 -> R2 -> ... -> Rn -> B where all intermediate vertices have kind "ref", this function produces a single edge A -> B, inheriting the kind and name from the first edge in the chain.

Ref vertices that become unreachable (no longer sources or targets of any non-ref edge) are removed.

This operation is idempotent: normalize(normalize(s)) == normalize(s).