Skip to main content

Module algorithm

Module algorithm 

Source
Expand description

Core compaction algorithm steps for JSON-LD 1.1.

This module implements:

  • Value object compaction (compact_value)
  • Node object compaction (compact_node)
  • Array compaction (compact_array)

All functions follow the W3C JSON-LD 1.1 Compaction Algorithm specification: https://www.w3.org/TR/json-ld11-api/#compaction-algorithm

Functionsยง

add_prefix_term
Add a simple term definition (IRI prefix) to the context for compaction use.
compact_array
Compact an array of JSON-LD values.
compact_node
Compact a node object.
compact_value
Compact a JSON-LD value object.