@lincs.project/webannotation-schema 1.0.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.
Files changed (119) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +155 -0
  3. package/dist/context.jsonld +24 -0
  4. package/dist/defs.jsonld +949 -0
  5. package/dist/schema.jsonld +621 -0
  6. package/dist/validate.js +1 -0
  7. package/lib/index.d.ts +145 -0
  8. package/lib/index.d.ts.map +1 -0
  9. package/lib/index.js +13 -0
  10. package/lib/index.js.map +1 -0
  11. package/lib/schema/config.d.ts +4 -0
  12. package/lib/schema/config.d.ts.map +1 -0
  13. package/lib/schema/config.js +4 -0
  14. package/lib/schema/config.js.map +1 -0
  15. package/lib/schema/context.d.ts +25 -0
  16. package/lib/schema/context.d.ts.map +1 -0
  17. package/lib/schema/context.js +25 -0
  18. package/lib/schema/context.js.map +1 -0
  19. package/lib/schema/definitions/agent.d.ts +36 -0
  20. package/lib/schema/definitions/agent.d.ts.map +1 -0
  21. package/lib/schema/definitions/agent.js +82 -0
  22. package/lib/schema/definitions/agent.js.map +1 -0
  23. package/lib/schema/definitions/body/citation.d.ts +27 -0
  24. package/lib/schema/definitions/body/citation.d.ts.map +1 -0
  25. package/lib/schema/definitions/body/citation.js +53 -0
  26. package/lib/schema/definitions/body/citation.js.map +1 -0
  27. package/lib/schema/definitions/body/common.d.ts +17 -0
  28. package/lib/schema/definitions/body/common.d.ts.map +1 -0
  29. package/lib/schema/definitions/body/common.js +46 -0
  30. package/lib/schema/definitions/body/common.js.map +1 -0
  31. package/lib/schema/definitions/body/conceptualObject.d.ts +27 -0
  32. package/lib/schema/definitions/body/conceptualObject.d.ts.map +1 -0
  33. package/lib/schema/definitions/body/conceptualObject.js +61 -0
  34. package/lib/schema/definitions/body/conceptualObject.js.map +1 -0
  35. package/lib/schema/definitions/body/correction.d.ts +24 -0
  36. package/lib/schema/definitions/body/correction.d.ts.map +1 -0
  37. package/lib/schema/definitions/body/correction.js +54 -0
  38. package/lib/schema/definitions/body/correction.js.map +1 -0
  39. package/lib/schema/definitions/body/date.d.ts +30 -0
  40. package/lib/schema/definitions/body/date.d.ts.map +1 -0
  41. package/lib/schema/definitions/body/date.js +61 -0
  42. package/lib/schema/definitions/body/date.js.map +1 -0
  43. package/lib/schema/definitions/body/index.d.ts +37 -0
  44. package/lib/schema/definitions/body/index.d.ts.map +1 -0
  45. package/lib/schema/definitions/body/index.js +220 -0
  46. package/lib/schema/definitions/body/index.js.map +1 -0
  47. package/lib/schema/definitions/body/keyword.d.ts +48 -0
  48. package/lib/schema/definitions/body/keyword.d.ts.map +1 -0
  49. package/lib/schema/definitions/body/keyword.js +100 -0
  50. package/lib/schema/definitions/body/keyword.js.map +1 -0
  51. package/lib/schema/definitions/body/link.d.ts +21 -0
  52. package/lib/schema/definitions/body/link.d.ts.map +1 -0
  53. package/lib/schema/definitions/body/link.js +37 -0
  54. package/lib/schema/definitions/body/link.js.map +1 -0
  55. package/lib/schema/definitions/body/note.d.ts +27 -0
  56. package/lib/schema/definitions/body/note.d.ts.map +1 -0
  57. package/lib/schema/definitions/body/note.js +54 -0
  58. package/lib/schema/definitions/body/note.js.map +1 -0
  59. package/lib/schema/definitions/body/organization.d.ts +27 -0
  60. package/lib/schema/definitions/body/organization.d.ts.map +1 -0
  61. package/lib/schema/definitions/body/organization.js +65 -0
  62. package/lib/schema/definitions/body/organization.js.map +1 -0
  63. package/lib/schema/definitions/body/person.d.ts +27 -0
  64. package/lib/schema/definitions/body/person.d.ts.map +1 -0
  65. package/lib/schema/definitions/body/person.js +61 -0
  66. package/lib/schema/definitions/body/person.js.map +1 -0
  67. package/lib/schema/definitions/body/physicalThing.d.ts +27 -0
  68. package/lib/schema/definitions/body/physicalThing.d.ts.map +1 -0
  69. package/lib/schema/definitions/body/physicalThing.js +61 -0
  70. package/lib/schema/definitions/body/physicalThing.js.map +1 -0
  71. package/lib/schema/definitions/body/place.d.ts +30 -0
  72. package/lib/schema/definitions/body/place.d.ts.map +1 -0
  73. package/lib/schema/definitions/body/place.js +64 -0
  74. package/lib/schema/definitions/body/place.js.map +1 -0
  75. package/lib/schema/definitions/body/work.d.ts +27 -0
  76. package/lib/schema/definitions/body/work.d.ts.map +1 -0
  77. package/lib/schema/definitions/body/work.js +61 -0
  78. package/lib/schema/definitions/body/work.js.map +1 -0
  79. package/lib/schema/definitions/index.d.ts +22 -0
  80. package/lib/schema/definitions/index.d.ts.map +1 -0
  81. package/lib/schema/definitions/index.js +24 -0
  82. package/lib/schema/definitions/index.js.map +1 -0
  83. package/lib/schema/definitions/target/index.d.ts +710 -0
  84. package/lib/schema/definitions/target/index.d.ts.map +1 -0
  85. package/lib/schema/definitions/target/index.js +231 -0
  86. package/lib/schema/definitions/target/index.js.map +1 -0
  87. package/lib/schema/definitions/target/selector/index.d.ts +5 -0
  88. package/lib/schema/definitions/target/selector/index.d.ts.map +1 -0
  89. package/lib/schema/definitions/target/selector/index.js +5 -0
  90. package/lib/schema/definitions/target/selector/index.js.map +1 -0
  91. package/lib/schema/definitions/target/selector/range.d.ts +141 -0
  92. package/lib/schema/definitions/target/selector/range.d.ts.map +1 -0
  93. package/lib/schema/definitions/target/selector/range.js +44 -0
  94. package/lib/schema/definitions/target/selector/range.js.map +1 -0
  95. package/lib/schema/definitions/target/selector/textPosition.d.ts +21 -0
  96. package/lib/schema/definitions/target/selector/textPosition.d.ts.map +1 -0
  97. package/lib/schema/definitions/target/selector/textPosition.js +57 -0
  98. package/lib/schema/definitions/target/selector/textPosition.js.map +1 -0
  99. package/lib/schema/definitions/target/selector/textQuote.d.ts +297 -0
  100. package/lib/schema/definitions/target/selector/textQuote.d.ts.map +1 -0
  101. package/lib/schema/definitions/target/selector/textQuote.js +78 -0
  102. package/lib/schema/definitions/target/selector/textQuote.js.map +1 -0
  103. package/lib/schema/definitions/target/selector/xpath.d.ts +46 -0
  104. package/lib/schema/definitions/target/selector/xpath.d.ts.map +1 -0
  105. package/lib/schema/definitions/target/selector/xpath.js +51 -0
  106. package/lib/schema/definitions/target/selector/xpath.js.map +1 -0
  107. package/lib/schema/index.d.ts +5 -0
  108. package/lib/schema/index.d.ts.map +1 -0
  109. package/lib/schema/index.js +5 -0
  110. package/lib/schema/index.js.map +1 -0
  111. package/lib/schema/root.d.ts +1076 -0
  112. package/lib/schema/root.d.ts.map +1 -0
  113. package/lib/schema/root.js +408 -0
  114. package/lib/schema/root.js.map +1 -0
  115. package/lib/validation.d.ts +25 -0
  116. package/lib/validation.d.ts.map +1 -0
  117. package/lib/validation.js +35 -0
  118. package/lib/validation.js.map +1 -0
  119. package/package.json +68 -0
