diff --git a/index.html b/index.html index 8247c6a1..dd6bc5d4 100644 --- a/index.html +++ b/index.html @@ -926,7 +926,7 @@

Context Processing Algorithm

an optional context, an optional nest value, an optional prefix flag, - a sealed, used to mark this as a sealed term, + a protected, used to mark this as a protected term, and an optional container mapping. A term definition can not only be used to map a term to an IRI, but also to map a term to a keyword, @@ -1131,13 +1131,13 @@

Algorithm

or currently being defined during recursion.
  • For each key-value pair in context where key is not @base, @vocab, - @language, @sealed, or @version, invoke the + @language, @protected, or @version, invoke the Create Term Definition algorithm, passing result for active context, context for local context, key, defined, - and the value of the @sealed - member from context, if any, for sealed.
  • + and the value of the @protected + member from context, if any, for protected.
  • Return result.
  • @@ -1187,7 +1187,7 @@

    Algorithm

    an active context, a local context, a term, and a map defined. The optional input is - sealed which defaults to false.

    + protected which defaults to false.

    1. If defined contains the member term and the associated value is true (indicating that the @@ -1212,8 +1212,8 @@

      Algorithm

      keyword redefinition error has been detected and processing is aborted.
    2. If the active context has an existing - term definition for term which is sealed, processing is aborted; - processors SHOULD issue a warning that an attempt was made to redefine a sealed term.
    3. + term definition for term which is protected, processing is aborted; + processors SHOULD issue a warning that an attempt was made to redefine a protected term.
    4. Otherwise, remove any existing term definition for term in active context.
    5. If value is null or value @@ -1231,10 +1231,10 @@

      Algorithm

      error has been detected and processing is aborted. Set simple term to false.
    6. Create a new term definition, definition.
    7. -
    8. If the @sealed member in value - is true, or there is no @sealed member in value - and the sealed parameter is true, - set the sealed in definition to true.
    9. +
    10. If the @protected member in value + is true, or there is no @protected member in value + and the protected parameter is true, + set the protected in definition to true.
    11. If value contains the member @type:
      1. Initialize type to the value associated with the @@ -5727,7 +5727,7 @@

        Changes since JSON-LD Community Group Final Report

        the first found JSON-LD script element, or all JSON-LD script elements.
      2. Added contentType field to RemoteDocument.
      3. -
      4. Added support for sealed contexts and term definitions.
      5. +
      6. Added support for protected contexts and term definitions.
      7. Because scoped contexts can lead to contexts being reloaded, replace the recursive context inclusion error with a context overflow error.
      8. Added support for "@type": "@none" in a term definition to prevent value compaction.
      9. diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index ee09b9ad..e337724d 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -1787,69 +1787,69 @@ "input": "expand/li10-in.jsonld", "expect": "expand/li10-out.jsonld" }, { - "@id": "#tse01", + "@id": "#tpr01", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Seal a term", - "purpose": "Sealed Contexts", + "name": "Protect a term", + "purpose": "Protected Contexts", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se01-in.jsonld", - "expect": "expand/se01-out.jsonld" + "input": "expand/pr01-in.jsonld", + "expect": "expand/pr01-out.jsonld" }, { - "@id": "#tse02", + "@id": "#tpr02", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Set a term to not be sealed", - "purpose": "A term with @sealed: false is not sealed.", + "name": "Set a term to not be protected", + "purpose": "A term with @protected: false is not protected.", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se02-in.jsonld", - "expect": "expand/se02-out.jsonld" + "input": "expand/pr02-in.jsonld", + "expect": "expand/pr02-out.jsonld" }, { - "@id": "#tse03", + "@id": "#tpr03", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Seal all terms in context", - "purpose": "A sealed context seals all term definitions.", + "name": "Protect all terms in context", + "purpose": "A protected context protects all term definitions.", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se03-in.jsonld", - "expect": "expand/se03-out.jsonld" + "input": "expand/pr03-in.jsonld", + "expect": "expand/pr03-out.jsonld" }, { - "@id": "#tse04", + "@id": "#tpr04", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Do not seal term with @sealed: false", - "purpose": "A sealed context does not seal terms with @sealed: false.", + "name": "Do not protect term with @protected: false", + "purpose": "A protected context does not protect terms with @protected: false.", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se04-in.jsonld", - "expect": "expand/se04-out.jsonld" + "input": "expand/pr04-in.jsonld", + "expect": "expand/pr04-out.jsonld" }, { - "@id": "#tse05", + "@id": "#tpr05", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Clear active context with sealed terms from an embedded context", + "name": "Clear active context with protected terms from an embedded context", "purpose": "The Active context be set to null from an embedded context.", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se05-in.jsonld", - "expect": "expand/se05-out.jsonld" + "input": "expand/pr05-in.jsonld", + "expect": "expand/pr05-out.jsonld" }, { - "@id": "#tse06", + "@id": "#tpr06", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Clear active context of sealed terms from a term.", + "name": "Clear active context of protected terms from a term.", "purpose": "The Active context may be set to null from a scoped context of a term.", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se06-in.jsonld", - "expect": "expand/se06-out.jsonld" + "input": "expand/pr06-in.jsonld", + "expect": "expand/pr06-out.jsonld" }, { - "@id": "#tse08", + "@id": "#tpr08", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Term with sealed scoped context.", - "purpose": "A scoped context can seal terms.", + "name": "Term with protected scoped context.", + "purpose": "A scoped context can protect terms.", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se08-in.jsonld", - "expect": "expand/se08-out.jsonld" + "input": "expand/pr08-in.jsonld", + "expect": "expand/pr08-out.jsonld" }, { - "@id": "#tse09", + "@id": "#tpr09", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "Attempt to redefine term in other sealed context.", - "purpose": "A sealed term cannot redefine another sealed term.", + "name": "Attempt to redefine term in other protected context.", + "purpose": "A protected term cannot redefine another protected term.", "option": {"specVersion": "json-ld-1.1"}, - "input": "expand/se09-in.jsonld", - "expect": "expand/se09-out.jsonld" + "input": "expand/pr09-in.jsonld", + "expect": "expand/pr09-out.jsonld" }, { "@id": "#ttn01", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], diff --git a/tests/expand/pr01-in.jsonld b/tests/expand/pr01-in.jsonld new file mode 100644 index 00000000..5f688056 --- /dev/null +++ b/tests/expand/pr01-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "@version": 1.1, + "protected": {"@protected": true} + }, + "protected": { + "@context": {"protected": "http://example.com/something-else"}, + "protected": "this should have the property http://example.com/protected" + } +} diff --git a/tests/expand/pr01-out.jsonld b/tests/expand/pr01-out.jsonld new file mode 100644 index 00000000..c25e0875 --- /dev/null +++ b/tests/expand/pr01-out.jsonld @@ -0,0 +1,7 @@ +[ + { + "http://example.com/protected": [{ + "http://example.com/protected": [{"@value": "this should have the property http://example.com/protected"}] + }] + } +] diff --git a/tests/expand/pr02-in.jsonld b/tests/expand/pr02-in.jsonld new file mode 100644 index 00000000..616db002 --- /dev/null +++ b/tests/expand/pr02-in.jsonld @@ -0,0 +1,14 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "@version": 1.1, + "protected": {"@protected": true}, + "unprotected": {"@protected": false} + }, + "protected": true, + "unprotected": true, + "scope": { + "@context": {"unprotected": "http://example.com/something-else"}, + "unprotected": "this should have the property http://example.com/something-else" + } +} diff --git a/tests/expand/se02-out.jsonld b/tests/expand/pr02-out.jsonld similarity index 60% rename from tests/expand/se02-out.jsonld rename to tests/expand/pr02-out.jsonld index e3b747a5..c655f783 100644 --- a/tests/expand/se02-out.jsonld +++ b/tests/expand/pr02-out.jsonld @@ -1,9 +1,9 @@ [ { - "http://example.com/sealed": [{"@value": true}], - "http://example.com/unsealed": [{"@value": true}], + "http://example.com/protected": [{"@value": true}], + "http://example.com/unprotected": [{"@value": true}], "http://example.com/scope": [{ "http://example.com/something-else": [{"@value": "this should have the property http://example.com/something-else"}] }] } -] \ No newline at end of file +] diff --git a/tests/expand/pr03-in.jsonld b/tests/expand/pr03-in.jsonld new file mode 100644 index 00000000..05b2b233 --- /dev/null +++ b/tests/expand/pr03-in.jsonld @@ -0,0 +1,17 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "@version": 1.1, + "@protected": true, + "protected1": {"@id": "http://example.com/protected1"}, + "protected2": {"@id": "http://example.com/protected2"} + }, + "protected1": { + "@context": { + "protected1": "http://example.com/something-else", + "protected2": "http://example.com/something-else" + }, + "protected1": "this should have the property http://example.com/protected1", + "protected2": "this should have the property http://example.com/protected2" + } +} diff --git a/tests/expand/pr03-out.jsonld b/tests/expand/pr03-out.jsonld new file mode 100644 index 00000000..45accb5e --- /dev/null +++ b/tests/expand/pr03-out.jsonld @@ -0,0 +1,8 @@ +[ + { + "http://example.com/protected1": [{ + "http://example.com/protected1": [{"@value": "this should have the property http://example.com/protected1"}], + "http://example.com/protected2": [{"@value": "this should have the property http://example.com/protected2"}] + }] + } +] diff --git a/tests/expand/pr04-in.jsonld b/tests/expand/pr04-in.jsonld new file mode 100644 index 00000000..09c1a62b --- /dev/null +++ b/tests/expand/pr04-in.jsonld @@ -0,0 +1,17 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "@version": 1.1, + "@protected": true, + "protected": {"@id": "http://example.com/protected"}, + "unprotected": {"@id": "http://example.com/unprotected", "@protected": false} + }, + "protected": { + "@context": { + "protected": "http://example.com/something-else1", + "unprotected": "http://example.com/something-else2" + }, + "protected": "this should have the property http://example.com/protected", + "unprotected": "this should have the property http://example.com/something-else2" + } +} diff --git a/tests/expand/pr04-out.jsonld b/tests/expand/pr04-out.jsonld new file mode 100644 index 00000000..753c50b5 --- /dev/null +++ b/tests/expand/pr04-out.jsonld @@ -0,0 +1,8 @@ +[ + { + "http://example.com/protected": [{ + "http://example.com/protected": [{"@value": "this should have the property http://example.com/protected"}], + "http://example.com/something-else2": [{"@value": "this should have the property http://example.com/something-else2"}] + }] + } +] diff --git a/tests/expand/pr05-in.jsonld b/tests/expand/pr05-in.jsonld new file mode 100644 index 00000000..a1cf6c47 --- /dev/null +++ b/tests/expand/pr05-in.jsonld @@ -0,0 +1,12 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "@version": 1.1, + "@protected": true, + "protected": {"@language": null} + }, + "protected": { + "@context": [null, {"@vocab": "http://something-else/"}], + "protected": "this should have the property http://something-else/protected" + } +} diff --git a/tests/expand/pr05-out.jsonld b/tests/expand/pr05-out.jsonld new file mode 100644 index 00000000..97d3fee6 --- /dev/null +++ b/tests/expand/pr05-out.jsonld @@ -0,0 +1,7 @@ +[ + { + "http://example.com/protected": [{ + "http://something-else/protected": [{"@value": "this should have the property http://something-else/protected"}] + }] + } +] diff --git a/tests/expand/pr06-in.jsonld b/tests/expand/pr06-in.jsonld new file mode 100644 index 00000000..1b525889 --- /dev/null +++ b/tests/expand/pr06-in.jsonld @@ -0,0 +1,12 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "@version": 1.1, + "@protected": true, + "protected": {"@type": "@id"}, + "unprotected": {"@protected": false, "@context": null} + }, + "unprotected": { + "protected": "not expanded, as protected is not a defined term" + } +} diff --git a/tests/expand/pr06-out.jsonld b/tests/expand/pr06-out.jsonld new file mode 100644 index 00000000..121aee43 --- /dev/null +++ b/tests/expand/pr06-out.jsonld @@ -0,0 +1,5 @@ +[ + { + "http://example.com/unprotected": [{}] + } +] diff --git a/tests/expand/pr08-in.jsonld b/tests/expand/pr08-in.jsonld new file mode 100644 index 00000000..c798a435 --- /dev/null +++ b/tests/expand/pr08-in.jsonld @@ -0,0 +1,24 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "@version": 1.1, + "protected": {"@protected": false}, + "scope1": { + "@protected": false, + "@context": {"protected": {"@id": "http://example.com/something-else"}} + }, + "scope2": { + "@protected": true, + "@context": {"protected": {"@protected": true}} + } + }, + "protected": false, + "scope1": { + "@context": {"protected": "http://example.com/another-thing"}, + "protected": "this should have the property http://example.com/another-thing" + }, + "scope2": { + "@context": {"protected": "http://example.com/another-thing"}, + "protected": "this should have the property http://example.com/protected" + } +} diff --git a/tests/expand/se08-out.jsonld b/tests/expand/pr08-out.jsonld similarity index 55% rename from tests/expand/se08-out.jsonld rename to tests/expand/pr08-out.jsonld index 7502baec..8ec78391 100644 --- a/tests/expand/se08-out.jsonld +++ b/tests/expand/pr08-out.jsonld @@ -1,11 +1,11 @@ [ { - "http://example.com/sealed": [{"@value": false}], + "http://example.com/protected": [{"@value": false}], "http://example.com/scope1": [{ "http://example.com/another-thing": [{"@value": "this should have the property http://example.com/another-thing"}] }], "http://example.com/scope2": [{ - "http://example.com/sealed": [{"@value": "this should have the property http://example.com/sealed"}] + "http://example.com/protected": [{"@value": "this should have the property http://example.com/protected"}] }] } -] \ No newline at end of file +] diff --git a/tests/expand/pr09-in.jsonld b/tests/expand/pr09-in.jsonld new file mode 100644 index 00000000..d7c5c0b5 --- /dev/null +++ b/tests/expand/pr09-in.jsonld @@ -0,0 +1,12 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "http://example.org/protected1", + "protected2": "http://example.org/protected2" + }, + "protected2": { + "@context": {"protected1": "http://example.com/something-else"}, + "protected1": "this should have the property http://example.org/protected1" + } +} diff --git a/tests/expand/pr09-out.jsonld b/tests/expand/pr09-out.jsonld new file mode 100644 index 00000000..89dc604d --- /dev/null +++ b/tests/expand/pr09-out.jsonld @@ -0,0 +1,7 @@ +[{ + "http://example.org/protected2": [{ + "http://example.org/protected1": [{ + "@value": "this should have the property http://example.org/protected1" + }] + }] +}] diff --git a/tests/expand/se01-in.jsonld b/tests/expand/se01-in.jsonld deleted file mode 100644 index 634ba415..00000000 --- a/tests/expand/se01-in.jsonld +++ /dev/null @@ -1,11 +0,0 @@ -{ - "@context": { - "@vocab": "http://example.com/", - "@version": 1.1, - "sealed": {"@sealed": true} - }, - "sealed": { - "@context": {"sealed": "http://example.com/something-else"}, - "sealed": "this should have the property http://example.com/sealed" - } -} \ No newline at end of file diff --git a/tests/expand/se01-out.jsonld b/tests/expand/se01-out.jsonld deleted file mode 100644 index aaf2c85f..00000000 --- a/tests/expand/se01-out.jsonld +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "http://example.com/sealed": [{ - "http://example.com/sealed": [{"@value": "this should have the property http://example.com/sealed"}] - }] - } -] \ No newline at end of file diff --git a/tests/expand/se02-in.jsonld b/tests/expand/se02-in.jsonld deleted file mode 100644 index ca7a8751..00000000 --- a/tests/expand/se02-in.jsonld +++ /dev/null @@ -1,14 +0,0 @@ -{ - "@context": { - "@vocab": "http://example.com/", - "@version": 1.1, - "sealed": {"@sealed": true}, - "unsealed": {"@sealed": false} - }, - "sealed": true, - "unsealed": true, - "scope": { - "@context": {"unsealed": "http://example.com/something-else"}, - "unsealed": "this should have the property http://example.com/something-else" - } -} \ No newline at end of file diff --git a/tests/expand/se03-in.jsonld b/tests/expand/se03-in.jsonld deleted file mode 100644 index d6413450..00000000 --- a/tests/expand/se03-in.jsonld +++ /dev/null @@ -1,17 +0,0 @@ -{ - "@context": { - "@vocab": "http://example.com/", - "@version": 1.1, - "@sealed": true, - "sealed1": {"@id": "http://example.com/sealed1"}, - "sealed2": {"@id": "http://example.com/sealed2"} - }, - "sealed1": { - "@context": { - "sealed1": "http://example.com/something-else", - "sealed2": "http://example.com/something-else" - }, - "sealed1": "this should have the property http://example.com/sealed1", - "sealed2": "this should have the property http://example.com/sealed2" - } -} \ No newline at end of file diff --git a/tests/expand/se03-out.jsonld b/tests/expand/se03-out.jsonld deleted file mode 100644 index b9a211bc..00000000 --- a/tests/expand/se03-out.jsonld +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "http://example.com/sealed1": [{ - "http://example.com/sealed1": [{"@value": "this should have the property http://example.com/sealed1"}], - "http://example.com/sealed2": [{"@value": "this should have the property http://example.com/sealed2"}] - }] - } -] \ No newline at end of file diff --git a/tests/expand/se04-in.jsonld b/tests/expand/se04-in.jsonld deleted file mode 100644 index 65338c39..00000000 --- a/tests/expand/se04-in.jsonld +++ /dev/null @@ -1,17 +0,0 @@ -{ - "@context": { - "@vocab": "http://example.com/", - "@version": 1.1, - "@sealed": true, - "sealed": {"@id": "http://example.com/sealed"}, - "unsealed": {"@id": "http://example.com/unsealed", "@sealed": false} - }, - "sealed": { - "@context": { - "sealed": "http://example.com/something-else1", - "unsealed": "http://example.com/something-else2" - }, - "sealed": "this should have the property http://example.com/sealed", - "unsealed": "this should have the property http://example.com/something-else2" - } -} \ No newline at end of file diff --git a/tests/expand/se04-out.jsonld b/tests/expand/se04-out.jsonld deleted file mode 100644 index f8c71652..00000000 --- a/tests/expand/se04-out.jsonld +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "http://example.com/sealed": [{ - "http://example.com/sealed": [{"@value": "this should have the property http://example.com/sealed"}], - "http://example.com/something-else2": [{"@value": "this should have the property http://example.com/something-else2"}] - }] - } -] \ No newline at end of file diff --git a/tests/expand/se05-in.jsonld b/tests/expand/se05-in.jsonld deleted file mode 100644 index f9ea66f9..00000000 --- a/tests/expand/se05-in.jsonld +++ /dev/null @@ -1,12 +0,0 @@ -{ - "@context": { - "@vocab": "http://example.com/", - "@version": 1.1, - "@sealed": true, - "sealed": {"@language": null} - }, - "sealed": { - "@context": [null, {"@vocab": "http://something-else/"}], - "sealed": "this should have the property http://something-else/sealed" - } -} \ No newline at end of file diff --git a/tests/expand/se05-out.jsonld b/tests/expand/se05-out.jsonld deleted file mode 100644 index b7a108b2..00000000 --- a/tests/expand/se05-out.jsonld +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "http://example.com/sealed": [{ - "http://something-else/sealed": [{"@value": "this should have the property http://something-else/sealed"}] - }] - } -] \ No newline at end of file diff --git a/tests/expand/se06-in.jsonld b/tests/expand/se06-in.jsonld deleted file mode 100644 index 9b0a6583..00000000 --- a/tests/expand/se06-in.jsonld +++ /dev/null @@ -1,12 +0,0 @@ -{ - "@context": { - "@vocab": "http://example.com/", - "@version": 1.1, - "@sealed": true, - "sealed": {"@type": "@id"}, - "unsealed": {"@sealed": false, "@context": null} - }, - "unsealed": { - "sealed": "not expanded, as sealed is not a defined term" - } -} \ No newline at end of file diff --git a/tests/expand/se06-out.jsonld b/tests/expand/se06-out.jsonld deleted file mode 100644 index ececc6e8..00000000 --- a/tests/expand/se06-out.jsonld +++ /dev/null @@ -1,5 +0,0 @@ -[ - { - "http://example.com/unsealed": [{}] - } -] \ No newline at end of file diff --git a/tests/expand/se08-in.jsonld b/tests/expand/se08-in.jsonld deleted file mode 100644 index 8c1ced5a..00000000 --- a/tests/expand/se08-in.jsonld +++ /dev/null @@ -1,24 +0,0 @@ -{ - "@context": { - "@vocab": "http://example.com/", - "@version": 1.1, - "sealed": {"@sealed": false}, - "scope1": { - "@sealed": false, - "@context": {"sealed": {"@id": "http://example.com/something-else"}} - }, - "scope2": { - "@sealed": true, - "@context": {"sealed": {"@sealed": true}} - } - }, - "sealed": false, - "scope1": { - "@context": {"sealed": "http://example.com/another-thing"}, - "sealed": "this should have the property http://example.com/another-thing" - }, - "scope2": { - "@context": {"sealed": "http://example.com/another-thing"}, - "sealed": "this should have the property http://example.com/sealed" - } -} \ No newline at end of file diff --git a/tests/expand/se09-in.jsonld b/tests/expand/se09-in.jsonld deleted file mode 100644 index 79eac0b3..00000000 --- a/tests/expand/se09-in.jsonld +++ /dev/null @@ -1,12 +0,0 @@ -{ - "@context": { - "@version": 1.1, - "@sealed": true, - "sealed1": "http://example.org/sealed1", - "sealed2": "http://example.org/sealed2" - }, - "sealed2": { - "@context": {"sealed1": "http://example.com/something-else"}, - "sealed1": "this should have the property http://example.org/sealed1" - } -} \ No newline at end of file diff --git a/tests/expand/se09-out.jsonld b/tests/expand/se09-out.jsonld deleted file mode 100644 index f1981679..00000000 --- a/tests/expand/se09-out.jsonld +++ /dev/null @@ -1,7 +0,0 @@ -[{ - "http://example.org/sealed2": [{ - "http://example.org/sealed1": [{ - "@value": "this should have the property http://example.org/sealed1" - }] - }] -}] \ No newline at end of file