pub fn compact_node(
active_ctx: &JsonLdContext,
_type_scoped_ctx: &JsonLdContext,
_active_property: Option<&str>,
node: &IndexMap<String, JsonLdValue>,
options: &CompactionOptions,
) -> Result<JsonLdValue, CompactionError>Expand description
Compact a node object.
This implements the node object compaction portion of the W3C JSON-LD 1.1 Compaction Algorithm.
§Steps (abbreviated)
- Compact
@id,@typeusing context term definitions. - Handle
@reverseproperties. - Handle container types (
@index,@graph,@set,@list,@language). - Recursively compact all property values.
§Arguments
active_ctx— the current active contexttype_scoped_ctx— type-scoped context (may differ fromactive_ctxwhen types change it)active_property— the property under which this node appearsnode— the expanded node object mapoptions— compaction options