Skip to content

Commit 6142c6f

Browse files
committed
Adds/updates annotations on triple terms.
1 parent 681767f commit 6142c6f

19 files changed

+198
-37
lines changed

tests/expand-manifest.jsonld

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,31 @@
357357
"expectErrorCode": "invalid annotation",
358358
"requires": "JSON-LD-star",
359359
"option": {"specVersion": "json-ld-star", "rdfstar": true}
360+
}, {
361+
"@id": "#tst28",
362+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
363+
"name": "Annotation on reifier 1",
364+
"purpose": "Node with @annotation property on reifier",
365+
"input": "expand/st28-in.jsonld",
366+
"expect": "expand/st28-out.jsonld",
367+
"requires": "JSON-LD-star",
368+
"option": {"specVersion": "json-ld-star", "rdfstar": true}
360369
}, {
361370
"@id": "#tst29",
362-
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
363-
"name": "Embedded annotation node 1",
364-
"purpose": "Node with @annotation property on embedded object",
371+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
372+
"name": "Annotation on triple term 2",
373+
"purpose": "Node with @annotation property on triple term",
365374
"input": "expand/st29-in.jsonld",
366-
"expectErrorCode": "invalid triple term",
375+
"expect": "expand/st29-out.jsonld",
376+
"requires": "JSON-LD-star",
377+
"option": {"specVersion": "json-ld-star", "rdfstar": true}
378+
}, {
379+
"@id": "#tst29r",
380+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
381+
"name": "Annotation on reification 2",
382+
"purpose": "Node with @annotation property on reification",
383+
"input": "expand/st29r-in.jsonld",
384+
"expect": "expand/st29r-out.jsonld",
367385
"requires": "JSON-LD-star",
368386
"option": {"specVersion": "json-ld-star", "rdfstar": true}
369387
}, {

tests/expand/st28-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@id": "_:rei",
3+
"@reifies": {
4+
"@id": "ex:rei",
5+
"ex:prop": {"@id": "_:value"}
6+
},
7+
"ex:prop": {
8+
"@value": "value2",
9+
"@annotation": {"ex:certainty": 0.8}
10+
}
11+
}

tests/expand/st28-out.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[{
2+
"@id": "_:rei",
3+
"@reifies": [{
4+
"@id": "ex:rei",
5+
"ex:prop": [{"@id": "_:value"}]
6+
}],
7+
"ex:prop": [{
8+
"@value": "value2",
9+
"@annotation": [{"ex:certainty": [{"@value": 0.8}]}]
10+
}]
11+
}]

tests/expand/st29-out.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[{
2+
"@id": "ex:subj",
3+
"ex:value": [{
4+
"@triple": {
5+
"@id": "ex:rei",
6+
"ex:prop": [{"@value": "value"}]
7+
},
8+
"@annotation": [{"ex:certainty": [{"@value": 0.8}]}]
9+
}]
10+
}]

tests/expand/st29r-in.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"@id": "ex:subj",
3+
"ex:value": {
4+
"@reifies": {
5+
"@id": "ex:rei",
6+
"ex:prop": "value"
7+
},
8+
"@annotation": {"ex:certainty": 0.8}
9+
}
10+
}

tests/expand/st29r-out.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[{
2+
"@id": "ex:subj",
3+
"ex:value": [{
4+
"@reifies": [{
5+
"@id": "ex:rei",
6+
"ex:prop": [{"@value": "value"}]
7+
}],
8+
"@annotation": [{"ex:certainty": [{"@value": 0.8}]}]
9+
}]
10+
}]

