diff --git a/spec/latest/common/terms.html b/spec/latest/common/terms.html index 9c1fc36e1..4fa7b94a9 100644 --- a/spec/latest/common/terms.html +++ b/spec/latest/common/terms.html @@ -110,7 +110,14 @@
@container set to @id, who's keys are
+ interpreted as IRIs representing the @id
+ of the associated node object; value MUST be a node object.
+ If the value contains a property expanding to @id, it's value MUST
+ be equivalent to the referencing key.@container set to @index, whose values MUST be any of the following types:
string,
@@ -244,6 +251,14 @@ @container set to @type, who's keys are
+ interpreted as IRIs representing the @type
+ of the associated node object;
+ value MUST be a node object, or array of node objects.
+ If the value contains a property expanding to @type, it's values
+ are merged with the map value when expanding.@container key, which must be either
@list, @set, @index,
+ @id, @type
or @language. Otherwise, an
invalid container mapping
has been detected and processing is aborted.@index and
+ term context is @index,
+ @type, or @id and
value is a JSON object then value
- is expanded from an index map as follows:
+ is expanded from an map as follows:
@index
+ and item does not have the key
@index, add the key-value pair
(@index-index) to
item.@id
+ and item does not have the key
+ @id, add the key-value pair
+ (@id-index) to
+ item.@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
+ item.@language or
- @index:
+ If container is @language,
+ @index, @id,
+ or @type:
true
+ for vocab.@language and
compacted item contains the key
@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.@index, then append the value @index
- to containers.@index,
+ @id, and @type, if value
+ contains that keyword, append it to containers.true, set type/language
to @type, type/language value to
@reverse, and append @set to containers.@container values within an expanded term definition may now
+ include @id and @type, corresponding to id maps and type maps.In addition to index maps, JSON-LD introduces the notion of id maps
+ for structuring data. The id indexing feature allows an author to
+ structure data using a simple key-value map where the keys map
+ to IRIs. This enables direct access to associated node objects
+ instead of having to scan an array in search of a specific item.
+ In JSON-LD such data can be specified by associating the
+ @id keyword with a
+ @container declaration in the context:
+ ++ +
In the example above, the post term has
+ been marked as an id map. The http://example.com/posts/1/en and
+ http://example.com/posts/1/de keys will be interpreted
+ as the @id property of the node object value.
The interpretation of the data above is exactly the same + as that in + using a JSON-LD processor.
+In addition to id and index maps, JSON-LD introduces the notion of type maps
+ for structuring data. The type indexing feature allows an author to
+ structure data using a simple key-value map where the keys map
+ to IRIs. This enables data to be structured based on the @type
+ of specific node objects.
+ In JSON-LD such data can be specified by associating the
+ @type keyword with a
+ @container declaration in the context:
+ ++ +
In the example above, the affiliation term has
+ been marked as an type map. The schema:Corporpation and
+ schema:ProfessionalService keys will be interpreted
+ as the @type property of the node object value.
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
+ (relative IRI, compact IRI (including blank node identifiers), or absolute IRI)
+ and the values MUST be node objects.
If the value contains a property expanding to @id, it's value MUST
+ be equivalent to the referencing key. Otherwise, the property from the value is used as
+ the @id of the node object value when expanding.
An type 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
+ (relative IRI, compact IRI (including blank node identifiers), or absolute IRI)
+ and the values MUST be node objects.
If the value contains a property expanding to @id, it's value MUST
+ be equivalent to the referencing key. Otherwise, the property from the value is used as
+ the @id of the node object value when expanding.
@context property, which defines a context used for values of
a property identified with such a term.@container values within an expanded term definition may now
+ include @id and @type, corresponding to id maps and type maps.The following is a list of open issues being worked on for the next release.
- - - diff --git a/test-suite/README.md b/test-suite/README.md index 4c648029f..0fc1022c5 100644 --- a/test-suite/README.md +++ b/test-suite/README.md @@ -23,6 +23,7 @@ Tests are defined into _compact_, _expand_, _flatten_, _frame_, _normalize_, and contained within the _sparql_ document using a SPARQL endpoint. The end result is a yes/no on whether the expected triples were extracted by the JSON-LD processor. +Unless `processingMode` is set explicitly in a test entry, `processingMode` is compatible with both `json-ld-1.0` and `json-ld-1.1`. Otherwise, a JSON-LD 1.0 processor should not run tests marked `json-ld-1.1` and a JSON-LD 1.1 processor should not run tests marked `json-ld-1.0`. Contributing ------------ diff --git a/test-suite/index.html b/test-suite/index.html index 0aa2d9e45..34176f4a8 100644 --- a/test-suite/index.html +++ b/test-suite/index.html @@ -166,6 +166,11 @@To run the tests, create a test runner which will run through each test manifest
and execute the tests defined within the manifest using the rules associated with
each @type defined for the test case as defined in the test vocabulary.
Unless processingMode is set explicitly in a test entry,
+ processingMode is compatible with both json-ld-1.0 and
+ json-ld-1.1. Otherwise, a JSON-LD 1.0 processor should not run
+ tests marked json-ld-1.1 and a JSON-LD 1.1 processor should not run
+ tests marked json-ld-1.0.
Note that property values are typed, and those which are typed as A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action. Negative syntax tests are tests of which the result should be a parser error. A A Negative Evaluation test is successful when the result of processing the input file specified as A Positive Evaluation test is successful when the result of processing the input file specified as A Negative Evaluation test is successful when the result of processing the input file specified as A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action.@id must
be treated as IRIs relative to the manifest test base. In particular, this means that
input, context, frame, and expandContext are to be
diff --git a/test-suite/tests/compact-m001-context.jsonld b/test-suite/tests/compact-m001-context.jsonld
new file mode 100644
index 000000000..e78b68996
--- /dev/null
+++ b/test-suite/tests/compact-m001-context.jsonld
@@ -0,0 +1,6 @@
+{
+ "@context": {
+ "@vocab": "http://example/",
+ "idmap": {"@container": "@id"}
+ }
+}
\ No newline at end of file
diff --git a/test-suite/tests/compact-m001-in.jsonld b/test-suite/tests/compact-m001-in.jsonld
new file mode 100644
index 000000000..c44d5e63e
--- /dev/null
+++ b/test-suite/tests/compact-m001-in.jsonld
@@ -0,0 +1,6 @@
+[{
+ "http://example/idmap": [
+ {"http://example/label": [{"@value": "Object with @id _:bar"}], "@id": "_:bar"},
+ {"http://example/label": [{"@value": "Object with @id
NormalizeTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the Normalization algorithmwith the input argument from mf:action (aliased as "input" in test manifest) referencing an JSON-LD file and optional options from :option. The expected results for a PositiveEvaluationTest are N-Quads serialized in lexographical order and MUST be compared using string comparison.mf:action (aliased as "input" in test manifest) results in the error identified by the literal value of mf:result (aliased as "expect" in test manifest). The specifics of invoking test, including the interpretation of options (:option) and other input files are specified through another class.mf:action (aliased as "input" in test manifest) exactly matches the output file specified as mf:result (aliased as "expect" in test manifest) using the comparison defined in another class. The specifics of invoking test, including the interpretation of options (:option) and other input files are specified through another class.mf:action (aliased as "input" in test manifest) results in the error identified by the literal value of mf:result (aliased as "expect" in test manifest). The specifics of invoking test, including the interpretation of options (:option) and other input files are specified through another class.
domain:
-
jld:Test
+ jld:Option