Skip to content

Commit 28491e3

Browse files
davidlehngkellogg
authored andcommitted
Add type-scoped graph container tests.
1 parent 014afd4 commit 28491e3

File tree

7 files changed

+111
-0
lines changed

7 files changed

+111
-0
lines changed

tests/compact-manifest.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,15 @@
11301130
"context": "compact/c024-context.jsonld",
11311131
"expect": "compact/c024-out.jsonld",
11321132
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1133+
}, {
1134+
"@id": "#tc025",
1135+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1136+
"name": "type-scoped + graph container",
1137+
"purpose": "type-scoped + graph container",
1138+
"input": "compact/c025-in.jsonld",
1139+
"context": "compact/c025-context.jsonld",
1140+
"expect": "compact/c025-out.jsonld",
1141+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
11331142
}, {
11341143
"@id": "#te001",
11351144
"@type": [ "jld:NegativeEvaluationTest", "jld:CompactTest" ],

tests/compact/c025-context.jsonld

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"type": "@type",
5+
"Outer": {
6+
"@id": "ex:Outer",
7+
"@context": {
8+
"nested": {
9+
"@id": "ex:nested",
10+
"@type": "@id",
11+
"@container": "@graph"
12+
}
13+
}
14+
},
15+
"Inner": {
16+
"@id": "ex:Inner",
17+
"@context": {
18+
"foo": "ex:foo"
19+
}
20+
}
21+
}
22+
}

tests/compact/c025-in.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[{
2+
"@type": ["ex:Outer"],
3+
"ex:nested": [{
4+
"@graph": [{
5+
"@type": ["ex:Inner"],
6+
"ex:foo": [{"@value": "bar"}]
7+
}]
8+
}]
9+
}]

tests/compact/c025-out.jsonld

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"type": "@type",
5+
"Outer": {
6+
"@id": "ex:Outer",
7+
"@context": {
8+
"nested": {
9+
"@id": "ex:nested",
10+
"@type": "@id",
11+
"@container": "@graph"
12+
}
13+
}
14+
},
15+
"Inner": {
16+
"@id": "ex:Inner",
17+
"@context": {
18+
"foo": "ex:foo"
19+
}
20+
}
21+
},
22+
"type": "Outer",
23+
"nested": {
24+
"type": "Inner",
25+
"foo": "bar"
26+
}
27+
}

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,14 @@
10321032
"input": "expand/c024-in.jsonld",
10331033
"expect": "expand/c024-out.jsonld",
10341034
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1035+
}, {
1036+
"@id": "#tc025",
1037+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1038+
"name": "type-scoped + graph container",
1039+
"purpose": "type-scoped + graph container",
1040+
"input": "expand/c025-in.jsonld",
1041+
"expect": "expand/c025-out.jsonld",
1042+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
10351043
}, {
10361044
"@id": "#te001",
10371045
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],

tests/expand/c025-in.jsonld

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"type": "@type",
5+
"Outer": {
6+
"@id": "ex:Outer",
7+
"@context": {
8+
"nested": {
9+
"@id": "ex:nested",
10+
"@type": "@id",
11+
"@container": "@graph"
12+
}
13+
}
14+
},
15+
"Inner": {
16+
"@id": "ex:Inner",
17+
"@context": {
18+
"foo": "ex:foo"
19+
}
20+
}
21+
},
22+
"type": "Outer",
23+
"nested": {
24+
"type": "Inner",
25+
"foo": "bar"
26+
}
27+
}

tests/expand/c025-out.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[{
2+
"@type": ["ex:Outer"],
3+
"ex:nested": [{
4+
"@graph": [{
5+
"@type": ["ex:Inner"],
6+
"ex:foo": [{"@value": "bar"}]
7+
}]
8+
}]
9+
}]

0 commit comments

Comments
 (0)