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 @@

General Terminology

node object or a value object in the input.
graph name
The IRI identifying a named graph.
-
index map
+
id map
+ An id map is a JSON object value of a term defined with + @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.
+
index map
An index map is a JSON object value of a term defined with @container set to @index, whose values MUST be any of the following types: string, @@ -244,6 +251,14 @@

General Terminology

a JSON object as a property, type, or elsewhere that a string is interpreted as a vocabulary item. Its value is either a string, expanding to an absolute IRI, or an expanded term definition.
+
type map
+ An type map is a JSON object value of a term defined with + @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.
typed literal
A typed literal is a literal with an associated IRI which indicates the literal's datatype. See Algorithm
  • Initialize container to the value associated with the @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.
  • @@ -1470,9 +1471,10 @@

    Algorithm

  • Otherwise, if key's container mapping in - term context is @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:
    1. Initialize expanded value to an empty array.
    2. @@ -1488,11 +1490,23 @@

      Algorithm

      key as active property, and index value as element.
    3. For each item in index value: -
        -
      1. If item does not have the key +
          +
        1. If container mapping is @index + and item does not have the key @index, add the key-value pair (@index-index) to item.
        2. +
        3. Otherwise, if container mapping is @id + and item does not have the key + @id, add the key-value pair + (@id-index) to + item.
        4. +
        5. Otherwise, if container mapping is @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.
        6. Append item to expanded value.
      2. @@ -1994,20 +2008,39 @@

        Algorithm

    4. - If container is @language or - @index: + If container is @language, + @index, @id, + or @type:
      1. If item active property is not a key in result, initialize it to an empty JSON object. Initialize map object to the value of item active property in result.
      2. +
      3. Set compacted container to the result of calling the + IRI Compaction algorithm + passing active context, + container as iri, and true + for vocab.
      4. If container is @language and compacted item contains the key @value, then set compacted item to the value associated with its @value key.
      5. -
      6. Initialize map key to the value associated with +
      7. If container is @index, + set map key to the value associated with with the key that equals container in expanded item.
      8. +
      9. If container is @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.
      10. +
      11. If container is @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.
      12. If map key is not a key in map object, then set this key's value in map object to compacted item. Otherwise, if the value @@ -2284,9 +2317,10 @@

        Algorithm

        variables will keep track of the preferred type mapping or language mapping for a term, based on what is compatible with value.
      13. -
      14. If value is a JSON object that contains the - key @index, then append the value @index - to containers.
      15. +
      16. If value is a JSON object, + then for the keywords @index, + @id, and @type, if value + contains that keyword, append it to containers.
      17. If reverse is true, set type/language to @type, type/language value to @reverse, and append @set to containers.
      18. @@ -4208,6 +4242,8 @@

        Changes since 1.0 Recommendation of 16 January 2014

      19. A new is required for framing, to create a single graph from the default and named graphs.
      20. +
      21. @container values within an expanded term definition may now + include @id and @type, corresponding to id maps and type maps.
      22. diff --git a/spec/latest/json-ld/index.html b/spec/latest/json-ld/index.html index 632eb7af3..7dcf77131 100644 --- a/spec/latest/json-ld/index.html +++ b/spec/latest/json-ld/index.html @@ -2583,6 +2583,107 @@

        Data Indexing

        +
        +

        Node Identifier Indexing

        + +

        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.

        +
        + +
        +

        Node Type Indexing

        + +

        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.

        +
        +

        Expanded Document Form

        @@ -3186,6 +3287,34 @@

        Index Maps

        See for further information on this topic.

        +
        +

        Id Maps

        + +

        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.

        +
        + +
        +

        Type Maps

        + +

        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 Definitions

        @@ -3451,17 +3580,16 @@

        Changes since 1.0 Recommendation of 16 January 2014

      23. An expanded term definition can now have an @context property, which defines a context used for values of a property identified with such a term.
      24. +
      25. @container values within an expanded term definition may now + include @id and @type, corresponding to id maps and type maps.
      26. Open Issues

        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 @@

        Running the test suit

        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 @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 "}], "@id": "http://example.org/foo"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-m001-out.jsonld b/test-suite/tests/compact-m001-out.jsonld new file mode 100644 index 000000000..81a736c75 --- /dev/null +++ b/test-suite/tests/compact-m001-out.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "idmap": {"@container": "@id"} + }, + "idmap": { + "http://example.org/foo": {"label": "Object with @id "}, + "_:bar": {"label": "Object with @id _:bar"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-m002-context.jsonld b/test-suite/tests/compact-m002-context.jsonld new file mode 100644 index 000000000..e78b68996 --- /dev/null +++ b/test-suite/tests/compact-m002-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-m002-in.jsonld b/test-suite/tests/compact-m002-in.jsonld new file mode 100644 index 000000000..274bb8c73 --- /dev/null +++ b/test-suite/tests/compact-m002-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example/idmap": [ + {"@id": "_:foo", "http://example/label": [{"@value": "Object with @id _:bar"}]}, + {"@id": "http://example.org/bar", "http://example/label": [{"@value": "Object with @id "}]} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-m002-out.jsonld b/test-suite/tests/compact-m002-out.jsonld new file mode 100644 index 000000000..c11c0bdd5 --- /dev/null +++ b/test-suite/tests/compact-m002-out.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "idmap": {"@container": "@id"} + }, + "idmap": { + "_:foo": {"label": "Object with @id _:bar"}, + "http://example.org/bar": {"label": "Object with @id "} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-m003-context.jsonld b/test-suite/tests/compact-m003-context.jsonld new file mode 100644 index 000000000..6540eb51d --- /dev/null +++ b/test-suite/tests/compact-m003-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-m003-in.jsonld b/test-suite/tests/compact-m003-in.jsonld new file mode 100644 index 000000000..ecdfc4498 --- /dev/null +++ b/test-suite/tests/compact-m003-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example/typemap": [ + {"http://example/label": [{"@value": "Object with @type _:bar"}], "@type": ["_:bar"]}, + {"http://example/label": [{"@value": "Object with @type "}], "@type": ["http://example.org/foo"]} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-m003-out.jsonld b/test-suite/tests/compact-m003-out.jsonld new file mode 100644 index 000000000..f79d87a63 --- /dev/null +++ b/test-suite/tests/compact-m003-out.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type"} + }, + "typemap": { + "http://example.org/foo": {"label": "Object with @type "}, + "_:bar": {"label": "Object with @type _:bar"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-m004-context.jsonld b/test-suite/tests/compact-m004-context.jsonld new file mode 100644 index 000000000..6540eb51d --- /dev/null +++ b/test-suite/tests/compact-m004-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-m004-in.jsonld b/test-suite/tests/compact-m004-in.jsonld new file mode 100644 index 000000000..f35a9a884 --- /dev/null +++ b/test-suite/tests/compact-m004-in.jsonld @@ -0,0 +1,12 @@ +[{ + "http://example/typemap": [ + { + "@type": ["_:bar", "_:foo"], + "http://example/label": [{"@value": "Object with @type _:bar"}] + }, + { + "@type": ["http://example.org/foo", "http://example.org/bar"], + "http://example/label": [{"@value": "Object with @type "}] + } + ] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-m004-out.jsonld b/test-suite/tests/compact-m004-out.jsonld new file mode 100644 index 000000000..b75a0ff84 --- /dev/null +++ b/test-suite/tests/compact-m004-out.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type"} + }, + "typemap": { + "http://example.org/foo": {"@type": "http://example.org/bar", "label": "Object with @type "}, + "_:bar": {"@type": "_:foo", "label": "Object with @type _:bar"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-manifest.jsonld b/test-suite/tests/compact-manifest.jsonld index 3958cad83..0aeb98f15 100644 --- a/test-suite/tests/compact-manifest.jsonld +++ b/test-suite/tests/compact-manifest.jsonld @@ -630,6 +630,42 @@ "context": "compact-c005-context.jsonld", "expect": "compact-c005-out.jsonld", "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm001", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Indexes to object not having an @id", + "purpose": "Compaction using @container: @id", + "input": "compact-m001-in.jsonld", + "context": "compact-m001-context.jsonld", + "expect": "compact-m001-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm002", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Indexes to object already having an @id", + "purpose": "Compaction using @container: @id", + "input": "compact-m002-in.jsonld", + "context": "compact-m002-context.jsonld", + "expect": "compact-m002-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm003", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Indexes to object not having an @type", + "purpose": "Compaction using @container: @type", + "input": "compact-m003-in.jsonld", + "context": "compact-m003-context.jsonld", + "expect": "compact-m003-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm004", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Indexes to object already having an @type", + "purpose": "Compaction using @container: @type", + "input": "compact-m004-in.jsonld", + "context": "compact-m004-context.jsonld", + "expect": "compact-m004-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} } ] } diff --git a/test-suite/tests/error-m021-in.jsonld b/test-suite/tests/error-m021-in.jsonld new file mode 100644 index 000000000..ea465394e --- /dev/null +++ b/test-suite/tests/error-m021-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "term": {"@id": "http://example/term", "@container": "@context"} + }, + "@id": "http://example/test#example" +} \ No newline at end of file diff --git a/test-suite/tests/error-manifest.jsonld b/test-suite/tests/error-manifest.jsonld index 11c25e54c..4ef0ceeee 100644 --- a/test-suite/tests/error-manifest.jsonld +++ b/test-suite/tests/error-manifest.jsonld @@ -152,7 +152,10 @@ "name": "Invalid container mapping", "purpose": "Verifies that an exception is raised on expansion when a invalid container mapping is found", "input": "error-0021-in.jsonld", - "expect": "invalid container mapping" + "expect": "invalid container mapping", + "option": { + "processingMode": "json-ld-1.0" + } }, { "@id": "#t0022", "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], @@ -316,6 +319,14 @@ "input": "error-c001-in.jsonld", "expect": "invalid term definition", "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm021", + "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], + "name": "Invalid container mapping", + "purpose": "Verifies that an exception is raised on expansion when a invalid container mapping is found", + "input": "error-m021-in.jsonld", + "expect": "invalid container mapping", + "option": {"processingMode": "json-ld-1.1"} } ] } diff --git a/test-suite/tests/expand-m001-in.jsonld b/test-suite/tests/expand-m001-in.jsonld new file mode 100644 index 000000000..81a736c75 --- /dev/null +++ b/test-suite/tests/expand-m001-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "idmap": {"@container": "@id"} + }, + "idmap": { + "http://example.org/foo": {"label": "Object with @id "}, + "_:bar": {"label": "Object with @id _:bar"} + } +} \ No newline at end of file diff --git a/test-suite/tests/expand-m001-out.jsonld b/test-suite/tests/expand-m001-out.jsonld new file mode 100644 index 000000000..c44d5e63e --- /dev/null +++ b/test-suite/tests/expand-m001-out.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 "}], "@id": "http://example.org/foo"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-m002-in.jsonld b/test-suite/tests/expand-m002-in.jsonld new file mode 100644 index 000000000..1134f16b7 --- /dev/null +++ b/test-suite/tests/expand-m002-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "idmap": {"@container": "@id"} + }, + "idmap": { + "http://example.org/foo": {"@id": "http://example.org/bar", "label": "Object with @id "}, + "_:bar": {"@id": "_:foo", "label": "Object with @id _:bar"} + } +} \ No newline at end of file diff --git a/test-suite/tests/expand-m002-out.jsonld b/test-suite/tests/expand-m002-out.jsonld new file mode 100644 index 000000000..274bb8c73 --- /dev/null +++ b/test-suite/tests/expand-m002-out.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example/idmap": [ + {"@id": "_:foo", "http://example/label": [{"@value": "Object with @id _:bar"}]}, + {"@id": "http://example.org/bar", "http://example/label": [{"@value": "Object with @id "}]} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-m003-in.jsonld b/test-suite/tests/expand-m003-in.jsonld new file mode 100644 index 000000000..f79d87a63 --- /dev/null +++ b/test-suite/tests/expand-m003-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type"} + }, + "typemap": { + "http://example.org/foo": {"label": "Object with @type "}, + "_:bar": {"label": "Object with @type _:bar"} + } +} \ No newline at end of file diff --git a/test-suite/tests/expand-m003-out.jsonld b/test-suite/tests/expand-m003-out.jsonld new file mode 100644 index 000000000..ecdfc4498 --- /dev/null +++ b/test-suite/tests/expand-m003-out.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example/typemap": [ + {"http://example/label": [{"@value": "Object with @type _:bar"}], "@type": ["_:bar"]}, + {"http://example/label": [{"@value": "Object with @type "}], "@type": ["http://example.org/foo"]} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-m004-in.jsonld b/test-suite/tests/expand-m004-in.jsonld new file mode 100644 index 000000000..b75a0ff84 --- /dev/null +++ b/test-suite/tests/expand-m004-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type"} + }, + "typemap": { + "http://example.org/foo": {"@type": "http://example.org/bar", "label": "Object with @type "}, + "_:bar": {"@type": "_:foo", "label": "Object with @type _:bar"} + } +} \ No newline at end of file diff --git a/test-suite/tests/expand-m004-out.jsonld b/test-suite/tests/expand-m004-out.jsonld new file mode 100644 index 000000000..f35a9a884 --- /dev/null +++ b/test-suite/tests/expand-m004-out.jsonld @@ -0,0 +1,12 @@ +[{ + "http://example/typemap": [ + { + "@type": ["_:bar", "_:foo"], + "http://example/label": [{"@value": "Object with @type _:bar"}] + }, + { + "@type": ["http://example.org/foo", "http://example.org/bar"], + "http://example/label": [{"@value": "Object with @type "}] + } + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-manifest.jsonld b/test-suite/tests/expand-manifest.jsonld index 925910b00..04cd53ef4 100644 --- a/test-suite/tests/expand-manifest.jsonld +++ b/test-suite/tests/expand-manifest.jsonld @@ -598,6 +598,38 @@ "input": "expand-c005-in.jsonld", "expect": "expand-c005-out.jsonld", "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm001", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Adds @id to object not having an @id", + "purpose": "Expansion using @container: @id", + "input": "expand-m001-in.jsonld", + "expect": "expand-m001-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm002", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Retains @id in object already having an @id", + "purpose": "Expansion using @container: @id", + "input": "expand-m002-in.jsonld", + "expect": "expand-m002-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm003", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Adds @type to object not having an @type", + "purpose": "Expansion using @container: @type", + "input": "expand-m003-in.jsonld", + "expect": "expand-m003-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tm004", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Prepends @type in object already having an @type", + "purpose": "Expansion using @container: @type", + "input": "expand-m004-in.jsonld", + "expect": "expand-m004-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} } ] } diff --git a/test-suite/vocab.html b/test-suite/vocab.html index 404a151b5..b7693bff2 100644 --- a/test-suite/vocab.html +++ b/test-suite/vocab.html @@ -143,10 +143,10 @@

        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.

        Normalization Evaluation Test

        A 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.

        -
        Positive Evaluation Test
        -

        A Negative Evaluation test is successful when the result of processing the input file specified as 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.

        Positive Evaluation Test

        A Positive Evaluation test is successful when the result of processing the input file specified as 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.

        +
        Positive Evaluation Test
        +

        A Negative Evaluation test is successful when the result of processing the input file specified as 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.

        Positive Syntax Test

        A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action.

        Processor Options
        @@ -301,7 +301,7 @@

        domain: - jld:Test + jld:Option
        diff --git a/test-suite/vocab.jsonld b/test-suite/vocab.jsonld index edfe6030c..dd01a6242 100644 --- a/test-suite/vocab.jsonld +++ b/test-suite/vocab.jsonld @@ -183,7 +183,7 @@ "@id": "jld:processingMode", "@type": "rdf:Property", "rdfs:comment": "If set to \"json-ld-1.1\", the JSON-LD processor must produce exactly the same results as the algorithms defined in this specification. If set to another value, the JSON-LD processor is allowed to extend or modify the algorithms defined in this specification to enable application-specific optimizations. The definition of such optimizations is beyond the scope of this specification and thus not defined. Consequently, different implementations may implement different optimizations. Developers must not define modes beginning with json-ld as they are reserved for future versions of this specification.", - "rdfs:domain": "jld:Test", + "rdfs:domain": "jld:Option", "rdfs:label": "processing mode", "rdfs:range": "xsd:string" }, diff --git a/test-suite/vocab.ttl b/test-suite/vocab.ttl index 1389df2dc..64980336d 100644 --- a/test-suite/vocab.ttl +++ b/test-suite/vocab.ttl @@ -224,7 +224,7 @@ Consequently, different implementations may implement different optimizations. Developers must not define modes beginning with json-ld as they are reserved for future versions of this specification. """ ; - rdfs:domain :Test ; + rdfs:domain :Option ; rdfs:range xsd:string . :produceGeneralizedRdf a rdf:Property ;