Resources may include an IRI property mapped to @id in the application-defined JSON-LD @context, identifying the
resource globally. This property is usually named id, but the mapping is arbitrary. A state without such a property
represents an anonymous (blank) node—useful for nested structures that don't need their own identity:
Resources can link to other resources using IRI references or embedded descriptions. IRI references identify a
resource without describing its state, while embedded descriptions include the linked resource's properties:
// IRI references: compact form linking to external resources
Nested resource states containing properties beyond the resource identifier are only accepted if
explicitly declared as embedded in the application-defined data model; non-embedded nested resources with
additional properties will be rejected during validation.
A Resource also serves as payload for HTTP PUT operations:
PUT https://example.com/products/42
({ "name":"Widget", "price":79.99, "categories": ["electronics", "premium"] // available // not included → deleted })
Important
State replacement is total — properties not included in the state are removed from the resource; empty arrays
are treated as property deletions, following set semantics where an empty set is equivalent to absence.
Patching
A Patch serves as payload for HTTP PATCH operations. Properties can be set to new values
or deleted using null; unlisted properties remain unchanged:
nested state: embedded resource description (object with property values)
Important
Arrays follow set semantics — duplicates are ignored, ordering is immaterial, and empty arrays are
treated as absent values. This aligns with JSON-LD's multi-valued property model.
IRIs
An IRI (Internationalized Resource Identifier) is a globally unique string identifying a resource on the
web.
IRIs enable entity linking by referencing resources without embedding their full state. Properties mapped to @id
in the application-provided JSON-LD @context expect IRI values, establishing relationships between resources across
systems and domains.
Note
The choice between absolute, root-relative, or relative IRIs is application-specific, but root-relative IRIs
(e.g., /users/123) are preferred for readability and portability. JSON-LD @base declarations can resolve
relative references to absolute IRIs during processing.
Literals
A Literal maps directly to JSON primitives (boolean, number, string). Dates, times, and other
structured values are represented as strings in standard formats (e.g., ISO 8601). Application-level @context
objects can declare datatype coercion rules for JSON-LD processing.
Localized Text
For multilingual content, use a Dictionary — an object mapping language tags to localized strings.
Language tags follow RFC 5646 (e.g., en, de-CH, zh-Hans):
A dictionary must be either single-valued (one string per tag) or multi-valued (string arrays per
tag) throughout; mixing cardinalities within the same dictionary is not supported.
Resource state model.
Defines types for describing resource states and partial updates in REST/JSON APIs, using native JSON types with localized text support:
Resource Operations
Retrieving
A Resource is a property map describing the state of a resource:
Resources may include an IRI property mapped to
@idin the application-defined JSON-LD@context, identifying the resource globally. This property is usually namedid, but the mapping is arbitrary. A state without such a property represents an anonymous (blank) node—useful for nested structures that don't need their own identity:Resources can link to other resources using IRI references or embedded descriptions. IRI references identify a resource without describing its state, while embedded descriptions include the linked resource's properties:
Creating
A Resource serves as payload for HTTP POST operations:
Nested resource states containing properties beyond the resource identifier are only accepted if explicitly declared as embedded in the application-defined data model; non-embedded nested resources with additional properties will be rejected during validation.
Updating
A Resource also serves as payload for HTTP PUT operations:
State replacement is total — properties not included in the state are removed from the resource; empty arrays are treated as property deletions, following set semantics where an empty set is equivalent to absence.
Patching
A Patch serves as payload for HTTP PATCH operations. Properties can be set to new values or deleted using
null; unlisted properties remain unchanged:Empty arrays are treated as property deletions, following set semantics where an empty set is equivalent to absence.
Deleting
HTTP DELETE operations remove the resource at the request URL (no payload is required):
Value Types
Each property in a resource state or patch holds Values:
A Value can be:
boolean,number,string)Arrays follow set semantics — duplicates are ignored, ordering is immaterial, and empty arrays are treated as absent values. This aligns with JSON-LD's multi-valued property model.
IRIs
An IRI (Internationalized Resource Identifier) is a globally unique string identifying a resource on the web. IRIs enable entity linking by referencing resources without embedding their full state. Properties mapped to
@idin the application-provided JSON-LD@contextexpect IRI values, establishing relationships between resources across systems and domains.The choice between absolute, root-relative, or relative IRIs is application-specific, but root-relative IRIs (e.g.,
/users/123) are preferred for readability and portability. JSON-LD@basedeclarations can resolve relative references to absolute IRIs during processing.Literals
A Literal maps directly to JSON primitives (
boolean,number,string). Dates, times, and other structured values are represented as strings in standard formats (e.g., ISO 8601). Application-level@contextobjects can declare datatype coercion rules for JSON-LD processing.Localized Text
For multilingual content, use a Dictionary — an object mapping language tags to localized strings. Language tags follow RFC 5646 (e.g.,
en,de-CH,zh-Hans):See