Skip to content

Commit 3abfe61

Browse files
committed
Add compaction test for mixed lists
This addresses #172.
1 parent f677925 commit 3abfe61

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"@context": {
3+
"id1": "http://example.com/id1",
4+
"type1": "http://example.com/t1",
5+
"type2": "http://example.com/t2",
6+
"@language": "de",
7+
"termL": { "@id": "http://example.com/termLanguage" },
8+
"termLL0": { "@id": "http://example.com/termLanguage", "@container": "@list" },
9+
"termLL1": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": "en" },
10+
"termLL2": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": null },
11+
"termT": { "@id": "http://example.com/termType" },
12+
"termTL0": { "@id": "http://example.com/termType", "@container": "@list" },
13+
"termTL1": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type1" },
14+
"termTL2": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type2" }
15+
}
16+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
3+
"@context": {
4+
"type1": "http://example.com/t1",
5+
"type2": "http://example.com/t2"
6+
},
7+
"@id": "http://example.com/id1",
8+
"http://example.com/termLanguage": [
9+
{
10+
"@list": [
11+
{ "@value": "termLL0.1", "@language": "de" },
12+
{ "@value": "termLL0.2", "@language": "de" }
13+
]
14+
},
15+
{
16+
"@list": [
17+
{ "@value": "termLL1.1", "@language": "en" },
18+
{ "@value": "termLL1.2", "@language": "en" }
19+
]
20+
},
21+
{
22+
"@list": [
23+
"termLL2.1",
24+
"termLL2.2"
25+
]
26+
}
27+
],
28+
"http://example.com/termType": [
29+
{
30+
"@list": [
31+
{ "@value": "termTL0.1", "@type": "type1" },
32+
{ "@value": "termTL0.2", "@type": "type2" }
33+
]
34+
},
35+
{
36+
"@list": [
37+
{ "@value": "termTL1.1", "@type": "type1" },
38+
{ "@value": "termTL1.2", "@type": "type1" }
39+
]
40+
},
41+
{
42+
"@list": [
43+
{ "@value": "termTL2.1", "@type": "type2" },
44+
{ "@value": "termTL2.2", "@type": "type2" }
45+
]
46+
}
47+
]
48+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"@context": {
3+
"id1": "http://example.com/id1",
4+
"type1": "http://example.com/t1",
5+
"type2": "http://example.com/t2",
6+
"@language": "de",
7+
"termL": { "@id": "http://example.com/termLanguage" },
8+
"termLL0": { "@id": "http://example.com/termLanguage", "@container": "@list" },
9+
"termLL1": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": "en" },
10+
"termLL2": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": null },
11+
"termT": { "@id": "http://example.com/termType" },
12+
"termTL0": { "@id": "http://example.com/termType", "@container": "@list" },
13+
"termTL1": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type1" },
14+
"termTL2": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type2" }
15+
},
16+
"@id": "id1",
17+
"termLL0": [
18+
"termLL0.1",
19+
"termLL0.2"
20+
],
21+
"termLL1": [
22+
"termLL1.1",
23+
"termLL1.2"
24+
],
25+
"termLL2": [
26+
"termLL2.1",
27+
"termLL2.2"
28+
],
29+
"termTL0": [
30+
{
31+
"@type": "type1",
32+
"@value": "termTL0.1"
33+
},
34+
{
35+
"@type": "type2",
36+
"@value": "termTL0.2"
37+
}
38+
],
39+
"termTL1": [
40+
"termTL1.1",
41+
"termTL1.2"
42+
],
43+
"termTL2": [
44+
"termTL2.1",
45+
"termTL2.2"
46+
]
47+
}

test-suite/tests/compact-manifest.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,11 @@
144144
"input": "compact-0023-in.jsonld",
145145
"context": "compact-0023-context.jsonld",
146146
"expect": "compact-0023-out.jsonld"
147+
}, {
148+
"@type": ["test:TestCase", "jld:CompactTest"],
149+
"name": "The most specific term that matches all of the elements in the list, taking into account the default language, must be selected.",
150+
"input": "compact-0024-in.jsonld",
151+
"context": "compact-0024-context.jsonld",
152+
"expect": "compact-0024-out.jsonld"
147153
}]
148154
}

0 commit comments

Comments
 (0)