Skip to content

Commit 9a36fd8

Browse files
committed
Add protected term redefinition tests.
1 parent c5efd4a commit 9a36fd8

File tree

10 files changed

+415
-0
lines changed

10 files changed

+415
-0
lines changed

tests/expand-manifest.jsonld

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,54 @@
21792179
"input": "expand/pr21-in.jsonld",
21802180
"expect": "invalid context nullification"
21812181
}, {
2182+
"@id": "#tpr22",
2183+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
2184+
"name": "Check legal overriding of type-scoped protected term from nested node.",
2185+
"purpose": "Check legal overriding of type-scoped protected term from nested node.",
2186+
"option": {"specVersion": "json-ld-1.1"},
2187+
"input": "expand/pr22-in.jsonld",
2188+
"expect": "expand/pr22-out.jsonld"
2189+
}, {
2190+
"@id": "#tpr23",
2191+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
2192+
"name": "Allows redefinition of protected alias term with same definition.",
2193+
"purpose": "Allows redefinition of protected alias term with same definition.",
2194+
"option": {"specVersion": "json-ld-1.1"},
2195+
"input": "expand/pr23-in.jsonld",
2196+
"expect": "expand/pr23-out.jsonld"
2197+
}, {
2198+
"@id": "#tpr24",
2199+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
2200+
"name": "Allows redefinition of protected prefix term with same definition.",
2201+
"purpose": "Allows redefinition of protected prefix term with same definition.",
2202+
"option": {"specVersion": "json-ld-1.1"},
2203+
"input": "expand/pr24-in.jsonld",
2204+
"expect": "expand/pr24-out.jsonld"
2205+
}, {
2206+
"@id": "#tpr25",
2207+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
2208+
"name": "Allows redefinition of terms with scoped contexts using same definitions.",
2209+
"purpose": "Allows redefinition of terms with scoped contexts using same definitions.",
2210+
"option": {"specVersion": "json-ld-1.1"},
2211+
"input": "expand/pr25-in.jsonld",
2212+
"expect": "expand/pr25-out.jsonld"
2213+
}, {
2214+
"@id": "#tpr26",
2215+
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
2216+
"name": "Fails on redefinition of terms with scoped contexts using different definitions.",
2217+
"purpose": "Fails on redefinition of terms with scoped contexts using different definitions.",
2218+
"option": {"specVersion": "json-ld-1.1"},
2219+
"input": "expand/pr26-in.jsonld",
2220+
"expect": "protected term redefinition"
2221+
}, {
2222+
"@id": "#tpr27",
2223+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
2224+
"name": "Allows redefinition of protected alias term with same definition modulo protected flag.",
2225+
"purpose": "Allows redefinition of protected alias term with same definition modulo protected flag.",
2226+
"option": {"specVersion": "json-ld-1.1"},
2227+
"input": "expand/pr27-in.jsonld",
2228+
"expect": "expand/pr27-out.jsonld"
2229+
}, {
21822230
"@id": "#ttn01",
21832231
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
21842232
"name": "@type: @none is illegal in 1.0.",

tests/expand/pr23-in.jsonld

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"@context": [{
3+
"@version": 1.1,
4+
"@protected": true,
5+
"id": "@id",
6+
"type": "@type"
7+
}, {
8+
"@version": 1.1,
9+
"@protected": true,
10+
"id": "@id",
11+
"type": "@type"
12+
}],
13+
"id": "http://example/id",
14+
"type": "http://example/type"
15+
}

tests/expand/pr23-out.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"@id": "http://example/id",
4+
"@type": [
5+
"http://example/type"
6+
]
7+
}
8+
]
9+

tests/expand/pr24-in.jsonld

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"@context": [{
3+
"@version": 1.1,
4+
"@protected": true,
5+
"foo": "http://example/foo#"
6+
}, {
7+
"@version": 1.1,
8+
"@protected": true,
9+
"foo": "http://example/foo#"
10+
}],
11+
"foo:bar": "foobar"
12+
}

tests/expand/pr24-out.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"http://example/foo#bar": [{
4+
"@value": "foobar"
5+
}]
6+
}
7+
]
8+

