Skip to content

Commit eae9301

Browse files
committed
Add more type-scoped compaction tests.
1 parent e15875f commit eae9301

19 files changed

+363
-0
lines changed

tests/compact-manifest.jsonld

+54
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,60 @@
10311031
"context": "compact/c013-context.jsonld",
10321032
"expect": "compact/c013-out.jsonld",
10331033
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1034+
}, {
1035+
"@id": "#tc014",
1036+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1037+
"name": "type-scoped context nullification",
1038+
"purpose": "type-scoped context nullification",
1039+
"input": "compact/c014-in.jsonld",
1040+
"context": "compact/c014-context.jsonld",
1041+
"expect": "compact/c014-out.jsonld",
1042+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1043+
}, {
1044+
"@id": "#tc015",
1045+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1046+
"name": "type-scoped base",
1047+
"purpose": "type-scoped base",
1048+
"input": "compact/c015-in.jsonld",
1049+
"context": "compact/c015-context.jsonld",
1050+
"expect": "compact/c015-out.jsonld",
1051+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1052+
}, {
1053+
"@id": "#tc016",
1054+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1055+
"name": "type-scoped vocab",
1056+
"purpose": "type-scoped vocab",
1057+
"input": "compact/c016-in.jsonld",
1058+
"context": "compact/c016-context.jsonld",
1059+
"expect": "compact/c016-out.jsonld",
1060+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1061+
}, {
1062+
"@id": "#tc017",
1063+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1064+
"name": "multiple type-scoped contexts are properly reverted",
1065+
"purpose": "multiple type-scoped contexts are property reverted",
1066+
"input": "compact/c017-in.jsonld",
1067+
"context": "compact/c017-context.jsonld",
1068+
"expect": "compact/c017-out.jsonld",
1069+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1070+
}, {
1071+
"@id": "#tc018",
1072+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1073+
"name": "multiple type-scoped types resolved against previous context",
1074+
"purpose": "multiple type-scoped types resolved against previous context",
1075+
"input": "compact/c018-in.jsonld",
1076+
"context": "compact/c018-context.jsonld",
1077+
"expect": "compact/c018-out.jsonld",
1078+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
1079+
}, {
1080+
"@id": "#tc019",
1081+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1082+
"name": "type-scoped context with multiple property scoped terms",
1083+
"purpose": "type-scoped context with multiple property scoped terms",
1084+
"input": "compact/c019-in.jsonld",
1085+
"context": "compact/c019-context.jsonld",
1086+
"expect": "compact/c019-out.jsonld",
1087+
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
10341088
}, {
10351089
"@id": "#te001",
10361090
"@type": [ "jld:NegativeEvaluationTest", "jld:CompactTest" ],

tests/compact/c014-context.jsonld

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"foo": "http://example/foo",
5+
"Type": {
6+
"@context": [
7+
null
8+
]
9+
}
10+
}
11+
}

tests/compact/c014-in.jsonld

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[{
2+
"http://example/foo": [{
3+
"@value": "will-exist"
4+
}],
5+
"http://example/p": [{
6+
"@type": ["http://example/Type"]
7+
}]
8+
}]

tests/compact/c014-out.jsonld

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"foo": "http://example/foo",
5+
"Type": {
6+
"@context": [
7+
null
8+
]
9+
}
10+
},
11+
"foo": "will-exist",
12+
"p": {
13+
"@type": "Type"
14+
}
15+
}

tests/compact/c015-context.jsonld

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"@context": {
3+
"@base": "http://example/base-base",
4+
"@vocab": "http://example/",
5+
"foo": "http://example/foo",
6+
"Type": {
7+
"@context": {
8+
"@base": "http://example/typed-base"
9+
}
10+
}
11+
}
12+
}

tests/compact/c015-in.jsonld

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[{
2+
"@id": "http://example/base-base#base-id",
3+
"http://example/p": [{
4+
"@id": "http://example/typed-base#typed-id",
5+
"@type": ["http://example/Type"],
6+
"http://example/nested": [{
7+
"@id": "http://example/base-base#nested-id"
8+
}]
9+
}]
10+
}]

tests/compact/c015-out.jsonld

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"@context": {
3+
"@base": "http://example/base-base",
4+
"@vocab": "http://example/",
5+
"foo": "http://example/foo",
6+
"Type": {
7+
"@context": {
8+
"@base": "http://example/typed-base"
9+
}
10+
}
11+
},
12+
"@id": "#base-id",
13+
"p": {
14+
"@id": "#typed-id",
15+
"@type": "Type",
16+
"nested": {
17+
"@id": "#nested-id"
18+
}
19+
}
20+
}

tests/compact/c016-context.jsonld

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example.org/",
4+
"Type": {
5+
"@context": {
6+
"@vocab": "http://example.com/"
7+
}
8+
}
9+
}
10+
}