tests/flatten-manifest.jsonld

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,16 @@
180180
}, {
181181
"@id": "#tst28",
182182
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
183-
"name": "Embedded annotation node 1",
184-
"purpose": "Node with @annotation property on triple term",
183+
"name": "Annotation on reifier 1",
184+
"purpose": "Node with @annotation property on reifier",
185185
"input": "flatten/st28-in.jsonld",
186186
"expect": "flatten/st28-out.jsonld",
187187
"requires": "JSON-LD-star",
188188
"option": {"specVersion": "json-ld-star", "rdfstar": true}
189189
}, {
190190
"@id": "#tst28n",
191191
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
192-
"name": "Embedded annotation node 1 (with @annotation)",
192+
"name": "Annotation on triple term 2",
193193
"purpose": "Node with @annotation property on triple term",
194194
"input": "flatten/st28-in.jsonld",
195195
"expect": "flatten/st28n-out.jsonld",
@@ -198,21 +198,39 @@
198198
}, {
199199
"@id": "#tst29",
200200
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
201-
"name": "Embedded annotation node 2",
202-
"purpose": "Node with @annotation property on embedded object",
201+
"name": "Annotation on triple term 2",
202+
"purpose": "Node with @annotation property on triple term",
203203
"input": "flatten/st29-in.jsonld",
204204
"expect": "flatten/st29-out.jsonld",
205205
"requires": "JSON-LD-star",
206206
"option": {"specVersion": "json-ld-star", "rdfstar": true}
207207
}, {
208208
"@id": "#tst29n",
209209
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
210-
"name": "Embedded annotation node 2 (with @annotation)",
211-
"purpose": "Node with @annotation property on embedded object",
210+
"name": "Annotation on triple term 2 (with @annotation)",
211+
"purpose": "Node with @annotation property on triple term",
212212
"input": "flatten/st29-in.jsonld",
213213
"expect": "flatten/st29n-out.jsonld",
214214
"requires": "JSON-LD-star",
215215
"option": {"specVersion": "json-ld-star", "rdfstar": true, "createAnnotations": true}
216+
}, {
217+
"@id": "#tst29r",
218+
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
219+
"name": "Annotation on reification 2",
220+
"purpose": "Node with @annotation property on reification",
221+
"input": "flatten/st29r-in.jsonld",
222+
"expect": "flatten/st29r-out.jsonld",
223+
"requires": "JSON-LD-star",
224+
"option": {"specVersion": "json-ld-star", "rdfstar": true}
225+
}, {
226+
"@id": "#tst29rn",
227+
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
228+
"name": "Annotation on reification 2 (with @annotation)",
229+
"purpose": "Node with @annotation property on reification",
230+
"input": "flatten/st29r-in.jsonld",
231+
"expect": "flatten/st29rn-out.jsonld",
232+
"requires": "JSON-LD-star",
233+
"option": {"specVersion": "json-ld-star", "rdfstar": true, "createAnnotations": true}
216234
}, {
217235
"@id": "#tst32",
218236
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],

tests/flatten/st29-in.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"@id": "ex:subj",
33
"ex:value": {
4-
"@reifies": {
4+
"@triple": {
55
"@id": "ex:rei",
66
"ex:prop": "value"
77
},

tests/flatten/st29-out.jsonld

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
[{
22
"@id": "ex:subj",
3-
"ex:value": [{"@id": "_:b0"}]
4-
}, {
5-
"@id": "_:b0",
6-
"@reifies": [{
7-
"@id": "ex:rei",
8-
"ex:prop": [{"@value": "value"}]
3+
"ex:value": [{
4+
"@triple": {
5+
"@id": "ex:rei",
6+
"ex:prop": [{"@value": "value"}]
7+
}
98
}]
109
}, {
11-
"@id": "_:b2",
10+
"@id": "_:b1",
1211
"@reifies": [{
1312
"@id": "ex:subj",
14-
"ex:value": [{"@id": "_:b0"}]
13+
"ex:value": [{
14+
"@triple": {
15+
"@id": "ex:rei",
16+
"ex:prop": [{"@value": "value"}]
17+
}
18+
}]
1519
}],
1620
"ex:certainty": [{"@value": 0.8}]
17-
}]
21+
}]

tests/flatten/st29n-out.jsonld

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
[{
22
"@id": "ex:subj",
33
"ex:value": [{
4-
"@id": "_:b0",
4+
"@triple": {
5+
"@id": "ex:rei",
6+
"ex:prop": [{"@value": "value"}]
7+
},
58
"@annotation": [{
6-
"@id": "_:b2",
9+
"@id": "_:b1",
710
"ex:certainty": [{"@value": 0.8}]
811
}]
912
}]
10-
},
11-
{
12-
"@id": "_:b0",
13-
"@reifies": [{
14-
"@id": "ex:rei",
15-
"ex:prop": [{"@value": "value"}]
16-
}]
1713
}]

0 commit comments

Comments
 (0)