# `JSON.LD.Compaction`
[🔗](https://github.com/rdf-elixir/jsonld-ex/blob/v1.0.1/lib/json/ld/compaction.ex#L1)

Implementation of the JSON-LD 1.1 Compaction Algorithms.

<https://www.w3.org/TR/json-ld11-api/#compaction-algorithm>

# `compact`

# `compact_iri`

```elixir
@spec compact_iri(
  any(),
  JSON.LD.Context.t(),
  JSON.LD.Options.t(),
  any() | nil,
  boolean(),
  boolean()
) ::
  any() | nil
```

IRI Compaction

See <https://www.w3.org/TR/json-ld11-api/#iri-compaction>

# `compact_value`

```elixir
@spec compact_value(any(), JSON.LD.Context.t(), String.t(), JSON.LD.Options.t()) ::
  any()
```

Value Compaction

Details at <https://www.w3.org/TR/json-ld-api/#value-compaction>

# `select_term`

```elixir
@spec select_term(JSON.LD.Context.t(), String.t(), [String.t()], String.t(), [
  String.t()
]) ::
  String.t() | nil
```

Term Selection

Note: Other than specified in W3C spec we assume here that the inverse context is already created,
since we don't want to return an updated context. Effectively an inverse context is never needed
in the only place where this function is used.

<https://www.w3.org/TR/json-ld11-api/#term-selection>

---

*Consult [api-reference.md](api-reference.md) for complete listing*
