Expand description
Implementation of the JSON-LD compaction algorithms.
Compaction turns an expanded JSON-LD document back into the terse,
human-friendly shape described by a @context: IRIs become terms or
compact IRIs, single-element arrays collapse, and value objects reduce to
plain JSON scalars wherever the context makes that lossless.
Compact compacts a whole document (an
ExpandedDocument or a
FlattenedDocument) and embeds the
@context used into the output. CompactFragment compacts a single
object, node, list or collection against an already-processed active
context, and is what the document-level algorithm recurses through.
This crate is the compaction half of the jsonld family; the jsonld
crate re-exports it behind a processor API that also handles expansion,
flattening and RDF serialization.
Structs§
- IriConfused
With Prefix - An IRI cannot be written out because it would be read back as a compact IRI.
- Options
- Compaction options.
Enums§
- Error
- Error raised while compacting a document.
Traits§
- Compact
- Whole documents that can be compacted against a processed
@context. - Compact
Fragment - Document fragments that can be compacted against an active context.
- Compact
Indexed Fragment - Document fragments that carry an
@indexseparately from their own contents. - Embed
Context - Documents that a
@contextcan be embedded into.
Type Aliases§
- Compact
Document Result - Result of compacting a whole document.
- Compact
Fragment Result - Result of compacting a document fragment.