Skip to content

Change from "sealed" to "protected". #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ <h2>Context Processing Algorithm</h2>
<span class="changed">an optional <a>context</a></span>,
<span class="changed">an optional <dfn>nest value</dfn>,</span>
<span class="changed">an optional <dfn>prefix flag</dfn>,</span>
<span class="changed">a <dfn>sealed</dfn>, used to mark this as a sealed term,</span>
<span class="changed">a <dfn>protected</dfn>, used to mark this as a protected term,</span>
and an optional <dfn>container mapping</dfn>.
A <a>term definition</a> can not only be used to map a <a>term</a>
to an IRI, but also to map a <a>term</a> to a <a>keyword</a>,
Expand Down Expand Up @@ -1131,13 +1131,13 @@ <h3>Algorithm</h3>
or currently being defined during recursion.</li>
<li>For each <var>key</var>-<var>value</var> pair in <var>context</var> where
<var>key</var> is not <code>@base</code>, <code>@vocab</code>,
<code>@language</code>, <code>@sealed</code>, or <code>@version</code>, invoke the
<code>@language</code>, <code>@protected</code>, or <code>@version</code>, invoke the
<a href="#create-term-definition">Create Term Definition algorithm</a>,
passing <var>result</var> for <var>active context</var>,
<var>context</var> for <var>local context</var>, <var>key</var>,
<var>defined</var>,
<span class="changed">and the value of the <code>@sealed</code>
member from <var>context</var>, if any, for <var>sealed</var></span>.</li>
<span class="changed">and the value of the <code>@protected</code>
member from <var>context</var>, if any, for <var>protected</var></span>.</li>
</ol>
</li>
<li>Return <var>result</var>.</li>
Expand Down Expand Up @@ -1187,7 +1187,7 @@ <h3>Algorithm</h3>
an <var>active context</var>, a <var>local context</var>,
a <var>term</var>, and a map <var>defined</var>.
<span class="changed">The optional input is
<var>sealed</var> which defaults to <code>false</code>.</span></p>
<var>protected</var> which defaults to <code>false</code>.</span></p>
<ol>
<li>If <var>defined</var> contains the <a>member</a> <var>term</var> and the associated
value is <code>true</code> (indicating that the
Expand All @@ -1212,8 +1212,8 @@ <h3>Algorithm</h3>
<a data-link-for="JsonLdErrorCode">keyword redefinition</a>
error has been detected and processing is aborted.</li>
<li class="changed">If the <var>active context</var> has an existing
<a>term definition</a> for <var>term</var> which is sealed, processing is aborted;
processors SHOULD issue a warning that an attempt was made to redefine a sealed term.</li>
<a>term definition</a> for <var>term</var> which is protected, processing is aborted;
processors SHOULD issue a warning that an attempt was made to redefine a protected term.</li>
<li>Otherwise, remove any existing <a>term definition</a> for <var>term</var> in
<var>active context</var>.</li>
<li>If <var>value</var> is <code>null</code> or <var>value</var>
Expand All @@ -1231,10 +1231,10 @@ <h3>Algorithm</h3>
error has been detected and processing is aborted.
<span class="changed">Set <var>simple term</var> to <code>false</code></span>.</li>
<li>Create a new <a>term definition</a>, <var>definition</var>.</li>
<li class="changed">If the <code>@sealed</code> member in <var>value</var>
is <code>true</code>, or there is no <code>@sealed</code> member in <var>value</var>
and the <var>sealed</var> parameter is <code>true</code>,
set the <a>sealed</a> in <var>definition</var> to true.</li>
<li class="changed">If the <code>@protected</code> member in <var>value</var>
is <code>true</code>, or there is no <code>@protected</code> member in <var>value</var>
and the <var>protected</var> parameter is <code>true</code>,
set the <a>protected</a> in <var>definition</var> to true.</li>
<li>If <var>value</var> contains the <a>member</a> <code>@type</code>:
<ol>
<li>Initialize <var>type</var> to the value associated with the
Expand Down Expand Up @@ -5727,7 +5727,7 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
the first found <a>JSON-LD script element</a>,
or all <a>JSON-LD script elements</a>.</li>
<li>Added <a data-link-for="RemoteDocument">contentType</a> field to <a>RemoteDocument</a>.</li>
<li>Added support for sealed <a>contexts</a> and <a>term definitions</a>.</li>
<li>Added support for protected <a>contexts</a> and <a>term definitions</a>.</li>
<li>Because scoped contexts can lead to contexts being reloaded, replace the
<strong>recursive context inclusion</strong> error with a <a data-link-for="JsonLdErrorCode">context overflow</a> error.</li>
<li>Added support for <code>"@type": "@none"</code> in a <a>term definition</a> to prevent value compaction.</li>
Expand Down
76 changes: 38 additions & 38 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
11 changes: 11 additions & 0 deletions tests/expand/pr01-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
7 changes: 7 additions & 0 deletions tests/expand/pr01-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"http://example.com/protected": [{
"http://example.com/protected": [{"@value": "this should have the property http://example.com/protected"}]
}]
}
]
14 changes: 14 additions & 0 deletions tests/expand/pr02-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
6 changes: 3 additions & 3 deletions tests/expand/se02-out.jsonld → tests/expand/pr02-out.jsonld
Original file line number Diff line number Diff line change
@@ -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"}]
}]
}
]
]
17 changes: 17 additions & 0 deletions tests/expand/pr03-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
8 changes: 8 additions & 0 deletions tests/expand/pr03-out.jsonld
Original file line number Diff line number Diff line change
@@ -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"}]
}]
}
]
17 changes: 17 additions & 0 deletions tests/expand/pr04-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
8 changes: 8 additions & 0 deletions tests/expand/pr04-out.jsonld
Original file line number Diff line number Diff line change
@@ -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"}]
}]
}
]
12 changes: 12 additions & 0 deletions tests/expand/pr05-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
7 changes: 7 additions & 0 deletions tests/expand/pr05-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"http://example.com/protected": [{
"http://something-else/protected": [{"@value": "this should have the property http://something-else/protected"}]
}]
}
]
12 changes: 12 additions & 0 deletions tests/expand/pr06-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
5 changes: 5 additions & 0 deletions tests/expand/pr06-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"http://example.com/unprotected": [{}]
}
]
24 changes: 24 additions & 0 deletions tests/expand/pr08-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
6 changes: 3 additions & 3 deletions tests/expand/se08-out.jsonld → tests/expand/pr08-out.jsonld
Original file line number Diff line number Diff line change
@@ -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"}]
}]
}
]
]
12 changes: 12 additions & 0 deletions tests/expand/pr09-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
}
7 changes: 7 additions & 0 deletions tests/expand/pr09-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[{
"http://example.org/protected2": [{
"http://example.org/protected1": [{
"@value": "this should have the property http://example.org/protected1"
}]
}]
}]
11 changes: 0 additions & 11 deletions tests/expand/se01-in.jsonld

This file was deleted.

Loading