@@ -0,0 +1,949 @@
1
+ {
2
+ "$id": "https://wa.lincsproject.ca/v1/defs.jsonld",
3
+ "type": "object",
4
+ "definitions": {
5
+ "creator": {
6
+ "type": "object",
7
+ "description": "Software Agent",
8
+ "properties": {
9
+ "id": {
10
+ "anyOf": [
11
+ {
12
+ "type": "string",
13
+ "format": "uri"
14
+ },
15
+ {
16
+ "type": "string",
17
+ "const": "anonymous"
18
+ }
19
+ ],
20
+ "description": "The URI that identifies the agent (Creator or Contributor)."
21
+ },
22
+ "type": {
23
+ "type": "string",
24
+ "const": "crm:E21_Person"
25
+ },
26
+ "name": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "description": "The name of the agent."
30
+ }
31
+ },
32
+ "required": [
33
+ "id",
34
+ "type",
35
+ "name"
36
+ ]
37
+ },
38
+ "software": {
39
+ "type": "object",
40
+ "description": "Software Agent",
41
+ "properties": {
42
+ "id": {
43
+ "type": "string",
44
+ "format": "uri",
45
+ "description": "The IRI that identifies the agent (software)."
46
+ },
47
+ "type": {
48
+ "type": "array",
49
+ "minItems": 2,
50
+ "maxItems": 2,
51
+ "items": [
52
+ {
53
+ "type": "string",
54
+ "const": "Software"
55
+ },
56
+ {
57
+ "type": "string",
58
+ "const": "crm:P16_used_specific_object"
59
+ }
60
+ ],
61
+ "description": "The type of the Agent."
62
+ },
63
+ "label": {
64
+ "type": "string",
65
+ "minLength": 1,
66
+ "description": "The name of the software."
67
+ },
68
+ "softwareVersion": {
69
+ "type": "string",
70
+ "description": "The software version."
71
+ }
72
+ },
73
+ "required": [
74
+ "id",
75
+ "type",
76
+ "label"
77
+ ]
78
+ },
79
+ "target": {
80
+ "type": "object",
81
+ "description": "Web Annotation Target",
82
+ "properties": {
83
+ "id": {
84
+ "anyOf": [
85
+ {
86
+ "type": "string",
87
+ "format": "uri",
88
+ "description": "This document URI"
89
+ },
90
+ {
91
+ "type": "string",
92
+ "format": "uuid"
93
+ }
94
+ ],
95
+ "description": "The IRI that identifies the Target resource."
96
+ },
97
+ "type": {
98
+ "type": "array",
99
+ "minItems": 2,
100
+ "maxItems": 2,
101
+ "items": [
102
+ {
103
+ "type": "string",
104
+ "const": "SpecificResource"
105
+ },
106
+ {
107
+ "type": "string",
108
+ "const": "crm:E73_Information_Object"
109
+ }
110
+ ],
111
+ "description": "The class of the Specific Resource."
112
+ },
113
+ "format": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "string",
117
+ "minLength": 1,
118
+ "description": "The format of the Web Resource's content. The value of the property should be the media-type of the format, following the [rfc6838] specification."
119
+ },
120
+ "description": "The formats of the Web Resource's content. The value of the property should and array of media-types of the format, following the [rfc6838] specification."
121
+ },
122
+ "language": {
123
+ "type": "array",
124
+ "items": {
125
+ "type": "string",
126
+ "minLength": 2,
127
+ "maxLength": 3,
128
+ "description": "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification."
129
+ },
130
+ "minItems": 1,
131
+ "description": "The languages of the Web Resource's content. The value of the property should be an array of language code following the [bcp47] specification."
132
+ },
133
+ "title": {
134
+ "type": "string",
135
+ "minLength": 1,
136
+ "description": "The title of the document being annotated."
137
+ },
138
+ "renderedVia": {
139
+ "$ref": "defs.jsonld#/definitions/software",
140
+ "description": "The relationship between the Specific Resource that represents the Target in the annotation, and the piece of software or other system that was used to render the Target when the annotation was created."
141
+ },
142
+ "selector": {
143
+ "type": "object",
144
+ "oneOf": [
145
+ {
146
+ "$ref": "defs.jsonld#/definitions/textQuoteSelector"
147
+ },
148
+ {
149
+ "$ref": "defs.jsonld#/definitions/rangeSelector"
150
+ },
151
+ {
152
+ "$ref": "defs.jsonld#/definitions/xpathSelector"
153
+ },
154
+ {
155
+ "$ref": "defs.jsonld#/definitions/textPositionSelector"
156
+ }
157
+ ],
158
+ "description": "The relationship between a Specific Resource and a Selector. ",
159
+ "required": [
160
+ "id",
161
+ "type"
162
+ ]
163
+ }
164
+ },
165
+ "required": [
166
+ "id",
167
+ "type"
168
+ ],
169
+ "allOf": [
170
+ {
171
+ "if": {
172
+ "type": "object",
173
+ "properties": {
174
+ "selector": {
175
+ "type": "object",
176
+ "properties": {
177
+ "type": {
178
+ "type": "array",
179
+ "minItems": 2,
180
+ "maxItems": 2,
181
+ "items": [
182
+ {
183
+ "type": "string",
184
+ "const": "TextQuoteSelector"
185
+ },
186
+ {
187
+ "type": "string",
188
+ "const": "crm:E33_Linguistic_Object"
189
+ }
190
+ ]
191
+ }
192
+ }
193
+ }
194
+ }
195
+ },
196
+ "then": {
197
+ "type": "object",
198
+ "properties": {
199
+ "selector": {
200
+ "type": "object",
201
+ "required": [
202
+ "type",
203
+ "exact"
204
+ ]
205
+ }
206
+ }
207
+ },
208
+ "required": [
209
+ "selector"
210
+ ]
211
+ },
212
+ {
213
+ "if": {
214
+ "type": "object",
215
+ "properties": {
216
+ "selector": {
217
+ "type": "object",
218
+ "properties": {
219
+ "type": {
220
+ "type": "array",
221
+ "minItems": 2,
222
+ "maxItems": 2,
223
+ "items": [
224
+ {
225
+ "type": "string",
226
+ "const": "RangeSelector"
227
+ },
228
+ {
229
+ "type": "string",
230
+ "const": "crm:E73_Information_Object"
231
+ }
232
+ ]
233
+ }
234
+ }
235
+ }
236
+ }
237
+ },
238
+ "then": {
239
+ "type": "object",
240
+ "properties": {
241
+ "selector": {
242
+ "type": "object",
243
+ "required": [
244
+ "type",
245
+ "startSelector",
246
+ "endSelector"
247
+ ]
248
+ }
249
+ },
250
+ "required": [
251
+ "selector"
252
+ ]
253
+ }
254
+ },
255
+ {
256
+ "if": {
257
+ "type": "object",
258
+ "properties": {
259
+ "selector": {
260
+ "type": "object",
261
+ "properties": {
262
+ "type": {
263
+ "type": "array",
264
+ "minItems": 2,
265
+ "maxItems": 2,
266
+ "items": [
267
+ {
268
+ "type": "string",
269
+ "const": "XPathSelector"
270
+ },
271
+ {
272
+ "type": "string",
273
+ "const": "crm:E73_Information_Object"
274
+ }
275
+ ]
276
+ }
277
+ }
278
+ }
279
+ }
280
+ },
281
+ "then": {
282
+ "type": "object",
283
+ "properties": {
284
+ "selector": {
285
+ "type": "object",
286
+ "required": [
287
+ "type",
288
+ "value"
289
+ ]
290
+ }
291
+ },
292
+ "required": [
293
+ "selector"
294
+ ]
295
+ }
296
+ },
297
+ {
298
+ "if": {
299
+ "type": "object",
300
+ "properties": {
301
+ "selector": {
302
+ "type": "object",
303
+ "properties": {
304
+ "type": {
305
+ "type": "array",
306
+ "minItems": 2,
307
+ "maxItems": 2,
308
+ "items": [
309
+ {
310
+ "type": "string",
311
+ "const": "TextPositionSelector"
312
+ },
313
+ {
314
+ "type": "string",
315
+ "const": "crm:E73_Information_Object"
316
+ }
317
+ ]
318
+ }
319
+ }
320
+ }
321
+ }
322
+ },
323
+ "then": {
324
+ "type": "object",
325
+ "properties": {
326
+ "selector": {
327
+ "type": "object",
328
+ "required": [
329
+ "type",
330
+ "start",
331
+ "end"
332
+ ]
333
+ }
334
+ },
335
+ "required": [
336
+ "selector"
337
+ ]
338
+ }
339
+ }
340
+ ]
341
+ },
342
+ "textQuoteSelector": {
343
+ "type": "object",
344
+ "description": "Quote Selector",
345
+ "properties": {
346
+ "id": {
347
+ "type": "string",
348
+ "format": "uuid",
349
+ "description": "UUID that identifies the selector."
350
+ },
351
+ "type": {
352
+ "type": "array",
353
+ "minItems": 2,
354
+ "maxItems": 2,
355
+ "items": [
356
+ {
357
+ "type": "string",
358
+ "const": "TextQuoteSelector"
359
+ },
360
+ {
361
+ "type": "string",
362
+ "const": "crm:E33_Linguistic_Object"
363
+ }
364
+ ],
365
+ "description": "The class of the Selector"
366
+ },
367
+ "exact": {
368
+ "type": "string",
369
+ "description": "A copy of the text which is being selected, after normalization."
370
+ },
371
+ "prefix": {
372
+ "type": "string",
373
+ "description": "The snippet of text that occurs immediately before the text which is being selected."
374
+ },
375
+ "sufix": {
376
+ "type": "string",
377
+ "description": "The snippet of text that occurs immediately after the text which is being selected."
378
+ },
379
+ "refinedBy": {
380
+ "type": "object",
381
+ "description": "The relationship between a broader selector and the more specific selector that should be applied to the results of the first.",
382
+ "oneOf": [
383
+ {
384
+ "$ref": "defs.jsonld#/definitions/rangeSelector"
385
+ },
386
+ {
387
+ "$ref": "defs.jsonld#/definitions/xpathSelector"
388
+ },
389
+ {
390
+ "$ref": "defs.jsonld#/definitions/textPositionSelector"
391
+ }
392
+ ],
393
+ "required": []
394
+ }
395
+ },
396
+ "required": [
397
+ "id",
398
+ "type",
399
+ "exact"
400
+ ]
401
+ },
402
+ "rangeSelector": {
403
+ "type": "object",
404
+ "description": "Range Selector",
405
+ "properties": {
406
+ "id": {
407
+ "type": "string",
408
+ "format": "uuid",
409
+ "description": "UUID that identifies the selector."
410
+ },
411
+ "type": {
412
+ "type": "array",
413
+ "minItems": 2,
414
+ "maxItems": 2,
415
+ "items": [
416
+ {
417
+ "type": "string",
418
+ "const": "RangeSelector"
419
+ },
420
+ {
421
+ "type": "string",
422
+ "const": "crm:E73_Information_Object"
423
+ }
424
+ ],
425
+ "description": "The class of the Selector,"
426
+ },
427
+ "startSelector": {
428
+ "$ref": "defs.jsonld#/definitions/xpathSelector"
429
+ },
430
+ "endSelector": {
431
+ "$ref": "defs.jsonld#/definitions/xpathSelector"
432
+ }
433
+ },
434
+ "required": [
435
+ "id",
436
+ "type",
437
+ "startSelector",
438
+ "endSelector"
439
+ ]
440
+ },
441
+ "xpathSelector": {
442
+ "type": "object",
443
+ "description": "Xpath Selector",
444
+ "properties": {
445
+ "id": {
446
+ "type": "string",
447
+ "format": "uuid",
448
+ "description": "UUID that identifies the selector."
449
+ },
450
+ "type": {
451
+ "type": "array",
452
+ "minItems": 2,
453
+ "maxItems": 2,
454
+ "items": [
455
+ {
456
+ "type": "string",
457
+ "const": "XPathSelector"
458
+ },
459
+ {
460
+ "type": "string",
461
+ "const": "crm:E73_Information_Object"
462
+ }
463
+ ],
464
+ "description": "The class of the Selector,"
465
+ },
466
+ "value": {
467
+ "type": "string",
468
+ "description": "Web Annotation Target Select Xpath"
469
+ },
470
+ "refinedBy": {
471
+ "$ref": "defs.jsonld#/definitions/textPositionSelector",
472
+ "description": "The relationship between a broader selector and the more specific selector that should be applied to the results of the first."
473
+ }
474
+ },
475
+ "required": [
476
+ "id",
477
+ "type",
478
+ "value"
479
+ ]
480
+ },
481
+ "textPositionSelector": {
482
+ "type": "object",
483
+ "description": "TextPosition Selector",
484
+ "properties": {
485
+ "id": {
486
+ "type": "string",
487
+ "format": "uuid",
488
+ "description": "UUID that identifies the selector."
489
+ },
490
+ "type": {
491
+ "type": "array",
492
+ "minItems": 2,
493
+ "maxItems": 2,
494
+ "items": [
495
+ {
496
+ "type": "string",
497
+ "const": "TextPositionSelector"
498
+ },
499
+ {
500
+ "type": "string",
501
+ "const": "crm:E73_Information_Object"
502
+ }
503
+ ],
504
+ "description": "The class of the Selector."
505
+ },
506
+ "start": {
507
+ "type": "number",
508
+ "minimum": 0,
509
+ "description": "The starting position of the segment. The first byte is character position 0."
510
+ },
511
+ "end": {
512
+ "type": "number",
513
+ "minimum": 0,
514
+ "description": "The end position of the segment. The last character is not included within the segment."
515
+ }
516
+ },
517
+ "required": [
518
+ "id",
519
+ "type",
520
+ "start",
521
+ "end"
522
+ ]
523
+ },
524
+ "body": {
525
+ "type": "object",
526
+ "description": "Web Annotation Body",
527
+ "properties": {
528
+ "id": {
529
+ "oneOf": [
530
+ {
531
+ "type": "string",
532
+ "format": "uri",
533
+ "description": "The IRI that identifies the Body resource"
534
+ },
535
+ {
536
+ "type": "string",
537
+ "format": "uuid"
538
+ }
539
+ ]
540
+ },
541
+ "type": {
542
+ "type": "string",
543
+ "const": "TextualBody"
544
+ },
545
+ "entityType": {
546
+ "oneOf": [
547
+ {
548
+ "type": "array",
549
+ "minItems": 2,
550
+ "maxItems": 2,
551
+ "items": [
552
+ {
553
+ "type": "string",
554
+ "const": "Person"
555
+ },
556
+ {
557
+ "oneOf": [
558
+ {
559
+ "type": "string",
560
+ "const": "crm:E21_Person",
561
+ "description": "Real Person"
562
+ },
563
+ {
564
+ "type": "string",
565
+ "const": "crm:E89_Propositional_Object",
566
+ "description": "Fictional Person"
567
+ }
568
+ ]
569
+ }
570
+ ]
571
+ },
572
+ {
573
+ "oneOf": [
574
+ {
575
+ "type": "string",
576
+ "const": "cwrc:place"
577
+ },
578
+ {
579
+ "type": "array",
580
+ "minItems": 2,
581
+ "maxItems": 2,
582
+ "items": [
583
+ {
584
+ "type": "string",
585
+ "const": "cwrc:place"
586
+ },
587
+ {
588
+ "type": "string",
589
+ "const": "crm:E89_Propositional_Object",
590
+ "description": "Fictional Place"
591
+ }
592
+ ]
593
+ }
594
+ ]
595
+ },
596
+ {
597
+ "type": "array",
598
+ "minItems": 2,
599
+ "maxItems": 2,
600
+ "items": [
601
+ {
602
+ "type": "string",
603
+ "const": "foaf:Organization"
604
+ },
605
+ {
606
+ "oneOf": [
607
+ {
608
+ "type": "string",
609
+ "const": "crm:E74_Group",
610
+ "description": "Real Organization"
611
+ },
612
+ {
613
+ "type": "string",
614
+ "const": "crm:E89_Propositional_Object",
615
+ "description": "Fictional Organization"
616
+ }
617
+ ]
618
+ }
619
+ ]
620
+ },
621
+ {
622
+ "type": "array",
623
+ "minItems": 2,
624
+ "maxItems": 2,
625
+ "items": [
626
+ {
627
+ "type": "string",
628
+ "const": "crm:E89_Propositional_Object"
629
+ },
630
+ {
631
+ "oneOf": [
632
+ {
633
+ "type": "string",
634
+ "const": "frbroo:F1",
635
+ "description": "Real Work"
636
+ },
637
+ {
638
+ "type": "string",
639
+ "const": "wikidata:Q15306849",
640
+ "description": "Fictional Work"
641
+ }
642
+ ]
643
+ }
644
+ ]
645
+ },
646
+ {
647
+ "oneOf": [
648
+ {
649
+ "type": "string",
650
+ "const": "crm:E18_Physical_Thing"
651
+ },
652
+ {
653
+ "type": "array",
654
+ "minItems": 2,
655
+ "maxItems": 2,
656
+ "items": [
657
+ {
658
+ "type": "string",
659
+ "const": "crm:E18_Physical_Thing"
660
+ },
661
+ {
662
+ "type": "string",
663
+ "const": "wikidata:Q15831596",
664
+ "description": "Fictional Physical Thing"
665
+ }
666
+ ]
667
+ }
668
+ ]
669
+ },
670
+ {
671
+ "oneOf": [
672
+ {
673
+ "type": "string",
674
+ "const": "crm:E28_Conceptual_Object"
675
+ },
676
+ {
677
+ "type": "array",
678
+ "minItems": 2,
679
+ "maxItems": 2,
680
+ "items": [
681
+ {
682
+ "type": "string",
683
+ "const": "crm:E28_Conceptual_Object"
684
+ },
685
+ {
686
+ "type": "string",
687
+ "const": "wikidata:Q15831596",
688
+ "description": "Fictional Conceptual Object"
689
+ }
690
+ ]
691
+ }
692
+ ]
693
+ },
694
+ {
695
+ "type": "array",
696
+ "minItems": 2,
697
+ "maxItems": 2,
698
+ "items": [
699
+ {
700
+ "type": "string",
701
+ "const": "cito:Citation"
702
+ },
703
+ {
704
+ "type": "string",
705
+ "const": "crm:E73_Information_Object"
706
+ }
707
+ ]
708
+ },
709
+ {
710
+ "type": "array",
711
+ "minItems": 2,
712
+ "maxItems": 2,
713
+ "items": [
714
+ {
715
+ "type": "string",
716
+ "const": "xsd:date"
717
+ },
718
+ {
719
+ "type": "string",
720
+ "const": "crm:E52_Time-Span"
721
+ }
722
+ ]
723
+ },
724
+ {
725
+ "type": "string",
726
+ "const": "crm:E33_Linguistic_Object"
727
+ },
728
+ {
729
+ "type": "array",
730
+ "minItems": 2,
731
+ "maxItems": 2,
732
+ "items": [
733
+ {
734
+ "type": "string",
735
+ "const": "fabio:Correction"
736
+ },
737
+ {
738
+ "type": "string",
739
+ "const": "crm:E33_Linguistic_Object"
740
+ }
741
+ ]
742
+ },
743
+ {
744
+ "type": "array",
745
+ "minItems": 2,
746
+ "maxItems": 2,
747
+ "items": [
748
+ {
749
+ "type": "string",
750
+ "const": "crm:E55_Type"
751
+ },
752
+ {
753
+ "type": "string",
754
+ "const": "crmdig:D1_Digital_Object"
755
+ }
756
+ ]
757
+ },
758
+ {
759
+ "type": "array",
760
+ "minItems": 2,
761
+ "maxItems": 2,
762
+ "items": [
763
+ {
764
+ "type": "string",
765
+ "const": "crm:E55_Type"
766
+ },
767
+ {
768
+ "type": "string",
769
+ "const": "crm:E33_Linguistic_Object"
770
+ }
771
+ ]
772
+ },
773
+ {
774
+ "type": "string",
775
+ "const": "crmdig:D1_Digital_Object"
776
+ }
777
+ ]
778
+ },
779
+ "additionalType": {
780
+ "anyOf": [
781
+ {
782
+ "type": "string"
783
+ },
784
+ {
785
+ "type": "array",
786
+ "items": {
787
+ "type": "string"
788
+ }
789
+ }
790
+ ]
791
+ },
792
+ "value": {
793
+ "type": "string"
794
+ },
795
+ "certainty": {
796
+ "type": "string",
797
+ "enum": [
798
+ "edit:qualityLow",
799
+ "edit:qualityMedium",
800
+ "edit:qualityHigh",
801
+ "edit:qualityUnknown"
802
+ ],
803
+ "description": "Indicates the degree of certainty associated with some aspect of an assertion, description, identification, or entity linked to the annotation body."
804
+ },
805
+ "precision": {
806
+ "type": "string",
807
+ "enum": [
808
+ "edit:qualityLow",
809
+ "edit:qualityMedium",
810
+ "edit:qualityHigh",
811
+ "edit:qualityUnknown"
812
+ ],
813
+ "description": "Indicates the degree of precision associated with the location of the entity linked to the annotation body."
814
+ },
815
+ "label": {
816
+ "type": "string",
817
+ "minLength": 1,
818
+ "description": "The title or name of a linked resource or named entity."
819
+ },
820
+ "description": {
821
+ "type": "string",
822
+ "description": "Short description of the linked resources or named entity."
823
+ }
824
+ },
825
+ "required": [
826
+ "id",
827
+ "entityType"
828
+ ],
829
+ "anyOf": [
830
+ {
831
+ "if": {
832
+ "type": "object",
833
+ "properties": {
834
+ "entityType": {
835
+ "anyOf": [
836
+ {
837
+ "const": "crm:E33_Linguistic_Object"
838
+ },
839
+ {
840
+ "type": "array",
841
+ "minItems": 2,
842
+ "maxItems": 2,
843
+ "items": [
844
+ {
845
+ "const": "xsd:date"
846
+ },
847
+ {
848
+ "const": "crm:E52_Time-Span"
849
+ }
850
+ ]
851
+ },
852
+ {
853
+ "type": "array",
854
+ "minItems": 2,
855
+ "maxItems": 2,
856
+ "items": [
857
+ {
858
+ "const": "fabio:Correction"
859
+ },
860
+ {
861
+ "const": "crm:E33_Linguistic_Object"
862
+ }
863
+ ]
864
+ },
865
+ {
866
+ "type": "array",
867
+ "minItems": 2,
868
+ "maxItems": 2,
869
+ "items": [
870
+ {
871
+ "const": "crm:E55_Type"
872
+ },
873
+ {
874
+ "const": "crm:E33_Linguistic_Object"
875
+ }
876
+ ]
877
+ }
878
+ ]
879
+ }
880
+ }
881
+ },
882
+ "then": {
883
+ "type": "object",
884
+ "required": [
885
+ "type",
886
+ "value"
887
+ ],
888
+ "properties": {
889
+ "id": {
890
+ "type": "string",
891
+ "format": "uuid"
892
+ },
893
+ "type": {
894
+ "type": "string",
895
+ "const": "TextualBody"
896
+ }
897
+ },
898
+ "if": {
899
+ "type": "object",
900
+ "properties": {
901
+ "entityType": {
902
+ "type": "array",
903
+ "minItems": 2,
904
+ "maxItems": 2,
905
+ "items": [
906
+ {
907
+ "const": "xsd:date"
908
+ },
909
+ {
910
+ "const": "crm:E52_Time-Span"
911
+ }
912
+ ]
913
+ }
914
+ }
915
+ },
916
+ "then": {
917
+ "type": "object",
918
+ "properties": {
919
+ "value": {
920
+ "type": "string",
921
+ "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:.\\d*)?)((-(\\d{2}):(\\d{2})|Z)?)\\/(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:.\\d*)?)((-(\\d{2}):(\\d{2})|Z)?)$"
922
+ }
923
+ }
924
+ },
925
+ "else": {
926
+ "type": "object",
927
+ "properties": {
928
+ "value": {
929
+ "type": "string"
930
+ }
931
+ }
932
+ }
933
+ },
934
+ "else": {
935
+ "type": "object",
936
+ "properties": {
937
+ "id": {
938
+ "type": "string",
939
+ "format": "uri"
940
+ }
941
+ }
942
+ }
943
+ }
944
+ ],
945
+ "additionalProperties": false
946
+ }
947
+ },
948
+ "required": []
949
+ }