Skip to content

Commit 9b4c6bf

Browse files
committed
Add RDF list tests where list element expands to an invalid IRI.
1 parent 8ad03db commit 9b4c6bf

File tree

11 files changed

+13279
-13032
lines changed

11 files changed

+13279
-13032
lines changed

reports/manifests.nt

Lines changed: 13075 additions & 13032 deletions
Large diffs are not rendered by default.

tests/toRdf-manifest.html

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8450,6 +8450,124 @@ <h2>
84508450
</dd>
84518451
</dl>
84528452
</dd>
8453+
<dt id='tli11'>
8454+
Test tli11 List with good @base.
8455+
</dt>
8456+
<dd>
8457+
<dl class='entry'>
8458+
<dt>id</dt>
8459+
<dd>#tli11</dd>
8460+
<dt>Type</dt>
8461+
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
8462+
<dt>Purpose</dt>
8463+
<dd>Tests list elements expanded to IRIs with a good @base.</dd>
8464+
<dt>input</dt>
8465+
<dd>
8466+
<a href='toRdf/li11-in.jsonld'>toRdf/li11-in.jsonld</a>
8467+
</dd>
8468+
<dt>expect</dt>
8469+
<dd>
8470+
<a href='toRdf/li11-out.nq'>toRdf/li11-out.nq</a>
8471+
</dd>
8472+
<dt>Options</dt>
8473+
<dd>
8474+
<dl class='options'>
8475+
<dt>specVersion</dt>
8476+
<dd>json-ld-1.1</dd>
8477+
<dt>base</dt>
8478+
<dd>http://example.com/</dd>
8479+
</dl>
8480+
</dd>
8481+
</dl>
8482+
</dd>
8483+
<dt id='tli12'>
8484+
Test tli12 List with bad @base.
8485+
</dt>
8486+
<dd>
8487+
<dl class='entry'>
8488+
<dt>id</dt>
8489+
<dd>#tli12</dd>
8490+
<dt>Type</dt>
8491+
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
8492+
<dt>Purpose</dt>
8493+
<dd>Tests list elements expanded to IRIs with a bad @base.</dd>
8494+
<dt>input</dt>
8495+
<dd>
8496+
<a href='toRdf/li12-in.jsonld'>toRdf/li12-in.jsonld</a>
8497+
</dd>
8498+
<dt>expect</dt>
8499+
<dd>
8500+
<a href='toRdf/li12-out.nq'>toRdf/li12-out.nq</a>
8501+
</dd>
8502+
<dt>Options</dt>
8503+
<dd>
8504+
<dl class='options'>
8505+
<dt>specVersion</dt>
8506+
<dd>json-ld-1.1</dd>
8507+
</dl>
8508+
</dd>
8509+
</dl>
8510+
</dd>
8511+
<dt id='tli13'>
8512+
Test tli13 List with empty @base.
8513+
</dt>
8514+
<dd>
8515+
<dl class='entry'>
8516+
<dt>id</dt>
8517+
<dd>#tli13</dd>
8518+
<dt>Type</dt>
8519+
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
8520+
<dt>Purpose</dt>
8521+
<dd>Tests list elements expanded to IRIs with an empty @base.</dd>
8522+
<dt>input</dt>
8523+
<dd>
8524+
<a href='toRdf/li13-in.jsonld'>toRdf/li13-in.jsonld</a>
8525+
</dd>
8526+
<dt>expect</dt>
8527+
<dd>
8528+
<a href='toRdf/li13-out.nq'>toRdf/li13-out.nq</a>
8529+
</dd>
8530+
<dt>Options</dt>
8531+
<dd>
8532+
<dl class='options'>
8533+
<dt>specVersion</dt>
8534+
<dd>json-ld-1.1</dd>
8535+
<dt>base</dt>
8536+
<dd>http://example.com/</dd>
8537+
</dl>
8538+
</dd>
8539+
</dl>
8540+
</dd>
8541+
<dt id='tli14'>
8542+
Test tli14 List with null @base.
8543+
</dt>
8544+
<dd>
8545+
<dl class='entry'>
8546+
<dt>id</dt>
8547+
<dd>#tli14</dd>
8548+
<dt>Type</dt>
8549+
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
8550+
<dt>Purpose</dt>
8551+
<dd>Tests list elements expanded to IRIs with a null @base.</dd>
8552+
<dt>input</dt>
8553+
<dd>
8554+
<a href='toRdf/li14-in.jsonld'>toRdf/li14-in.jsonld</a>
8555+
</dd>
8556+
<dt>expect</dt>
8557+
<dd>
8558+
<a href='toRdf/li14-out.nq'>toRdf/li14-out.nq</a>
8559+
</dd>
8560+
<dt>Options</dt>
8561+
<dd>
8562+
<dl class='options'>
8563+
<dt>specVersion</dt>
8564+
<dd>json-ld-1.1</dd>
8565+
<dt>base</dt>
8566+
<dd>http://example.com/</dd>
8567+
</dl>
8568+
</dd>
8569+
</dl>
8570+
</dd>
84538571
<dt id='tm001'>
84548572
Test tm001 Adds @id to object not having an @id
84558573
</dt>

