Skip to content

Add test for JSON literal with a context. #263

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
Dec 19, 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
28 changes: 28 additions & 0 deletions tests/expand-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -6472,6 +6472,34 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tjs21'>
Test tjs21 Expand JSON literal with @context
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tjs21</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests expanding JSON literal with a @context.</dd>
<dt>input</dt>
<dd>
<a href='expand/js21-in.jsonld'>expand/js21-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/js21-out.jsonld'>expand/js21-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='tl001'>
Test tl001 Language map with null value
</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 @@ -1927,6 +1927,14 @@
"input": "expand/js20-in.jsonld",
"expect": "expand/js20-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tjs21",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Expand JSON literal with @context",
"purpose": "Tests expanding JSON literal with a @context.",
"input": "expand/js21-in.jsonld",
"expect": "expand/js21-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tl001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
12 changes: 12 additions & 0 deletions tests/expand/js21-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context": {
"@version": 1.1,
"ex:foo": {
"@type": "@json"
}
},
"ex:foo": {
"@context": "ex:not:a:context",
"test": 1
}
}
9 changes: 9 additions & 0 deletions tests/expand/js21-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[{
"ex:foo": [{
"@type": "@json",
"@value": {
"@context": "ex:not:a:context",
"test": 1
}
}]
}]
28 changes: 28 additions & 0 deletions tests/toRdf-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -6149,6 +6149,34 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tjs21'>
Test tjs21 Transform JSON literal with @context
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tjs21</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
<dt>Purpose</dt>
<dd>Tests transforming JSON literal with a @context.</dd>
<dt>input</dt>
<dd>
<a href='toRdf/js21-in.jsonld'>toRdf/js21-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='toRdf/js21-out.nq'>toRdf/js21-out.nq</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='tli01'>
Test tli01 @list containing @list
</dt>
Expand Down
8 changes: 8 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,14 @@
"input": "toRdf/js20-in.jsonld",
"expect": "toRdf/js20-out.nq",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tjs21",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Transform JSON literal with @context",
"purpose": "Tests transforming JSON literal with a @context.",
"input": "toRdf/js21-in.jsonld",
"expect": "toRdf/js21-out.nq",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tli01",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
12 changes: 12 additions & 0 deletions tests/toRdf/js21-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context": {
"@version": 1.1,
"ex:foo": {
"@type": "@json"
}
},
"ex:foo": {
"@context": "ex:not:a:context",
"test": 1
}
}
1 change: 1 addition & 0 deletions tests/toRdf/js21-out.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_:c14n0 <ex:foo> "{\"@context\":\"ex:not:a:context\",\"test\":1}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .