diff --git a/index.html b/index.html index 609c79fd..e6fa534e 100644 --- a/index.html +++ b/index.html @@ -1341,6 +1341,13 @@

Algorithm

error has been detected and processing is aborted; if it equals @context, an invalid keyword alias error has been detected and processing is aborted. +
  • If the term contains a colon (:) + anywhere but as the last character of term, + and the result of expanding term + using the IRI Expansion algorithm + is not the same as the IRI mapping of definition, + an invalid IRI mapping + error has been detected and processing is aborted.
  • If term does not contain a colon (:), simple term is true, and the, IRI mapping of definition ends with a URI @@ -5937,6 +5944,8 @@

    Changes since JSON-LD Community Group Final Report

    recursive context inclusion error with a context overflow error.
  • Added support for "@type": "@none" in a term definition to prevent value compaction.
  • Added support for JSON literals.
  • +
  • Term definitions with keys which are of the form of a compact IRI or absolute IRI MUST NOT + expand to an IRI other than the expansion of the key itself.
  • diff --git a/tests/compact/ep09-context.jsonld b/tests/compact/ep09-context.jsonld index 7d7d2eae..15b0baca 100644 --- a/tests/compact/ep09-context.jsonld +++ b/tests/compact/ep09-context.jsonld @@ -1,5 +1,6 @@ { "@context": { - "foo:bar": {"@id": "http://example/foo/bar/", "@prefix": true} + "foo": "http://example/foo/", + "foo:bar": {"@id": "http://example/foo/bar", "@prefix": true} } } \ No newline at end of file diff --git a/tests/compact/p007-context.jsonld b/tests/compact/p007-context.jsonld index 29d4f974..8d06da6b 100644 --- a/tests/compact/p007-context.jsonld +++ b/tests/compact/p007-context.jsonld @@ -1,6 +1,6 @@ { "@context": { "foo": "http://example.org/", - "foo:bar": "foo:baz/" + "foo:bar": {"@type": "@id"} } } diff --git a/tests/compact/p007-in.jsonld b/tests/compact/p007-in.jsonld index 0594114e..47e98a8a 100644 --- a/tests/compact/p007-in.jsonld +++ b/tests/compact/p007-in.jsonld @@ -1,4 +1,4 @@ { - "@id": "http://example.org/baz/a", - "http://example.org/baz/b": "c" + "@id": "http://example.org/bar/a", + "http://example.org/bar/b": "c" } diff --git a/tests/compact/p007-out.jsonld b/tests/compact/p007-out.jsonld index 48b60a7b..b82492a8 100644 --- a/tests/compact/p007-out.jsonld +++ b/tests/compact/p007-out.jsonld @@ -1,8 +1,8 @@ { "@context": { "foo": "http://example.org/", - "foo:bar": "foo:baz/" + "foo:bar": {"@type": "@id"} }, - "@id": "foo:baz/a", - "foo:baz/b": "c" + "@id": "foo:bar/a", + "foo:bar/b": "c" } diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index a6e5ace7..b3e93c4c 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -187,7 +187,8 @@ "name": "Term definition with @id: @type", "purpose": "Expanding term mapping to @type uses @type syntax", "input": "expand/0026-in.jsonld", - "expect": "expand/0026-out.jsonld" + "expect": "expand/0026-out.jsonld", + "option": {"specVersion": "json-ld-1.0"} }, { "@id": "#t0027", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], @@ -502,7 +503,8 @@ "name": "Redefine terms looking like compact IRIs", "purpose": "Term definitions may look like compact IRIs", "input": "expand/0071-in.jsonld", - "expect": "expand/0071-out.jsonld" + "expect": "expand/0071-out.jsonld", + "option": {"specVersion": "json-ld-1.0"} }, { "@id": "#t0072", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], @@ -1225,6 +1227,22 @@ "purpose": "Verifies that an exception is raised on expansion when processing an invalid context attempting to define @container on a keyword", "input": "expand/e042-in.jsonld", "expect": "keyword redefinition" + }, { + "@id": "#te043", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Term definition with @id: @type", + "purpose": "Expanding term mapping to @type uses @type syntax now illegal", + "input": "expand/e043-in.jsonld", + "expect": "invalid IRI mapping", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#te044", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Redefine terms looking like compact IRIs", + "purpose": "Term definitions may look like compact IRIs, but must be consistent.", + "input": "expand/e044-in.jsonld", + "expect": "invalid IRI mapping", + "option": {"specVersion": "json-ld-1.1"} }, { "@id": "#tec01", "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ], diff --git a/tests/expand/0025-in.jsonld b/tests/expand/0025-in.jsonld index 426de362..2cd0d48e 100644 --- a/tests/expand/0025-in.jsonld +++ b/tests/expand/0025-in.jsonld @@ -1,7 +1,7 @@ { "@context": { "foo": "http://example.com/foo/", - "foo:bar": "http://example.com/bar", + "foo:bar": "http://example.com/foo/bar", "bar": {"@id": "foo:bar", "@type": "@id"}, "_": "http://example.com/underscore/" }, diff --git a/tests/expand/0025-out.jsonld b/tests/expand/0025-out.jsonld index 61e1278a..eea75af1 100644 --- a/tests/expand/0025-out.jsonld +++ b/tests/expand/0025-out.jsonld @@ -1,7 +1,7 @@ [{ "@type": [ "http://example.com/foo/", - "http://example.com/bar", + "http://example.com/foo/bar", "http://example.com/underscore/" ] }] diff --git a/tests/expand/e043-in.jsonld b/tests/expand/e043-in.jsonld new file mode 100644 index 00000000..36d8cac7 --- /dev/null +++ b/tests/expand/e043-in.jsonld @@ -0,0 +1,20 @@ +{ + "@context": { + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {"@id": "@type", "@type": "@id"} + }, + "@graph": [ + { + "@id": "http://example.com/a", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://example.com/b" + }, { + "@id": "http://example.com/c", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ + "http://example.com/d", + "http://example.com/e" + ] + }, { + "@id": "http://example.com/f", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://example.com/g" + } + ] +} diff --git a/tests/expand/e044-in.jsonld b/tests/expand/e044-in.jsonld new file mode 100644 index 00000000..257bd312 --- /dev/null +++ b/tests/expand/e044-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": [ + { + "v": "http://example.com/vocab#", + "v:term": "v:somethingElse", + "v:termId": { "@id": "v:somethingElseId" } + } + ], + "v:term": "value of v:term", + "v:termId": "value of v:termId" +} diff --git a/tests/expand/e045-in.jsonld b/tests/expand/e045-in.jsonld new file mode 100644 index 00000000..598c43fe --- /dev/null +++ b/tests/expand/e045-in.jsonld @@ -0,0 +1,15 @@ +{ + "@context": [ + { + "v": "http://example.com/vocab#", + "v:term": "v:somethingElse", + "v:termId": { "@id": "v:somethingElseId" } + }, + { + "v:term": "v:term", + "v:termId": { "@id": "v:termId" } + } + ], + "v:term": "value of v:term", + "v:termId": "value of v:termId" +} diff --git a/tests/flatten-manifest.jsonld b/tests/flatten-manifest.jsonld index 5b6b3e55..10956442 100644 --- a/tests/flatten-manifest.jsonld +++ b/tests/flatten-manifest.jsonld @@ -187,7 +187,8 @@ "name": "Term definition with @id: @type", "purpose": "Flattening term mapping to @type uses @type syntax", "input": "flatten/0026-in.jsonld", - "expect": "flatten/0026-out.jsonld" + "expect": "flatten/0026-out.jsonld", + "option": {"specVersion": "json-ld-1.0"} }, { "@id": "#t0027", "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"], diff --git a/tests/flatten/0025-in.jsonld b/tests/flatten/0025-in.jsonld index de45eb4c..276851f6 100644 --- a/tests/flatten/0025-in.jsonld +++ b/tests/flatten/0025-in.jsonld @@ -1,7 +1,7 @@ { "@context": { "foo": "http://example.com/foo/", - "foo:bar": "http://example.com/bar", + "foo:bar": "http://example.com/foo/bar", "bar": {"@id": "foo:bar", "@type": "@id"}, "_": "http://example.com/underscore/" }, diff --git a/tests/flatten/0025-out.jsonld b/tests/flatten/0025-out.jsonld index 3617a3e4..cc9881d9 100644 --- a/tests/flatten/0025-out.jsonld +++ b/tests/flatten/0025-out.jsonld @@ -3,7 +3,7 @@ "@id": "_:b0", "@type": [ "http://example.com/foo/", - "http://example.com/bar", + "http://example.com/foo/bar", "http://example.com/underscore/" ] } diff --git a/tests/toRdf-manifest.jsonld b/tests/toRdf-manifest.jsonld index 1e8b012d..183b7e6e 100644 --- a/tests/toRdf-manifest.jsonld +++ b/tests/toRdf-manifest.jsonld @@ -432,7 +432,8 @@ "name": "Expanding term mapping to @type uses @type syntax", "purpose": "RDF version of expand-0026", "input": "toRdf/0066-in.jsonld", - "expect": "toRdf/0066-out.nq" + "expect": "toRdf/0066-out.nq", + "option": {"specVersion": "json-ld-1.0"} }, { "@id": "#t0067", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], @@ -748,7 +749,8 @@ "name": "Redefine terms looking like compact IRIs", "purpose": "RDF version of expand-0071", "input": "toRdf/0111-in.jsonld", - "expect": "toRdf/0111-out.nq" + "expect": "toRdf/0111-out.nq", + "option": {"specVersion": "json-ld-1.0"} }, { "@id": "#t0112", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], diff --git a/tests/toRdf/0065-in.jsonld b/tests/toRdf/0065-in.jsonld index 426de362..2cd0d48e 100644 --- a/tests/toRdf/0065-in.jsonld +++ b/tests/toRdf/0065-in.jsonld @@ -1,7 +1,7 @@ { "@context": { "foo": "http://example.com/foo/", - "foo:bar": "http://example.com/bar", + "foo:bar": "http://example.com/foo/bar", "bar": {"@id": "foo:bar", "@type": "@id"}, "_": "http://example.com/underscore/" }, diff --git a/tests/toRdf/0065-out.nq b/tests/toRdf/0065-out.nq index 57adb84c..4256e246 100644 --- a/tests/toRdf/0065-out.nq +++ b/tests/toRdf/0065-out.nq @@ -1,3 +1,3 @@ -_:b0 . _:b0 . +_:b0 . _:b0 .