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