Skip to content

Commit 92cfed9

Browse files
committed
Add tests for round-tripping property indexes. For #514.
1 parent 81ccb0b commit 92cfed9

File tree

8 files changed

+132
-0
lines changed

8 files changed

+132
-0
lines changed

tests/compact-manifest.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3162,6 +3162,56 @@ <h2>
31623162
</dd>
31633163
</dl>
31643164
</dd>
3165+
<dt id='t0113'>
3166+
Test t0113 Compact property index using Absolute IRI index
3167+
</dt>
3168+
<dd>
3169+
<dl class='entry'>
3170+
<dt>id</dt>
3171+
<dd>#t0113</dd>
3172+
<dt>Type</dt>
3173+
<dd>jld:PositiveEvaluationTest, jld:CompactTest</dd>
3174+
<dt>Purpose</dt>
3175+
<dd>With @container: @index and @index an absolute IRI, ensure round-tripping of compacted representation</dd>
3176+
<dt>input</dt>
3177+
<dd>
3178+
<a href='compact/0113-in.jsonld'>compact/0113-in.jsonld</a>
3179+
</dd>
3180+
<dt>context</dt>
3181+
<dd>
3182+
<a href='compact/0113-context.jsonld'>compact/0113-context.jsonld</a>
3183+
</dd>
3184+
<dt>expect</dt>
3185+
<dd>
3186+
<a href='compact/0113-out.jsonld'>compact/0113-out.jsonld</a>
3187+
</dd>
3188+
</dl>
3189+
</dd>
3190+
<dt id='t0112'>
3191+
Test t0112 Compact property index using Compact IRI index
3192+
</dt>
3193+
<dd>
3194+
<dl class='entry'>
3195+
<dt>id</dt>
3196+
<dd>#t0112</dd>
3197+
<dt>Type</dt>
3198+
<dd>jld:PositiveEvaluationTest, jld:CompactTest</dd>
3199+
<dt>Purpose</dt>
3200+
<dd>With @container: @index and @index a compact IRI, ensure round-tripping of compacted representation</dd>
3201+
<dt>input</dt>
3202+
<dd>
3203+
<a href='compact/0112-in.jsonld'>compact/0112-in.jsonld</a>
3204+
</dd>
3205+
<dt>context</dt>
3206+
<dd>
3207+
<a href='compact/0112-context.jsonld'>compact/0112-context.jsonld</a>
3208+
</dd>
3209+
<dt>expect</dt>
3210+
<dd>
3211+
<a href='compact/0112-out.jsonld'>compact/0112-out.jsonld</a>
3212+
</dd>
3213+
</dl>
3214+
</dd>
31653215
<dt id='tc001'>
31663216
Test tc001 adding new term
31673217
</dt>

tests/compact-manifest.jsonld

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,22 @@
941941
"context": "compact/0111-context.jsonld",
942942
"expect": "compact/0111-out.jsonld",
943943
"option": {"specVersion": "json-ld-1.1"}
944+
}, {
945+
"@id": "#t0113",
946+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
947+
"name": "Compact property index using Absolute IRI index",
948+
"purpose": "With @container: @index and @index an absolute IRI, ensure round-tripping of compacted representation",
949+
"input": "compact/0113-in.jsonld",
950+
"context": "compact/0113-context.jsonld",
951+
"expect": "compact/0113-out.jsonld"
952+
}, {
953+
"@id": "#t0112",
954+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
955+
"name": "Compact property index using Compact IRI index",
956+
"purpose": "With @container: @index and @index a compact IRI, ensure round-tripping of compacted representation",
957+
"input": "compact/0112-in.jsonld",
958+
"context": "compact/0112-context.jsonld",
959+
"expect": "compact/0112-out.jsonld"
944960
}, {
945961
"@id": "#tc001",
946962
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],

tests/compact/0112-context.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"@context": {
3+
"ex": "http://example.org/ns/",
4+
"prop": {
5+
"@id": "ex:prop",
6+
"@container": "@index",
7+
"@index": "ex:name"
8+
}
9+
}
10+
}

tests/compact/0112-in.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"http://example.org/ns/prop": [{
3+
"@id": "http://example.org/ns/bar",
4+
"http://example.org/ns/name": "bar"
5+
}, {
6+
"@id": "http://example.org/ns/foo",
7+
"http://example.org/ns/name": "foo"
8+
}]
9+
}

tests/compact/0112-out.jsonld

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"@context": {
3+
"ex": "http://example.org/ns/",
4+
"prop": {
5+
"@id": "ex:prop",
6+
"@container": "@index",
7+
"@index": "ex:name"
8+
}
9+
},
10+
"prop": {
11+
"foo": { "@id": "ex:foo"},
12+
"bar": { "@id": "ex:bar"}
13+
}
14+
}

tests/compact/0113-context.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"@context": {
3+
"ex": "http://example.org/ns/",
4+
"prop": {
5+
"@id": "ex:prop",
6+
"@container": "@index",
7+
"@index": "http://example.org/ns/name"
8+
}
9+
}
10+
}

tests/compact/0113-in.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"http://example.org/ns/prop": [{
3+
"@id": "http://example.org/ns/bar",
4+
"http://example.org/ns/name": "bar"
5+
}, {
6+
"@id": "http://example.org/ns/foo",
7+
"http://example.org/ns/name": "foo"
8+
}]
9+
}

tests/compact/0113-out.jsonld

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"@context": {
3+
"ex": "http://example.org/ns/",
4+
"prop": {
5+
"@id": "ex:prop",
6+
"@container": "@index",
7+
"@index": "http://example.org/ns/name"
8+
}
9+
},
10+
"prop": {
11+
"foo": { "@id": "ex:foo"},
12+
"bar": { "@id": "ex:bar"}
13+
}
14+
}

0 commit comments

Comments
 (0)