Skip to content

Context

The context provides a mapping for terms that can be used in the document. For additional details, see the JSON-LD spec.

A term can be defined to provide a shorthand:

---
"@context":
name: http://schema.org/name
name: "Example"
---

Terms can also be used as prefixes:

---
"@context":
schema: http://schema.org/
schema:name: "Example"
---

Prefixes can also be used to define context terms:

---
"@context":
schema: http://schema.org/
name: schema:name
name: "Example"
---

A term can also include the @type keyword to specify the datatype, in which case @id should be used to specify the IRI the term refers to:

---
"@context":
schema: http://schema.org/
dateCreated:
"@id": schema:dateCreated
"@type": schema:Date
dateCreated: "2026-04-27"
---

A context can be defined within a workspace file:

context.yamlld
"@context":
schema: http://schema.org/
xsd: http://www.w3.org/2001/XMLSchema#

Documents can use the workspace-relative IRI to include the context:

document.md
---
"@context": http://example.knowboard.dev/context.yamlld
schema:name: "Example document"
---

Contexts can be combined to reference a workspace context as well as additional inline context:

document.md
---
"@context":
- http://example.knowboard.dev/context.yamlld
- name: schema:name
name: "Example document"
---