tests/expand/pr25-in.jsonld

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"@context": [{
3+
"@version": 1.1,
4+
"@protected": true,
5+
"id": "@id",
6+
"type": "@type",
7+
"foo": {
8+
"@id": "http://example/foo",
9+
"@container": ["@graph", "@set"]
10+
},
11+
"bar": {
12+
"@id": "http://example/bar",
13+
"@type": "@id",
14+
"@context": {
15+
"@version": 1.1,
16+
"@protected": true,
17+
"bar-1": {
18+
"@id": "http://example/bar-1",
19+
"@context": {
20+
"@version": 1.1,
21+
"@protected": true,
22+
"bar-2": "http://example/bar-2",
23+
"Foo": {
24+
"@id": "http://example/Foo",
25+
"@context": {
26+
"@version": 1.1,
27+
"@protected": true,
28+
"bar-2": "http://example/bar-2"
29+
}
30+
}
31+
}
32+
}
33+
}
34+
},
35+
"Bar": {
36+
"@id": "http://example/Bar",
37+
"@context": {
38+
"@version": 1.1,
39+
"@protected": true,
40+
"bar-1": {
41+
"@id": "http://example/bar-1",
42+
"@context": {
43+
"@version": 1.1,
44+
"@protected": true,
45+
"bar-2": "http://example/bar-2",
46+
"Foo": {
47+
"@id": "http://example/Foo",
48+
"@context": {
49+
"@version": 1.1,
50+
"@protected": true,
51+
"bar-2": "http://example/bar-2"
52+
}
53+
}
54+
}
55+
}
56+
}
57+
},
58+
"Foo": {
59+
"@id": "http://example/Foo",
60+
"@context": {
61+
"@version": 1.1,
62+
"@protected": true,
63+
"bar-2": "http://example/bar-2"
64+
}
65+
}
66+
}, {
67+
"@version": 1.1,
68+
"@protected": true,
69+
"id": "@id",
70+
"type": "@type",
71+
"foo": {
72+
"@id": "http://example/foo",
73+
"@container": ["@graph", "@set"]
74+
},
75+
"bar": {
76+
"@id": "http://example/bar",
77+
"@type": "@id",
78+
"@context": {
79+
"@version": 1.1,
80+
"@protected": true,
81+
"bar-1": {
82+
"@id": "http://example/bar-1",
83+
"@context": {
84+
"@version": 1.1,
85+
"@protected": true,
86+
"bar-2": "http://example/bar-2",
87+
"Foo": {
88+
"@id": "http://example/Foo",
89+
"@context": {
90+
"@version": 1.1,
91+
"@protected": true,
92+
"bar-2": "http://example/bar-2"
93+
}
94+
}
95+
}
96+
}
97+
}
98+
},
99+
"Bar": {
100+
"@id": "http://example/Bar",
101+
"@context": {
102+
"@version": 1.1,
103+
"@protected": true,
104+
"bar-1": {
105+
"@id": "http://example/bar-1",
106+
"@context": {
107+
"@version": 1.1,
108+
"@protected": true,
109+
"bar-2": "http://example/bar-2",
110+
"Foo": {
111+
"@id": "http://example/Foo",
112+
"@context": {
113+
"@version": 1.1,
114+
"@protected": true,
115+
"bar-2": "http://example/bar-2"
116+
}
117+
}
118+
}
119+
}
120+
}
121+
},
122+
"Foo": {
123+
"@id": "http://example/Foo",
124+
"@context": {
125+
"@version": 1.1,
126+
"@protected": true,
127+
"bar-2": "http://example/bar-2"
128+
}
129+
}
130+
}],
131+
"type": "Bar",
132+
"foo": [{
133+
"bar": "http://example/"
134+
}],
135+
"bar-1": {
136+
"bar-2": {
137+
"type": "Foo",
138+
"bar-2": "bar-2"
139+
}
140+
}
141+
}

tests/expand/pr25-out.jsonld

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"@type": [
4+
"http://example/Bar"
5+
],
6+
"http://example/foo": [{
7+
"@graph": [{
8+
"http://example/bar": [{
9+
"@id": "http://example/"
10+
}]
11+
}]
12+
}],
13+
"http://example/bar-1": [{
14+
"http://example/bar-2": [{
15+
"@type": ["http://example/Foo"],
16+
"http://example/bar-2": [{
17+
"@value": "bar-2"
18+
}]
19+
}]
20+
}]
21+
}
22+
]
23+

0 commit comments

Comments
 (0)