Skip to content

Commit 6822636

Browse files
committed
Add pr40 for toRdf and fromRdf from PR #419.
1 parent c0eee17 commit 6822636

File tree

8 files changed

+903
-506
lines changed

8 files changed

+903
-506
lines changed

tests/expand-manifest.html

Lines changed: 531 additions & 503 deletions
Large diffs are not rendered by default.

tests/expand-manifest.jsonld

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,14 @@
17121712
"purpose": "Verifies that an exception is raised in Expansion when an invalid value object value is found using a value alias",
17131713
"input": "expand/er51-in.jsonld",
17141714
"expectErrorCode": "invalid value object value"
1715-
}, {
1715+
}, {
1716+
"@id": "#ter52",
1717+
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
1718+
"name": "Definition for the empty term",
1719+
"purpose": "Verifies that an exception is raised on expansion when a context contains a definition for the empty term",
1720+
"input": "expand/er52-in.jsonld",
1721+
"expectErrorCode": "invalid term definition"
1722+
}, {
17161723
"@id": "#tes01",
17171724
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
17181725
"name": "Using an array value for @context is illegal in JSON-LD 1.0",
@@ -2720,6 +2727,14 @@
27202727
"option": {"specVersion": "json-ld-1.1"},
27212728
"input": "expand/pr39-in.jsonld",
27222729
"expect": "expand/pr39-out.jsonld"
2730+
}, {
2731+
"@id": "#tpr40",
2732+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
2733+
"name": "Protected terms and property-scoped contexts",
2734+
"purpose": "Check overriding of protected term from property-scoped context.",
2735+
"option": {"specVersion": "json-ld-1.1"},
2736+
"input": "expand/pr40-in.jsonld",
2737+
"expect": "expand/pr40-out.jsonld"
27232738
}, {
27242739
"@id": "#tso01",
27252740
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],

tests/expand/pr40-in.jsonld

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://vocab.org/",
4+
"@protected": true,
5+
"bar": "http://ignored.org/bar",
6+
"foo": {
7+
"@context": {
8+
"bar": "http://example.org/other"
9+
}
10+
}
11+
},
12+
"@id": "ex:outer",
13+
"foo": {
14+
"@id": "ex:inner",
15+
"bar": "baz"
16+
}
17+
}

tests/expand/pr40-out.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[{
2+
"@id": "ex:outer",
3+
"http://vocab.org/foo": [{
4+
"@id": "ex:inner",
5+
"http://example.org/other": [{"@value": "baz"}]
6+
}]
7+
}]

tests/toRdf-manifest.html