tests/compact/c016-in.jsonld

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[{
2+
"http://example.org/foo": [{
3+
"@value": "org"
4+
}],
5+
"http://example.org/p": [{
6+
"@type": ["http://example.org/Type"],
7+
"http://example.com/foo": [{
8+
"@value": "com"
9+
}],
10+
"http://example.com/nested": [{
11+
"http://example.org/nested-prop": [{
12+
"@value": "org"
13+
}]
14+
}]
15+
}]
16+
}]

tests/compact/c016-out.jsonld

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example.org/",
4+
"Type": {
5+
"@context": {
6+
"@vocab": "http://example.com/"
7+
}
8+
}
9+
},
10+
"foo": "org",
11+
"p": {
12+
"@type": "Type",
13+
"foo": "com",
14+
"nested": {
15+
"nested-prop": "org"
16+
}
17+
}
18+
}

tests/compact/c017-context.jsonld

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"Bar": {
5+
"@context": [
6+
{
7+
"prop": "http://example/bar-prop"
8+
}
9+
]
10+
},
11+
"Foo": {
12+
"@context": [
13+
{
14+
"prop": "http://example/foo-prop"
15+
}
16+
]
17+
}
18+
}
19+
}

tests/compact/c017-in.jsonld

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[{
2+
"@type": [
3+
"http://example/Foo",
4+
"http://example/Bar"
5+
],
6+
"http://example/foo-prop": [{
7+
"@value": "foo"
8+
}],
9+
"http://example/nested": [{
10+
"http://example/prop": [{
11+
"@value": "vocab"
12+
}]
13+
}]
14+
}]

tests/compact/c017-out.jsonld

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"Bar": {
5+
"@context": [
6+
{
7+
"prop": "http://example/bar-prop"
8+
}
9+
]
10+
},
11+
"Foo": {
12+
"@context": [
13+
{
14+
"prop": "http://example/foo-prop"
15+
}
16+
]
17+
}
18+
},
19+
"@type": ["Foo", "Bar"],
20+
"prop": "foo",
21+
"nested": {
22+
"prop": "vocab"
23+
}
24+
}

tests/compact/c018-context.jsonld

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"Bar": {
5+
"@context": [
6+
null,
7+
{
8+
"prop": "http://example/bar-prop"
9+
}
10+
]
11+
},
12+
"Foo": {
13+
"@context": [
14+
null,
15+
{
16+
"prop": "http://example/foo-prop"
17+
}
18+
]
19+
}
20+
}
21+
}

tests/compact/c018-in.jsonld

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[{
2+
"@type": [
3+
"http://example/Foo",
4+
"http://example/Bar"
5+
],
6+
"http://example/foo-prop": [
7+
{
8+
"@value": "foo"
9+
}
10+
]
11+
}]

tests/compact/c018-out.jsonld

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
{
3+
"@context": {
4+
"@vocab": "http://example/",
5+
"Bar": {
6+
"@context": [
7+
null,
8+
{
9+
"prop": "http://example/bar-prop"
10+
}
11+
]
12+
},
13+
"Foo": {
14+
"@context": [
15+
null,
16+
{
17+
"prop": "http://example/foo-prop"
18+
}
19+
]
20+
}
21+
},
22+
"@type": ["Foo", "Bar"],
23+
"prop": "foo"
24+
}

tests/compact/c019-context.jsonld

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"prop": "http://example/base-prop",
5+
"Type": {
6+
"@context": {
7+
"foo": {
8+
"@context": {
9+
"prop": "http://example/foo-prop"
10+
}
11+
},
12+
"bar": {
13+
"@context": {
14+
"prop": "http://example/bar-prop"
15+
}
16+
}
17+
}
18+
}
19+
}
20+
}

tests/compact/c019-in.jsonld

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[{
2+
"@type": [
3+
"http://example/Type"
4+
],
5+
"http://example/foo": [{
6+
"http://example/foo-prop": [
7+
{
8+
"@value": "foo"
9+
}
10+
]
11+
}],
12+
"http://example/bar": [{
13+
"http://example/bar-prop": [
14+
{
15+
"@value": "bar"
16+
}
17+
]
18+
}],
19+
"http://example/baz": [{
20+
"http://example/base-prop": [
21+
{
22+
"@value": "baz"
23+
}
24+
]
25+
}]
26+
}]

tests/compact/c019-out.jsonld

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example/",
4+
"prop": "http://example/base-prop",
5+
"Type": {
6+
"@context": {
7+
"foo": {
8+
"@context": {
9+
"prop": "http://example/foo-prop"
10+
}
11+
},
12+
"bar": {
13+
"@context": {
14+
"prop": "http://example/bar-prop"
15+
}
16+
}
17+
}
18+
}
19+
},
20+
"@type": "Type",
21+
"foo": {
22+
"prop": "foo"
23+
},
24+
"bar": {
25+
"prop": "bar"
26+
},
27+
"baz": {
28+
"prop": "baz"
29+
}
30+
}

0 commit comments

Comments
 (0)