From 3f035c775d1085618a43204b4cd8e25800bd4d31 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 12 Jan 2017 13:42:11 -0800 Subject: [PATCH 1/2] This adds a `@nest` member to term definitions used for _transparent properties_. --- spec/latest/common/terms.html | 4 + spec/latest/json-ld-api/index.html | 81 +++++++++++-- spec/latest/json-ld/index.html | 116 ++++++++++++++++++- test-suite/tests/compact-manifest.jsonld | 90 ++++++++++++++ test-suite/tests/compact-n001-context.jsonld | 6 + test-suite/tests/compact-n001-in.jsonld | 4 + test-suite/tests/compact-n001-out.jsonld | 10 ++ test-suite/tests/compact-n002-context.jsonld | 7 ++ test-suite/tests/compact-n002-in.jsonld | 4 + test-suite/tests/compact-n002-out.jsonld | 11 ++ test-suite/tests/compact-n003-context.jsonld | 7 ++ test-suite/tests/compact-n003-in.jsonld | 4 + test-suite/tests/compact-n003-out.jsonld | 11 ++ test-suite/tests/compact-n004-context.jsonld | 6 + test-suite/tests/compact-n004-in.jsonld | 4 + test-suite/tests/compact-n004-out.jsonld | 10 ++ test-suite/tests/compact-n005-context.jsonld | 7 ++ test-suite/tests/compact-n005-in.jsonld | 6 + test-suite/tests/compact-n005-out.jsonld | 10 ++ test-suite/tests/compact-n006-context.jsonld | 7 ++ test-suite/tests/compact-n006-in.jsonld | 6 + test-suite/tests/compact-n006-out.jsonld | 13 +++ test-suite/tests/compact-n007-context.jsonld | 7 ++ test-suite/tests/compact-n007-in.jsonld | 6 + test-suite/tests/compact-n007-out.jsonld | 13 +++ test-suite/tests/compact-n008-context.jsonld | 7 ++ test-suite/tests/compact-n008-in.jsonld | 6 + test-suite/tests/compact-n008-out.jsonld | 13 +++ test-suite/tests/compact-n009-context.jsonld | 7 ++ test-suite/tests/compact-n009-in.jsonld | 6 + test-suite/tests/compact-n009-out.jsonld | 13 +++ test-suite/tests/compact-n010-context.jsonld | 9 ++ test-suite/tests/compact-n010-in.jsonld | 4 + test-suite/tests/compact-n010-out.jsonld | 11 ++ test-suite/tests/error-manifest.jsonld | 62 +++++++++- test-suite/tests/error-n001-in.jsonld | 4 + test-suite/tests/error-n002-in.jsonld | 4 + test-suite/tests/error-n003-in.jsonld | 4 + test-suite/tests/error-n004-in.jsonld | 4 + test-suite/tests/error-n005-in.jsonld | 5 + test-suite/tests/error-n006-in.jsonld | 5 + test-suite/tests/error-n007-context.jsonld | 5 + test-suite/tests/error-n007-in.jsonld | 3 + test-suite/tests/expand-manifest.jsonld | 56 +++++++++ test-suite/tests/expand-n001-in.jsonld | 7 ++ test-suite/tests/expand-n001-out.jsonld | 4 + test-suite/tests/expand-n002-in.jsonld | 10 ++ test-suite/tests/expand-n002-out.jsonld | 4 + test-suite/tests/expand-n003-in.jsonld | 11 ++ test-suite/tests/expand-n003-out.jsonld | 7 ++ test-suite/tests/expand-n004-in.jsonld | 15 +++ test-suite/tests/expand-n004-out.jsonld | 8 ++ test-suite/tests/expand-n005-in.jsonld | 13 +++ test-suite/tests/expand-n005-out.jsonld | 8 ++ test-suite/tests/expand-n006-in.jsonld | 11 ++ test-suite/tests/expand-n006-out.jsonld | 9 ++ test-suite/tests/expand-n007-in.jsonld | 13 +++ test-suite/tests/expand-n007-out.jsonld | 9 ++ 58 files changed, 792 insertions(+), 15 deletions(-) create mode 100644 test-suite/tests/compact-n001-context.jsonld create mode 100644 test-suite/tests/compact-n001-in.jsonld create mode 100644 test-suite/tests/compact-n001-out.jsonld create mode 100644 test-suite/tests/compact-n002-context.jsonld create mode 100644 test-suite/tests/compact-n002-in.jsonld create mode 100644 test-suite/tests/compact-n002-out.jsonld create mode 100644 test-suite/tests/compact-n003-context.jsonld create mode 100644 test-suite/tests/compact-n003-in.jsonld create mode 100644 test-suite/tests/compact-n003-out.jsonld create mode 100644 test-suite/tests/compact-n004-context.jsonld create mode 100644 test-suite/tests/compact-n004-in.jsonld create mode 100644 test-suite/tests/compact-n004-out.jsonld create mode 100644 test-suite/tests/compact-n005-context.jsonld create mode 100644 test-suite/tests/compact-n005-in.jsonld create mode 100644 test-suite/tests/compact-n005-out.jsonld create mode 100644 test-suite/tests/compact-n006-context.jsonld create mode 100644 test-suite/tests/compact-n006-in.jsonld create mode 100644 test-suite/tests/compact-n006-out.jsonld create mode 100644 test-suite/tests/compact-n007-context.jsonld create mode 100644 test-suite/tests/compact-n007-in.jsonld create mode 100644 test-suite/tests/compact-n007-out.jsonld create mode 100644 test-suite/tests/compact-n008-context.jsonld create mode 100644 test-suite/tests/compact-n008-in.jsonld create mode 100644 test-suite/tests/compact-n008-out.jsonld create mode 100644 test-suite/tests/compact-n009-context.jsonld create mode 100644 test-suite/tests/compact-n009-in.jsonld create mode 100644 test-suite/tests/compact-n009-out.jsonld create mode 100644 test-suite/tests/compact-n010-context.jsonld create mode 100644 test-suite/tests/compact-n010-in.jsonld create mode 100644 test-suite/tests/compact-n010-out.jsonld create mode 100644 test-suite/tests/error-n001-in.jsonld create mode 100644 test-suite/tests/error-n002-in.jsonld create mode 100644 test-suite/tests/error-n003-in.jsonld create mode 100644 test-suite/tests/error-n004-in.jsonld create mode 100644 test-suite/tests/error-n005-in.jsonld create mode 100644 test-suite/tests/error-n006-in.jsonld create mode 100644 test-suite/tests/error-n007-context.jsonld create mode 100644 test-suite/tests/error-n007-in.jsonld create mode 100644 test-suite/tests/expand-n001-in.jsonld create mode 100644 test-suite/tests/expand-n001-out.jsonld create mode 100644 test-suite/tests/expand-n002-in.jsonld create mode 100644 test-suite/tests/expand-n002-out.jsonld create mode 100644 test-suite/tests/expand-n003-in.jsonld create mode 100644 test-suite/tests/expand-n003-out.jsonld create mode 100644 test-suite/tests/expand-n004-in.jsonld create mode 100644 test-suite/tests/expand-n004-out.jsonld create mode 100644 test-suite/tests/expand-n005-in.jsonld create mode 100644 test-suite/tests/expand-n005-out.jsonld create mode 100644 test-suite/tests/expand-n006-in.jsonld create mode 100644 test-suite/tests/expand-n006-out.jsonld create mode 100644 test-suite/tests/expand-n007-in.jsonld create mode 100644 test-suite/tests/expand-n007-out.jsonld diff --git a/spec/latest/common/terms.html b/spec/latest/common/terms.html index 6fc4abc08..166f4a149 100644 --- a/spec/latest/common/terms.html +++ b/spec/latest/common/terms.html @@ -173,6 +173,10 @@

