@lincs.project/webannotation-schema 1.7.0 → 1.9.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.
package/dist/index.mjs CHANGED
@@ -22,35 +22,51 @@ var schemaContext = {
22
22
  wikidata: "http://www.wikidata.org/entity/",
23
23
  crm: "http://www.cidoc-crm.org/cidoc-crm/",
24
24
  crmdig: "http://www.ics.forth.gr/isl/CRMdig/",
25
- additionalType: {
25
+ citing: "edit:citing",
26
+ correcting: "edit:correcting",
27
+ "oa:identifying": {
28
+ type: "crm:E55_Type"
29
+ },
30
+ "oa:describing": {
31
+ type: "crm:E55_Type"
32
+ },
33
+ "oa:tagging": {
34
+ type: "crm:E55_Type"
35
+ },
36
+ "oa:classifying": {
37
+ type: "crm:E55_Type"
38
+ },
39
+ "oa:linking": {
40
+ type: "crm:E55_Type"
41
+ },
42
+ certainty: {
26
43
  "@type": "@id",
27
44
  "@id": "crm:P2_has_type"
28
45
  },
29
- certainty: {
46
+ precision: {
30
47
  "@type": "@id",
31
48
  "@id": "crm:P2_has_type"
32
49
  },
33
50
  contributor: "dcterms:contributor",
34
- description: "rdfs:comment",
35
51
  entityType: {
36
52
  "@type": "@id",
37
53
  "@id": "rdf:type"
38
54
  },
39
- identifiedBy: "crm:P1_is_identified_by",
40
- precision: {
55
+ additionalType: {
41
56
  "@type": "@id",
42
57
  "@id": "crm:P2_has_type"
43
58
  },
59
+ modeExistence: "edit:ModeExistence",
60
+ description: "rdfs:comment",
61
+ identifiedBy: "crm:P1_is_identified_by",
62
+ title: "crm:P190_has_symbolic_content",
63
+ usedSpecificObject: "crm:P16_used_specific_object",
44
64
  softwareVersion: "schema:softwareVersion",
45
65
  status: {
46
66
  "@type": "@id",
47
67
  "@id": "crm:P2_has_type"
48
68
  },
49
- title: "crm:P190_has_symbolic_content",
50
- usedSpecificObject: "crm:P16_used_specific_object",
51
69
  approved: "edit:statusApproved",
52
- citing: "edit:citing",
53
- correcting: "edit:correcting",
54
70
  draft: "edit:statusDraft",
55
71
  published: "edit:statusPublished"
56
72
  }
@@ -61,7 +77,7 @@ import { z } from "zod";
61
77
  var userIdDescription = "The IRI that identifies the agent (Creator or Contributor).";
62
78
  var User = z.object({
63
79
  id: z.string().url().describe(userIdDescription),
64
- type: z.tuple([z.literal("foaf:Person"), z.literal("crm:E21_Person")]).describe("The type of the Agent."),
80
+ type: z.literal("crm:E21_Person").describe("The type of the Agent."),
65
81
  name: z.string().min(1, { message: "Cannot be empty" }).describe("The name of the agent.")
66
82
  }).describe("Human Agent");
67
83
  var creatorSchema = {
@@ -69,15 +85,7 @@ var creatorSchema = {
69
85
  description: "Software Agent",
70
86
  properties: {
71
87
  id: { type: "string", format: "uri", description: userIdDescription },
72
- type: {
73
- type: "array",
74
- minItems: 2,
75
- maxItems: 2,
76
- items: [
77
- { type: "string", const: "foaf:Person" },
78
- { type: "string", const: "crm:E21_Person" }
79
- ]
80
- },
88
+ type: { type: "string", const: "crm:E21_Person" },
81
89
  name: { type: "string", minLength: 1, description: "The name of the agent." }
82
90
  },
83
91
  required: ["id", "type", "name"]
@@ -111,6 +119,37 @@ import { z as z3 } from "zod";
111
119
 
112
120
  // src/v1/schema/definitions/body/common.ts
113
121
  import { z as z2 } from "zod";
122
+ var ModeExistence = z2.union([
123
+ z2.literal("edit:modeReal").describe(
124
+ "An indication that an entity or thing, such as a person, place or text, is understood to be part of lived or historical existence."
125
+ ),
126
+ z2.literal("edit:modeFictional").describe(
127
+ "An indication that an entity or a thing, such as a person, place or text, is invented or imagined."
128
+ ),
129
+ z2.literal("edit:modeIdentifiable").describe(
130
+ "An indication that an entity or a thing is understood as both existing and imagined, for instance a character in a work of literature that corresponds to a historical person or a place represented under another name that can be identified as a real place."
131
+ )
132
+ ]).describe("An indication of the state of being of an entity or thing (OED).");
133
+ var modeExistenceSchema = {
134
+ oneOf: [
135
+ {
136
+ type: "string",
137
+ const: "edit:modeReal",
138
+ description: "An indication that an entity or thing, such as a person, place or text, is understood to be part of lived or historical existence."
139
+ },
140
+ {
141
+ type: "string",
142
+ const: "edit:modeFictional",
143
+ description: "An indication that an entity or a thing, such as a person, place or text, is invented or imagined."
144
+ },
145
+ {
146
+ type: "string",
147
+ const: "edit:modeIdentifiable",
148
+ description: "An indication that an entity or a thing is understood as both existing and imagined, for instance a character in a work of literature that corresponds to a historical person or a place represented under another name that can be identified as a real place."
149
+ }
150
+ ],
151
+ description: "An indication of the state of being of an entity or thing (OED)."
152
+ };
114
153
  var labelDescription = "The title or name of a linked resource or named entity.";
115
154
  var Label = z2.string().min(1, { message: "The label cannot be empty" }).describe(labelDescription);
116
155
  var labelSchema = {
@@ -161,15 +200,13 @@ var citationSchema = {
161
200
  import { z as z4 } from "zod";
162
201
  var ConceptualObjectEntityType = z4.union([
163
202
  z4.literal("crm:E28_Conceptual_Object"),
164
- z4.tuple([
165
- z4.literal("crm:E28_Conceptual_Object"),
166
- z4.literal("wikidata:Q15831596").describe("Fictional Conceptual Object")
167
- ])
203
+ z4.tuple([z4.literal("crm:E28_Conceptual_Object"), z4.literal("wikidata:Q15831596")])
168
204
  ]);
169
205
  var ConceptualObject = z4.object({
170
206
  id: z4.string().url().describe(bodyIdDescription),
171
207
  entityType: ConceptualObjectEntityType,
172
208
  label: Label.optional(),
209
+ modeExistence: ModeExistence.optional(),
173
210
  description: Description.optional()
174
211
  }).describe("Conceptual Object");
175
212
  var conceptualObjectEntityTypeSchema = {
@@ -181,7 +218,7 @@ var conceptualObjectEntityTypeSchema = {
181
218
  maxItems: 2,
182
219
  items: [
183
220
  { type: "string", const: "crm:E28_Conceptual_Object" },
184
- { type: "string", const: "wikidata:Q15831596", description: "Fictional Conceptual Object" }
221
+ { type: "string", const: "wikidata:Q15831596" }
185
222
  ]
186
223
  }
187
224
  ]
@@ -193,9 +230,32 @@ var conceptualObjectSchema = {
193
230
  id: { type: "string", format: "uri", description: bodyIdDescription },
194
231
  entityType: conceptualObjectEntityTypeSchema,
195
232
  label: { $ref: "defs.jsonld#/definitions/label" },
233
+ modeExistence: { ...modeExistenceSchema, nullable: true },
196
234
  description: { $ref: "defs.jsonld#/definitions/description" }
197
235
  },
198
- required: ["id", "entityType"]
236
+ required: ["id", "entityType"],
237
+ allOf: [
238
+ {
239
+ if: {
240
+ type: "object",
241
+ properties: {
242
+ modeExistence: "edit:modeReal"
243
+ }
244
+ },
245
+ then: {
246
+ type: "object",
247
+ properties: {
248
+ entityType: "crm:E28_Conceptual_Object"
249
+ }
250
+ },
251
+ else: {
252
+ type: "object",
253
+ properties: {
254
+ entityType: ["crm:E28_Conceptual_Object", "wikidata:Q15831596"]
255
+ }
256
+ }
257
+ }
258
+ ]
199
259
  };
200
260
 
201
261
  // src/v1/schema/definitions/body/correction.ts
@@ -274,29 +334,27 @@ var dateSchema = {
274
334
 
275
335
  // src/v1/schema/definitions/body/event.ts
276
336
  import { z as z7 } from "zod";
277
- var EventEntityType = z7.tuple([
278
- z7.literal("YET TO BE DEFINED EVENT CLASS"),
279
- z7.union([
280
- z7.literal("crm:E5_Event").describe("Real Event"),
281
- z7.literal("crm:E89_Propositional_Object").describe("Fictional Event")
282
- ])
337
+ var EventEntityType = z7.union([
338
+ z7.literal("crm:E5_Event"),
339
+ z7.tuple([z7.literal("crm:E5_Event"), z7.literal("crm:E89_Propositional_Object")])
283
340
  ]);
284
341
  var Event = z7.object({
285
342
  id: z7.string().url().describe(bodyIdDescription),
286
343
  entityType: EventEntityType,
287
344
  label: Label.optional(),
345
+ modeExistence: ModeExistence.optional(),
288
346
  description: Description.optional()
289
347
  }).describe("Event");
290
348
  var eventEntityTypeSchema = {
291
- type: "array",
292
- minItems: 2,
293
- maxItems: 2,
294
- items: [
295
- { type: "string", const: "YET TO BE DEFINED EVENT CLASS" },
349
+ oneOf: [
350
+ { type: "string", const: "crm:E5_Event" },
296
351
  {
297
- oneOf: [
298
- { type: "string", const: "crm:E5_Event", description: "Real Event" },
299
- { type: "string", const: "crm:E89_Propositional_Object", description: "Fictional Event" }
352
+ type: "array",
353
+ minItems: 2,
354
+ maxItems: 2,
355
+ items: [
356
+ { type: "string", const: "crm:E5_Event" },
357
+ { type: "string", const: "crm:E89_Propositional_Object" }
300
358
  ]
301
359
  }
302
360
  ]
@@ -308,9 +366,32 @@ var eventSchema = {
308
366
  id: { type: "string", format: "uri", description: bodyIdDescription },
309
367
  entityType: eventEntityTypeSchema,
310
368
  label: { $ref: "defs.jsonld#/definitions/label" },
369
+ modeExistence: { ...modeExistenceSchema, nullable: true },
311
370
  description: { $ref: "defs.jsonld#/definitions/description" }
312
371
  },
313
- required: ["id", "entityType"]
372
+ required: ["id", "entityType"],
373
+ allOf: [
374
+ {
375
+ if: {
376
+ type: "object",
377
+ properties: {
378
+ modeExistence: "edit:modeReal"
379
+ }
380
+ },
381
+ then: {
382
+ type: "object",
383
+ properties: {
384
+ entityType: "crm:E5_Event"
385
+ }
386
+ },
387
+ else: {
388
+ type: "object",
389
+ properties: {
390
+ entityType: ["crm:E5_Event", "crm:E89_Propositional_Object"]
391
+ }
392
+ }
393
+ }
394
+ ]
314
395
  };
315
396
 
316
397
  // src/v1/schema/definitions/body/keyword.ts
@@ -439,33 +520,27 @@ var noteSchema = {
439
520
 
440
521
  // src/v1/schema/definitions/body/organization.ts
441
522
  import { z as z11 } from "zod";
442
- var OrganizationEntityType = z11.tuple([
443
- z11.literal("foaf:Organization"),
444
- z11.union([
445
- z11.literal("crm:E74_Group").describe("Real Organization"),
446
- z11.literal("crm:E89_Propositional_Object").describe("Fictional Organization")
447
- ])
523
+ var OrganizationEntityType = z11.union([
524
+ z11.literal("crm:E74_Group"),
525
+ z11.tuple([z11.literal("foaf:Organization"), z11.literal("crm:E89_Propositional_Object")])
448
526
  ]);
449
527
  var Organization = z11.object({
450
528
  id: z11.string().url().describe(bodyIdDescription),
451
529
  entityType: OrganizationEntityType,
452
530
  label: Label.optional(),
531
+ modeExistence: ModeExistence.optional(),
453
532
  description: Description.optional()
454
533
  }).describe("Organization");
455
534
  var organizationEntityTypeSchema = {
456
- type: "array",
457
- minItems: 2,
458
- maxItems: 2,
459
- items: [
460
- { type: "string", const: "foaf:Organization" },
535
+ oneOf: [
536
+ { type: "string", const: "crm:E74_Group" },
461
537
  {
462
- oneOf: [
463
- { type: "string", const: "crm:E74_Group", description: "Real Organization" },
464
- {
465
- type: "string",
466
- const: "crm:E89_Propositional_Object",
467
- description: "Fictional Organization"
468
- }
538
+ type: "array",
539
+ minItems: 2,
540
+ maxItems: 2,
541
+ items: [
542
+ { type: "string", const: "foaf:Organization" },
543
+ { type: "string", const: "crm:E89_Propositional_Object" }
469
544
  ]
470
545
  }
471
546
  ]
@@ -477,36 +552,57 @@ var organizationSchema = {
477
552
  id: { type: "string", format: "uri", description: bodyIdDescription },
478
553
  entityType: organizationEntityTypeSchema,
479
554
  label: { $ref: "defs.jsonld#/definitions/label" },
555
+ modeExistence: { ...modeExistenceSchema, nullable: true },
480
556
  description: { $ref: "defs.jsonld#/definitions/description" }
481
557
  },
482
- required: ["id", "entityType"]
558
+ required: ["id", "entityType"],
559
+ allOf: [
560
+ {
561
+ if: {
562
+ type: "object",
563
+ properties: {
564
+ modeExistence: "edit:modeReal"
565
+ }
566
+ },
567
+ then: {
568
+ type: "object",
569
+ properties: {
570
+ entityType: "crm:E74_Group"
571
+ }
572
+ },
573
+ else: {
574
+ type: "object",
575
+ properties: {
576
+ entityType: ["foaf:Organization", "crm:E89_Propositional_Object"]
577
+ }
578
+ }
579
+ }
580
+ ]
483
581
  };
484
582
 
485
583
  // src/v1/schema/definitions/body/person.ts
486
584
  import { z as z12 } from "zod";
487
- var PersonEntityType = z12.tuple([
488
- z12.literal("foaf:Person"),
489
- z12.union([
490
- z12.literal("crm:E21_Person").describe("Real Person"),
491
- z12.literal("crm:E89_Propositional_Object").describe("Fictional Person")
492
- ])
585
+ var PersonEntityType = z12.union([
586
+ z12.literal("crm:E21_Person"),
587
+ z12.tuple([z12.literal("foaf:Person"), z12.literal("crm:E89_Propositional_Object")])
493
588
  ]);
494
589
  var Person = z12.object({
495
590
  id: z12.string().url().describe(bodyIdDescription),
496
591
  entityType: PersonEntityType,
497
592
  label: Label.optional(),
593
+ modeExistence: ModeExistence.optional(),
498
594
  description: Description.optional()
499
595
  }).describe("Person");
500
596
  var personEntityTypeSchema = {
501
- type: "array",
502
- minItems: 2,
503
- maxItems: 2,
504
- items: [
505
- { type: "string", const: "foaf:Person" },
597
+ oneOf: [
598
+ { type: "string", const: "crm:E21_Person" },
506
599
  {
507
- oneOf: [
508
- { type: "string", const: "crm:E21_Person", description: "Real Person" },
509
- { type: "string", const: "crm:E89_Propositional_Object", description: "Fictional Person" }
600
+ type: "array",
601
+ minItems: 2,
602
+ maxItems: 2,
603
+ items: [
604
+ { type: "string", const: "foaf:Person" },
605
+ { type: "string", const: "crm:E89_Propositional_Object" }
510
606
  ]
511
607
  }
512
608
  ]
@@ -518,24 +614,45 @@ var personSchema = {
518
614
  id: { type: "string", format: "uri", description: bodyIdDescription },
519
615
  entityType: personEntityTypeSchema,
520
616
  label: { $ref: "defs.jsonld#/definitions/label" },
617
+ modeExistence: { ...modeExistenceSchema, nullable: true },
521
618
  description: { $ref: "defs.jsonld#/definitions/description" }
522
619
  },
523
- required: ["id", "entityType"]
620
+ required: ["id", "entityType"],
621
+ allOf: [
622
+ {
623
+ if: {
624
+ type: "object",
625
+ properties: {
626
+ modeExistence: "edit:modeReal"
627
+ }
628
+ },
629
+ then: {
630
+ type: "object",
631
+ properties: {
632
+ entityType: "crm:E21_Person"
633
+ }
634
+ },
635
+ else: {
636
+ type: "object",
637
+ properties: {
638
+ entityType: ["foaf:Person", "crm:E89_Propositional_Object"]
639
+ }
640
+ }
641
+ }
642
+ ]
524
643
  };
525
644
 
526
645
  // src/v1/schema/definitions/body/physicalThing.ts
527
646
  import { z as z13 } from "zod";
528
647
  var PhysicalThingEntityType = z13.union([
529
648
  z13.literal("crm:E18_Physical_Thing"),
530
- z13.tuple([
531
- z13.literal("crm:E18_Physical_Thing"),
532
- z13.literal("wikidata:Q15831596").describe("Fictional Physical Thing")
533
- ])
649
+ z13.tuple([z13.literal("crm:E18_Physical_Thing"), z13.literal("wikidata:Q15831596")])
534
650
  ]);
535
651
  var PhysicalThing = z13.object({
536
652
  id: z13.string().url().describe(bodyIdDescription),
537
653
  entityType: PhysicalThingEntityType,
538
654
  label: Label.optional(),
655
+ modeExistence: ModeExistence.optional(),
539
656
  description: Description.optional()
540
657
  }).describe("Physical Thing");
541
658
  var physicalThingEntityTypeSchema = {
@@ -547,7 +664,7 @@ var physicalThingEntityTypeSchema = {
547
664
  maxItems: 2,
548
665
  items: [
549
666
  { type: "string", const: "crm:E18_Physical_Thing" },
550
- { type: "string", const: "wikidata:Q15831596", description: "Fictional Physical Thing" }
667
+ { type: "string", const: "wikidata:Q15831596" }
551
668
  ]
552
669
  }
553
670
  ]
@@ -559,24 +676,45 @@ var physicalThingSchema = {
559
676
  id: { type: "string", format: "uri", description: bodyIdDescription },
560
677
  entityType: physicalThingEntityTypeSchema,
561
678
  label: { $ref: "defs.jsonld#/definitions/label" },
679
+ modeExistence: { ...modeExistenceSchema, nullable: true },
562
680
  description: { $ref: "defs.jsonld#/definitions/description" }
563
681
  },
564
- required: ["id", "entityType"]
682
+ required: ["id", "entityType"],
683
+ allOf: [
684
+ {
685
+ if: {
686
+ type: "object",
687
+ properties: {
688
+ modeExistence: "edit:modeReal"
689
+ }
690
+ },
691
+ then: {
692
+ type: "object",
693
+ properties: {
694
+ entityType: "crm:E18_Physical_Thing"
695
+ }
696
+ },
697
+ else: {
698
+ type: "object",
699
+ properties: {
700
+ entityType: ["crm:E18_Physical_Thing", "wikidata:Q15831596"]
701
+ }
702
+ }
703
+ }
704
+ ]
565
705
  };
566
706
 
567
707
  // src/v1/schema/definitions/body/place.ts
568
708
  import { z as z14 } from "zod";
569
709
  var PlaceEntityType = z14.union([
570
710
  z14.literal("cwrc:place"),
571
- z14.tuple([
572
- z14.literal("cwrc:place"),
573
- z14.literal("crm:E89_Propositional_Object").describe("Fictional Place")
574
- ])
711
+ z14.tuple([z14.literal("cwrc:place"), z14.literal("crm:E89_Propositional_Object")])
575
712
  ]);
576
713
  var Place = z14.object({
577
714
  id: z14.string().url().describe(bodyIdDescription),
578
715
  entityType: PlaceEntityType,
579
716
  label: Label.optional(),
717
+ modeExistence: ModeExistence.optional(),
580
718
  description: Description.optional()
581
719
  }).describe("Place");
582
720
  var placeEntityTypeSchema = {
@@ -588,7 +726,7 @@ var placeEntityTypeSchema = {
588
726
  maxItems: 2,
589
727
  items: [
590
728
  { type: "string", const: "cwrc:place" },
591
- { type: "string", const: "crm:E89_Propositional_Object", description: "Fictional Place" }
729
+ { type: "string", const: "crm:E89_Propositional_Object" }
592
730
  ]
593
731
  }
594
732
  ]
@@ -600,36 +738,57 @@ var placeSchema = {
600
738
  id: { type: "string", format: "uri", description: bodyIdDescription },
601
739
  entityType: placeEntityTypeSchema,
602
740
  label: { $ref: "defs.jsonld#/definitions/label" },
741
+ modeExistence: { ...modeExistenceSchema, nullable: true },
603
742
  description: { $ref: "defs.jsonld#/definitions/description" }
604
743
  },
605
- required: ["id", "entityType"]
744
+ required: ["id", "entityType"],
745
+ allOf: [
746
+ {
747
+ if: {
748
+ type: "object",
749
+ properties: {
750
+ modeExistence: "edit:modeReal"
751
+ }
752
+ },
753
+ then: {
754
+ type: "object",
755
+ properties: {
756
+ entityType: "cwrc:place"
757
+ }
758
+ },
759
+ else: {
760
+ type: "object",
761
+ properties: {
762
+ entityType: ["cwrc:place", "crm:E89_Propositional_Object"]
763
+ }
764
+ }
765
+ }
766
+ ]
606
767
  };
607
768
 
608
769
  // src/v1/schema/definitions/body/work.ts
609
770
  import { z as z15 } from "zod";
610
- var WorkEntityType = z15.tuple([
771
+ var WorkEntityType = z15.union([
611
772
  z15.literal("crm:E89_Propositional_Object"),
612
- z15.union([
613
- z15.literal("frbroo:F1").describe("Real Work"),
614
- z15.literal("wikidata:Q15306849").describe("Fictional Work")
615
- ])
773
+ z15.tuple([z15.literal("frbroo:F1"), z15.literal("wikidata:Q15306849")])
616
774
  ]);
617
775
  var Work = z15.object({
618
776
  id: z15.string().url().describe(bodyIdDescription),
619
777
  entityType: WorkEntityType,
620
778
  label: Label.optional(),
779
+ modeExistence: ModeExistence.optional(),
621
780
  description: Description.optional()
622
781
  }).describe("Work");
623
782
  var workEntityTypeSchema = {
624
- type: "array",
625
- minItems: 2,
626
- maxItems: 2,
627
- items: [
783
+ oneOf: [
628
784
  { type: "string", const: "crm:E89_Propositional_Object" },
629
785
  {
630
- oneOf: [
631
- { type: "string", const: "frbroo:F1", description: "Real Work" },
632
- { type: "string", const: "wikidata:Q15306849", description: "Fictional Work" }
786
+ type: "array",
787
+ minItems: 2,
788
+ maxItems: 2,
789
+ items: [
790
+ { type: "string", const: "frbroo:F1" },
791
+ { type: "string", const: "wikidata:Q15306849" }
633
792
  ]
634
793
  }
635
794
  ]
@@ -641,9 +800,32 @@ var workSchema = {
641
800
  id: { type: "string", format: "uri", description: bodyIdDescription },
642
801
  entityType: workEntityTypeSchema,
643
802
  label: { $ref: "defs.jsonld#/definitions/label" },
803
+ modeExistence: { ...modeExistenceSchema, nullable: true },
644
804
  description: { $ref: "defs.jsonld#/definitions/description" }
645
805
  },
646
- required: ["id", "entityType"]
806
+ required: ["id", "entityType"],
807
+ allOf: [
808
+ {
809
+ if: {
810
+ type: "object",
811
+ properties: {
812
+ modeExistence: "edit:modeReal"
813
+ }
814
+ },
815
+ then: {
816
+ type: "object",
817
+ properties: {
818
+ entityType: "crm:E89_Propositional_Object"
819
+ }
820
+ },
821
+ else: {
822
+ type: "object",
823
+ properties: {
824
+ entityType: ["frbroo:F1", "wikidata:Q15306849"]
825
+ }
826
+ }
827
+ }
828
+ ]
647
829
  };
648
830
 
649
831
  // src/v1/schema/definitions/body/choice.ts
@@ -735,6 +917,7 @@ var Body = z17.object({
735
917
  additionalType: z17.union([z17.string(), z17.string().array()]).nullish().describe("Extra types that refines the body"),
736
918
  value: z17.string().describe("The value of the body").optional(),
737
919
  label: Label.optional(),
920
+ modeExistence: ModeExistence.optional(),
738
921
  description: Description.optional()
739
922
  }).describe("Web Annotation Body");
740
923
  var bodySchema = {
@@ -749,6 +932,7 @@ var bodySchema = {
749
932
  },
750
933
  value: { type: "string" },
751
934
  label: labelSchema,
935
+ modeExistence: modeExistenceSchema,
752
936
  description: descriptionSchema
753
937
  },
754
938
  required: ["id", "entityType"],
@@ -1343,69 +1527,40 @@ var definitionSchema = {
1343
1527
  };
1344
1528
 
1345
1529
  // src/v1/schema/root.ts
1346
- import { z as z27 } from "zod";
1347
-
1348
- // src/v1/schema/definitions/motivation.ts
1349
1530
  import { z as z26 } from "zod";
1350
- var MotivationInstance = z26.union([
1351
- z26.literal("identifying"),
1352
- z26.literal("describing"),
1353
- z26.literal("correcting"),
1354
- z26.literal("tagging"),
1355
- z26.literal("classifying"),
1356
- z26.literal("linking"),
1357
- z26.literal("citing")
1358
- ]);
1359
- var MotivationType = z26.object({
1360
- type: z26.literal("crm:E55_Type")
1361
- });
1362
- var Motivation = z26.record(MotivationInstance, MotivationType).describe("The relationship between an Annotation and a Motivation.");
1363
- var motivationType = {
1364
- type: "object",
1365
- properties: {
1366
- type: { type: "string", const: "crm:E55_Type" }
1367
- },
1368
- required: ["type"]
1369
- };
1370
- var motivationSchema = {
1371
- type: "object",
1372
- description: "The relationship between an Annotation and a Motivation.",
1373
- properties: {
1374
- identifying: { ...motivationType, nullable: true },
1375
- describing: { ...motivationType, nullable: true },
1376
- correcting: { ...motivationType, nullable: true },
1377
- tagging: { ...motivationType, nullable: true },
1378
- classifying: { ...motivationType, nullable: true },
1379
- linking: { ...motivationType, nullable: true },
1380
- citing: { ...motivationType, nullable: true }
1381
- }
1382
- };
1383
-
1384
- // src/v1/schema/root.ts
1385
1531
  var Status = ["edit:statusDraft", "edit:statusApproved", "edit:statusPublished"];
1386
- var WebAnnotation = z27.object({
1387
- "@context": z27.tuple([
1388
- z27.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
1389
- z27.literal(contextUri).describe("LINCS Web Annotation Context.")
1532
+ var Motivation = [
1533
+ "oa:identifying",
1534
+ "oa:describing",
1535
+ "correcting",
1536
+ "oa:tagging",
1537
+ "oa:classifying",
1538
+ "oa:linking",
1539
+ "citing"
1540
+ ];
1541
+ var WebAnnotation = z26.object({
1542
+ "@context": z26.tuple([
1543
+ z26.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
1544
+ z26.literal(contextUri).describe("LINCS Web Annotation Context.")
1390
1545
  ]).describe(
1391
1546
  "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."
1392
1547
  ),
1393
- id: z27.string().url().describe("The identity of the Annotation."),
1394
- type: z27.tuple([z27.literal("Annotation"), z27.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
1395
- motivation: Motivation,
1396
- created: z27.string().datetime().describe("The time at which the resource was created."),
1397
- modified: z27.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
1548
+ id: z26.string().url().describe("The identity of the Annotation."),
1549
+ type: z26.tuple([z26.literal("Annotation"), z26.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
1550
+ motivation: z26.enum(Motivation).describe("The relationship between an Annotation and a Motivation."),
1551
+ created: z26.string().datetime().describe("The time at which the resource was created."),
1552
+ modified: z26.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
1398
1553
  creator: User.describe("The agent responsible for creating the resource.").optional(),
1399
- contributor: z27.array(User.describe("The agents responsible for modifying the resource.")).nonempty().optional().describe("The agents responsible for modifying the resource."),
1554
+ contributor: z26.array(User.describe("The agents responsible for modifying the resource.")).nonempty().optional().describe("The agents responsible for modifying the resource."),
1400
1555
  generator: Software.describe(
1401
1556
  "The agent responsible for generating the serialization of the Annotation. "
1402
1557
  ),
1403
1558
  target: Target.describe("The relationship between an Annotation and its Target."),
1404
- body: z27.union([BodyChoice, Body, z27.array(Body)]).describe("The relationship between an Annotation and its Body."),
1559
+ body: z26.union([BodyChoice, Body, z26.array(Body)]).describe("The relationship between an Annotation and its Body."),
1405
1560
  certainty: Certainty.optional(),
1406
1561
  precision: Precision.optional(),
1407
- label: z27.string().min(1, { message: "The label cannot be empty" }).optional().describe("The descriptive label for the annotation"),
1408
- status: z27.enum(Status).describe("The status of this annotation in a workflow.")
1562
+ label: z26.string().min(1, { message: "The label cannot be empty" }).optional().describe("The descriptive label for the annotation"),
1563
+ status: z26.enum(Status).describe("The status of this annotation in a workflow.").optional()
1409
1564
  }).describe("Web Annotation Root");
1410
1565
  var webAnnotationSchema = {
1411
1566
  $id: schemaId,
@@ -1437,7 +1592,11 @@ var webAnnotationSchema = {
1437
1592
  ],
1438
1593
  description: "The type of the Annotation."
1439
1594
  },
1440
- motivation: motivationSchema,
1595
+ motivation: {
1596
+ type: "string",
1597
+ enum: Motivation,
1598
+ description: "The relationship between an Annotation and a Motivation."
1599
+ },
1441
1600
  created: {
1442
1601
  type: "string",
1443
1602
  format: "date-time",
@@ -1475,17 +1634,7 @@ var webAnnotationSchema = {
1475
1634
  label: { type: "string" },
1476
1635
  status: { type: "string", enum: Status }
1477
1636
  },
1478
- required: [
1479
- "@context",
1480
- "id",
1481
- "type",
1482
- "motivation",
1483
- "created",
1484
- "generator",
1485
- "target",
1486
- "body",
1487
- "status"
1488
- ],
1637
+ required: ["@context", "id", "type", "motivation", "created", "generator", "target", "body"],
1489
1638
  additionalProperties: false,
1490
1639
  allOf: [
1491
1640
  {
@@ -1514,17 +1663,7 @@ var webAnnotationSchema = {
1514
1663
  then: {
1515
1664
  type: "object",
1516
1665
  properties: {
1517
- motivation: {
1518
- type: "object",
1519
- properties: {
1520
- identifying: {
1521
- type: "object",
1522
- properties: {
1523
- type: { type: "string", const: "crm:E55_Type" }
1524
- }
1525
- }
1526
- }
1527
- }
1666
+ motivation: { type: "string", const: "oa:identifying" }
1528
1667
  }
1529
1668
  },
1530
1669
  else: {
@@ -1542,17 +1681,7 @@ var webAnnotationSchema = {
1542
1681
  then: {
1543
1682
  type: "object",
1544
1683
  properties: {
1545
- motivation: {
1546
- type: "object",
1547
- properties: {
1548
- describing: {
1549
- type: "object",
1550
- properties: {
1551
- type: { type: "string", const: "crm:E55_Type" }
1552
- }
1553
- }
1554
- }
1555
- }
1684
+ motivation: { type: "string", const: "oa:describing" }
1556
1685
  }
1557
1686
  },
1558
1687
  else: {
@@ -1570,17 +1699,7 @@ var webAnnotationSchema = {
1570
1699
  then: {
1571
1700
  type: "object",
1572
1701
  properties: {
1573
- motivation: {
1574
- type: "object",
1575
- properties: {
1576
- correcting: {
1577
- type: "object",
1578
- properties: {
1579
- type: { type: "string", const: "crm:E55_Type" }
1580
- }
1581
- }
1582
- }
1583
- }
1702
+ motivation: { type: "string", const: "correcting" }
1584
1703
  }
1585
1704
  },
1586
1705
  else: {
@@ -1598,17 +1717,7 @@ var webAnnotationSchema = {
1598
1717
  then: {
1599
1718
  type: "object",
1600
1719
  properties: {
1601
- motivation: {
1602
- type: "object",
1603
- properties: {
1604
- tagging: {
1605
- type: "object",
1606
- properties: {
1607
- type: { type: "string", const: "crm:E55_Type" }
1608
- }
1609
- }
1610
- }
1611
- }
1720
+ motivation: { type: "string", const: "oa:tagging" }
1612
1721
  }
1613
1722
  },
1614
1723
  else: {
@@ -1626,17 +1735,7 @@ var webAnnotationSchema = {
1626
1735
  then: {
1627
1736
  type: "object",
1628
1737
  properties: {
1629
- motivation: {
1630
- type: "object",
1631
- properties: {
1632
- classifying: {
1633
- type: "object",
1634
- properties: {
1635
- type: { type: "string", const: "crm:E55_Type" }
1636
- }
1637
- }
1638
- }
1639
- }
1738
+ motivation: { type: "string", const: "oa:classifying" }
1640
1739
  }
1641
1740
  },
1642
1741
  else: {
@@ -1654,17 +1753,7 @@ var webAnnotationSchema = {
1654
1753
  then: {
1655
1754
  type: "object",
1656
1755
  properties: {
1657
- motivation: {
1658
- type: "object",
1659
- properties: {
1660
- linking: {
1661
- type: "object",
1662
- properties: {
1663
- type: { type: "string", const: "crm:E55_Type" }
1664
- }
1665
- }
1666
- }
1667
- }
1756
+ motivation: { type: "string", const: "oa:linking" }
1668
1757
  }
1669
1758
  },
1670
1759
  else: {
@@ -1682,17 +1771,7 @@ var webAnnotationSchema = {
1682
1771
  then: {
1683
1772
  type: "object",
1684
1773
  properties: {
1685
- motivation: {
1686
- type: "object",
1687
- properties: {
1688
- citing: {
1689
- type: "object",
1690
- properties: {
1691
- type: { type: "string", const: "crm:E55_Type" }
1692
- }
1693
- }
1694
- }
1695
- }
1774
+ motivation: { type: "string", const: "citing" }
1696
1775
  }
1697
1776
  }
1698
1777
  }
@@ -1711,18 +1790,18 @@ import Ajv from "ajv";
1711
1790
  import addFormats from "ajv-formats";
1712
1791
 
1713
1792
  // src/v1/validator/types.ts
1714
- import { z as z28 } from "zod";
1715
- var ValidationError = z28.object({
1716
- message: z28.string(),
1717
- path: z28.string(),
1718
- suggestion: z28.string().optional(),
1719
- context: z28.object({
1720
- errorType: z28.string()
1721
- }).and(z28.unknown())
1793
+ import { z as z27 } from "zod";
1794
+ var ValidationError = z27.object({
1795
+ message: z27.string(),
1796
+ path: z27.string(),
1797
+ suggestion: z27.string().optional(),
1798
+ context: z27.object({
1799
+ errorType: z27.string()
1800
+ }).and(z27.unknown())
1722
1801
  });
1723
- var ValidateResult = z28.object({
1724
- valid: z28.boolean(),
1725
- errors: z28.array(ValidationError).optional()
1802
+ var ValidateResult = z27.object({
1803
+ valid: z27.boolean(),
1804
+ errors: z27.array(ValidationError).optional()
1726
1805
  });
1727
1806
 
1728
1807
  // src/v1/validator/index.ts
@@ -1777,6 +1856,7 @@ __export(v1_exports, {
1777
1856
  KeywordFolksnomyEntityType: () => KeywordFolksnomyEntityType,
1778
1857
  Link: () => Link,
1779
1858
  LinkEntityType: () => LinkEntityType,
1859
+ Motivation: () => Motivation,
1780
1860
  Note: () => Note,
1781
1861
  NoteEntityType: () => NoteEntityType,
1782
1862
  Organization: () => Organization,
@@ -1892,6 +1972,7 @@ export {
1892
1972
  KeywordFolksnomyEntityType,
1893
1973
  Link,
1894
1974
  LinkEntityType,
1975
+ Motivation,
1895
1976
  Note,
1896
1977
  NoteEntityType,
1897
1978
  Organization,