Skip to content

Commit 014afd4

Browse files
davidlehngkellogg
authored andcommitted
Add more type-scoped tests.
1 parent a951c13 commit 014afd4

File tree

7 files changed

+156
-0
lines changed

7 files changed

+156
-0
lines changed

tests/compact-manifest.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,15 @@
11211121
"context": "compact/c023-context.jsonld",
11221122
"expect": "compact/c023-out.jsonld",
11231123
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1124+
}, {
1125+
"@id": "#tc024",
1126+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1127+
"name": "type-scoped + property-scoped + values evaluates against previous context",
1128+
"purpose": "type-scoped + property-scoped + values evaluates against previous context",
1129+
"input": "compact/c024-in.jsonld",
1130+
"context": "compact/c024-context.jsonld",
1131+
"expect": "compact/c024-out.jsonld",
1132+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
11241133
}, {
11251134
"@id": "#te001",
11261135
"@type": [ "jld:NegativeEvaluationTest", "jld:CompactTest" ],

tests/compact/c024-context.jsonld

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"Outer": {
5+
"@id": "ex:Outer",
6+
"@context": {
7+
"nested": "ex:nested"
8+
}
9+
},
10+
"Inner": {
11+
"@id": "ex:Inner",
12+
"@context": {
13+
"@version": 1.1,
14+
"val": "@value",
15+
"foo": {
16+
"@id": "ex:foo",
17+
"@container": "@set",
18+
"@type": "ex:Number",
19+
"@context": {
20+
"value": "@value"
21+
}
22+
},
23+
"bar": {
24+
"@id": "ex:bar",
25+
"@container": "@set",
26+
"@type": "@id",
27+
"@context": {
28+
"@base": "http://example/"
29+
}
30+
}
31+
}
32+
}
33+
}
34+
}

tests/compact/c024-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[{
2+
"@type": ["ex:Outer"],
3+
"ex:nested": [{
4+
"@type": ["ex:Inner"],
5+
"ex:foo": {"@type": "ex:Number", "@value": "1"},
6+
"ex:bar": [
7+
{"@id": "http://example/a"},
8+
{"@id": "http://example/b"}
9+
]
10+
}]
11+
}]

tests/compact/c024-out.jsonld

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"Outer": {
5+
"@id": "ex:Outer",
6+
"@context": {
7+
"nested": "ex:nested"
8+
}
9+
},
10+
"Inner": {
11+
"@id": "ex:Inner",
12+
"@context": {
13+
"@version": 1.1,
14+
"val": "@value",
15+
"foo": {
16+
"@id": "ex:foo",
17+
"@container": "@set",
18+
"@type": "ex:Number",
19+
"@context": {
20+
"value": "@value"
21+
}
22+
},
23+
"bar": {
24+
"@id": "ex:bar",
25+
"@container": "@set",
26+
"@type": "@id",
27+
"@context": {
28+
"@base": "http://example/"
29+
}
30+
}
31+
}
32+
}
33+
},
34+
"@type": "Outer",
35+
"nested": {
36+
"@type": "Inner",
37+
"foo": ["1"],
38+
"bar": ["a", "b"]
39+
}
40+
}

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,14 @@
10241024
"input": "expand/c023-in.jsonld",
10251025
"expect": "expand/c023-out.jsonld",
10261026
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1027+
}, {
1028+
"@id": "#tc024",
1029+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1030+
"name": "type-scoped + property-scoped + values evaluates against previous context",
1031+
"purpose": "type-scoped + property-scoped + values evaluates against previous context",
1032+
"input": "expand/c024-in.jsonld",
1033+
"expect": "expand/c024-out.jsonld",
1034+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
10271035
}, {
10281036
"@id": "#te001",
10291037
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],

tests/expand/c024-in.jsonld

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"Outer": {
5+
"@id": "ex:Outer",
6+
"@context": {
7+
"nested": "ex:nested"
8+
}
9+
},
10+
"Inner": {
11+
"@id": "ex:Inner",
12+
"@context": {
13+
"@version": 1.1,
14+
"val": "@value",
15+
"foo": {
16+
"@id": "ex:foo",
17+
"@container": "@set",
18+
"@type": "ex:Number",
19+
"@context": {
20+
"value": "@value"
21+
}
22+
},
23+
"bar": {
24+
"@id": "ex:bar",
25+
"@container": "@set",
26+
"@type": "@id",
27+
"@context": {
28+
"@base": "http://example/"
29+
}
30+
}
31+
}
32+
}
33+
},
34+
"@type": "Outer",
35+
"nested": {
36+
"@type": "Inner",
37+
"foo": [{"value": "1"}, "2"],
38+
"bar": [{"@id": "a"}, "b"]
39+
}
40+
}

tests/expand/c024-out.jsonld

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[{
2+
"@type": ["ex:Outer"],
3+
"ex:nested": [{
4+
"@type": ["ex:Inner"],
5+
"ex:foo": [
6+
{"@value": "1"},
7+
{"@type": "ex:Number", "@value": "2"}
8+
],
9+
"ex:bar": [
10+
{"@id": "http://example/a"},
11+
{"@id": "http://example/b"}
12+
]
13+
}]
14+
}]

0 commit comments

Comments
 (0)