Skip to content

Adds tests for null json literals, and fixes one expected result #283

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 5 commits into from
Dec 26, 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
66 changes: 33 additions & 33 deletions tests/expand-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -5614,7 +5614,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in01-in.jsonld'>expand/in01-in.jsonld</a>
Expand Down Expand Up @@ -5642,7 +5642,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in02-in.jsonld'>expand/in02-in.jsonld</a>
Expand Down Expand Up @@ -5670,7 +5670,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in03-in.jsonld'>expand/in03-in.jsonld</a>
Expand Down Expand Up @@ -5698,7 +5698,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in04-in.jsonld'>expand/in04-in.jsonld</a>
Expand Down Expand Up @@ -5726,7 +5726,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in05-in.jsonld'>expand/in05-in.jsonld</a>
Expand Down Expand Up @@ -5754,7 +5754,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in06-in.jsonld'>expand/in06-in.jsonld</a>
Expand Down Expand Up @@ -5782,7 +5782,7 @@ <h2>
<dt>Type</dt>
<dd>jld:NegativeEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in07-in.jsonld'>expand/in07-in.jsonld</a>
Expand Down Expand Up @@ -5810,7 +5810,7 @@ <h2>
<dt>Type</dt>
<dd>jld:NegativeEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in08-in.jsonld'>expand/in08-in.jsonld</a>
Expand Down Expand Up @@ -5838,7 +5838,7 @@ <h2>
<dt>Type</dt>
<dd>jld:NegativeEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests included maps.</dd>
<dd>Tests included blocks.</dd>
<dt>input</dt>
<dd>
<a href='expand/in09-in.jsonld'>expand/in09-in.jsonld</a>
Expand Down Expand Up @@ -6416,24 +6416,24 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tjs13'>
Test tjs13 Expand JSON literal with aliased @type
<dt id='tjs21'>
Test tjs21 Expand JSON literal with @context
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tjs13</dd>
<dd>#tjs21</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests expanding JSON literal with aliased @type.</dd>
<dd>Tests expanding JSON literal with a @context.</dd>
<dt>input</dt>
<dd>
<a href='expand/js13-in.jsonld'>expand/js13-in.jsonld</a>
<a href='expand/js21-in.jsonld'>expand/js21-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/js13-out.jsonld'>expand/js13-out.jsonld</a>
<a href='expand/js21-out.jsonld'>expand/js21-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
Expand All @@ -6444,24 +6444,24 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tjs14'>
Test tjs14 Expand JSON literal with aliased @value
<dt id='tjs22'>
Test tjs22 Expand JSON literal (null) aleady in expanded form.
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tjs14</dd>
<dd>#tjs22</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests expanding JSON literal with aliased @value.</dd>
<dd>Tests expanding property with @type @json to a JSON literal (null).</dd>
<dt>input</dt>
<dd>
<a href='expand/js14-in.jsonld'>expand/js14-in.jsonld</a>
<a href='expand/js22-in.jsonld'>expand/js22-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/js14-out.jsonld'>expand/js14-out.jsonld</a>
<a href='expand/js22-out.jsonld'>expand/js22-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
Expand All @@ -6472,24 +6472,24 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tjs21'>
Test tjs21 Expand JSON literal with @context
<dt id='tjs23'>
Test tjs23 Expand JSON literal (empty array).
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tjs21</dd>
<dd>#tjs23</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Tests expanding JSON literal with a @context.</dd>
<dd>Tests expanding property with @type @json to a JSON literal (empty array).</dd>
<dt>input</dt>
<dd>
<a href='expand/js21-in.jsonld'>expand/js21-in.jsonld</a>
<a href='expand/js23-in.jsonld'>expand/js23-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/js21-out.jsonld'>expand/js21-out.jsonld</a>
<a href='expand/js23-out.jsonld'>expand/js23-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
Expand Down Expand Up @@ -7147,7 +7147,7 @@ <h2>
</dl>
</dd>
<dt id='tm013'>
Test tm013 index map with @none
Test tm013 graph index map with @none
</dt>
<dd>
<dl class='entry'>
Expand Down Expand Up @@ -7175,7 +7175,7 @@ <h2>
</dl>
</dd>
<dt id='tm014'>
Test tm014 index map with alias @none
Test tm014 graph index map with alias @none
</dt>
<dd>
<dl class='entry'>
Expand Down Expand Up @@ -7203,7 +7203,7 @@ <h2>
</dl>
</dd>
<dt id='tm015'>
Test tm015 index map with alias @none
Test tm015 graph id index map with aliased @none
</dt>
<dd>
<dl class='entry'>
Expand All @@ -7212,7 +7212,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>index on @graph and @index</dd>
<dd>index on @graph and @id with @none</dd>
<dt>input</dt>
<dd>
<a href='expand/m015-in.jsonld'>expand/m015-in.jsonld</a>
Expand All @@ -7231,7 +7231,7 @@ <h2>
</dl>
</dd>
<dt id='tm016'>
Test tm016 index map with alias @none
Test tm016 graph id index map with aliased @none
</dt>
<dd>
<dl class='entry'>
Expand All @@ -7240,7 +7240,7 @@ <h2>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>index on @graph and @index</dd>
<dd>index on @graph and @id with @none</dd>
<dt>input</dt>
<dd>
<a href='expand/m016-in.jsonld'>expand/m016-in.jsonld</a>
Expand Down
16 changes: 16 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,22 @@
"input": "expand/js21-in.jsonld",
"expect": "expand/js21-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tjs22",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Expand JSON literal (null) aleady in expanded form.",
"purpose": "Tests expanding property with @type @json to a JSON literal (null).",
"input": "expand/js22-in.jsonld",
"expect": "expand/js22-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tjs23",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Expand JSON literal (empty array).",
"purpose": "Tests expanding property with @type @json to a JSON literal (empty array).",
"input": "expand/js23-in.jsonld",
"expect": "expand/js23-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tl001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
2 changes: 1 addition & 1 deletion tests/expand/0122-out.jsonld
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[{
"http://example.org/vocab/at": [{"@id": "http://example.org/@"}],
"http://example.org/vocab/foo.bar": [{"@id": "http://example.org/@foo.bar"}],
"http://example.org/vocab/ignoreme": [{"@id": ""}]
"http://example.org/vocab/ignoreme": [{"@id": null}]
}]
3 changes: 3 additions & 0 deletions tests/expand/js22-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"http://example.org/vocab#null": {"@value": null, "@type": "@json"}
}
6 changes: 6 additions & 0 deletions tests/expand/js22-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[{
"http://example.org/vocab#null": [{
"@value": null,
"@type": "@json"
}]
}]
3 changes: 3 additions & 0 deletions tests/expand/js23-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"http://example.org/vocab#null": {"@value": [], "@type": "@json"}
}
6 changes: 6 additions & 0 deletions tests/expand/js23-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[{
"http://example.org/vocab#null": [{
"@value": [],
"@type": "@json"
}]
}]
56 changes: 56 additions & 0 deletions tests/toRdf-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -6177,6 +6177,62 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tjs22'>
Test tjs22 Transform JSON literal (null) aleady in expanded form.
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tjs22</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
<dt>Purpose</dt>
<dd>Tests transforming property with @type @json to a JSON literal (null).</dd>
<dt>input</dt>
<dd>
<a href='toRdf/js22-in.jsonld'>toRdf/js22-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='toRdf/js22-out.nq'>toRdf/js22-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='tjs23'>
Test tjs23 Transform JSON literal (empty array).
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tjs23</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
<dt>Purpose</dt>
<dd>Tests transforming property with @type @json to a JSON literal (empty array).</dd>
<dt>input</dt>
<dd>
<a href='toRdf/js23-in.jsonld'>toRdf/js23-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='toRdf/js23-out.nq'>toRdf/js23-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
16 changes: 16 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,22 @@
"input": "toRdf/js21-in.jsonld",
"expect": "toRdf/js21-out.nq",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tjs22",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Transform JSON literal (null) aleady in expanded form.",
"purpose": "Tests transforming property with @type @json to a JSON literal (null).",
"input": "toRdf/js22-in.jsonld",
"expect": "toRdf/js22-out.nq",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tjs23",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Transform JSON literal (empty array).",
"purpose": "Tests transforming property with @type @json to a JSON literal (empty array).",
"input": "toRdf/js23-in.jsonld",
"expect": "toRdf/js23-out.nq",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tli01",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
3 changes: 3 additions & 0 deletions tests/toRdf/js22-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"http://example.org/vocab#null": {"@value": null, "@type": "@json"}
}
1 change: 1 addition & 0 deletions tests/toRdf/js22-out.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_:b0 <http://example.org/vocab#null> "null"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .
3 changes: 3 additions & 0 deletions tests/toRdf/js23-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"http://example.org/vocab#null": {"@value": [], "@type": "@json"}
}
1 change: 1 addition & 0 deletions tests/toRdf/js23-out.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_:b0 <http://example.org/vocab#null> "[]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .