Skip to content

Commit 1872c1b

Browse files
committed
Add test for outer type being cleared when inner type is used in a type map.
1 parent 72c1c6f commit 1872c1b

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,14 @@
936936
"input": "expand/c012-in.jsonld",
937937
"expect": "expand/c012-out.jsonld",
938938
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
939+
}, {
940+
"@id": "#tc013",
941+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
942+
"name": "type maps use scoped context from type index and not scoped context from containing",
943+
"purpose": "scoped context on @type",
944+
"input": "expand/c013-in.jsonld",
945+
"expect": "expand/c013-out.jsonld",
946+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
939947
}, {
940948
"@id": "#te001",
941949
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],

tests/expand/c013-in.jsonld

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"prop": {"@container": "@index"},
5+
"foo": "http://example/base-foo",
6+
"Outer": {
7+
"@context": {
8+
"prop": {
9+
"@id": "http://example/outer-prop",
10+
"@container": "@type"
11+
}
12+
}
13+
},
14+
"Inner": {"@context": {"foo": "http://example/inner-foo"}}
15+
},
16+
"@type": "Outer",
17+
"prop": {
18+
"Inner": {
19+
"prop": {
20+
"index": {
21+
"@id": "http://example/inner-with-index",
22+
"foo": "inner-foo"
23+
}
24+
}
25+
}
26+
},
27+
"foo": "base-foo"
28+
}

tests/expand/c013-out.jsonld

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[{
2+
"@type": ["http://example/Outer"],
3+
"http://example/base-foo": [{"@value": "base-foo"}],
4+
"http://example/outer-prop": [{
5+
"@type": ["http://example/Inner"],
6+
"http://example/prop": [{
7+
"@id": "http://example/inner-with-index",
8+
"@index": "index",
9+
"http://example/inner-foo": [{"@value": "inner-foo"}]
10+
}]
11+
}]
12+
}]

0 commit comments

Comments
 (0)