Lines changed: 304 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@ <h2>
25762576
</dl>
25772577
</dd>
25782578
<dt id='te001'>
2579-
Test te001 drop free-floating nodes (xxx drop, duplicates #te046)
2579+
Test te001 drop free-floating nodes
25802580
</dt>
25812581
<dd>
25822582
<dl class='entry'>
@@ -5617,6 +5617,260 @@ <h2>
56175617
</dd>
56185618
</dl>
56195619
</dd>
5620+
<dt id='tem01'>
5621+
Test tem01 Invalid container mapping
5622+
</dt>
5623+
<dd>
5624+
<dl class='entry'>
5625+
<dt>id</dt>
5626+
<dd>#tem01</dd>
5627+
<dt>Type</dt>
5628+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5629+
<dt>Purpose</dt>
5630+
<dd>Verifies that an exception is raised on expansion when a invalid container mapping is found</dd>
5631+
<dt>input</dt>
5632+
<dd>
5633+
<a href='toRdf/em01-in.jsonld'>toRdf/em01-in.jsonld</a>
5634+
</dd>
5635+
<dt>expect</dt>
5636+
<dd>
5637+
invalid container mapping
5638+
</dd>
5639+
<dt>Options</dt>
5640+
<dd>
5641+
<dl class='options'>
5642+
<dt>specVersion</dt>
5643+
<dd>json-ld-1.1</dd>
5644+
</dl>
5645+
</dd>
5646+
</dl>
5647+
</dd>
5648+
<dt id='ten01'>
5649+
Test ten01 @nest MUST NOT have a string value
5650+
</dt>
5651+
<dd>
5652+
<dl class='entry'>
5653+
<dt>id</dt>
5654+
<dd>#ten01</dd>
5655+
<dt>Type</dt>
5656+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5657+
<dt>Purpose</dt>
5658+
<dd>container: @nest</dd>
5659+
<dt>input</dt>
5660+
<dd>
5661+
<a href='toRdf/en01-in.jsonld'>toRdf/en01-in.jsonld</a>
5662+
</dd>
5663+
<dt>expect</dt>
5664+
<dd>
5665+
invalid @nest value
5666+
</dd>
5667+
<dt>Options</dt>
5668+
<dd>
5669+
<dl class='options'>
5670+
<dt>specVersion</dt>
5671+
<dd>json-ld-1.1</dd>
5672+
</dl>
5673+
</dd>
5674+
</dl>
5675+
</dd>
5676+
<dt id='ten02'>
5677+
Test ten02 @nest MUST NOT have a boolen value
5678+
</dt>
5679+
<dd>
5680+
<dl class='entry'>
5681+
<dt>id</dt>
5682+
<dd>#ten02</dd>
5683+
<dt>Type</dt>
5684+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5685+
<dt>Purpose</dt>
5686+
<dd>Transparent Nesting</dd>
5687+
<dt>input</dt>
5688+
<dd>
5689+
<a href='toRdf/en02-in.jsonld'>toRdf/en02-in.jsonld</a>
5690+
</dd>
5691+
<dt>expect</dt>
5692+
<dd>
5693+
invalid @nest value
5694+
</dd>
5695+
<dt>Options</dt>
5696+
<dd>
5697+
<dl class='options'>
5698+
<dt>specVersion</dt>
5699+
<dd>json-ld-1.1</dd>
5700+
</dl>
5701+
</dd>
5702+
</dl>
5703+
</dd>
5704+
<dt id='ten03'>
5705+
Test ten03 @nest MUST NOT have a numeric value
5706+
</dt>
5707+
<dd>
5708+
<dl class='entry'>
5709+
<dt>id</dt>
5710+
<dd>#ten03</dd>
5711+
<dt>Type</dt>
5712+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5713+
<dt>Purpose</dt>
5714+
<dd>Transparent Nesting</dd>
5715+
<dt>input</dt>
5716+
<dd>
5717+
<a href='toRdf/en03-in.jsonld'>toRdf/en03-in.jsonld</a>
5718+
</dd>
5719+
<dt>expect</dt>
5720+
<dd>
5721+
invalid @nest value
5722+
</dd>
5723+
<dt>Options</dt>
5724+
<dd>
5725+
<dl class='options'>
5726+
<dt>specVersion</dt>
5727+
<dd>json-ld-1.1</dd>
5728+
</dl>
5729+
</dd>
5730+
</dl>
5731+
</dd>
5732+
<dt id='ten04'>
5733+
Test ten04 @nest MUST NOT have a value object value
5734+
</dt>
5735+
<dd>
5736+
<dl class='entry'>
5737+
<dt>id</dt>
5738+
<dd>#ten04</dd>
5739+
<dt>Type</dt>
5740+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5741+
<dt>Purpose</dt>
5742+
<dd>Transparent Nesting</dd>
5743+
<dt>input</dt>
5744+
<dd>
5745+
<a href='toRdf/en04-in.jsonld'>toRdf/en04-in.jsonld</a>
5746+
</dd>
5747+
<dt>expect</dt>
5748+
<dd>
5749+
invalid @nest value
5750+
</dd>
5751+
<dt>Options</dt>
5752+
<dd>
5753+
<dl class='options'>
5754+
<dt>specVersion</dt>
5755+
<dd>json-ld-1.1</dd>
5756+
</dl>
5757+
</dd>
5758+
</dl>
5759+
</dd>
5760+
<dt id='ten05'>
5761+
Test ten05 does not allow a keyword other than @nest for the value of @nest
5762+
</dt>
5763+
<dd>
5764+
<dl class='entry'>
5765+
<dt>id</dt>
5766+
<dd>#ten05</dd>
5767+
<dt>Type</dt>
5768+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5769+
<dt>Purpose</dt>
5770+
<dd>Transparent Nesting</dd>
5771+
<dt>input</dt>
5772+
<dd>
5773+
<a href='toRdf/en05-in.jsonld'>toRdf/en05-in.jsonld</a>
5774+
</dd>
5775+
<dt>expect</dt>
5776+
<dd>
5777+
invalid @nest value
5778+
</dd>
5779+
<dt>Options</dt>
5780+
<dd>
5781+
<dl class='options'>
5782+
<dt>specVersion</dt>
5783+
<dd>json-ld-1.1</dd>
5784+
</dl>
5785+
</dd>
5786+
</dl>
5787+
</dd>
5788+
<dt id='ten06'>
5789+
Test ten06 does not allow @nest with @reverse
5790+
</dt>
5791+
<dd>
5792+
<dl class='entry'>
5793+
<dt>id</dt>
5794+
<dd>#ten06</dd>
5795+
<dt>Type</dt>
5796+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5797+
<dt>Purpose</dt>
5798+
<dd>Transparent Nesting</dd>
5799+
<dt>input</dt>
5800+
<dd>
5801+
<a href='toRdf/en06-in.jsonld'>toRdf/en06-in.jsonld</a>
5802+
</dd>
5803+
<dt>expect</dt>
5804+
<dd>
5805+
invalid reverse property
5806+
</dd>
5807+
<dt>Options</dt>
5808+
<dd>
5809+
<dl class='options'>
5810+
<dt>specVersion</dt>
5811+
<dd>json-ld-1.1</dd>
5812+
</dl>
5813+
</dd>
5814+
</dl>
5815+
</dd>
5816+
<dt id='tep02'>
5817+
Test tep02 processingMode json-ld-1.0 conflicts with @version: 1.1
5818+
</dt>
5819+
<dd>
5820+
<dl class='entry'>
5821+
<dt>id</dt>
5822+
<dd>#tep02</dd>
5823+
<dt>Type</dt>
5824+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5825+
<dt>Purpose</dt>
5826+
<dd>If processingMode is explicitly json-ld-1.0, it will conflict with 1.1 features.</dd>
5827+
<dt>input</dt>
5828+
<dd>
5829+
<a href='toRdf/ep02-in.jsonld'>toRdf/ep02-in.jsonld</a>
5830+
</dd>
5831+
<dt>expect</dt>
5832+
<dd>
5833+
processing mode conflict
5834+
</dd>
5835+
<dt>Options</dt>
5836+
<dd>
5837+
<dl class='options'>
5838+
<dt>processingMode</dt>
5839+
<dd>json-ld-1.0</dd>
5840+
<dt>specVersion</dt>
5841+
<dd>json-ld-1.1</dd>
5842+
</dl>
5843+
</dd>
5844+
</dl>
5845+
</dd>
5846+
<dt id='tep03'>
5847+
Test tep03 @version must be 1.1
5848+
</dt>
5849+
<dd>
5850+
<dl class='entry'>
5851+
<dt>id</dt>
5852+
<dd>#tep03</dd>
5853+
<dt>Type</dt>
5854+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
5855+
<dt>Purpose</dt>
5856+
<dd>If @version is specified, it must be 1.1</dd>
5857+
<dt>input</dt>
5858+
<dd>
5859+
<a href='toRdf/ep03-in.jsonld'>toRdf/ep03-in.jsonld</a>
5860+
</dd>
5861+
<dt>expect</dt>
5862+
<dd>
5863+
invalid @version value
5864+
</dd>
5865+
<dt>Options</dt>
5866+
<dd>
5867+
<dl class='options'>
5868+
<dt>specVersion</dt>
5869+
<dd>json-ld-1.1</dd>
5870+
</dl>
5871+
</dd>
5872+
</dl>
5873+
</dd>
56205874
<dt id='ter01'>
56215875
Test ter01 Keywords cannot be aliased to other keywords
56225876
</dt>
@@ -6685,6 +6939,27 @@ <h2>
66856939
</dd>
66866940
</dl>
66876941
</dd>
6942+
<dt id='ter52'>
6943+
Test ter52 Definition for the empty term
6944+
</dt>
6945+
<dd>
6946+
<dl class='entry'>
6947+
<dt>id</dt>
6948+
<dd>#ter52</dd>
6949+
<dt>Type</dt>
6950+
<dd>jld:NegativeEvaluationTest, jld:ToRDFTest</dd>
6951+
<dt>Purpose</dt>
6952+
<dd>Verifies that an exception is raised on expansion when a context contains a definition for the empty term</dd>
6953+
<dt>input</dt>
6954+
<dd>
6955+
<a href='toRdf/er52-in.jsonld'>toRdf/er52-in.jsonld</a>
6956+
</dd>
6957+
<dt>expect</dt>
6958+
<dd>
6959+
invalid term definition
6960+
</dd>
6961+
</dl>
6962+
</dd>
66886963
<dt id='tin01'>
66896964
Test tin01 Basic Included array
66906965
</dt>
@@ -10515,6 +10790,34 @@ <h2>
1051510790
</dd>
1051610791
</dl>
1051710792
</dd>
10793+
<dt id='tpr40'>
10794+
Test tpr40 Protected terms and property-scoped contexts
10795+
</dt>
10796+
<dd>
10797+
<dl class='entry'>
10798+
<dt>id</dt>
10799+
<dd>#tpr40</dd>
10800+
<dt>Type</dt>
10801+
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
10802+
<dt>Purpose</dt>
10803+
<dd>Check overriding of protected term from property-scoped context.</dd>
10804+
<dt>input</dt>
10805+
<dd>
10806+
<a href='toRdf/pr40-in.jsonld'>toRdf/pr40-in.jsonld</a>
10807+
</dd>
10808+
<dt>expect</dt>
10809+
<dd>
10810+
<a href='toRdf/pr40-out.nq'>toRdf/pr40-out.nq</a>
10811+
</dd>
10812+
<dt>Options</dt>
10813+
<dd>
10814+
<dl class='options'>
10815+
<dt>specVersion</dt>
10816+
<dd>json-ld-1.1</dd>
10817+
</dl>
10818+
</dd>
10819+
</dl>
10820+
</dd>
1051810821
<dt id='trt01'>
1051910822
Test trt01 Representing numbers >= 1e21
1052010823
</dt>

0 commit comments

Comments
 (0)