Skip to content

Commit 3fa30af

Browse files
committed
Add @annotation expansion test
This addresses #196.
1 parent 05ef43f commit 3fa30af

File tree

3 files changed

+216
-0
lines changed

3 files changed

+216
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"@context": {
3+
"property": "http://example.com/property",
4+
"annotContainer": { "@id": "http://example.com/container", "@container": "@annotation" }
5+
},
6+
"@id": "http://example.org/annotationsTest",
7+
"annotContainer": {
8+
"A": [
9+
{
10+
"@id": "http://example.org/nodeWithoutAnnotationA"
11+
},
12+
{
13+
"@id": "http://example.org/nodeWithAnnotationA",
14+
"@annotation": "this overrides the 'A' annotation from the container"
15+
},
16+
1,
17+
true,
18+
false,
19+
null,
20+
"simple string A",
21+
{
22+
"@value": "typed literal A",
23+
"@type": "http://example.org/type"
24+
},
25+
{
26+
"@value": "language-tagged string A",
27+
"@language": "en"
28+
}
29+
],
30+
"B": "simple string B",
31+
"C": [
32+
{
33+
"@id": "http://example.org/nodeWithoutAnnotationC"
34+
},
35+
{
36+
"@id": "http://example.org/nodeWithAnnotationC",
37+
"@annotation": "this overrides the 'C' annotation from the container"
38+
},
39+
3,
40+
true,
41+
false,
42+
null,
43+
"simple string C",
44+
{
45+
"@value": "typed literal C",
46+
"@type": "http://example.org/type"
47+
},
48+
{
49+
"@value": "language-tagged string C",
50+
"@language": "en"
51+
}
52+
]
53+
},
54+
"property": [
55+
{
56+
"@id": "http://example.org/nodeWithoutAnnotationProp"
57+
},
58+
{
59+
"@id": "http://example.org/nodeWithAnnotationProp",
60+
"@annotation": "prop"
61+
},
62+
{
63+
"@value": 3,
64+
"@annotation": "prop"
65+
},
66+
{
67+
"@value": true,
68+
"@annotation": "prop"
69+
},
70+
{
71+
"@value": false,
72+
"@annotation": "prop"
73+
},
74+
{
75+
"@value": null,
76+
"@annotation": "prop"
77+
},
78+
"simple string no annotation",
79+
{
80+
"@value": "typed literal Prop",
81+
"@type": "http://example.org/type",
82+
"@annotation": "prop"
83+
},
84+
{
85+
"@value": "language-tagged string Prop",
86+
"@language": "en",
87+
"@annotation": "prop"
88+
},
89+
{
90+
"@value": "annotation using an array with just one element (automatic recovery)",
91+
"@annotation": [ "prop" ]
92+
}
93+
]
94+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
[
2+
{
3+
"@id": "http://example.org/annotationsTest",
4+
"http://example.com/container": [
5+
{
6+
"@id": "http://example.org/nodeWithoutAnnotationA",
7+
"@annotation": "A"
8+
},
9+
{
10+
"@id": "http://example.org/nodeWithAnnotationA",
11+
"@annotation": "this overrides the 'A' annotation from the container"
12+
},
13+
{
14+
"@value": 1,
15+
"@annotation": "A"
16+
},
17+
{
18+
"@value": true,
19+
"@annotation": "A"
20+
},
21+
{
22+
"@value": false,
23+
"@annotation": "A"
24+
},
25+
{
26+
"@value": "simple string A",
27+
"@annotation": "A"
28+
},
29+
{
30+
"@value": "typed literal A",
31+
"@type": "http://example.org/type",
32+
"@annotation": "A"
33+
},
34+
{
35+
"@value": "language-tagged string A",
36+
"@language": "en",
37+
"@annotation": "A"
38+
},
39+
{
40+
"@value": "simple string B",
41+
"@annotation": "B"
42+
},
43+
{
44+
"@id": "http://example.org/nodeWithoutAnnotationC",
45+
"@annotation": "C"
46+
},
47+
{
48+
"@id": "http://example.org/nodeWithAnnotationC",
49+
"@annotation": "this overrides the 'C' annotation from the container"
50+
},
51+
{
52+
"@value": 3,
53+
"@annotation": "C"
54+
},
55+
{
56+
"@value": true,
57+
"@annotation": "C"
58+
},
59+
{
60+
"@value": false,
61+
"@annotation": "C"
62+
},
63+
{
64+
"@value": "simple string C",
65+
"@annotation": "C"
66+
},
67+
{
68+
"@value": "typed literal C",
69+
"@type": "http://example.org/type",
70+
"@annotation": "C"
71+
},
72+
{
73+
"@value": "language-tagged string C",
74+
"@language": "en",
75+
"@annotation": "C"
76+
}
77+
],
78+
"http://example.com/property": [
79+
{
80+
"@id": "http://example.org/nodeWithoutAnnotationProp"
81+
},
82+
{
83+
"@id": "http://example.org/nodeWithAnnotationProp",
84+
"@annotation": "prop"
85+
},
86+
{
87+
"@value": 3,
88+
"@annotation": "prop"
89+
},
90+
{
91+
"@value": true,
92+
"@annotation": "prop"
93+
},
94+
{
95+
"@value": false,
96+
"@annotation": "prop"
97+
},
98+
{
99+
"@value": "simple string no annotation"
100+
},
101+
{
102+
"@value": "typed literal Prop",
103+
"@type": "http://example.org/type",
104+
"@annotation": "prop"
105+
},
106+
{
107+
"@value": "language-tagged string Prop",
108+
"@language": "en",
109+
"@annotation": "prop"
110+
},
111+
{
112+
"@value": "annotation using an array with just one element (automatic recovery)",
113+
"@annotation": "prop"
114+
}
115+
]
116+
}
117+
]

test-suite/tests/expand-manifest.jsonld

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@
181181
"name": "Using language maps with @vocab, a default language, and a colliding property",
182182
"input": "expand-0035-in.jsonld",
183183
"expect": "expand-0035-out.jsonld"
184+
}, {
185+
"@type": ["test:TestCase", "jld:ExpandTest"],
186+
"name": "Expanding @annotation",
187+
"input": "expand-0036-in.jsonld",
188+
"expect": "expand-0036-out.jsonld"
184189
}
185190
]
186191
}

0 commit comments

Comments
 (0)