@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.js CHANGED
@@ -52,6 +52,7 @@ __export(src_exports, {
52
52
  KeywordFolksnomyEntityType: () => KeywordFolksnomyEntityType,
53
53
  Link: () => Link,
54
54
  LinkEntityType: () => LinkEntityType,
55
+ Motivation: () => Motivation,
55
56
  Note: () => Note,
56
57
  NoteEntityType: () => NoteEntityType,
57
58
  Organization: () => Organization,
@@ -165,35 +166,51 @@ var schemaContext = {
165
166
  wikidata: "http://www.wikidata.org/entity/",
166
167
  crm: "http://www.cidoc-crm.org/cidoc-crm/",
167
168
  crmdig: "http://www.ics.forth.gr/isl/CRMdig/",
168
- additionalType: {
169
+ citing: "edit:citing",
170
+ correcting: "edit:correcting",
171
+ "oa:identifying": {
172
+ type: "crm:E55_Type"
173
+ },
174
+ "oa:describing": {
175
+ type: "crm:E55_Type"
176
+ },
177
+ "oa:tagging": {
178
+ type: "crm:E55_Type"
179
+ },
180
+ "oa:classifying": {
181
+ type: "crm:E55_Type"
182
+ },
183
+ "oa:linking": {
184
+ type: "crm:E55_Type"
185
+ },
186
+ certainty: {
169
187
  "@type": "@id",
170
188
  "@id": "crm:P2_has_type"
171
189
  },
172
- certainty: {
190
+ precision: {
173
191
  "@type": "@id",
174
192
  "@id": "crm:P2_has_type"
175
193
  },
176
194
  contributor: "dcterms:contributor",
177
- description: "rdfs:comment",
178
195
  entityType: {
179
196
  "@type": "@id",
180
197
  "@id": "rdf:type"
181
198
  },
182
- identifiedBy: "crm:P1_is_identified_by",
183
- precision: {
199
+ additionalType: {
184
200
  "@type": "@id",
185
201
  "@id": "crm:P2_has_type"
186
202
  },
203
+ modeExistence: "edit:ModeExistence",
204
+ description: "rdfs:comment",
205
+ identifiedBy: "crm:P1_is_identified_by",
206
+ title: "crm:P190_has_symbolic_content",
207
+ usedSpecificObject: "crm:P16_used_specific_object",
187
208
  softwareVersion: "schema:softwareVersion",
188
209
  status: {
189
210
  "@type": "@id",
190
211
  "@id": "crm:P2_has_type"
191
212
  },
192
- title: "crm:P190_has_symbolic_content",
193
- usedSpecificObject: "crm:P16_used_specific_object",
194
213
  approved: "edit:statusApproved",
195
- citing: "edit:citing",
196
- correcting: "edit:correcting",
197
214
  draft: "edit:statusDraft",
198
215
  published: "edit:statusPublished"
199
216
  }
@@ -204,7 +221,7 @@ var import_zod = require("zod");
204
221
  var userIdDescription = "The IRI that identifies the agent (Creator or Contributor).";
205
222
  var User = import_zod.z.object({
206
223
  id: import_zod.z.string().url().describe(userIdDescription),
207
- type: import_zod.z.tuple([import_zod.z.literal("foaf:Person"), import_zod.z.literal("crm:E21_Person")]).describe("The type of the Agent."),
224
+ type: import_zod.z.literal("crm:E21_Person").describe("The type of the Agent."),
208
225
  name: import_zod.z.string().min(1, { message: "Cannot be empty" }).describe("The name of the agent.")
209
226
  }).describe("Human Agent");
210
227
  var creatorSchema = {
@@ -212,15 +229,7 @@ var creatorSchema = {
212
229
  description: "Software Agent",
213
230
  properties: {
214
231
  id: { type: "string", format: "uri", description: userIdDescription },
215
- type: {
216
- type: "array",
217
- minItems: 2,
218
- maxItems: 2,
219
- items: [
220
- { type: "string", const: "foaf:Person" },
221
- { type: "string", const: "crm:E21_Person" }
222
- ]
223
- },
232
+ type: { type: "string", const: "crm:E21_Person" },
224
233
  name: { type: "string", minLength: 1, description: "The name of the agent." }
225
234
  },
226
235
  required: ["id", "type", "name"]
@@ -254,6 +263,37 @@ var import_zod3 = require("zod");
254
263
 
255
264
  // src/v1/schema/definitions/body/common.ts
256
265
  var import_zod2 = require("zod");
266
+ var ModeExistence = import_zod2.z.union([
267
+ import_zod2.z.literal("edit:modeReal").describe(
268
+ "An indication that an entity or thing, such as a person, place or text, is understood to be part of lived or historical existence."
269
+ ),
270
+ import_zod2.z.literal("edit:modeFictional").describe(
271
+ "An indication that an entity or a thing, such as a person, place or text, is invented or imagined."
272
+ ),
273
+ import_zod2.z.literal("edit:modeIdentifiable").describe(
274
+ "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."
275
+ )
276
+ ]).describe("An indication of the state of being of an entity or thing (OED).");
277
+ var modeExistenceSchema = {
278
+ oneOf: [
279
+ {
280
+ type: "string",
281
+ const: "edit:modeReal",
282
+ 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."
283
+ },
284
+ {
285
+ type: "string",
286
+ const: "edit:modeFictional",
287
+ description: "An indication that an entity or a thing, such as a person, place or text, is invented or imagined."
288
+ },
289
+ {
290
+ type: "string",
291
+ const: "edit:modeIdentifiable",
292
+ 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."
293
+ }
294
+ ],
295
+ description: "An indication of the state of being of an entity or thing (OED)."
296
+ };
257
297
  var labelDescription = "The title or name of a linked resource or named entity.";
258
298
  var Label = import_zod2.z.string().min(1, { message: "The label cannot be empty" }).describe(labelDescription);
259
299
  var labelSchema = {
@@ -304,15 +344,13 @@ var citationSchema = {
304
344
  var import_zod4 = require("zod");
305
345
  var ConceptualObjectEntityType = import_zod4.z.union([
306
346
  import_zod4.z.literal("crm:E28_Conceptual_Object"),
307
- import_zod4.z.tuple([
308
- import_zod4.z.literal("crm:E28_Conceptual_Object"),
309
- import_zod4.z.literal("wikidata:Q15831596").describe("Fictional Conceptual Object")
310
- ])
347
+ import_zod4.z.tuple([import_zod4.z.literal("crm:E28_Conceptual_Object"), import_zod4.z.literal("wikidata:Q15831596")])
311
348
  ]);
312
349
  var ConceptualObject = import_zod4.z.object({
313
350
  id: import_zod4.z.string().url().describe(bodyIdDescription),
314
351
  entityType: ConceptualObjectEntityType,
315
352
  label: Label.optional(),
353
+ modeExistence: ModeExistence.optional(),
316
354
  description: Description.optional()
317
355
  }).describe("Conceptual Object");
318
356
  var conceptualObjectEntityTypeSchema = {
@@ -324,7 +362,7 @@ var conceptualObjectEntityTypeSchema = {
324
362
  maxItems: 2,
325
363
  items: [
326
364
  { type: "string", const: "crm:E28_Conceptual_Object" },
327
- { type: "string", const: "wikidata:Q15831596", description: "Fictional Conceptual Object" }
365
+ { type: "string", const: "wikidata:Q15831596" }
328
366
  ]
329
367
  }
330
368
  ]
@@ -336,9 +374,32 @@ var conceptualObjectSchema = {
336
374
  id: { type: "string", format: "uri", description: bodyIdDescription },
337
375
  entityType: conceptualObjectEntityTypeSchema,
338
376
  label: { $ref: "defs.jsonld#/definitions/label" },
377
+ modeExistence: { ...modeExistenceSchema, nullable: true },
339
378
  description: { $ref: "defs.jsonld#/definitions/description" }
340
379
  },
341
- required: ["id", "entityType"]
380
+ required: ["id", "entityType"],
381
+ allOf: [
382
+ {
383
+ if: {
384
+ type: "object",
385
+ properties: {
386
+ modeExistence: "edit:modeReal"
387
+ }
388
+ },
389
+ then: {
390
+ type: "object",
391
+ properties: {
392
+ entityType: "crm:E28_Conceptual_Object"
393
+ }
394
+ },
395
+ else: {
396
+ type: "object",
397
+ properties: {
398
+ entityType: ["crm:E28_Conceptual_Object", "wikidata:Q15831596"]
399
+ }
400
+ }
401
+ }
402
+ ]
342
403
  };
343
404
 
344
405
  // src/v1/schema/definitions/body/correction.ts
@@ -417,29 +478,27 @@ var dateSchema = {
417
478
 
418
479
  // src/v1/schema/definitions/body/event.ts
419
480
  var import_zod7 = require("zod");
420
- var EventEntityType = import_zod7.z.tuple([
421
- import_zod7.z.literal("YET TO BE DEFINED EVENT CLASS"),
422
- import_zod7.z.union([
423
- import_zod7.z.literal("crm:E5_Event").describe("Real Event"),
424
- import_zod7.z.literal("crm:E89_Propositional_Object").describe("Fictional Event")
425
- ])
481
+ var EventEntityType = import_zod7.z.union([
482
+ import_zod7.z.literal("crm:E5_Event"),
483
+ import_zod7.z.tuple([import_zod7.z.literal("crm:E5_Event"), import_zod7.z.literal("crm:E89_Propositional_Object")])
426
484
  ]);
427
485
  var Event = import_zod7.z.object({
428
486
  id: import_zod7.z.string().url().describe(bodyIdDescription),
429
487
  entityType: EventEntityType,
430
488
  label: Label.optional(),
489
+ modeExistence: ModeExistence.optional(),
431
490
  description: Description.optional()
432
491
  }).describe("Event");
433
492
  var eventEntityTypeSchema = {
434
- type: "array",
435
- minItems: 2,
436
- maxItems: 2,
437
- items: [
438
- { type: "string", const: "YET TO BE DEFINED EVENT CLASS" },
493
+ oneOf: [
494
+ { type: "string", const: "crm:E5_Event" },
439
495
  {
440
- oneOf: [
441
- { type: "string", const: "crm:E5_Event", description: "Real Event" },
442
- { type: "string", const: "crm:E89_Propositional_Object", description: "Fictional Event" }
496
+ type: "array",
497
+ minItems: 2,
498
+ maxItems: 2,
499
+ items: [
500
+ { type: "string", const: "crm:E5_Event" },
501
+ { type: "string", const: "crm:E89_Propositional_Object" }
443
502
  ]
444
503
  }
445
504
  ]
@@ -451,9 +510,32 @@ var eventSchema = {
451
510
  id: { type: "string", format: "uri", description: bodyIdDescription },
452
511
  entityType: eventEntityTypeSchema,
453
512
  label: { $ref: "defs.jsonld#/definitions/label" },
513
+ modeExistence: { ...modeExistenceSchema, nullable: true },
454
514
  description: { $ref: "defs.jsonld#/definitions/description" }
455
515
  },
456
- required: ["id", "entityType"]
516
+ required: ["id", "entityType"],
517
+ allOf: [
518
+ {
519
+ if: {
520
+ type: "object",
521
+ properties: {
522
+ modeExistence: "edit:modeReal"
523
+ }
524
+ },
525
+ then: {
526
+ type: "object",
527
+ properties: {
528
+ entityType: "crm:E5_Event"
529
+ }
530
+ },
531
+ else: {
532
+ type: "object",
533
+ properties: {
534
+ entityType: ["crm:E5_Event", "crm:E89_Propositional_Object"]
535
+ }
536
+ }
537
+ }
538
+ ]
457
539
  };
458
540
 
459
541
  // src/v1/schema/definitions/body/keyword.ts
@@ -582,33 +664,27 @@ var noteSchema = {
582
664
 
583
665
  // src/v1/schema/definitions/body/organization.ts
584
666
  var import_zod11 = require("zod");
585
- var OrganizationEntityType = import_zod11.z.tuple([
586
- import_zod11.z.literal("foaf:Organization"),
587
- import_zod11.z.union([
588
- import_zod11.z.literal("crm:E74_Group").describe("Real Organization"),
589
- import_zod11.z.literal("crm:E89_Propositional_Object").describe("Fictional Organization")
590
- ])
667
+ var OrganizationEntityType = import_zod11.z.union([
668
+ import_zod11.z.literal("crm:E74_Group"),
669
+ import_zod11.z.tuple([import_zod11.z.literal("foaf:Organization"), import_zod11.z.literal("crm:E89_Propositional_Object")])
591
670
  ]);
592
671
  var Organization = import_zod11.z.object({
593
672
  id: import_zod11.z.string().url().describe(bodyIdDescription),
594
673
  entityType: OrganizationEntityType,
595
674
  label: Label.optional(),
675
+ modeExistence: ModeExistence.optional(),
596
676
  description: Description.optional()
597
677
  }).describe("Organization");
598
678
  var organizationEntityTypeSchema = {
599
- type: "array",
600
- minItems: 2,
601
- maxItems: 2,
602
- items: [
603
- { type: "string", const: "foaf:Organization" },
679
+ oneOf: [
680
+ { type: "string", const: "crm:E74_Group" },
604
681
  {
605
- oneOf: [
606
- { type: "string", const: "crm:E74_Group", description: "Real Organization" },
607
- {
608
- type: "string",
609
- const: "crm:E89_Propositional_Object",
610
- description: "Fictional Organization"
611
- }
682
+ type: "array",
683
+ minItems: 2,
684
+ maxItems: 2,
685
+ items: [
686
+ { type: "string", const: "foaf:Organization" },
687
+ { type: "string", const: "crm:E89_Propositional_Object" }
612
688
  ]
613
689
  }
614
690
  ]
@@ -620,36 +696,57 @@ var organizationSchema = {
620
696
  id: { type: "string", format: "uri", description: bodyIdDescription },
621
697
  entityType: organizationEntityTypeSchema,
622
698
  label: { $ref: "defs.jsonld#/definitions/label" },
699
+ modeExistence: { ...modeExistenceSchema, nullable: true },
623
700
  description: { $ref: "defs.jsonld#/definitions/description" }
624
701
  },
625
- required: ["id", "entityType"]
702
+ required: ["id", "entityType"],
703
+ allOf: [
704
+ {
705
+ if: {
706
+ type: "object",
707
+ properties: {
708
+ modeExistence: "edit:modeReal"
709
+ }
710
+ },
711
+ then: {
712
+ type: "object",
713
+ properties: {
714
+ entityType: "crm:E74_Group"
715
+ }
716
+ },
717
+ else: {
718
+ type: "object",
719
+ properties: {
720
+ entityType: ["foaf:Organization", "crm:E89_Propositional_Object"]
721
+ }
722
+ }
723
+ }
724
+ ]
626
725
  };
627
726
 
628
727
  // src/v1/schema/definitions/body/person.ts
629
728
  var import_zod12 = require("zod");
630
- var PersonEntityType = import_zod12.z.tuple([
631
- import_zod12.z.literal("foaf:Person"),
632
- import_zod12.z.union([
633
- import_zod12.z.literal("crm:E21_Person").describe("Real Person"),
634
- import_zod12.z.literal("crm:E89_Propositional_Object").describe("Fictional Person")
635
- ])
729
+ var PersonEntityType = import_zod12.z.union([
730
+ import_zod12.z.literal("crm:E21_Person"),
731
+ import_zod12.z.tuple([import_zod12.z.literal("foaf:Person"), import_zod12.z.literal("crm:E89_Propositional_Object")])
636
732
  ]);
637
733
  var Person = import_zod12.z.object({
638
734
  id: import_zod12.z.string().url().describe(bodyIdDescription),
639
735
  entityType: PersonEntityType,
640
736
  label: Label.optional(),
737
+ modeExistence: ModeExistence.optional(),
641
738
  description: Description.optional()
642
739
  }).describe("Person");
643
740
  var personEntityTypeSchema = {
644
- type: "array",
645
- minItems: 2,
646
- maxItems: 2,
647
- items: [
648
- { type: "string", const: "foaf:Person" },
741
+ oneOf: [
742
+ { type: "string", const: "crm:E21_Person" },
649
743
  {
650
- oneOf: [
651
- { type: "string", const: "crm:E21_Person", description: "Real Person" },
652
- { type: "string", const: "crm:E89_Propositional_Object", description: "Fictional Person" }
744
+ type: "array",
745
+ minItems: 2,
746
+ maxItems: 2,
747
+ items: [
748
+ { type: "string", const: "foaf:Person" },
749
+ { type: "string", const: "crm:E89_Propositional_Object" }
653
750
  ]
654
751
  }
655
752
  ]
@@ -661,24 +758,45 @@ var personSchema = {
661
758
  id: { type: "string", format: "uri", description: bodyIdDescription },
662
759
  entityType: personEntityTypeSchema,
663
760
  label: { $ref: "defs.jsonld#/definitions/label" },
761
+ modeExistence: { ...modeExistenceSchema, nullable: true },
664
762
  description: { $ref: "defs.jsonld#/definitions/description" }
665
763
  },
666
- required: ["id", "entityType"]
764
+ required: ["id", "entityType"],
765
+ allOf: [
766
+ {
767
+ if: {
768
+ type: "object",
769
+ properties: {
770
+ modeExistence: "edit:modeReal"
771
+ }
772
+ },
773
+ then: {
774
+ type: "object",
775
+ properties: {
776
+ entityType: "crm:E21_Person"
777
+ }
778
+ },
779
+ else: {
780
+ type: "object",
781
+ properties: {
782
+ entityType: ["foaf:Person", "crm:E89_Propositional_Object"]
783
+ }
784
+ }
785
+ }
786
+ ]
667
787
  };
668
788
 
669
789
  // src/v1/schema/definitions/body/physicalThing.ts
670
790
  var import_zod13 = require("zod");
671
791
  var PhysicalThingEntityType = import_zod13.z.union([
672
792
  import_zod13.z.literal("crm:E18_Physical_Thing"),
673
- import_zod13.z.tuple([
674
- import_zod13.z.literal("crm:E18_Physical_Thing"),
675
- import_zod13.z.literal("wikidata:Q15831596").describe("Fictional Physical Thing")
676
- ])
793
+ import_zod13.z.tuple([import_zod13.z.literal("crm:E18_Physical_Thing"), import_zod13.z.literal("wikidata:Q15831596")])
677
794
  ]);
678
795
  var PhysicalThing = import_zod13.z.object({
679
796
  id: import_zod13.z.string().url().describe(bodyIdDescription),
680
797
  entityType: PhysicalThingEntityType,
681
798
  label: Label.optional(),
799
+ modeExistence: ModeExistence.optional(),
682
800
  description: Description.optional()
683
801
  }).describe("Physical Thing");
684
802
  var physicalThingEntityTypeSchema = {
@@ -690,7 +808,7 @@ var physicalThingEntityTypeSchema = {
690
808
  maxItems: 2,
691
809
  items: [
692
810
  { type: "string", const: "crm:E18_Physical_Thing" },
693
- { type: "string", const: "wikidata:Q15831596", description: "Fictional Physical Thing" }
811
+ { type: "string", const: "wikidata:Q15831596" }
694
812
  ]
695
813
  }
696
814
  ]
@@ -702,24 +820,45 @@ var physicalThingSchema = {
702
820
  id: { type: "string", format: "uri", description: bodyIdDescription },
703
821
  entityType: physicalThingEntityTypeSchema,
704
822
  label: { $ref: "defs.jsonld#/definitions/label" },
823
+ modeExistence: { ...modeExistenceSchema, nullable: true },
705
824
  description: { $ref: "defs.jsonld#/definitions/description" }
706
825
  },
707
- required: ["id", "entityType"]
826
+ required: ["id", "entityType"],
827
+ allOf: [
828
+ {
829
+ if: {
830
+ type: "object",
831
+ properties: {
832
+ modeExistence: "edit:modeReal"
833
+ }
834
+ },
835
+ then: {
836
+ type: "object",
837
+ properties: {
838
+ entityType: "crm:E18_Physical_Thing"
839
+ }
840
+ },
841
+ else: {
842
+ type: "object",
843
+ properties: {
844
+ entityType: ["crm:E18_Physical_Thing", "wikidata:Q15831596"]
845
+ }
846
+ }
847
+ }
848
+ ]
708
849
  };
709
850
 
710
851
  // src/v1/schema/definitions/body/place.ts
711
852
  var import_zod14 = require("zod");
712
853
  var PlaceEntityType = import_zod14.z.union([
713
854
  import_zod14.z.literal("cwrc:place"),
714
- import_zod14.z.tuple([
715
- import_zod14.z.literal("cwrc:place"),
716
- import_zod14.z.literal("crm:E89_Propositional_Object").describe("Fictional Place")
717
- ])
855
+ import_zod14.z.tuple([import_zod14.z.literal("cwrc:place"), import_zod14.z.literal("crm:E89_Propositional_Object")])
718
856
  ]);
719
857
  var Place = import_zod14.z.object({
720
858
  id: import_zod14.z.string().url().describe(bodyIdDescription),
721
859
  entityType: PlaceEntityType,
722
860
  label: Label.optional(),
861
+ modeExistence: ModeExistence.optional(),
723
862
  description: Description.optional()
724
863
  }).describe("Place");
725
864
  var placeEntityTypeSchema = {
@@ -731,7 +870,7 @@ var placeEntityTypeSchema = {
731
870
  maxItems: 2,
732
871
  items: [
733
872
  { type: "string", const: "cwrc:place" },
734
- { type: "string", const: "crm:E89_Propositional_Object", description: "Fictional Place" }
873
+ { type: "string", const: "crm:E89_Propositional_Object" }
735
874
  ]
736
875
  }
737
876
  ]
@@ -743,36 +882,57 @@ var placeSchema = {
743
882
  id: { type: "string", format: "uri", description: bodyIdDescription },
744
883
  entityType: placeEntityTypeSchema,
745
884
  label: { $ref: "defs.jsonld#/definitions/label" },
885
+ modeExistence: { ...modeExistenceSchema, nullable: true },
746
886
  description: { $ref: "defs.jsonld#/definitions/description" }
747
887
  },
748
- required: ["id", "entityType"]
888
+ required: ["id", "entityType"],
889
+ allOf: [
890
+ {
891
+ if: {
892
+ type: "object",
893
+ properties: {
894
+ modeExistence: "edit:modeReal"
895
+ }
896
+ },
897
+ then: {
898
+ type: "object",
899
+ properties: {
900
+ entityType: "cwrc:place"
901
+ }
902
+ },
903
+ else: {
904
+ type: "object",
905
+ properties: {
906
+ entityType: ["cwrc:place", "crm:E89_Propositional_Object"]
907
+ }
908
+ }
909
+ }
910
+ ]
749
911
  };
750
912
 
751
913
  // src/v1/schema/definitions/body/work.ts
752
914
  var import_zod15 = require("zod");
753
- var WorkEntityType = import_zod15.z.tuple([
915
+ var WorkEntityType = import_zod15.z.union([
754
916
  import_zod15.z.literal("crm:E89_Propositional_Object"),
755
- import_zod15.z.union([
756
- import_zod15.z.literal("frbroo:F1").describe("Real Work"),
757
- import_zod15.z.literal("wikidata:Q15306849").describe("Fictional Work")
758
- ])
917
+ import_zod15.z.tuple([import_zod15.z.literal("frbroo:F1"), import_zod15.z.literal("wikidata:Q15306849")])
759
918
  ]);
760
919
  var Work = import_zod15.z.object({
761
920
  id: import_zod15.z.string().url().describe(bodyIdDescription),
762
921
  entityType: WorkEntityType,
763
922
  label: Label.optional(),
923
+ modeExistence: ModeExistence.optional(),
764
924
  description: Description.optional()
765
925
  }).describe("Work");
766
926
  var workEntityTypeSchema = {
767
- type: "array",
768
- minItems: 2,
769
- maxItems: 2,
770
- items: [
927
+ oneOf: [
771
928
  { type: "string", const: "crm:E89_Propositional_Object" },
772
929
  {
773
- oneOf: [
774
- { type: "string", const: "frbroo:F1", description: "Real Work" },
775
- { type: "string", const: "wikidata:Q15306849", description: "Fictional Work" }
930
+ type: "array",
931
+ minItems: 2,
932
+ maxItems: 2,
933
+ items: [
934
+ { type: "string", const: "frbroo:F1" },
935
+ { type: "string", const: "wikidata:Q15306849" }
776
936
  ]
777
937
  }
778
938
  ]
@@ -784,9 +944,32 @@ var workSchema = {
784
944
  id: { type: "string", format: "uri", description: bodyIdDescription },
785
945
  entityType: workEntityTypeSchema,
786
946
  label: { $ref: "defs.jsonld#/definitions/label" },
947
+ modeExistence: { ...modeExistenceSchema, nullable: true },
787
948
  description: { $ref: "defs.jsonld#/definitions/description" }
788
949
  },
789
- required: ["id", "entityType"]
950
+ required: ["id", "entityType"],
951
+ allOf: [
952
+ {
953
+ if: {
954
+ type: "object",
955
+ properties: {
956
+ modeExistence: "edit:modeReal"
957
+ }
958
+ },
959
+ then: {
960
+ type: "object",
961
+ properties: {
962
+ entityType: "crm:E89_Propositional_Object"
963
+ }
964
+ },
965
+ else: {
966
+ type: "object",
967
+ properties: {
968
+ entityType: ["frbroo:F1", "wikidata:Q15306849"]
969
+ }
970
+ }
971
+ }
972
+ ]
790
973
  };
791
974
 
792
975
  // src/v1/schema/definitions/body/choice.ts
@@ -878,6 +1061,7 @@ var Body = import_zod17.z.object({
878
1061
  additionalType: import_zod17.z.union([import_zod17.z.string(), import_zod17.z.string().array()]).nullish().describe("Extra types that refines the body"),
879
1062
  value: import_zod17.z.string().describe("The value of the body").optional(),
880
1063
  label: Label.optional(),
1064
+ modeExistence: ModeExistence.optional(),
881
1065
  description: Description.optional()
882
1066
  }).describe("Web Annotation Body");
883
1067
  var bodySchema = {
@@ -892,6 +1076,7 @@ var bodySchema = {
892
1076
  },
893
1077
  value: { type: "string" },
894
1078
  label: labelSchema,
1079
+ modeExistence: modeExistenceSchema,
895
1080
  description: descriptionSchema
896
1081
  },
897
1082
  required: ["id", "entityType"],
@@ -1486,69 +1671,40 @@ var definitionSchema = {
1486
1671
  };
1487
1672
 
1488
1673
  // src/v1/schema/root.ts
1489
- var import_zod27 = require("zod");
1490
-
1491
- // src/v1/schema/definitions/motivation.ts
1492
1674
  var import_zod26 = require("zod");
1493
- var MotivationInstance = import_zod26.z.union([
1494
- import_zod26.z.literal("identifying"),
1495
- import_zod26.z.literal("describing"),
1496
- import_zod26.z.literal("correcting"),
1497
- import_zod26.z.literal("tagging"),
1498
- import_zod26.z.literal("classifying"),
1499
- import_zod26.z.literal("linking"),
1500
- import_zod26.z.literal("citing")
1501
- ]);
1502
- var MotivationType = import_zod26.z.object({
1503
- type: import_zod26.z.literal("crm:E55_Type")
1504
- });
1505
- var Motivation = import_zod26.z.record(MotivationInstance, MotivationType).describe("The relationship between an Annotation and a Motivation.");
1506
- var motivationType = {
1507
- type: "object",
1508
- properties: {
1509
- type: { type: "string", const: "crm:E55_Type" }
1510
- },
1511
- required: ["type"]
1512
- };
1513
- var motivationSchema = {
1514
- type: "object",
1515
- description: "The relationship between an Annotation and a Motivation.",
1516
- properties: {
1517
- identifying: { ...motivationType, nullable: true },
1518
- describing: { ...motivationType, nullable: true },
1519
- correcting: { ...motivationType, nullable: true },
1520
- tagging: { ...motivationType, nullable: true },
1521
- classifying: { ...motivationType, nullable: true },
1522
- linking: { ...motivationType, nullable: true },
1523
- citing: { ...motivationType, nullable: true }
1524
- }
1525
- };
1526
-
1527
- // src/v1/schema/root.ts
1528
1675
  var Status = ["edit:statusDraft", "edit:statusApproved", "edit:statusPublished"];
1529
- var WebAnnotation = import_zod27.z.object({
1530
- "@context": import_zod27.z.tuple([
1531
- import_zod27.z.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
1532
- import_zod27.z.literal(contextUri).describe("LINCS Web Annotation Context.")
1676
+ var Motivation = [
1677
+ "oa:identifying",
1678
+ "oa:describing",
1679
+ "correcting",
1680
+ "oa:tagging",
1681
+ "oa:classifying",
1682
+ "oa:linking",
1683
+ "citing"
1684
+ ];
1685
+ var WebAnnotation = import_zod26.z.object({
1686
+ "@context": import_zod26.z.tuple([
1687
+ import_zod26.z.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
1688
+ import_zod26.z.literal(contextUri).describe("LINCS Web Annotation Context.")
1533
1689
  ]).describe(
1534
1690
  "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."
1535
1691
  ),
1536
- id: import_zod27.z.string().url().describe("The identity of the Annotation."),
1537
- type: import_zod27.z.tuple([import_zod27.z.literal("Annotation"), import_zod27.z.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
1538
- motivation: Motivation,
1539
- created: import_zod27.z.string().datetime().describe("The time at which the resource was created."),
1540
- modified: import_zod27.z.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
1692
+ id: import_zod26.z.string().url().describe("The identity of the Annotation."),
1693
+ type: import_zod26.z.tuple([import_zod26.z.literal("Annotation"), import_zod26.z.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
1694
+ motivation: import_zod26.z.enum(Motivation).describe("The relationship between an Annotation and a Motivation."),
1695
+ created: import_zod26.z.string().datetime().describe("The time at which the resource was created."),
1696
+ modified: import_zod26.z.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
1541
1697
  creator: User.describe("The agent responsible for creating the resource.").optional(),
1542
- contributor: import_zod27.z.array(User.describe("The agents responsible for modifying the resource.")).nonempty().optional().describe("The agents responsible for modifying the resource."),
1698
+ contributor: import_zod26.z.array(User.describe("The agents responsible for modifying the resource.")).nonempty().optional().describe("The agents responsible for modifying the resource."),
1543
1699
  generator: Software.describe(
1544
1700
  "The agent responsible for generating the serialization of the Annotation. "
1545
1701
  ),
1546
1702
  target: Target.describe("The relationship between an Annotation and its Target."),
1547
- body: import_zod27.z.union([BodyChoice, Body, import_zod27.z.array(Body)]).describe("The relationship between an Annotation and its Body."),
1703
+ body: import_zod26.z.union([BodyChoice, Body, import_zod26.z.array(Body)]).describe("The relationship between an Annotation and its Body."),
1548
1704
  certainty: Certainty.optional(),
1549
1705
  precision: Precision.optional(),
1550
- label: import_zod27.z.string().min(1, { message: "The label cannot be empty" }).optional().describe("The descriptive label for the annotation"),
1551
- status: import_zod27.z.enum(Status).describe("The status of this annotation in a workflow.")
1706
+ label: import_zod26.z.string().min(1, { message: "The label cannot be empty" }).optional().describe("The descriptive label for the annotation"),
1707
+ status: import_zod26.z.enum(Status).describe("The status of this annotation in a workflow.").optional()
1552
1708
  }).describe("Web Annotation Root");
1553
1709
  var webAnnotationSchema = {
1554
1710
  $id: schemaId,
@@ -1580,7 +1736,11 @@ var webAnnotationSchema = {
1580
1736
  ],
1581
1737
  description: "The type of the Annotation."
1582
1738
  },
1583
- motivation: motivationSchema,
1739
+ motivation: {
1740
+ type: "string",
1741
+ enum: Motivation,
1742
+ description: "The relationship between an Annotation and a Motivation."
1743
+ },
1584
1744
  created: {
1585
1745
  type: "string",
1586
1746
  format: "date-time",
@@ -1618,17 +1778,7 @@ var webAnnotationSchema = {
1618
1778
  label: { type: "string" },
1619
1779
  status: { type: "string", enum: Status }
1620
1780
  },
1621
- required: [
1622
- "@context",
1623
- "id",
1624
- "type",
1625
- "motivation",
1626
- "created",
1627
- "generator",
1628
- "target",
1629
- "body",
1630
- "status"
1631
- ],
1781
+ required: ["@context", "id", "type", "motivation", "created", "generator", "target", "body"],
1632
1782
  additionalProperties: false,
1633
1783
  allOf: [
1634
1784
  {
@@ -1657,17 +1807,7 @@ var webAnnotationSchema = {
1657
1807
  then: {
1658
1808
  type: "object",
1659
1809
  properties: {
1660
- motivation: {
1661
- type: "object",
1662
- properties: {
1663
- identifying: {
1664
- type: "object",
1665
- properties: {
1666
- type: { type: "string", const: "crm:E55_Type" }
1667
- }
1668
- }
1669
- }
1670
- }
1810
+ motivation: { type: "string", const: "oa:identifying" }
1671
1811
  }
1672
1812
  },
1673
1813
  else: {
@@ -1685,17 +1825,7 @@ var webAnnotationSchema = {
1685
1825
  then: {
1686
1826
  type: "object",
1687
1827
  properties: {
1688
- motivation: {
1689
- type: "object",
1690
- properties: {
1691
- describing: {
1692
- type: "object",
1693
- properties: {
1694
- type: { type: "string", const: "crm:E55_Type" }
1695
- }
1696
- }
1697
- }
1698
- }
1828
+ motivation: { type: "string", const: "oa:describing" }
1699
1829
  }
1700
1830
  },
1701
1831
  else: {
@@ -1713,17 +1843,7 @@ var webAnnotationSchema = {
1713
1843
  then: {
1714
1844
  type: "object",
1715
1845
  properties: {
1716
- motivation: {
1717
- type: "object",
1718
- properties: {
1719
- correcting: {
1720
- type: "object",
1721
- properties: {
1722
- type: { type: "string", const: "crm:E55_Type" }
1723
- }
1724
- }
1725
- }
1726
- }
1846
+ motivation: { type: "string", const: "correcting" }
1727
1847
  }
1728
1848
  },
1729
1849
  else: {
@@ -1741,17 +1861,7 @@ var webAnnotationSchema = {
1741
1861
  then: {
1742
1862
  type: "object",
1743
1863
  properties: {
1744
- motivation: {
1745
- type: "object",
1746
- properties: {
1747
- tagging: {
1748
- type: "object",
1749
- properties: {
1750
- type: { type: "string", const: "crm:E55_Type" }
1751
- }
1752
- }
1753
- }
1754
- }
1864
+ motivation: { type: "string", const: "oa:tagging" }
1755
1865
  }
1756
1866
  },
1757
1867
  else: {
@@ -1769,17 +1879,7 @@ var webAnnotationSchema = {
1769
1879
  then: {
1770
1880
  type: "object",
1771
1881
  properties: {
1772
- motivation: {
1773
- type: "object",
1774
- properties: {
1775
- classifying: {
1776
- type: "object",
1777
- properties: {
1778
- type: { type: "string", const: "crm:E55_Type" }
1779
- }
1780
- }
1781
- }
1782
- }
1882
+ motivation: { type: "string", const: "oa:classifying" }
1783
1883
  }
1784
1884
  },
1785
1885
  else: {
@@ -1797,17 +1897,7 @@ var webAnnotationSchema = {
1797
1897
  then: {
1798
1898
  type: "object",
1799
1899
  properties: {
1800
- motivation: {
1801
- type: "object",
1802
- properties: {
1803
- linking: {
1804
- type: "object",
1805
- properties: {
1806
- type: { type: "string", const: "crm:E55_Type" }
1807
- }
1808
- }
1809
- }
1810
- }
1900
+ motivation: { type: "string", const: "oa:linking" }
1811
1901
  }
1812
1902
  },
1813
1903
  else: {
@@ -1825,17 +1915,7 @@ var webAnnotationSchema = {
1825
1915
  then: {
1826
1916
  type: "object",
1827
1917
  properties: {
1828
- motivation: {
1829
- type: "object",
1830
- properties: {
1831
- citing: {
1832
- type: "object",
1833
- properties: {
1834
- type: { type: "string", const: "crm:E55_Type" }
1835
- }
1836
- }
1837
- }
1838
- }
1918
+ motivation: { type: "string", const: "citing" }
1839
1919
  }
1840
1920
  }
1841
1921
  }
@@ -1854,18 +1934,18 @@ var import_ajv = __toESM(require("ajv"));
1854
1934
  var import_ajv_formats = __toESM(require("ajv-formats"));
1855
1935
 
1856
1936
  // src/v1/validator/types.ts
1857
- var import_zod28 = require("zod");
1858
- var ValidationError = import_zod28.z.object({
1859
- message: import_zod28.z.string(),
1860
- path: import_zod28.z.string(),
1861
- suggestion: import_zod28.z.string().optional(),
1862
- context: import_zod28.z.object({
1863
- errorType: import_zod28.z.string()
1864
- }).and(import_zod28.z.unknown())
1937
+ var import_zod27 = require("zod");
1938
+ var ValidationError = import_zod27.z.object({
1939
+ message: import_zod27.z.string(),
1940
+ path: import_zod27.z.string(),
1941
+ suggestion: import_zod27.z.string().optional(),
1942
+ context: import_zod27.z.object({
1943
+ errorType: import_zod27.z.string()
1944
+ }).and(import_zod27.z.unknown())
1865
1945
  });
1866
- var ValidateResult = import_zod28.z.object({
1867
- valid: import_zod28.z.boolean(),
1868
- errors: import_zod28.z.array(ValidationError).optional()
1946
+ var ValidateResult = import_zod27.z.object({
1947
+ valid: import_zod27.z.boolean(),
1948
+ errors: import_zod27.z.array(ValidationError).optional()
1869
1949
  });
1870
1950
 
1871
1951
  // src/v1/validator/index.ts
@@ -1920,6 +2000,7 @@ __export(v1_exports, {
1920
2000
  KeywordFolksnomyEntityType: () => KeywordFolksnomyEntityType,
1921
2001
  Link: () => Link,
1922
2002
  LinkEntityType: () => LinkEntityType,
2003
+ Motivation: () => Motivation,
1923
2004
  Note: () => Note,
1924
2005
  NoteEntityType: () => NoteEntityType,
1925
2006
  Organization: () => Organization,
@@ -2036,6 +2117,7 @@ __export(v1_exports, {
2036
2117
  KeywordFolksnomyEntityType,
2037
2118
  Link,
2038
2119
  LinkEntityType,
2120
+ Motivation,
2039
2121
  Note,
2040
2122
  NoteEntityType,
2041
2123
  Organization,