resolve_references
Stable function · Graphs
Tier: stable · Kind: function · Topic: Graphs
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
resolve_references | resolveReferences | resolve_references | resolve_references | ResolveReferences |
Julia
resolve_references(document::AbstractDict)
resolve_references(document::AbstractDict) -> OrderedDict{String,ReferenceGraph}
Resolve reference edges for every model in document. Throws a
ReferenceResolutionError
on any unresolved reference or reference
cycle (each model’s graph is checked acyclic eagerly here).
The document’s top-level index_sets registry is threaded into every model’s
build_reference_graph
call — that is where esm 1.0.0 puts it.
Node ids are collected from EVERY model first, so a derived index set’s
from_faq may name a producer in any model (esm-spec.md §9.7.5) and a duplicate
id anywhere in the document is an error.
TypeScript
function resolveReferences(document: EsmFile | RawObject): Map<string, ReferenceGraph>
Resolve reference edges for EVERY model in document.
Returns a modelName -> ReferenceGraph map. Throws
ReferenceResolutionError
on any unresolved reference or reference
cycle (each model’s graph is checked acyclic eagerly here).
The document-scoped index_sets registry is read once from the top level and
threaded into every model, so a caller never assembles it by hand.
Node ids are collected from EVERY model first, so a derived index set’s
from_faq may name a producer in any model (esm-spec.md §9.7.5) and a
duplicate id anywhere in the document is an error.
Python
resolve_references(document: dict) -> dict[str, ReferenceGraph]
Resolve reference edges for every model in document.
Returns a {model_name: ReferenceGraph} map. Raises
ReferenceResolutionError
on any unresolved reference or reference
cycle (each model’s graph is checked acyclic eagerly here).
Node ids are collected from every model first, so a derived index set’s
from_faq may name a producer in any model (esm-spec.md §9.7.5) and a
duplicate id anywhere in the document is an error.
Rust
pub fn resolve_references(document: &Value) -> Result<IndexMap<String, ReferenceGraph>, ReferenceResolutionError>
Resolve reference edges for every model in document.
Returns a {model_name: ReferenceGraph} map. Errors on any unresolved
reference or reference cycle (each model’s graph is checked acyclic).
Node ids are collected from EVERY model first, so a derived index set’s
from_faq may name a producer in any model (esm-spec.md §9.7.5) and a
duplicate id anywhere in the document is an error.
Go
func ResolveReferences(document map[string]any) (map[string]*ReferenceGraph, error)
ResolveReferences resolves the reference edges of every model in a raw document view, returning a {model name: graph} map.
Returns a *ReferenceResolutionError on any unresolved reference OR reference cycle — each model’s graph is checked acyclic eagerly here, unlike BuildReferenceGraph, which leaves cycle detection to TopologicalOrder.
Node ids are collected from EVERY model first, so a derived index set’s from_faq may name a producer in any model (esm-spec.md §9.7.5) and a duplicate id anywhere in the document is an error.