diff --git a/spec/latest/json-ld-api/index.html b/spec/latest/json-ld-api/index.html index adf1e2c89..7914d3acc 100644 --- a/spec/latest/json-ld-api/index.html +++ b/spec/latest/json-ld-api/index.html @@ -1067,11 +1067,18 @@
@container
key, which must be either
@list
, @set
, @index
,
@id
, @type
- or @language
. Otherwise, an
+ or @language
,
+
+ or an array containing exactly any one of those keywords,
+ or a combination of @set
and any of @index
,
+ @id
, @type
, @language
+ in any order
+ .
+ Otherwise, an
invalid container mapping
has been detected and processing is aborted.
json-ld-1.0
and the container value
- is @id
or @type
, an
+ is @id
or @type
, or is otherwise not a string, an
invalid container mapping
has been detected and processing is aborted.1
), active property has no
- container mapping in active context, and
- compactArrays
+ 1
),
+
+ active property is not @graph
or @set
,
+ or the container mapping for active property in
+ active context does not include @list
or @set
,
+
+ and compactArrays
is true
, set result to its only item.null
. If there
is a container mapping for
item active property in active context,
- set container to its value.@set
.
+ true
or false
depending on if the container mapping for
+ item active property in active context
+ includes @set
or if item active property
+ is @graph
or @list
.@language
,
+ If container includes @language
,
@index
, @id
,
or @type
:
true
,
+ set compacted item to an array containing that value.false
, container is @set
or
- @list
, or expanded property is
- @list
or @graph
and
+ is false
, as array is true
and
compacted item is not an array,
set it to a new array
containing only compacted item.null
,
term cannot be selected during compaction,
so continue to the next term.@none
. If there
- is a container mapping in
- term definition, set container to
- its associated value.@none
. If
+
+ the container mapping in term definition
+ includes @id
, @index
,
+ @language
, @list
, @type
, or
+ @set
in that order
+ set container to
+ the first such value found.@container
in an expanded term definition
+ can also be an array containing any appropriate container
+ keyword along with @set
(other than @list
).
+ This allows a way to ensure that such property values will always
+ be expressed in array form.@container
@list
The value of @container
can also
+ be an array containing both @index
and @set
.
+ When compacting, this ensures that a JSON-LD Processor will use
+ the array form for all values of indexes.
+ ++ + +
JSON which includes string values in multiple languages may be
+ represented using a language map to allow for easily
+ indexing property values by language tag. This enables direct access to
+ lanugage values instead of having to scan an array in search of a specific item.
+ In JSON-LD such data can be specified by associating the
+ @language
keyword with a
+ @container
declaration in the context:
+ ++ +
In the example above, the label term has
+ been marked as an language map. The en and
+ de keys are implicitly associated with their respective
+ values by the JSON-LD Processor. This allows a developer to
+ access the German version of the label using the
+ following code snippet: obj.label.de
.
The value of @container
can also
+ be an array containing both @language
and @set
.
+ When compacting, this ensures that a JSON-LD Processor will use
+ the array form for all values of language tags.
+ +
The value of @container
can also
+ be an array containing both @id
and @set
.
+ When compacting, this ensures that a JSON-LD Processor will use
+ the array form for all values of node identifiers.
+ ++
Id maps are a new feature in JSON-LD 1.1, requiring
processing mode set to json-ld-1.1
@container
declaration in the context:
+ title="Indexing data in JSON-LD by type"> @@ -2693,6 +2835,39 @@-Node Type Indexing
schema:ProfessionalService
keys will be interpreted as the@type
property of the node object value. +The value of
+ +@container
can also + be an array containing both@type
and@set
. + When compacting, this ensures that a JSON-LD Processor will use + the array form for all values of types.+ ++Type maps are a new feature in JSON-LD 1.1, requiring processing mode set to
@@ -2784,7 +2959,7 @@json-ld-1.1
Expanded Document Form
The JSON-LD Processing Algorithms and API specification [[JSON-LD-API]] defines a method for expanding a JSON-LD document. - Expansion is the process of taking a JSON-LD document and applying a + Expansion is the process of taking a JSON-LD document and applying a
@@ -2807,7 +2982,7 @@@context
such that all IRIs, types, and values are expanded so that the@context
is no longer necessary.Expanded Document Form
-->
Running the JSON-LD Expansion algorithm against the JSON-LD input document +
Running the JSON-LD Expansion algorithm against the JSON-LD input document provided above would result in the following output:
Expanded Document Form-Compacted Document Form
The JSON-LD Processing Algorithms and API specification [[JSON-LD-API]] defines - a method for compacting a JSON-LD document. Compaction is the process + a method for compacting a JSON-LD document. Compaction is the process of applying a developer-supplied context to shorten IRIs to terms or compact IRIs and JSON-LD values expressed in expanded form to simple values such as @@ -2880,7 +3055,7 @@
Compacted Document Form
-->
Running the JSON-LD Compaction algorithm given the context supplied above +
Running the JSON-LD Compaction algorithm given the context supplied above against the JSON-LD input document provided above would result in the following output:
@@ -2911,7 +3086,7 @@The JSON-LD Processing Algorithms and API specification [[JSON-LD-API]] defines - a method for flattening a JSON-LD document. Flattening collects all + a method for flattening a JSON-LD document. Flattening collects all properties of a node in a single JSON object and labels all blank nodes with blank node identifiers. @@ -2942,7 +3117,7 @@
Running the JSON-LD Flattening algorithm against the JSON-LD input document in +
Running the JSON-LD Flattening algorithm against the JSON-LD input document in the example above and using the same context would result in the following output:
@@ -3367,14 +3542,17 @@A language map is used to associate a language with a value in a
way that allows easy programmatic access. A language map may be
used as a term value within a node object if the term is defined
- with @container
set to @language
. The keys of a
+ with @container
set to @language
,
+
+ or an array containing both @language
and @set
+ . The keys of a
language map MUST be strings representing
[[BCP47]] language codes and the values MUST be any of the following types:
See for further discussion @@ -3388,7 +3566,10 @@
@container
set to @index
.
+ term is defined with @container
set to @index
,
+
+ or an array containing both @index
and @set
+ .
The values of the members of an index map MUST be one
of the following types:
@@ -3413,7 +3594,9 @@ An id map is used to associate an IRI with a value that allows easy
programatic access. An id map may be used as a term value within a node object if the term
- is defined with @container
set to @id
. The keys of an id map MUST be IRIs
+ is defined with @container
set to @id
,
+ or an array containing both @id
and @set
.
+ The keys of an id map MUST be IRIs
(relative IRI, compact IRI (including blank node identifiers), or absolute IRI)
and the values MUST be node objects.
A type map is used to associate an IRI with a value that allows easy
programatic access. A type map may be used as a term value within a node object if the term
- is defined with @container
set to @type
. The keys of a type map MUST be IRIs
+ is defined with @container
set to @type
,
+ or an array containing both @type
and @set
.
+ The keys of a type map MUST be IRIs
(relative IRI, compact IRI (including blank node identifiers), or absolute IRI)
and the values MUST be node objects.
A nested property is used to gather properties of a node object in a separate JSON object, or array of JSON objects which are not value objects. It is semantically transparent and is removed - during the process of expansion. Property nesting is recursive, and + during the process of expansion. Property nesting is recursive, and collections of nested properties may contain further nesting.
Semantically, nesting is treated as if the properties and values were declared directly @@ -3516,7 +3701,14 @@
If the expanded term definition contains the @container
keyword, its value MUST be either @list
, @set
,
- @language
, @index
, @id
, @type
or be null. If the value
+ @language
, @index
, @id
, @type
or be null
+
+ or an array containing exactly any one of those keywords,
+ or a combination of @set
and any of @index
,
+ @id
, @type
, @language
+ in any order
+ .
+ If the value
is @language
, when the term is used outside of the
@context
, the associated value MUST be a language map.
If the value is @index
, when the term is used outside of
@@ -3631,7 +3823,7 @@
Running the JSON-LD Expansion and Flattening algorithms against the +
Running the JSON-LD Expansion and Flattening algorithms against the JSON-LD input document in the example above would result in the following output:
@@ -3730,6 +3922,12 @@@container
in an expanded term definition
+ can also be an array containing any appropriate container
+ keyword along with @set
(other than @list
).
+ This allows a way to ensure that such property values will always
+ be expressed in array form.