Skip to content
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

Add protected graph container null context test. #582

Merged
merged 3 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
28 changes: 28 additions & 0 deletions tests/expand-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -9643,6 +9643,34 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tpr43'>
Test tpr43 Clear protection in @graph @container with null context.
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tpr43</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Clear protection in @graph @container with null context.</dd>
<dt>input</dt>
<dd>
<a href='expand/pr43-in.jsonld'>expand/pr43-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/pr43-out.jsonld'>expand/pr43-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='tso01'>
Test tso01 @import is invalid in 1.0.
</dt>
Expand Down
8 changes: 8 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -2858,6 +2858,14 @@
"option": {"specVersion": "json-ld-1.1"},
"input": "expand/pr42-in.jsonld",
"expectErrorCode": "protected term redefinition"
}, {
"@id": "#tpr43",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Clear protection in @graph @container with null context.",
"purpose": "Clear protection in @graph @container with null context.",
"option": {"specVersion": "json-ld-1.1"},
"input": "expand/pr43-in.jsonld",
"expect": "expand/pr43-out.jsonld"
}, {
"@id": "#tso01",
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
Expand Down
23 changes: 23 additions & 0 deletions tests/expand/pr43-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"@context": {
"@protected": true,
"protected": {
"@id": "ex:protected1",
"@type": "@id"
},
"unprotected": {
"@id": "ex:unprotected",
"@type": "@id",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"unprotected": {
"@context": {
"protected": "ex:protected2"
},
"@id": "ex:inner",
"protected": "p === ex:protected2"
}
}
19 changes: 19 additions & 0 deletions tests/expand/pr43-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"@id": "ex:outer",
"ex:unprotected": [
{
"@graph": [
{
"@id": "ex:inner",
"ex:protected2": [
{
"@value": "p === ex:protected2"
}
]
}
]
}
]
}
]
8 changes: 8 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -3387,6 +3387,14 @@
"option": {"specVersion": "json-ld-1.1"},
"input": "toRdf/pr42-in.jsonld",
"expectErrorCode": "protected term redefinition"
}, {
"@id": "#tpr43",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Clear protection in @graph @container with null context.",
"purpose": "Clear protection in @graph @container with null context.",
"option": {"specVersion": "json-ld-1.1"},
"input": "toRdf/pr43-in.jsonld",
"expect": "toRdf/pr43-out.nq"
}, {
"@id": "#trt01",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
23 changes: 23 additions & 0 deletions tests/toRdf/pr43-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"@context": {
"@protected": true,
"protected": {
"@id": "ex:protected1",
"@type": "@id"
},
"unprotected": {
"@id": "ex:unprotected",
"@type": "@id",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"unprotected": {
"@context": {
"protected": "ex:protected2"
},
"@id": "ex:inner",
"protected": "p === ex:protected2"
}
}
2 changes: 2 additions & 0 deletions tests/toRdf/pr43-out.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<ex:outer> <ex:unprotected> _:b0 .
<ex:inner> <ex:protected2> "p === ex:protected2" _:b0 .