@lincs.project/webannotation-schema 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,602 @@
1
+ {
2
+ "$id": "https://wa.lincsproject.ca/v1/schema.jsonld",
3
+ "type": "object",
4
+ "description": "Web Annotation",
5
+ "properties": {
6
+ "@context": {
7
+ "type": "array",
8
+ "minItems": 2,
9
+ "maxItems": 2,
10
+ "items": [
11
+ {
12
+ "type": "string",
13
+ "const": "http://www.w3.org/ns/anno.jsonld"
14
+ },
15
+ {
16
+ "type": "string",
17
+ "const": "https://wa.lincsproject.ca/v1/ns/anno.jsonld"
18
+ }
19
+ ],
20
+ "description": "The context that determines the meaning of the JSON as an Annotation. The itens should point to a URI containing the defiintion used in this schema."
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "format": "uri",
25
+ "description": "The type of the Annotation."
26
+ },
27
+ "type": {
28
+ "type": "array",
29
+ "minItems": 2,
30
+ "maxItems": 2,
31
+ "items": [
32
+ {
33
+ "type": "string",
34
+ "const": "Annotation"
35
+ },
36
+ {
37
+ "type": "string",
38
+ "const": "crm:E33_Linguistic_Object"
39
+ }
40
+ ],
41
+ "description": "The type of the Annotation."
42
+ },
43
+ "motivation": {
44
+ "type": "array",
45
+ "minItems": 2,
46
+ "maxItems": 2,
47
+ "items": [
48
+ {
49
+ "type": "string",
50
+ "enum": [
51
+ "identifying",
52
+ "describing",
53
+ "correcting",
54
+ "tagging",
55
+ "classifying",
56
+ "linking",
57
+ "citing"
58
+ ]
59
+ },
60
+ {
61
+ "type": "string",
62
+ "const": "crm:E55_Type"
63
+ }
64
+ ],
65
+ "description": "The relationship between an Annotation and a Motivation."
66
+ },
67
+ "created": {
68
+ "type": "string",
69
+ "format": "date-time",
70
+ "description": "The time at which the resource was created."
71
+ },
72
+ "modified": {
73
+ "type": "string",
74
+ "format": "date-time",
75
+ "description": "The time at which the resource was modified, after creation."
76
+ },
77
+ "creator": {
78
+ "$ref": "defs.jsonld#/definitions/creator"
79
+ },
80
+ "contributor": {
81
+ "type": "array",
82
+ "items": {
83
+ "$ref": "defs.jsonld#/definitions/creator"
84
+ },
85
+ "minItems": 1
86
+ },
87
+ "generator": {
88
+ "$ref": "defs.jsonld#/definitions/software"
89
+ },
90
+ "target": {
91
+ "$ref": "defs.jsonld#/definitions/target"
92
+ },
93
+ "body": {
94
+ "oneOf": [
95
+ {
96
+ "$ref": "defs.jsonld#/definitions/body"
97
+ },
98
+ {
99
+ "type": "array",
100
+ "items": {
101
+ "$ref": "defs.jsonld#/definitions/body"
102
+ },
103
+ "minItems": 1
104
+ }
105
+ ]
106
+ },
107
+ "status": {
108
+ "type": "string",
109
+ "enum": [
110
+ "draft",
111
+ "approved",
112
+ "published"
113
+ ]
114
+ }
115
+ },
116
+ "required": [
117
+ "@context",
118
+ "id",
119
+ "type",
120
+ "motivation",
121
+ "created",
122
+ "generator",
123
+ "target",
124
+ "body",
125
+ "status"
126
+ ],
127
+ "allOf": [
128
+ {
129
+ "if": {
130
+ "type": "object",
131
+ "properties": {
132
+ "body": {
133
+ "type": "object",
134
+ "properties": {
135
+ "entityType": {
136
+ "oneOf": [
137
+ {
138
+ "type": "array",
139
+ "minItems": 2,
140
+ "maxItems": 2,
141
+ "items": [
142
+ {
143
+ "type": "string",
144
+ "const": "Person"
145
+ },
146
+ {
147
+ "oneOf": [
148
+ {
149
+ "type": "string",
150
+ "const": "crm:E21_Person",
151
+ "description": "Real Person"
152
+ },
153
+ {
154
+ "type": "string",
155
+ "const": "crm:E89_Propositional_Object",
156
+ "description": "Fictional Person"
157
+ }
158
+ ]
159
+ }
160
+ ]
161
+ },
162
+ {
163
+ "oneOf": [
164
+ {
165
+ "type": "string",
166
+ "const": "cwrc:place"
167
+ },
168
+ {
169
+ "type": "array",
170
+ "minItems": 2,
171
+ "maxItems": 2,
172
+ "items": [
173
+ {
174
+ "type": "string",
175
+ "const": "cwrc:place"
176
+ },
177
+ {
178
+ "type": "string",
179
+ "const": "crm:E89_Propositional_Object",
180
+ "description": "Fictional Place"
181
+ }
182
+ ]
183
+ }
184
+ ]
185
+ },
186
+ {
187
+ "type": "array",
188
+ "minItems": 2,
189
+ "maxItems": 2,
190
+ "items": [
191
+ {
192
+ "type": "string",
193
+ "const": "foaf:Organization"
194
+ },
195
+ {
196
+ "oneOf": [
197
+ {
198
+ "type": "string",
199
+ "const": "crm:E74_Group",
200
+ "description": "Real Organization"
201
+ },
202
+ {
203
+ "type": "string",
204
+ "const": "crm:E89_Propositional_Object",
205
+ "description": "Fictional Organization"
206
+ }
207
+ ]
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "type": "array",
213
+ "minItems": 2,
214
+ "maxItems": 2,
215
+ "items": [
216
+ {
217
+ "type": "string",
218
+ "const": "crm:E89_Propositional_Object"
219
+ },
220
+ {
221
+ "oneOf": [
222
+ {
223
+ "type": "string",
224
+ "const": "frbroo:F1",
225
+ "description": "Real Work"
226
+ },
227
+ {
228
+ "type": "string",
229
+ "const": "wikidata:Q15306849",
230
+ "description": "Fictional Work"
231
+ }
232
+ ]
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "oneOf": [
238
+ {
239
+ "type": "string",
240
+ "const": "crm:E18_Physical_Thing"
241
+ },
242
+ {
243
+ "type": "array",
244
+ "minItems": 2,
245
+ "maxItems": 2,
246
+ "items": [
247
+ {
248
+ "type": "string",
249
+ "const": "crm:E18_Physical_Thing"
250
+ },
251
+ {
252
+ "type": "string",
253
+ "const": "wikidata:Q15831596",
254
+ "description": "Fictional Physical Thing"
255
+ }
256
+ ]
257
+ }
258
+ ]
259
+ },
260
+ {
261
+ "oneOf": [
262
+ {
263
+ "type": "string",
264
+ "const": "crm:E28_Conceptual_Object"
265
+ },
266
+ {
267
+ "type": "array",
268
+ "minItems": 2,
269
+ "maxItems": 2,
270
+ "items": [
271
+ {
272
+ "type": "string",
273
+ "const": "crm:E28_Conceptual_Object"
274
+ },
275
+ {
276
+ "type": "string",
277
+ "const": "wikidata:Q15831596",
278
+ "description": "Fictional Conceptual Object"
279
+ }
280
+ ]
281
+ }
282
+ ]
283
+ },
284
+ {
285
+ "type": "array",
286
+ "minItems": 2,
287
+ "maxItems": 2,
288
+ "items": [
289
+ {
290
+ "type": "string",
291
+ "const": "xsd:date"
292
+ },
293
+ {
294
+ "type": "string",
295
+ "const": "crm:E52_Time-Span"
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "oneOf": [
301
+ {
302
+ "type": "string",
303
+ "const": "crm:E5_Event",
304
+ "description": "Real Event"
305
+ },
306
+ {
307
+ "type": "string",
308
+ "const": "YET TO BE DEFINED A CLASS FOR FICTIONAL EVENTS",
309
+ "description": "Fictional Event"
310
+ }
311
+ ]
312
+ }
313
+ ]
314
+ }
315
+ }
316
+ }
317
+ }
318
+ },
319
+ "then": {
320
+ "type": "object",
321
+ "properties": {
322
+ "motivation": {
323
+ "type": "array",
324
+ "minItems": 2,
325
+ "maxItems": 2,
326
+ "items": [
327
+ {
328
+ "type": "string",
329
+ "const": "identifying"
330
+ },
331
+ {
332
+ "type": "string",
333
+ "const": "crm:E55_Type"
334
+ }
335
+ ]
336
+ }
337
+ }
338
+ },
339
+ "else": {
340
+ "if": {
341
+ "type": "object",
342
+ "properties": {
343
+ "body": {
344
+ "type": "object",
345
+ "properties": {
346
+ "entityType": {
347
+ "type": "string",
348
+ "const": "crm:E33_Linguistic_Object"
349
+ }
350
+ }
351
+ }
352
+ }
353
+ },
354
+ "then": {
355
+ "type": "object",
356
+ "properties": {
357
+ "motivation": {
358
+ "type": "array",
359
+ "minItems": 2,
360
+ "maxItems": 2,
361
+ "items": [
362
+ {
363
+ "type": "string",
364
+ "const": "describing"
365
+ },
366
+ {
367
+ "type": "string",
368
+ "const": "crm:E55_Type"
369
+ }
370
+ ]
371
+ }
372
+ }
373
+ },
374
+ "else": {
375
+ "if": {
376
+ "type": "object",
377
+ "properties": {
378
+ "body": {
379
+ "type": "object",
380
+ "properties": {
381
+ "entityType": {
382
+ "type": "array",
383
+ "minItems": 2,
384
+ "maxItems": 2,
385
+ "items": [
386
+ {
387
+ "type": "string",
388
+ "const": "fabio:Correction"
389
+ },
390
+ {
391
+ "type": "string",
392
+ "const": "crm:E33_Linguistic_Object"
393
+ }
394
+ ]
395
+ }
396
+ }
397
+ }
398
+ }
399
+ },
400
+ "then": {
401
+ "type": "object",
402
+ "properties": {
403
+ "motivation": {
404
+ "type": "array",
405
+ "minItems": 2,
406
+ "maxItems": 2,
407
+ "items": [
408
+ {
409
+ "type": "string",
410
+ "const": "correcting"
411
+ },
412
+ {
413
+ "type": "string",
414
+ "const": "crm:E55_Type"
415
+ }
416
+ ]
417
+ }
418
+ }
419
+ },
420
+ "else": {
421
+ "if": {
422
+ "type": "object",
423
+ "properties": {
424
+ "body": {
425
+ "type": "object",
426
+ "properties": {
427
+ "entityType": {
428
+ "type": "array",
429
+ "minItems": 2,
430
+ "maxItems": 2,
431
+ "items": [
432
+ {
433
+ "type": "string",
434
+ "const": "crm:E55_Type"
435
+ },
436
+ {
437
+ "type": "string",
438
+ "const": "crm:E33_Linguistic_Object"
439
+ }
440
+ ]
441
+ }
442
+ }
443
+ }
444
+ }
445
+ },
446
+ "then": {
447
+ "type": "object",
448
+ "properties": {
449
+ "motivation": {
450
+ "type": "array",
451
+ "minItems": 2,
452
+ "maxItems": 2,
453
+ "items": [
454
+ {
455
+ "type": "string",
456
+ "const": "tagging"
457
+ },
458
+ {
459
+ "type": "string",
460
+ "const": "crm:E55_Type"
461
+ }
462
+ ]
463
+ }
464
+ }
465
+ },
466
+ "else": {
467
+ "if": {
468
+ "type": "object",
469
+ "properties": {
470
+ "body": {
471
+ "type": "object",
472
+ "properties": {
473
+ "entityType": {
474
+ "type": "array",
475
+ "minItems": 2,
476
+ "maxItems": 2,
477
+ "items": [
478
+ {
479
+ "type": "string",
480
+ "const": "crm:E55_Type"
481
+ },
482
+ {
483
+ "type": "string",
484
+ "const": "crmdig:D1_Digital_Object"
485
+ }
486
+ ]
487
+ }
488
+ }
489
+ }
490
+ }
491
+ },
492
+ "then": {
493
+ "type": "object",
494
+ "properties": {
495
+ "motivation": {
496
+ "type": "array",
497
+ "minItems": 2,
498
+ "maxItems": 2,
499
+ "items": [
500
+ {
501
+ "type": "string",
502
+ "const": "classifying"
503
+ },
504
+ {
505
+ "type": "string",
506
+ "const": "crm:E55_Type"
507
+ }
508
+ ]
509
+ }
510
+ }
511
+ },
512
+ "else": {
513
+ "if": {
514
+ "type": "object",
515
+ "properties": {
516
+ "body": {
517
+ "type": "object",
518
+ "properties": {
519
+ "entityType": {
520
+ "type": "string",
521
+ "const": "crmdig:D1_Digital_Object"
522
+ }
523
+ }
524
+ }
525
+ }
526
+ },
527
+ "then": {
528
+ "type": "object",
529
+ "properties": {
530
+ "motivation": {
531
+ "type": "array",
532
+ "minItems": 2,
533
+ "maxItems": 2,
534
+ "items": [
535
+ {
536
+ "type": "string",
537
+ "const": "linking"
538
+ },
539
+ {
540
+ "type": "string",
541
+ "const": "crm:E55_Type"
542
+ }
543
+ ]
544
+ }
545
+ }
546
+ },
547
+ "else": {
548
+ "if": {
549
+ "type": "object",
550
+ "properties": {
551
+ "body": {
552
+ "type": "object",
553
+ "properties": {
554
+ "entityType": {
555
+ "type": "array",
556
+ "minItems": 2,
557
+ "maxItems": 2,
558
+ "items": [
559
+ {
560
+ "type": "string",
561
+ "const": "cito:Citation"
562
+ },
563
+ {
564
+ "type": "string",
565
+ "const": "crm:E73_Information_Object"
566
+ }
567
+ ]
568
+ }
569
+ }
570
+ }
571
+ }
572
+ },
573
+ "then": {
574
+ "type": "object",
575
+ "properties": {
576
+ "motivation": {
577
+ "type": "array",
578
+ "minItems": 2,
579
+ "maxItems": 2,
580
+ "items": [
581
+ {
582
+ "type": "string",
583
+ "const": "citing"
584
+ },
585
+ {
586
+ "type": "string",
587
+ "const": "crm:E55_Type"
588
+ }
589
+ ]
590
+ }
591
+ }
592
+ }
593
+ }
594
+ }
595
+ }
596
+ }
597
+ }
598
+ }
599
+ }
600
+ ],
601
+ "additionalProperties": false
602
+ }