Skip to content

Commit d78f6b0

Browse files
committed
Add minor spec update and tests for JSON literal string and null values.
Supplemental to #149.
1 parent ea646cb commit d78f6b0

30 files changed

+470
-6
lines changed

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2150,7 +2150,9 @@ <h3>Algorithm</h3>
21502150
<var>active property</var>, <var>value</var> for <var>element</var>,
21512151
<span class="changed">and the {{JsonLdOptions/frameExpansion}}
21522152
and {{JsonLdOptions/ordered}} flags</span>.</li>
2153-
<li>Unless <var>expanded value</var> is <code>null</code>, set
2153+
<li>Unless <var>expanded value</var> is <code>null</code>,
2154+
<span class="changed">and <var>expanded property</var> is `@value`,
2155+
and <var>input type</var> is `@json`</span>, set
21542156
the <var>expanded property</var> <a>entry</a> of <var>result</var> to
21552157
<var>expanded value</var>.</li>
21562158
<li>Continue with the next <var>key</var> from <var>element</var>.</li>

tests/compact-manifest.html

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5054,6 +5054,74 @@ <h2>
50545054
</dd>
50555055
</dl>
50565056
</dd>
5057+
<dt id='tjs10'>
5058+
Test tjs10 Compact JSON literal (string)
5059+
</dt>
5060+
<dd>
5061+
<dl class='entry'>
5062+
<dt>id</dt>
5063+
<dd>#tjs10</dd>
5064+
<dt>Type</dt>
5065+
<dd>jld:PositiveEvaluationTest, jld:CompactTest</dd>
5066+
<dt>Purpose</dt>
5067+
<dd>Tests compacting property with @type @json to a JSON literal (string).</dd>
5068+
<dt>input</dt>
5069+
<dd>
5070+
<a href='compact/js10-in.jsonld'>compact/js10-in.jsonld</a>
5071+
</dd>
5072+
<dt>context</dt>
5073+
<dd>
5074+
<a href='compact/js10-context.jsonld'>compact/js10-context.jsonld</a>
5075+
</dd>
5076+
<dt>expect</dt>
5077+
<dd>
5078+
<a href='compact/js10-out.jsonld'>compact/js10-out.jsonld</a>
5079+
</dd>
5080+
<dt>Options</dt>
5081+
<dd>
5082+
<dl class='options'>
5083+
<dt>specVersion</dt>
5084+
<dd>json-ld-1.1</dd>
5085+
<dt>processingMode</dt>
5086+
<dd>json-ld-1.1</dd>
5087+
</dl>
5088+
</dd>
5089+
</dl>
5090+
</dd>
5091+
<dt id='tjs11'>
5092+
Test tjs11 Compact JSON literal (null)
5093+
</dt>
5094+
<dd>
5095+
<dl class='entry'>
5096+
<dt>id</dt>
5097+
<dd>#tjs11</dd>
5098+
<dt>Type</dt>
5099+
<dd>jld:PositiveEvaluationTest, jld:CompactTest</dd>
5100+
<dt>Purpose</dt>
5101+
<dd>Tests compacting property with @type @json to a JSON literal (null).</dd>
5102+
<dt>input</dt>
5103+
<dd>
5104+
<a href='compact/js11-in.jsonld'>compact/js11-in.jsonld</a>
5105+
</dd>
5106+
<dt>context</dt>
5107+
<dd>
5108+
<a href='compact/js11-context.jsonld'>compact/js11-context.jsonld</a>
5109+
</dd>
5110+
<dt>expect</dt>
5111+
<dd>
5112+
<a href='compact/js11-out.jsonld'>compact/js11-out.jsonld</a>
5113+
</dd>
5114+
<dt>Options</dt>
5115+
<dd>
5116+
<dl class='options'>
5117+
<dt>specVersion</dt>
5118+
<dd>json-ld-1.1</dd>
5119+
<dt>processingMode</dt>
5120+
<dd>json-ld-1.1</dd>
5121+
</dl>
5122+
</dd>
5123+
</dl>
5124+
</dd>
50575125
<dt id='tm001'>
50585126
Test tm001 Indexes to object not having an @id
50595127
</dt>

tests/compact-manifest.jsonld

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,24 @@
14361436
"context": "compact/js09-context.jsonld",
14371437
"expect": "compact/js09-out.jsonld",
14381438
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
1439+
}, {
1440+
"@id": "#tjs10",
1441+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1442+
"name": "Compact JSON literal (string)",
1443+
"purpose": "Tests compacting property with @type @json to a JSON literal (string).",
1444+
"input": "compact/js10-in.jsonld",
1445+
"context": "compact/js10-context.jsonld",
1446+
"expect": "compact/js10-out.jsonld",
1447+
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
1448+
}, {
1449+
"@id": "#tjs11",
1450+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1451+
"name": "Compact JSON literal (null)",
1452+
"purpose": "Tests compacting property with @type @json to a JSON literal (null).",
1453+
"input": "compact/js11-in.jsonld",
1454+
"context": "compact/js11-context.jsonld",
1455+
"expect": "compact/js11-out.jsonld",
1456+
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
14391457
}, {
14401458
"@id": "#tm001",
14411459
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],

tests/compact/js10-context.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"e": {"@id": "http://example.org/vocab#string", "@type": "@json"}
5+
}
6+
}

