diff --git a/spec/latest/common/terms.html b/spec/latest/common/terms.html
index 3f6ed8432..bdb0ce9ec 100644
--- a/spec/latest/common/terms.html
+++ b/spec/latest/common/terms.html
@@ -2,7 +2,7 @@
This document uses the following terms as defined in JSON [[!RFC7159]]. Refer
- to the JSON Grammar section in [[!RFC7159]] for formal definitions.General Terminology
@context
where
the value, or the @id
of the value, is null
@@ -32,7 +32,7 @@ @value
, @list
, or @set
is set to
null in expanded form, then the entire JSON
object is ignored.Furthermore, the following terminology is used throughout this document:
_:
._:
.@list
@@ -180,13 +180,13 @@ @context
keyword.@id
key.@set
member.@type
, it's values
are merged with the map value when expanding.
- To understand the basics in this specification you must first be familiar with - JSON, which is detailed in [[!RFC7159]]. You must also understand the + JSON, which is detailed in [[!RFC7159]]. You must also understand the JSON-LD syntax defined in [[!JSON-LD]], which is the base syntax used by all of the algorithms in this document. To understand the API and how it is intended to operate in a programming environment, it is useful to have working @@ -717,16 +717,16 @@
true
,
set value to the result of resolving value against
the base IRI. Only the basic algorithm in
- section 5.2
+ section 5.2
of [[!RFC3986]] is used; neither
- Syntax-Based Normalization nor
- Scheme-Based Normalization
+ Syntax-Based Normalization nor
+ Scheme-Based Normalization
are performed. Characters additionally allowed in IRI references are treated
in the same way that unreserved characters are treated in URI references, per
- section 6.5
+ section 6.5
of [[!RFC3987]].@context
key as local context.
+ @type
using the
+ IRI Expansion algorithm,
+ passing active context, key for
+ value, and true
for vocab:
+ @type
,
+ and index's term definition in
+ term context has a local context, set
+ map context to the result of the Context Processing
+ algorithm, passing term context as active context and the
+ value of the index's local context as
+ local context. Otherwise, set map context
+ to term context.@id
and item does not have the key
@id
, add the key-value pair
- (@id
-index) to
- item.@id
-expanded index) to
+ item, where expanded index is set to the result of
+ using the
+ IRI Expansion algorithm,
+ passing active context, index, and true
+ for document relative.@type
- set types to the concatenation of index
- value with any existing values of
- @type
in item and add the
- key-value pair (@type
-types) to
+ set types to the concatenation of
+ expanded index with any existing values of
+ @type
in item, where
+ expanded index is set to the result of using
+ the IRI Expansion
+ algorithm, passing active context,
+ index, true
for vocab,
+ and true
for document relative
+ and add the key-value pair
+ (@type
-types) to
item.true
for vocab,
- to compacted value.true
for vocab.1
), then
set compacted value to its only item.@value
, then set compacted item
to the value associated with its @value
key.
- @index
,
- set map key to the value associated with
- with the key that equals container in
- expanded item.@id
, set
- map key to the value associated with the key that equals
- compacted container in compacted item
- and remove that key-value pair from compacted item.@type
,
- set map key to the first value associated with
- the key that equals container in expanded
- item. If there are remaining values in compacted
- item for compacted container, set the value
- of compacted container in compacted
- value to those remaining values. Otherwise, remove
- that key-value pair from compacted item.true
for vocab.
+ If there are remaining values in compacted item
+ for compacted container, set the value of
+ compacted container in compacted value
+ to those remaining values. Otherwise, remove that
+ key-value pair from compacted item.
xsd:double
, convert value to a
string in canonical lexical form of
- an xsd:double
as defined in [[!XMLSCHEMA11-2]]
+ an xsd:double
as defined in [[!XMLSCHEMA11-2]]
and described in
.
If datatype is null
, set it to
@@ -3309,7 +3362,7 @@ xsd:integer
, convert value to a
string in canonical lexical form of
- an xsd:integer
as defined in [[!XMLSCHEMA11-2]]
+ an xsd:integer
as defined in [[!XMLSCHEMA11-2]]
and described in
.
If datatype is null
, set it to
@@ -3386,7 +3439,7 @@ In the RDF abstract syntax, RDF literals have a - lexical form, as defined + lexical form, as defined in [[RDF11-CONCEPTS]]. The form of these literals is used when creating JSON-LD values based on these literals.
The JSON-LD API uses Promises to represent the result of the various asynchronous operations. - Promises are defined in [[ECMASCRIPT-6.0]]. + Promises are defined in [[ECMASCRIPT-6.0]]. General use within specifications can be found in [[promises-guide]].
To understand the basics in this specification you must first be familiar with -JSON, which is detailed in [[!RFC7159]]. You must also understand the +JSON, which is detailed in [[!RFC7159]]. You must also understand the JSON-LD Syntax [[!JSON-LD]], which is the base syntax used by all of the algorithms in this document, and the JSON-LD API [[!JSON-LD-API]]. To understand the API and how it is diff --git a/spec/latest/json-ld/index.html b/spec/latest/json-ld/index.html index 5b9ef5a6d..b63594d2d 100644 --- a/spec/latest/json-ld/index.html +++ b/spec/latest/json-ld/index.html @@ -220,7 +220,7 @@
To understand the basics in this specification you must first be familiar with - JSON, which is detailed in [[!RFC7159]].
+ JSON, which is detailed in [[!RFC7159]].This document almost exclusively uses the term IRI (Internationalized Resource Indicator) @@ -450,7 +450,7 @@
Linked Data, and the Web in general, uses IRIs - (Internationalized Resource Identifiers as described in [[!RFC3987]]) for unambiguous + (Internationalized Resource Identifiers as described in [[!RFC3987]]) for unambiguous identification. The idea is to use IRIs to assign unambiguous identifiers to data that may be of use to other developers. It is useful for terms, @@ -571,7 +571,7 @@
JSON documents can be interpreted as JSON-LD without having to be modified by - referencing a context via an HTTP Link Header + referencing a context via an HTTP Link Header as described in . It is also possible to apply a custom context using the JSON-LD API [[JSON-LD-API]].
@@ -613,12 +613,12 @@IRIs (Internationalized Resource Identifiers +
IRIs (Internationalized Resource Identifiers [[!RFC3987]]) are fundamental to Linked Data as that is how most nodes and properties are identified. In JSON-LD, IRIs may be represented as an absolute IRI or a relative IRI. An - absolute IRI is defined in [[!RFC3987]] as containing a + absolute IRI is defined in [[!RFC3987]] as containing a scheme along with path and optional query and fragment segments. A relative IRI is an IRI that is relative to some other absolute IRI. @@ -863,7 +863,7 @@
JSON-LD allows IRIs to be specified in a relative form which is
resolved against the document base according
- section 5.1 Establishing a Base URI
+ section 5.1 Establishing a Base URI
of [[RFC3986]]. The base IRI may be explicitly set with a context
using the @base
keyword.
Ordinary JSON documents can be interpreted as JSON-LD by referencing a JSON-LD
- context document in an HTTP Link Header. Doing so allows JSON to
+ context document in an HTTP Link Header. Doing so allows JSON to
be unambiguously machine-readable without requiring developers to drastically
change their documents and provides an upgrade path for existing infrastructure
without breaking existing clients that rely on the application/json
@@ -1500,7 +1500,7 @@
In order to use an external context with an ordinary JSON document, an author
MUST specify an IRI to a valid JSON-LD document in
- an HTTP Link Header [[!RFC5988]] using the http://www.w3.org/ns/json-ld#context
+ an HTTP Link Header [[!RFC5988]] using the http://www.w3.org/ns/json-ld#context
link relation. The referenced document MUST have a top-level JSON object.
The @context
subtree within that object is added to the top-level
JSON object of the referencing document. If an array
@@ -1510,7 +1510,7 @@
@context
subtree in the referenced document MUST be
discarded. Effectively this means that the active context is
initialized with the referenced external context. A response MUST NOT
- contain more than one HTTP Link Header [[!RFC5988]] using the
+ contain more than one HTTP Link Header [[!RFC5988]] using the
http://www.w3.org/ns/json-ld#context
link relation.
The following example demonstrates the use of an external context with an @@ -1542,7 +1542,7 @@
application/ld+json
media type MUST have all context information, including references to external
contexts, within the body of the document. Contexts linked via a
- http://www.w3.org/ns/json-ld#context
HTTP Link Header MUST be
+ http://www.w3.org/ns/json-ld#context
HTTP Link Header MUST be
ignored for such documents.
The example above would associate the ja
language
code with the two strings 花澄 and 科学者.
- Languages codes are defined in [[!BCP47]]. The default language applies to all
+ Languages codes are defined in [[!BCP47]]. The default language applies to all
string values that are not type coerced.
To clear the default language for a subtree, @language
can
@@ -2150,7 +2150,7 @@
+ +
Scoping can also be performed using a term used as a value of @type
:
+ ++ +
Scoping on @type
is useful when common properties are used to relate things of different types, where the vocabularies in use within different entities calls for different context scoping. For example, `hasPart`/`partOf` may be common terms used in a document, but mean different things depending on the context.
JSON-LD is a serialization format for Linked Data based on JSON. It is therefore important to distinguish between the syntax, which is defined by JSON in [[!RFC7159]], and the data model which is - an extension of the RDF data model [[!RDF11-CONCEPTS]]. The precise + an extension of the RDF data model [[!RDF11-CONCEPTS]]. The precise details of how JSON-LD relates to the RDF data model are given in .
@@ -3071,14 +3099,14 @@JSON-LD documents MAY contain data @@ -3098,7 +3126,7 @@
This appendix restates the syntactic conventions described in the previous sections more formally.
-A JSON-LD document MUST be valid JSON text as described +
A JSON-LD document MUST be valid JSON text as described in [[!RFC7159]].
A JSON-LD document MUST be a single node object @@ -3277,7 +3305,7 @@
The value associated with the @language
key MUST have the
- lexical form described in [[!BCP47]], or be null.
The value associated with the @index
key MUST be a
string.
@vocab
.
If the context definition has an @language
key,
- its value MUST have the lexical form described in [[!BCP47]] or be null.
If the context definition has an @base
key,
its value MUST be an absolute IRI, a relative IRI,
@@ -3475,7 +3503,7 @@
@id
or @vocab
.
If the expanded term definition contains the @language
keyword,
- its value MUST have the lexical form described in [[!BCP47]] or be null.
If the expanded term definition contains the @container
keyword, its value MUST be either @list
, @set
,
@@ -3506,12 +3534,12 @@
JSON-LD is a - concrete RDF syntax + concrete RDF syntax as described in [[RDF11-CONCEPTS]]. Hence, a JSON-LD document is both an RDF document and a JSON document and correspondingly represents an instance of an RDF data model. However, JSON-LD also extends the RDF data model to optionally allow JSON-LD to serialize - generalized RDF Datasets. + generalized RDF Datasets. The JSON-LD extensions to the RDF data model are:
Even though JSON-LD serializes generalized RDF Datasets, it can - also be used as a RDF graph source. + also be used as a RDF graph source. In that case, a consumer MUST only use the default graph and ignore all named graphs. This allows servers to expose data in languages such as Turtle and JSON-LD using content negotiation.
@@ -4101,7 +4129,7 @@When processing the "profile" media type parameter, it is important to note that its value contains one or more URIs and not IRIs. In some cases it might therefore be necessary to convert between IRIs and URIs as specified in - section 3 Relationship between IRIs and URIs + section 3 Relationship between IRIs and URIs of [[RFC3987]].
Fragment identifiers used with application/ld+json are treated as in RDF syntaxes, as per - RDF 1.1 Concepts and Abstract Syntax + RDF 1.1 Concepts and Abstract Syntax [[RDF11-CONCEPTS]].
diff --git a/test-suite/tests/compact-m005-context.jsonld b/test-suite/tests/compact-m005-context.jsonld new file mode 100644 index 000000000..5ebfbc699 --- /dev/null +++ b/test-suite/tests/compact-m005-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example/", + "ex": "http://example.org/", + "idmap": {"@container": "@id"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-m005-in.jsonld b/test-suite/tests/compact-m005-in.jsonld new file mode 100644 index 000000000..fe15d6377 --- /dev/null +++ b/test-suite/tests/compact-m005-in.jsonld @@ -0,0 +1,5 @@ +[{ + "http://example/idmap": [ + {"http://example/label": [{"@value": "Object with @id