tests/toRdf-manifest.jsonld

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,6 +2556,38 @@
25562556
"option": {"specVersion": "json-ld-1.1"},
25572557
"input": "toRdf/li10-in.jsonld",
25582558
"expect": "toRdf/li10-out.nq"
2559+
}, {
2560+
"@id": "#tli11",
2561+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
2562+
"name": "List with good @base.",
2563+
"purpose": "Tests list elements expanded to IRIs with a good @base.",
2564+
"option": {"specVersion": "json-ld-1.1", "base": "http://example.com/"},
2565+
"input": "toRdf/li11-in.jsonld",
2566+
"expect": "toRdf/li11-out.nq"
2567+
}, {
2568+
"@id": "#tli12",
2569+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
2570+
"name": "List with bad @base.",
2571+
"purpose": "Tests list elements expanded to IRIs with a bad @base.",
2572+
"option": {"specVersion": "json-ld-1.1"},
2573+
"input": "toRdf/li12-in.jsonld",
2574+
"expect": "toRdf/li12-out.nq"
2575+
}, {
2576+
"@id": "#tli13",
2577+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
2578+
"name": "List with empty @base.",
2579+
"purpose": "Tests list elements expanded to IRIs with an empty @base.",
2580+
"option": {"specVersion": "json-ld-1.1", "base": "http://example.com/"},
2581+
"input": "toRdf/li13-in.jsonld",
2582+
"expect": "toRdf/li13-out.nq"
2583+
}, {
2584+
"@id": "#tli14",
2585+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
2586+
"name": "List with null @base.",
2587+
"purpose": "Tests list elements expanded to IRIs with a null @base.",
2588+
"option": {"specVersion": "json-ld-1.1", "base": "http://example.com/"},
2589+
"input": "toRdf/li14-in.jsonld",
2590+
"expect": "toRdf/li14-out.nq"
25592591
}, {
25602592
"@id": "#tm001",
25612593
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],

tests/toRdf/li11-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@base": "ex:",
4+
"list": {
5+
"@id": "foo:bar",
6+
"@container": "@list",
7+
"@type": "@id"
8+
}
9+
},
10+
"list": ["test"]
11+
}

tests/toRdf/li11-out.nq

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_:b0 <foo:bar> _:b1 .
2+
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <ex:test> .
3+
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .

tests/toRdf/li12-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@base": "http://invalid/<>/",
4+
"list": {
5+
"@id": "foo:bar",
6+
"@container": "@list",
7+
"@type": "@id"
8+
}
9+
},
10+
"list": ["test"]
11+
}

tests/toRdf/li12-out.nq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_:b0 <foo:bar> _:b1 .
2+
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .

tests/toRdf/li13-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@base": "",
4+
"list": {
5+
"@id": "foo:bar",
6+
"@container": "@list",
7+
"@type": "@id"
8+
}
9+
},
10+
"list": ["test"]
11+
}

tests/toRdf/li13-out.nq

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_:b0 <foo:bar> _:b1 .
2+
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/test> .
3+
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .

tests/toRdf/li14-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@base": null,
4+
"list": {
5+
"@id": "foo:bar",
6+
"@container": "@list",
7+
"@type": "@id"
8+
}
9+
},
10+
"list": ["test"]
11+
}

0 commit comments

Comments
 (0)