Skip to content

Commit d86086a

Browse files
committed
Add type/property-scoped type:vocab tests.
1 parent 84aea12 commit d86086a

12 files changed

+196
-0
lines changed

tests/compact-manifest.jsonld

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,24 @@
11031103
"context": "compact/c021-context.jsonld",
11041104
"expect": "compact/c021-out.jsonld",
11051105
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1106+
}, {
1107+
"@id": "#tc022",
1108+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1109+
"name": "type-scoped property-scoped contexts including @type:@vocab",
1110+
"purpose": "type-scoped property-scoped contexts including @type:@vocab",
1111+
"input": "compact/c022-in.jsonld",
1112+
"context": "compact/c022-context.jsonld",
1113+
"expect": "compact/c022-out.jsonld",
1114+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1115+
}, {
1116+
"@id": "#tc023",
1117+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1118+
"name": "composed type-scoped property-scoped contexts including @type:@vocab",
1119+
"purpose": "composed type-scoped property-scoped contexts including @type:@vocab",
1120+
"input": "compact/c023-in.jsonld",
1121+
"context": "compact/c023-context.jsonld",
1122+
"expect": "compact/c023-out.jsonld",
1123+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
11061124
}, {
11071125
"@id": "#te001",
11081126
"@type": [ "jld:NegativeEvaluationTest", "jld:CompactTest" ],

tests/compact/c022-context.jsonld

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"@context": {
3+
"@vocab": "ex:",
4+
"Type": {
5+
"@context": {
6+
"foo": {
7+
"@id": "ex:foo",
8+
"@type": "@vocab",
9+
"@context": {
10+
"@version": 1.1,
11+
"Foo": "ex:Foo",
12+
"Bar": "ex:Bar"
13+
}
14+
}
15+
}
16+
}
17+
}
18+
}

tests/compact/c022-in.jsonld

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[{
2+
"@type": ["ex:Type"],
3+
"ex:foo": [{"@id": "ex:Bar"}]
4+
}]

tests/compact/c022-out.jsonld

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

tests/compact/c023-context.jsonld

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
"foo": {
15+
"@id": "ex:foo",
16+
"@type": "@vocab",
17+
"@context": {
18+
"Foo": "ex:Foo"
19+
}
20+
}
21+
}
22+
}
23+
}
24+
}

tests/compact/c023-in.jsonld

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

tests/compact/c023-out.jsonld

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
"foo": {
15+
"@id": "ex:foo",
16+
"@type": "@vocab",
17+
"@context": {
18+
"Foo": "ex:Foo"
19+
}
20+
}
21+
}
22+
}
23+
},
24+
"@type": "Outer",
25+
"nested": {
26+
"@type": "Inner",
27+
"foo": "Foo"
28+
}
29+
}

tests/expand-manifest.jsonld

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,22 @@
10081008
"input": "expand/c021-in.jsonld",
10091009
"expect": "expand/c021-out.jsonld",
10101010
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1011+
}, {
1012+
"@id": "#tc022",
1013+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1014+
"name": "type-scoped property-scoped contexts including @type:@vocab",
1015+
"purpose": "type-scoped property-scoped contexts including @type:@vocab",
1016+
"input": "expand/c022-in.jsonld",
1017+
"expect": "expand/c022-out.jsonld",
1018+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1019+
}, {
1020+
"@id": "#tc023",
1021+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1022+
"name": "composed type-scoped property-scoped contexts including @type:@vocab",
1023+
"purpose": "composed type-scoped property-scoped contexts including @type:@vocab",
1024+
"input": "expand/c023-in.jsonld",
1025+
"expect": "expand/c023-out.jsonld",
1026+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
10111027
}, {
10121028
"@id": "#te001",
10131029
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],

tests/expand/c022-in.jsonld

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

tests/expand/c022-out.jsonld

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[{
2+
"@type": ["ex:Type"],
3+
"ex:foo": [{"@id": "ex:Bar"}]
4+
}]

tests/expand/c023-in.jsonld

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
"foo": {
15+
"@id": "ex:foo",
16+
"@type": "@vocab",
17+
"@context": {
18+
"Foo": "ex:Foo"
19+
}
20+
}
21+
}
22+
}
23+
},
24+
"@type": "Outer",
25+
"nested": {
26+
"@type": "Inner",
27+
"foo": "Foo"
28+
}
29+
}

tests/expand/c023-out.jsonld

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

0 commit comments

Comments
 (0)