General Terminology

specified via the @context keyword.
named graph
A linked data graph that is identified by an IRI or blank node +
nested property
+ A nested property is a property which is contained within an object referenced by + a semantically meaningless nesting property. +
(the graph name) and a graph.
node
Every node is an IRI, a blank node, diff --git a/spec/latest/json-ld-api/index.html b/spec/latest/json-ld-api/index.html index 842a6f84b..f82d555d5 100644 --- a/spec/latest/json-ld-api/index.html +++ b/spec/latest/json-ld-api/index.html @@ -903,7 +903,7 @@

Algorithm

  • If value contains the key @reverse:
      -
    1. If value contains an @id, member, an +
    2. If value contains @id or @nest, members, an invalid reverse property error has been detected and processing is aborted.
    3. If the value associated with the @reverse key @@ -1019,9 +1019,18 @@

      Algorithm

      of definition to language.
  • +
  • If value contains the key @nest: +
      +
    1. Initialize nest to the value associated with the + @nest key, which must be a string and + must not be a keyword other than @nest. Otherwise, an + invalid @nest value + error has been detected and processing is aborted.
    2. +
    +
  • If the value contains any key other than @id, @reverse, @container, - @context, or @type, an + @context, @nest, or @type, an invalid term definition error has been detected and processing is aborted.
  • Set the term definition of term in @@ -1269,7 +1278,7 @@

    Algorithm

    passing active context and the value of the @context key as local context.
  • Initialize an empty JSON object, result.
  • -
  • For each key and value in element, +
  • For each key and value in element, ordered lexicographically by key:
    1. If key is @context, continue to @@ -1417,6 +1426,10 @@

      Algorithm

    2. Continue with the next key from element.
  • +
  • If expanded property is @nest, + add key to nests, initializing it to an empty array, + if necessary. + Continue with the next key from element.
  • When the frame expansion flag is set, if expanded property is any other framing keyword (@explicit, @default, @@ -1545,6 +1558,22 @@

    Algorithm

    member of result.
  • +
  • For each key nesting-key in nests +
      +
    1. Set nested values to the value of nesting-key + in element, ensuring that it is an array.
    2. +
    3. For each nested value in nested values: +
        +
      1. If nested value is not a JSON object, or any key within + nested value expands to @value, an + invalid @nest value error + has been detected and processing is aborted.
      2. +
      3. Recursively repeat step 7 + using nested value for element.
      4. +
      +
    4. +
    +
  • If result contains the key @value: @@ -1928,7 +1957,22 @@

    Algorithm

    expanded value for value, true for vocab, and inside reverse.
  • -
  • If result does not have the key that equals +
  • If the term definition for item active property + in the active context has a @nest + member, that value (nest term) must be + @nest, or a term definition in the + active context that expands to @nest, + otherwise an invalid @nest + value error has been detected, and processing is aborted. + If result does not have the key that equals nest + term, initialize it to an empty JSON object (nest + object). If nest object does not have the key + that equals item active property, set this key's + value in nest object to an empty + array.Otherwise, if the key's value is not an + array, then set it to one containing only the + value.
  • +
  • Otherwise, if result does not have the key that equals item active property, set this key's value in result to an empty array. Otherwise, if the key's value is not an array, then set it @@ -1948,6 +1992,16 @@

    Algorithm

    expanded item for value, true for vocab, and inside reverse.
  • +
  • If the term definition for item active property + in the active context has a @nest + member, that value (nest term) must be + @nest, or a term definition in the + active context that expands to @nest, + otherwise an invalid @nest + value error has been detected, and processing is aborted. + Set nest result to the value of nest term in result, + initializing it to a new JSON object, if necessary; otherwise + set nest result to result.
  • Initialize container to null. If there is a container mapping for item active property in active context, @@ -1985,7 +2039,7 @@

    Algorithm

  • Otherwise, item active property must not be a key - in result because there cannot be two + in nest result because there cannot be two list objects associated with an active property that has a container mapping; a @@ -1998,9 +2052,9 @@

    Algorithm

    @index:
    1. If item active property is not a key in - result, initialize it to an empty JSON object. + nest result, initialize it to an empty JSON object. Initialize map object to the value of item active property - in result.
    2. + in nest result.
    3. If container is @language and compacted item contains the key @value, then set compacted item @@ -2030,9 +2084,9 @@

      Algorithm

    4. If item active property is not a key in result then add the key-value pair, (item active property-compacted item), - to result.
    5. + to nest result.
    6. Otherwise, if the value associated with the key that - equals item active property in result + equals item active property in nest result is not an array, set it to a new array containing only the value. Then append compacted item to the value if @@ -4058,6 +4112,7 @@

      JsonLdErrorCode

      "invalid language mapping", "invalid language-tagged string", "invalid language-tagged value", + "invalid @nest value", "invalid local context", "invalid remote context", "invalid reverse property", @@ -4134,6 +4189,8 @@

      JsonLdErrorCode

      associated language tag was detected.
  • invalid local context
    In invalid local context was detected.
    +
    invalid @nest value
    +
    An invalid value for @nest has been found.
    invalid remote context
    No valid context document has been found for a referenced, remote context.
    @@ -4208,6 +4265,12 @@

    Changes since 1.0 Recommendation of 16 January 2014

  • A new is required for framing, to create a single graph from the default and named graphs.
  • +
  • An expanded term definition can now have an + @nest property, which identifies a term expanding to + @nest which is used for containing properties using the same + @nest mapping. When expanding, the values of a property + expanding to @nest are treated as if they were contained + within the enclosing node object directly.
  • diff --git a/spec/latest/json-ld/index.html b/spec/latest/json-ld/index.html index 632eb7af3..24b62ef6a 100644 --- a/spec/latest/json-ld/index.html +++ b/spec/latest/json-ld/index.html @@ -395,6 +395,8 @@

    Syntax Tokens and Keywords

    IRI. This keyword is described in .
    @graph
    Used to express a graph. This keyword is described in .
    +
    @nest
    Collects a set of nested properties within + a node object.
    :
    The separator for JSON keys and values that use compact IRIs.
    @@ -2583,6 +2585,85 @@

    Data Indexing

    +
    +

    Nested Properties

    + +

    Many JSON APIs separate properties from their entities using an + intermediate object; in JSON-LD these are called nested properties. + For example, a set of possible labels may be grouped + under a common property:

    +
    +  
    +  
    + +

    By defining labels using the keyword @nest, + a JSON-LD processor will ignore the nesting created by using the + labels property and process the contents as if it were declared + directly within containing object. In this case, the labels + property is semantically meaningless. Defining it as equivalent to + @nest causes it to be ignored when expanding, making it + equivalent to the following:

    + +
    +  
    +  
    + +

    Similarly, node definitions may contain a @nest property to + reference a term aliased to @nest which causes such + values to be nested under that aliased term.

    +
    +  
    +  
    +
    +

    Expanded Document Form

    @@ -2989,6 +3070,7 @@

    Node Objects

  • @context,
  • @id,
  • @graph,
  • +
  • @nest,
  • @type,
  • @reverse, or
  • @index
  • @@ -3044,6 +3126,12 @@

    Node Objects

    for further discussion on @index values.

    +

    If the node object contains the @nest key, + its value MUST be an JSON object or an array of JSON objects + which MUST NOT include a value object. See + for further discussion + on @nest values.

    +

    Keys in a node object that are not keyword MAY expand to an absolute IRI using the active context. The values associated with keys that expand @@ -3186,6 +3274,19 @@

    Index Maps

    See for further information on this topic.

    +
    +

    Property Nesting

    + +

    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 + collections of nested properties may contain further nesting.

    + +

    Semantically, nesting is treated as if the properties and values were declared directly + within the containing node object.

    +
    +

    Context Definitions

    @@ -3225,7 +3326,7 @@

    Context Definitions

    expanded term definition SHOULD NOT contain any other keys.

    If an expanded term definition has an @reverse member, - it MUST NOT have an @id member at the same time. If an + it MUST NOT have @id or @nest members at the same time. If an @container member exists, its value MUST be null, @set, or @index.

    @@ -3263,6 +3364,10 @@

    Context Definitions

    the definition of a term cannot depend on the definition of another term if that other term also depends on the first term.

    +

    If the expanded term definition contains the @nest + keyword, its value MUST be either @nest, or a term + which expands to @nest.

    +

    See for further discussion on contexts.

    @@ -3451,17 +3556,20 @@

    Changes since 1.0 Recommendation of 16 January 2014

  • 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.
  • +
  • An expanded term definition can now have an + @nest property, which identifies a term expanding to + @nest which is used for containing properties using the same + @nest mapping. When expanding, the values of a property + expanding to @nest are treated as if they were contained + within the enclosing node object directly.
  • Open Issues

    The following is a list of open issues being worked on for the next release.

    -

    -

    -

    diff --git a/test-suite/tests/compact-manifest.jsonld b/test-suite/tests/compact-manifest.jsonld index 3958cad83..2ef140639 100644 --- a/test-suite/tests/compact-manifest.jsonld +++ b/test-suite/tests/compact-manifest.jsonld @@ -630,6 +630,96 @@ "context": "compact-c005-context.jsonld", "expect": "compact-c005-out.jsonld", "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn001", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Indexes to @nest for property with @nest", + "purpose": "Compaction using @nest", + "input": "compact-n001-in.jsonld", + "context": "compact-n001-context.jsonld", + "expect": "compact-n001-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn002", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Indexes to @nest for all properties with @nest", + "purpose": "Compaction using @nest", + "input": "compact-n002-in.jsonld", + "context": "compact-n002-context.jsonld", + "expect": "compact-n002-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn003", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Nests using alias of @nest", + "purpose": "Compaction using @nest", + "input": "compact-n003-in.jsonld", + "context": "compact-n003-context.jsonld", + "expect": "compact-n003-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn004", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Arrays of nested values", + "purpose": "Compaction using @nest", + "input": "compact-n004-in.jsonld", + "context": "compact-n004-context.jsonld", + "expect": "compact-n004-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn005", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Nested @container: @list", + "purpose": "Compaction using @nest", + "input": "compact-n005-in.jsonld", + "context": "compact-n005-context.jsonld", + "expect": "compact-n005-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn006", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Nested @container: @index", + "purpose": "Compaction using @nest", + "input": "compact-n006-in.jsonld", + "context": "compact-n006-context.jsonld", + "expect": "compact-n006-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn007", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Nested @container: @language", + "purpose": "Compaction using @nest", + "input": "compact-n007-in.jsonld", + "context": "compact-n007-context.jsonld", + "expect": "compact-n007-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn008", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Nested @container: @type", + "purpose": "Compaction using @nest", + "input": "compact-n008-in.jsonld", + "context": "compact-n008-context.jsonld", + "expect": "compact-n008-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn009", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Nested @container: @id", + "purpose": "Compaction using @nest", + "input": "compact-n009-in.jsonld", + "context": "compact-n009-context.jsonld", + "expect": "compact-n009-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn010", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Multiple nest aliases", + "purpose": "Compaction using @nest", + "input": "compact-n010-in.jsonld", + "context": "compact-n010-context.jsonld", + "expect": "compact-n010-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} } ] } diff --git a/test-suite/tests/compact-n001-context.jsonld b/test-suite/tests/compact-n001-context.jsonld new file mode 100644 index 000000000..18017f10b --- /dev/null +++ b/test-suite/tests/compact-n001-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "p2": {"@nest": "@nest"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n001-in.jsonld b/test-suite/tests/compact-n001-in.jsonld new file mode 100644 index 000000000..c03734564 --- /dev/null +++ b/test-suite/tests/compact-n001-in.jsonld @@ -0,0 +1,4 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [{"@value": "v2"}] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-n001-out.jsonld b/test-suite/tests/compact-n001-out.jsonld new file mode 100644 index 000000000..15819870e --- /dev/null +++ b/test-suite/tests/compact-n001-out.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "p2": {"@nest": "@nest"} + }, + "p1": "v1", + "@nest": { + "p2": "v2" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n002-context.jsonld b/test-suite/tests/compact-n002-context.jsonld new file mode 100644 index 000000000..557c93ac2 --- /dev/null +++ b/test-suite/tests/compact-n002-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "p1": {"@nest": "@nest"}, + "p2": {"@nest": "@nest"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n002-in.jsonld b/test-suite/tests/compact-n002-in.jsonld new file mode 100644 index 000000000..c03734564 --- /dev/null +++ b/test-suite/tests/compact-n002-in.jsonld @@ -0,0 +1,4 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [{"@value": "v2"}] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-n002-out.jsonld b/test-suite/tests/compact-n002-out.jsonld new file mode 100644 index 000000000..e9ff8d7c1 --- /dev/null +++ b/test-suite/tests/compact-n002-out.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "p1": {"@nest": "@nest"}, + "p2": {"@nest": "@nest"} + }, + "@nest": { + "p1": "v1", + "p2": "v2" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n003-context.jsonld b/test-suite/tests/compact-n003-context.jsonld new file mode 100644 index 000000000..421621b30 --- /dev/null +++ b/test-suite/tests/compact-n003-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "nest": "@nest", + "p2": {"@nest": "nest"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n003-in.jsonld b/test-suite/tests/compact-n003-in.jsonld new file mode 100644 index 000000000..c03734564 --- /dev/null +++ b/test-suite/tests/compact-n003-in.jsonld @@ -0,0 +1,4 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [{"@value": "v2"}] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-n003-out.jsonld b/test-suite/tests/compact-n003-out.jsonld new file mode 100644 index 000000000..a2415a83c --- /dev/null +++ b/test-suite/tests/compact-n003-out.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "nest": "@nest", + "p2": {"@nest": "nest"} + }, + "p1": "v1", + "nest": { + "p2": "v2" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n004-context.jsonld b/test-suite/tests/compact-n004-context.jsonld new file mode 100644 index 000000000..18017f10b --- /dev/null +++ b/test-suite/tests/compact-n004-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "p2": {"@nest": "@nest"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n004-in.jsonld b/test-suite/tests/compact-n004-in.jsonld new file mode 100644 index 000000000..5b70771a3 --- /dev/null +++ b/test-suite/tests/compact-n004-in.jsonld @@ -0,0 +1,4 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [{"@value": "v2"}, {"@value": "v3"}] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-n004-out.jsonld b/test-suite/tests/compact-n004-out.jsonld new file mode 100644 index 000000000..66705e9b9 --- /dev/null +++ b/test-suite/tests/compact-n004-out.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "p2": {"@nest": "@nest"} + }, + "p1": "v1", + "@nest": { + "p2": ["v2", "v3"] + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n005-context.jsonld b/test-suite/tests/compact-n005-context.jsonld new file mode 100644 index 000000000..5a712da14 --- /dev/null +++ b/test-suite/tests/compact-n005-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "list": {"@container": "@list", "@nest": "nestedlist"}, + "nestedlist": "@nest" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n005-in.jsonld b/test-suite/tests/compact-n005-in.jsonld new file mode 100644 index 000000000..ad985e83f --- /dev/null +++ b/test-suite/tests/compact-n005-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/list": [{"@list": [ + {"@value": "a"}, + {"@value": "b"} + ]}] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-n005-out.jsonld b/test-suite/tests/compact-n005-out.jsonld new file mode 100644 index 000000000..5e0035ab3 --- /dev/null +++ b/test-suite/tests/compact-n005-out.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "list": {"@container": "@list", "@nest": "nestedlist"}, + "nestedlist": "@nest" + }, + "nestedlist": { + "list": ["a", "b"] + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n006-context.jsonld b/test-suite/tests/compact-n006-context.jsonld new file mode 100644 index 000000000..281100fc7 --- /dev/null +++ b/test-suite/tests/compact-n006-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "index": {"@container": "@index", "@nest": "nestedindex"}, + "nestedindex": "@nest" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n006-in.jsonld b/test-suite/tests/compact-n006-in.jsonld new file mode 100644 index 000000000..2682faf32 --- /dev/null +++ b/test-suite/tests/compact-n006-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/index": [ + {"@value": "a", "@index": "A"}, + {"@value": "b", "@index": "B"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-n006-out.jsonld b/test-suite/tests/compact-n006-out.jsonld new file mode 100644 index 000000000..49f2172da --- /dev/null +++ b/test-suite/tests/compact-n006-out.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "index": {"@container": "@index", "@nest": "nestedindex"}, + "nestedindex": "@nest" + }, + "nestedindex": { + "index": { + "A": "a", + "B": "b" + } + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n007-context.jsonld b/test-suite/tests/compact-n007-context.jsonld new file mode 100644 index 000000000..02492cee3 --- /dev/null +++ b/test-suite/tests/compact-n007-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "container": {"@container": "@language", "@nest": "nestedlanguage"}, + "nestedlanguage": "@nest" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n007-in.jsonld b/test-suite/tests/compact-n007-in.jsonld new file mode 100644 index 000000000..f32329ab1 --- /dev/null +++ b/test-suite/tests/compact-n007-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/container": [ + {"@value": "Die Königin", "@language": "de"}, + {"@value": "The Queen", "@language": "en"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/compact-n007-out.jsonld b/test-suite/tests/compact-n007-out.jsonld new file mode 100644 index 000000000..659788d4c --- /dev/null +++ b/test-suite/tests/compact-n007-out.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "container": {"@container": "@language", "@nest": "nestedlanguage"}, + "nestedlanguage": "@nest" + }, + "nestedlanguage": { + "container": { + "en": "The Queen", + "de": "Die Königin" + } + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n008-context.jsonld b/test-suite/tests/compact-n008-context.jsonld new file mode 100644 index 000000000..0eeff3163 --- /dev/null +++ b/test-suite/tests/compact-n008-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type", "@nest": "nestedtypemap"}, + "nestedtypemap": "@nest" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n008-in.jsonld b/test-suite/tests/compact-n008-in.jsonld new file mode 100644 index 000000000..ecdfc4498 --- /dev/null +++ b/test-suite/tests/compact-n008-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-n008-out.jsonld b/test-suite/tests/compact-n008-out.jsonld new file mode 100644 index 000000000..d1e44c631 --- /dev/null +++ b/test-suite/tests/compact-n008-out.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@vocab": "http://example/", + "typemap": {"@container": "@type", "@nest": "nestedtypemap"}, + "nestedtypemap": "@nest" + }, + "nestedtypemap": { + "typemap": { + "_:bar": {"label": "Object with @type _:bar"}, + "http://example.org/foo": {"label": "Object with @type "} + } + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n009-context.jsonld b/test-suite/tests/compact-n009-context.jsonld new file mode 100644 index 000000000..2d4914180 --- /dev/null +++ b/test-suite/tests/compact-n009-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@vocab": "http://example/", + "idmap": {"@container": "@id", "@nest": "nestedidmap"}, + "nestedidmap": "@nest" + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n009-in.jsonld b/test-suite/tests/compact-n009-in.jsonld new file mode 100644 index 000000000..c44d5e63e --- /dev/null +++ b/test-suite/tests/compact-n009-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-n009-out.jsonld b/test-suite/tests/compact-n009-out.jsonld new file mode 100644 index 000000000..a251580cb --- /dev/null +++ b/test-suite/tests/compact-n009-out.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@vocab": "http://example/", + "idmap": {"@container": "@id", "@nest": "nestedidmap"}, + "nestedidmap": "@nest" + }, + "nestedidmap": { + "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-n010-context.jsonld b/test-suite/tests/compact-n010-context.jsonld new file mode 100644 index 000000000..c3f0c9dfc --- /dev/null +++ b/test-suite/tests/compact-n010-context.jsonld @@ -0,0 +1,9 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "foonest": "@nest", + "barnest": "@nest", + "foo": {"@nest": "foonest"}, + "bar": {"@nest": "barnest"} + } +} \ No newline at end of file diff --git a/test-suite/tests/compact-n010-in.jsonld b/test-suite/tests/compact-n010-in.jsonld new file mode 100644 index 000000000..5a47bb396 --- /dev/null +++ b/test-suite/tests/compact-n010-in.jsonld @@ -0,0 +1,4 @@ +{ + "http://example.org/foo": "bar", + "http://example.org/bar": "foo" +} \ No newline at end of file diff --git a/test-suite/tests/compact-n010-out.jsonld b/test-suite/tests/compact-n010-out.jsonld new file mode 100644 index 000000000..c53a3d76b --- /dev/null +++ b/test-suite/tests/compact-n010-out.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "foonest": "@nest", + "barnest": "@nest", + "foo": {"@nest": "foonest"}, + "bar": {"@nest": "barnest"} + }, + "barnest": {"bar": "foo"}, + "foonest": {"foo": "bar"} +} \ No newline at end of file diff --git a/test-suite/tests/error-manifest.jsonld b/test-suite/tests/error-manifest.jsonld index f9f1f8c38..f74aed07a 100644 --- a/test-suite/tests/error-manifest.jsonld +++ b/test-suite/tests/error-manifest.jsonld @@ -309,12 +309,70 @@ "input": "error-0043-in.jsonld", "expect": "conflicting indexes" }, { - "@id": "#t1001", + "@id": "#tc001", "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], "name": "Invalid keyword in term definition", "purpose": "Verifies that an exception is raised on expansion when a invalid term definition is found", "input": "error-c001-in.jsonld", - "expect": "invalid term definition" + "expect": "invalid term definition", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn001", + "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], + "name": "@nest MUST NOT have a string value", + "purpose": "container: @nest", + "input": "error-n001-in.jsonld", + "expect": "invalid @nest value", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn002", + "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], + "name": "@nest MUST NOT have a boolen value", + "purpose": "Transparent Nesting", + "input": "error-n002-in.jsonld", + "expect": "invalid @nest value", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn003", + "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], + "name": "@nest MUST NOT have a numeric value", + "purpose": "Transparent Nesting", + "input": "error-n003-in.jsonld", + "expect": "invalid @nest value", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn004", + "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], + "name": "@nest MUST NOT have a value object value", + "purpose": "Transparent Nesting", + "input": "error-n004-in.jsonld", + "expect": "invalid @nest value", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn005", + "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], + "name": "does not allow a keyword other than @nest for the value of @nest", + "purpose": "Transparent Nesting", + "input": "error-n005-in.jsonld", + "expect": "invalid @nest value", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn006", + "@type": [ "jld:NegativeEvaluationTest", "jld:FlattenTest" ], + "name": "does not allow @nest with @reverse", + "purpose": "Transparent Nesting", + "input": "error-n006-in.jsonld", + "expect": "invalid reverse property", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn007", + "@type": [ "jld:NegativeEvaluationTest", "jld:CompactTest" ], + "name": "Nest term not defined", + "purpose": "Transparent Nesting", + "input": "error-n007-in.jsonld", + "context": "error-n007-context.jsonld", + "expect": "invalid @nest value", + "option": {"processingMode": "json-ld-1.1"} } ] } diff --git a/test-suite/tests/error-n001-in.jsonld b/test-suite/tests/error-n001-in.jsonld new file mode 100644 index 000000000..81408e661 --- /dev/null +++ b/test-suite/tests/error-n001-in.jsonld @@ -0,0 +1,4 @@ +{ + "@context": {"@vocab": "http://example.org/"}, + "@nest": "This should generate an error" +} \ No newline at end of file diff --git a/test-suite/tests/error-n002-in.jsonld b/test-suite/tests/error-n002-in.jsonld new file mode 100644 index 000000000..7af5e3b47 --- /dev/null +++ b/test-suite/tests/error-n002-in.jsonld @@ -0,0 +1,4 @@ +{ + "@context": {"@vocab": "http://example.org/"}, + "@nest": true +} \ No newline at end of file diff --git a/test-suite/tests/error-n003-in.jsonld b/test-suite/tests/error-n003-in.jsonld new file mode 100644 index 000000000..91d338864 --- /dev/null +++ b/test-suite/tests/error-n003-in.jsonld @@ -0,0 +1,4 @@ +{ + "@context": {"@vocab": "http://example.org/"}, + "@nest": 1 +} \ No newline at end of file diff --git a/test-suite/tests/error-n004-in.jsonld b/test-suite/tests/error-n004-in.jsonld new file mode 100644 index 000000000..11e246a32 --- /dev/null +++ b/test-suite/tests/error-n004-in.jsonld @@ -0,0 +1,4 @@ +{ + "@context": {"@vocab": "http://example.org/"}, + "@nest": {"@value": "This should generate an error"} +} \ No newline at end of file diff --git a/test-suite/tests/error-n005-in.jsonld b/test-suite/tests/error-n005-in.jsonld new file mode 100644 index 000000000..a33791ca4 --- /dev/null +++ b/test-suite/tests/error-n005-in.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "term": {"@id": "http://example/term", "@nest": "@id"} + } +} \ No newline at end of file diff --git a/test-suite/tests/error-n006-in.jsonld b/test-suite/tests/error-n006-in.jsonld new file mode 100644 index 000000000..3015c7af6 --- /dev/null +++ b/test-suite/tests/error-n006-in.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "term": {"@reverse": "http://example/term", "@nest": "@nest"} + } +} \ No newline at end of file diff --git a/test-suite/tests/error-n007-context.jsonld b/test-suite/tests/error-n007-context.jsonld new file mode 100644 index 000000000..d9cec5a10 --- /dev/null +++ b/test-suite/tests/error-n007-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "term": {"@id": "http://example/foo", "@nest": "unknown"} + } +} \ No newline at end of file diff --git a/test-suite/tests/error-n007-in.jsonld b/test-suite/tests/error-n007-in.jsonld new file mode 100644 index 000000000..ffc25a6b7 --- /dev/null +++ b/test-suite/tests/error-n007-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example/foo": "bar" +} \ No newline at end of file diff --git a/test-suite/tests/expand-manifest.jsonld b/test-suite/tests/expand-manifest.jsonld index 925910b00..60411fddf 100644 --- a/test-suite/tests/expand-manifest.jsonld +++ b/test-suite/tests/expand-manifest.jsonld @@ -598,6 +598,62 @@ "input": "expand-c005-in.jsonld", "expect": "expand-c005-out.jsonld", "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn001", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expands input using @nest", + "purpose": "Expansion using @nest", + "input": "expand-n001-in.jsonld", + "expect": "expand-n001-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn002", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expands input using @nest", + "purpose": "Expansion using @nest", + "input": "expand-n002-in.jsonld", + "expect": "expand-n002-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn003", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expands input using @nest", + "purpose": "Expansion using @nest", + "input": "expand-n003-in.jsonld", + "expect": "expand-n003-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn004", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expands input using @nest", + "purpose": "Expansion using @nest", + "input": "expand-n004-in.jsonld", + "expect": "expand-n004-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn005", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expands input using @nest", + "purpose": "Expansion using @nest", + "input": "expand-n005-in.jsonld", + "expect": "expand-n005-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn006", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expands input using @nest", + "purpose": "Expansion using @nest", + "input": "expand-n006-in.jsonld", + "expect": "expand-n006-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} + }, { + "@id": "#tn007", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expands input using @nest", + "purpose": "Expansion using @nest", + "input": "expand-n007-in.jsonld", + "expect": "expand-n007-out.jsonld", + "option": {"processingMode": "json-ld-1.1"} } ] } diff --git a/test-suite/tests/expand-n001-in.jsonld b/test-suite/tests/expand-n001-in.jsonld new file mode 100644 index 000000000..f07430585 --- /dev/null +++ b/test-suite/tests/expand-n001-in.jsonld @@ -0,0 +1,7 @@ +{ + "@context": {"@vocab": "http://example.org/"}, + "p1": "v1", + "@nest": { + "p2": "v2" + } +} \ No newline at end of file diff --git a/test-suite/tests/expand-n001-out.jsonld b/test-suite/tests/expand-n001-out.jsonld new file mode 100644 index 000000000..c03734564 --- /dev/null +++ b/test-suite/tests/expand-n001-out.jsonld @@ -0,0 +1,4 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [{"@value": "v2"}] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-n002-in.jsonld b/test-suite/tests/expand-n002-in.jsonld new file mode 100644 index 000000000..36e57b95d --- /dev/null +++ b/test-suite/tests/expand-n002-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "nest": "@nest" + }, + "p1": "v1", + "nest": { + "p2": "v2" + } +} \ No newline at end of file diff --git a/test-suite/tests/expand-n002-out.jsonld b/test-suite/tests/expand-n002-out.jsonld new file mode 100644 index 000000000..c03734564 --- /dev/null +++ b/test-suite/tests/expand-n002-out.jsonld @@ -0,0 +1,4 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [{"@value": "v2"}] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-n003-in.jsonld b/test-suite/tests/expand-n003-in.jsonld new file mode 100644 index 000000000..c1ec90227 --- /dev/null +++ b/test-suite/tests/expand-n003-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "nest": "@nest" + }, + "p1": "v1", + "nest": { + "p2": "v3" + }, + "p2": "v2" +} \ No newline at end of file diff --git a/test-suite/tests/expand-n003-out.jsonld b/test-suite/tests/expand-n003-out.jsonld new file mode 100644 index 000000000..c8fc8de29 --- /dev/null +++ b/test-suite/tests/expand-n003-out.jsonld @@ -0,0 +1,7 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [ + {"@value": "v2"}, + {"@value": "v3"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-n004-in.jsonld b/test-suite/tests/expand-n004-in.jsonld new file mode 100644 index 000000000..eeffff0a6 --- /dev/null +++ b/test-suite/tests/expand-n004-in.jsonld @@ -0,0 +1,15 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "nest1": "@nest", + "nest2": "@nest" + }, + "p1": "v1", + "nest2": { + "p2": "v4" + }, + "p2": "v2", + "nest1": { + "p2": "v3" + } +} \ No newline at end of file diff --git a/test-suite/tests/expand-n004-out.jsonld b/test-suite/tests/expand-n004-out.jsonld new file mode 100644 index 000000000..90e1950b1 --- /dev/null +++ b/test-suite/tests/expand-n004-out.jsonld @@ -0,0 +1,8 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [ + {"@value": "v2"}, + {"@value": "v3"}, + {"@value": "v4"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-n005-in.jsonld b/test-suite/tests/expand-n005-in.jsonld new file mode 100644 index 000000000..a9f394978 --- /dev/null +++ b/test-suite/tests/expand-n005-in.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@vocab": "http://example.org/" + }, + "p1": "v1", + "@nest": { + "p2": "v3", + "@nest": { + "p2": "v4" + } + }, + "p2": "v2" +} \ No newline at end of file diff --git a/test-suite/tests/expand-n005-out.jsonld b/test-suite/tests/expand-n005-out.jsonld new file mode 100644 index 000000000..90e1950b1 --- /dev/null +++ b/test-suite/tests/expand-n005-out.jsonld @@ -0,0 +1,8 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [ + {"@value": "v2"}, + {"@value": "v3"}, + {"@value": "v4"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-n006-in.jsonld b/test-suite/tests/expand-n006-in.jsonld new file mode 100644 index 000000000..9b02d605d --- /dev/null +++ b/test-suite/tests/expand-n006-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "nest": "@nest" + }, + "p1": "v1", + "nest": { + "p2": ["v4", "v5"] + }, + "p2": ["v2", "v3"] +} \ No newline at end of file diff --git a/test-suite/tests/expand-n006-out.jsonld b/test-suite/tests/expand-n006-out.jsonld new file mode 100644 index 000000000..d5c104074 --- /dev/null +++ b/test-suite/tests/expand-n006-out.jsonld @@ -0,0 +1,9 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [ + {"@value": "v2"}, + {"@value": "v3"}, + {"@value": "v4"}, + {"@value": "v5"} + ] +}] \ No newline at end of file diff --git a/test-suite/tests/expand-n007-in.jsonld b/test-suite/tests/expand-n007-in.jsonld new file mode 100644 index 000000000..aa9e84681 --- /dev/null +++ b/test-suite/tests/expand-n007-in.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@vocab": "http://example.org/", + "nest": "@nest" + }, + "p1": "v1", + "nest": [{ + "p2": "v4" + }, { + "p2": "v5" + }], + "p2": ["v2", "v3"] +} \ No newline at end of file diff --git a/test-suite/tests/expand-n007-out.jsonld b/test-suite/tests/expand-n007-out.jsonld new file mode 100644 index 000000000..d5c104074 --- /dev/null +++ b/test-suite/tests/expand-n007-out.jsonld @@ -0,0 +1,9 @@ +[{ + "http://example.org/p1": [{"@value": "v1"}], + "http://example.org/p2": [ + {"@value": "v2"}, + {"@value": "v3"}, + {"@value": "v4"}, + {"@value": "v5"} + ] +}] \ No newline at end of file From fbae5727fc5367392a689184cb3417cd76ead52d Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 12 Jan 2017 14:48:26 -0800 Subject: [PATCH 2/2] Move order of "invalid @nest value" to be along with other invalid keywords --- spec/latest/json-ld-api/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/latest/json-ld-api/index.html b/spec/latest/json-ld-api/index.html index f82d555d5..ff1ca37bb 100644 --- a/spec/latest/json-ld-api/index.html +++ b/spec/latest/json-ld-api/index.html @@ -4102,6 +4102,7 @@

    JsonLdErrorCode

    "cyclic IRI mapping", "invalid @id value", "invalid @index value", + "invalid @nest value", "invalid @reverse value", "invalid base IRI", "invalid container mapping", @@ -4112,7 +4113,6 @@

    JsonLdErrorCode

    "invalid language mapping", "invalid language-tagged string", "invalid language-tagged value", - "invalid @nest value", "invalid local context", "invalid remote context", "invalid reverse property", @@ -4154,6 +4154,8 @@

    JsonLdErrorCode

    invalid @index value
    An @index member was encountered whose value was not a string.
    +
    invalid @nest value
    +
    An invalid value for @nest has been found.
    invalid @reverse value
    An invalid value for an @reverse member has been detected, i.e., the value was not a JSON object.
    @@ -4189,8 +4191,6 @@

    JsonLdErrorCode

    associated language tag was detected.
    invalid local context
    In invalid local context was detected.
    -
    invalid @nest value
    -
    An invalid value for @nest has been found.
    invalid remote context
    No valid context document has been found for a referenced, remote context.