tests/compact/js10-in.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[{
2+
"http://example.org/vocab#string": [{
3+
"@value": "string",
4+
"@type": "@json"
5+
}]
6+
}]

tests/compact/js10-out.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"e": {"@id": "http://example.org/vocab#string", "@type": "@json"}
5+
},
6+
"e": "string"
7+
}

tests/compact/js11-context.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"e": {"@id": "http://example.org/vocab#null", "@type": "@json"}
5+
}
6+
}

tests/compact/js11-in.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[{
2+
"http://example.org/vocab#null": [{
3+
"@value": null,
4+
"@type": "@json"
5+
}]
6+
}]

tests/compact/js11-out.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"e": {"@id": "http://example.org/vocab#null", "@type": "@json"}
5+
},
6+
"e": null
7+
}

tests/expand-manifest.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5630,6 +5630,62 @@ <h2>
56305630
</dd>
56315631
</dl>
56325632
</dd>
5633+
<dt id='tjs11'>
5634+
Test tjs11 Expand JSON literal (string)
5635+
</dt>
5636+
<dd>
5637+
<dl class='entry'>
5638+
<dt>id</dt>
5639+
<dd>#tjs11</dd>
5640+
<dt>Type</dt>
5641+
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
5642+
<dt>Purpose</dt>
5643+
<dd>Tests expanding JSON literal in expanded form with aliased keys in value object.</dd>
5644+
<dt>input</dt>
5645+
<dd>
5646+
<a href='expand/js11-in.jsonld'>expand/js11-in.jsonld</a>
5647+
</dd>
5648+
<dt>expect</dt>
5649+
<dd>
5650+
<a href='expand/js11-out.jsonld'>expand/js11-out.jsonld</a>
5651+
</dd>
5652+
<dt>Options</dt>
5653+
<dd>
5654+
<dl class='options'>
5655+
<dt>specVersion</dt>
5656+
<dd>json-ld-1.1</dd>
5657+
</dl>
5658+
</dd>
5659+
</dl>
5660+
</dd>
5661+
<dt id='tjs12'>
5662+
Test tjs12 Expand JSON literal (null)
5663+
</dt>
5664+
<dd>
5665+
<dl class='entry'>
5666+
<dt>id</dt>
5667+
<dd>#tjs12</dd>
5668+
<dt>Type</dt>
5669+
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
5670+
<dt>Purpose</dt>
5671+
<dd>Tests expanding JSON literal in expanded form with aliased keys in value object.</dd>
5672+
<dt>input</dt>
5673+
<dd>
5674+
<a href='expand/js12-in.jsonld'>expand/js12-in.jsonld</a>
5675+
</dd>
5676+
<dt>expect</dt>
5677+
<dd>
5678+
<a href='expand/js12-out.jsonld'>expand/js12-out.jsonld</a>
5679+
</dd>
5680+
<dt>Options</dt>
5681+
<dd>
5682+
<dl class='options'>
5683+
<dt>specVersion</dt>
5684+
<dd>json-ld-1.1</dd>
5685+
</dl>
5686+
</dd>
5687+
</dl>
5688+
</dd>
56335689
<dt id='tl001'>
56345690
Test tl001 Language map with null value
56355691
</dt>

tests/expand-manifest.jsonld

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,22 @@
16761676
"input": "expand/js10-in.jsonld",
16771677
"expect": "expand/js10-out.jsonld",
16781678
"option": {"specVersion": "json-ld-1.1"}
1679+
}, {
1680+
"@id": "#tjs11",
1681+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1682+
"name": "Expand JSON literal (string)",
1683+
"purpose": "Tests expanding JSON literal in expanded form with aliased keys in value object.",
1684+
"input": "expand/js11-in.jsonld",
1685+
"expect": "expand/js11-out.jsonld",
1686+
"option": {"specVersion": "json-ld-1.1"}
1687+
}, {
1688+
"@id": "#tjs12",
1689+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1690+
"name": "Expand JSON literal (null)",
1691+
"purpose": "Tests expanding JSON literal in expanded form with aliased keys in value object.",
1692+
"input": "expand/js12-in.jsonld",
1693+
"expect": "expand/js12-out.jsonld",
1694+
"option": {"specVersion": "json-ld-1.1"}
16791695
}, {
16801696
"@id": "#tl001",
16811697
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],

tests/expand/js11-in.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"e": {"@id": "http://example.org/vocab#string", "@type": "@json"}
5+
},
6+
"e": "string"
7+
}

tests/expand/js11-out.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[{
2+
"http://example.org/vocab#string": [{
3+
"@value": "string",
4+
"@type": "@json"
5+
}]
6+
}]

tests/expand/js12-in.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"e": {"@id": "http://example.org/vocab#null", "@type": "@json"}
5+
},
6+
"e": null
7+
}

tests/expand/js12-out.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[{
2+
"http://example.org/vocab#null": [{
3+
"@value": null,
4+
"@type": "@json"
5+
}]
6+
}]

tests/flatten-manifest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ <h2>Disclaimer</h2>
8787
<dt>baseIri</dt>
8888
<dd>https://w3c.github.io/json-ld-api/tests/</dd>
8989
</dl>
90-
<p>JSON-LD flattening tests.</p>
90+
<p>JSON-LD Flattening tests.</p>
9191
<section>
9292
<h2>
9393
Test sequence:

0 commit comments

Comments
 (0)