@lincs.project/webannotation-schema 1.1.1 → 1.2.1

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
@@ -2768,33 +2768,119 @@ var require_lib = __commonJS({
2768
2768
  var src_exports = {};
2769
2769
  __export(src_exports, {
2770
2770
  Body: () => Body,
2771
+ BodyEntityType: () => BodyEntityType,
2772
+ Certainty: () => Certainty,
2773
+ Citation: () => Citation,
2774
+ CitationEntityType: () => CitationEntityType,
2775
+ ConceptualObject: () => ConceptualObject,
2776
+ ConceptualObjectEntityType: () => ConceptualObjectEntityType,
2777
+ Correction: () => Correction,
2778
+ CorrectionEntityType: () => CorrectionEntityType,
2779
+ DATE_RANGE_PATTERN: () => DATE_RANGE_PATTERN,
2780
+ Date: () => Date2,
2781
+ DateEntityType: () => DateEntityType,
2782
+ Description: () => Description,
2783
+ Event: () => Event,
2784
+ EventEntityType: () => EventEntityType,
2785
+ Keyword: () => Keyword,
2786
+ KeywordEntityType: () => KeywordEntityType,
2787
+ KeywordFolksnomy: () => KeywordFolksnomy,
2788
+ KeywordFolksnomyEntityType: () => KeywordFolksnomyEntityType,
2789
+ Label: () => Label,
2790
+ Link: () => Link,
2791
+ LinkEntityType: () => LinkEntityType,
2771
2792
  Motivation: () => Motivation,
2793
+ Note: () => Note,
2794
+ NoteEntityType: () => NoteEntityType,
2795
+ Organization: () => Organization,
2796
+ OrganizationEntityType: () => OrganizationEntityType,
2772
2797
  Person: () => Person,
2773
2798
  PersonEntityType: () => PersonEntityType,
2799
+ PhysicalThing: () => PhysicalThing,
2800
+ PhysicalThingEntityType: () => PhysicalThingEntityType,
2801
+ Place: () => Place,
2802
+ PlaceEntityType: () => PlaceEntityType,
2803
+ Precision: () => Precision,
2804
+ Quality: () => Quality,
2805
+ RangeSelector: () => RangeSelector,
2806
+ Selector: () => Selector,
2774
2807
  Software: () => Software,
2808
+ Source: () => Source,
2775
2809
  Status: () => Status,
2776
2810
  Target: () => Target,
2811
+ TextPositionSelector: () => TextPositionSelector,
2812
+ TextPositionSelectorExtended: () => TextPositionSelectorExtended,
2813
+ TextQuoteSelector: () => TextQuoteSelector,
2814
+ TextQuoteSelectorExtended: () => TextQuoteSelectorExtended,
2777
2815
  User: () => User,
2778
2816
  VERSION: () => VERSION,
2779
2817
  ValidateResult: () => ValidateResult,
2780
2818
  ValidationError: () => ValidationError,
2781
2819
  WebAnnotation: () => WebAnnotation,
2820
+ Work: () => Work,
2821
+ WorkEntityType: () => WorkEntityType,
2822
+ XpathSelector: () => XpathSelector,
2823
+ XpathSelectorExtended: () => XpathSelectorExtended,
2782
2824
  ajv: () => ajv,
2825
+ bodyIdDescription: () => bodyIdDescription,
2783
2826
  bodySchema: () => bodySchema,
2827
+ certaintySchema: () => certaintySchema,
2828
+ citationEntityTypeSchema: () => citationEntityTypeSchema,
2829
+ citationSchema: () => citationSchema,
2830
+ conceptualObjectEntityTypeSchema: () => conceptualObjectEntityTypeSchema,
2831
+ conceptualObjectSchema: () => conceptualObjectSchema,
2784
2832
  contextUri: () => contextUri,
2833
+ correctionEntityTypeSchema: () => correctionEntityTypeSchema,
2834
+ correctionSchema: () => correctionSchema,
2785
2835
  creatorSchema: () => creatorSchema,
2836
+ dateEntityTypeSchema: () => dateEntityTypeSchema,
2837
+ dateSchema: () => dateSchema,
2786
2838
  definitionSchema: () => definitionSchema,
2787
2839
  defsId: () => defsId,
2840
+ descriptionSchema: () => descriptionSchema,
2841
+ eventEntityTypeSchema: () => eventEntityTypeSchema,
2842
+ eventSchema: () => eventSchema,
2843
+ formatSchema: () => formatSchema,
2844
+ keywordEntityTypeSchema: () => keywordEntityTypeSchema,
2845
+ keywordFolksnomyEntityTypeSchema: () => keywordFolksnomyEntityTypeSchema,
2846
+ keywordFolksnomySchema: () => keywordFolksnomySchema,
2847
+ keywordSchema: () => keywordSchema,
2848
+ labelSchema: () => labelSchema,
2849
+ languageSchema: () => languageSchema,
2850
+ linkEntityTypeSchema: () => linkEntityTypeSchema,
2851
+ linkSchema: () => linkSchema,
2852
+ noteEntityTypeSchema: () => noteEntityTypeSchema,
2853
+ noteSchema: () => noteSchema,
2854
+ organizationEntityTypeSchema: () => organizationEntityTypeSchema,
2855
+ organizationSchema: () => organizationSchema,
2788
2856
  personEntityTypeSchema: () => personEntityTypeSchema,
2789
2857
  personSchema: () => personSchema,
2858
+ physicalThingEntityTypeSchema: () => physicalThingEntityTypeSchema,
2859
+ physicalThingSchema: () => physicalThingSchema,
2860
+ placeEntityTypeSchema: () => placeEntityTypeSchema,
2861
+ placeSchema: () => placeSchema,
2862
+ precisionSchema: () => precisionSchema,
2863
+ rangeSelectorSchema: () => rangeSelectorSchema,
2790
2864
  schemaContext: () => schemaContext,
2791
2865
  schemaId: () => schemaId,
2866
+ selectorIdDescription: () => selectorIdDescription,
2867
+ selectorRefinedByDescription: () => selectorRefinedByDescription,
2868
+ selectorSchema: () => selectorSchema,
2792
2869
  softwareSchema: () => softwareSchema,
2870
+ sourceSchema: () => sourceSchema,
2793
2871
  targetSchema: () => targetSchema,
2872
+ textPositionSelectorExtendedSchema: () => textPositionSelectorExtendedSchema,
2873
+ textPositionSelectorSchema: () => textPositionSelectorSchema,
2874
+ textQuoteSelectorExtendedSchema: () => textQuoteSelectorExtendedSchema,
2875
+ textQuoteSelectorSchema: () => textQuoteSelectorSchema,
2794
2876
  v1: () => v1_exports,
2795
2877
  validate: () => validate,
2796
2878
  validator: () => validator,
2797
- webAnnotationSchema: () => webAnnotationSchema
2879
+ webAnnotationSchema: () => webAnnotationSchema,
2880
+ workEntityTypeSchema: () => workEntityTypeSchema,
2881
+ workSchema: () => workSchema,
2882
+ xpathSelectorExtendedSchema: () => xpathSelectorExtendedSchema,
2883
+ xpathSelectorSchema: () => xpathSelectorSchema
2798
2884
  });
2799
2885
  module.exports = __toCommonJS(src_exports);
2800
2886
 
@@ -2833,7 +2919,7 @@ var schemaContext = {
2833
2919
  },
2834
2920
  entityType: {
2835
2921
  "@type": "@id",
2836
- "@id": "crm:P2_has_type"
2922
+ "@id": "rdf:type"
2837
2923
  },
2838
2924
  additionalType: {
2839
2925
  "@type": "@id",
@@ -2849,8 +2935,9 @@ var schemaContext = {
2849
2935
 
2850
2936
  // src/v1/schema/definitions/agent.ts
2851
2937
  var import_zod = require("zod");
2938
+ var userIdDescription = "The IRI that identifies the agent (Creator or Contributor).";
2852
2939
  var User = import_zod.z.object({
2853
- id: import_zod.z.union([import_zod.z.string().url({ message: "Must be an URI" }), import_zod.z.literal("anonymous")]).describe("The IRI that identifies the agent (Creator or Contributor)."),
2940
+ id: import_zod.z.string().url().describe(userIdDescription),
2854
2941
  type: import_zod.z.literal("crm:E21_Person").describe("The type of the Agent."),
2855
2942
  name: import_zod.z.string().min(1, { message: "Cannot be empty" }).describe("The name of the agent.")
2856
2943
  }).describe("Human Agent");
@@ -2858,20 +2945,15 @@ var creatorSchema = {
2858
2945
  type: "object",
2859
2946
  description: "Software Agent",
2860
2947
  properties: {
2861
- id: {
2862
- anyOf: [
2863
- { type: "string", format: "uri" },
2864
- { type: "string", const: "anonymous" }
2865
- ],
2866
- description: "The URI that identifies the agent (Creator or Contributor)."
2867
- },
2948
+ id: { type: "string", format: "uri", description: userIdDescription },
2868
2949
  type: { type: "string", const: "crm:E21_Person" },
2869
2950
  name: { type: "string", minLength: 1, description: "The name of the agent." }
2870
2951
  },
2871
2952
  required: ["id", "type", "name"]
2872
2953
  };
2954
+ var softwareIdDescription = "The IRI that identifies the agent (software).";
2873
2955
  var Software = import_zod.z.object({
2874
- id: import_zod.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the agent (software)."),
2956
+ id: import_zod.z.string().url().describe(softwareIdDescription),
2875
2957
  type: import_zod.z.tuple([import_zod.z.literal("Software"), import_zod.z.literal("crm:P16_used_specific_object")]).describe("The type of the Agent."),
2876
2958
  label: import_zod.z.string().min(1).describe("The name of the software."),
2877
2959
  softwareVersion: import_zod.z.string().optional().describe("The software version.")
@@ -2880,11 +2962,7 @@ var softwareSchema = {
2880
2962
  type: "object",
2881
2963
  description: "Software Agent",
2882
2964
  properties: {
2883
- id: {
2884
- type: "string",
2885
- format: "uri",
2886
- description: "The IRI that identifies the agent (software)."
2887
- },
2965
+ id: { type: "string", format: "uri", description: softwareIdDescription },
2888
2966
  type: {
2889
2967
  type: "array",
2890
2968
  minItems: 2,
@@ -2915,32 +2993,32 @@ var Quality = [
2915
2993
  "edit:qualityHigh",
2916
2994
  "edit:qualityUnknown"
2917
2995
  ];
2918
- var Certainty = import_zod2.z.enum(Quality).describe(
2919
- "Indicates the degree of certainty associated with some aspect of an assertion, description, identification, or entity linked to the annotation body."
2920
- );
2996
+ var certaintyDescription = "Indicates the degree of certainty associated with some aspect of an assertion, description, identification, or entity linked to the annotation body.";
2997
+ var Certainty = import_zod2.z.enum(Quality).describe(certaintyDescription);
2921
2998
  var certaintySchema = {
2922
2999
  type: "string",
2923
3000
  enum: Quality,
2924
- description: "Indicates the degree of certainty associated with some aspect of an assertion, description, identification, or entity linked to the annotation body."
3001
+ description: certaintyDescription
2925
3002
  };
2926
- var Precision = import_zod2.z.enum(Quality).describe(
2927
- "Indicates the degree of precision associated with the location of the entity linked to the annotation body."
2928
- );
3003
+ var precisionDescription = "Indicates the degree of precision associated with the location of the entity linked to the annotation body.";
3004
+ var Precision = import_zod2.z.enum(Quality).describe(precisionDescription);
2929
3005
  var precisionSchema = {
2930
3006
  type: "string",
2931
3007
  enum: Quality,
2932
- description: "Indicates the degree of precision associated with the location of the entity linked to the annotation body."
3008
+ description: precisionDescription
2933
3009
  };
2934
- var Label = import_zod2.z.string().min(1, { message: "The label cannot be empty" }).describe("The title or name of a linked resource or named entity.");
3010
+ var labelDescription = "The title or name of a linked resource or named entity.";
3011
+ var Label = import_zod2.z.string().min(1, { message: "The label cannot be empty" }).describe(labelDescription);
2935
3012
  var labelSchema = {
2936
3013
  type: "string",
2937
3014
  minLength: 1,
2938
- description: "The title or name of a linked resource or named entity."
3015
+ description: labelDescription
2939
3016
  };
2940
- var Description = import_zod2.z.string().describe("Short description of the linked resources or named entity.");
3017
+ var descriptionDescription = "Short description of the linked resources or named entity.";
3018
+ var Description = import_zod2.z.string().describe(descriptionDescription);
2941
3019
  var descriptionSchema = {
2942
3020
  type: "string",
2943
- description: "Short description of the linked resources or named entity."
3021
+ description: descriptionDescription
2944
3022
  };
2945
3023
 
2946
3024
  // src/v1/schema/definitions/body/citation.ts
@@ -2949,11 +3027,8 @@ var CitationEntityType = import_zod3.z.tuple([
2949
3027
  import_zod3.z.literal("crm:E73_Information_Object")
2950
3028
  ]);
2951
3029
  var Citation = import_zod3.z.object({
2952
- id: import_zod3.z.union([
2953
- import_zod3.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
2954
- import_zod3.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
2955
- ]),
2956
- entityType: import_zod3.z.tuple([import_zod3.z.literal("cito:Citation"), import_zod3.z.literal("crm:E73_Information_Object")]),
3030
+ id: import_zod3.z.string().url().describe(bodyIdDescription),
3031
+ entityType: CitationEntityType,
2957
3032
  certainty: Certainty.optional(),
2958
3033
  label: Label.optional(),
2959
3034
  description: Description.optional()
@@ -2967,6 +3042,18 @@ var citationEntityTypeSchema = {
2967
3042
  { type: "string", const: "crm:E73_Information_Object" }
2968
3043
  ]
2969
3044
  };
3045
+ var citationSchema = {
3046
+ type: "object",
3047
+ description: "A citation entity",
3048
+ properties: {
3049
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3050
+ entityType: citationEntityTypeSchema,
3051
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3052
+ label: { $ref: "defs.jsonld#/definitions/label" },
3053
+ description: { $ref: "defs.jsonld#/definitions/description" }
3054
+ },
3055
+ required: ["id", "entityType"]
3056
+ };
2970
3057
 
2971
3058
  // src/v1/schema/definitions/body/conceptualObject.ts
2972
3059
  var import_zod4 = require("zod");
@@ -2978,10 +3065,7 @@ var ConceptualObjectEntityType = import_zod4.z.union([
2978
3065
  ])
2979
3066
  ]);
2980
3067
  var ConceptualObject = import_zod4.z.object({
2981
- id: import_zod4.z.union([
2982
- import_zod4.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
2983
- import_zod4.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
2984
- ]),
3068
+ id: import_zod4.z.string().url().describe(bodyIdDescription),
2985
3069
  entityType: ConceptualObjectEntityType,
2986
3070
  certainty: Certainty.optional(),
2987
3071
  label: Label.optional(),
@@ -3001,6 +3085,18 @@ var conceptualObjectEntityTypeSchema = {
3001
3085
  }
3002
3086
  ]
3003
3087
  };
3088
+ var conceptualObjectSchema = {
3089
+ type: "object",
3090
+ description: "A conceptual object entity",
3091
+ properties: {
3092
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3093
+ entityType: conceptualObjectEntityTypeSchema,
3094
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3095
+ label: { $ref: "defs.jsonld#/definitions/label" },
3096
+ description: { $ref: "defs.jsonld#/definitions/description" }
3097
+ },
3098
+ required: ["id", "entityType"]
3099
+ };
3004
3100
 
3005
3101
  // src/v1/schema/definitions/body/correction.ts
3006
3102
  var import_zod5 = require("zod");
@@ -3009,7 +3105,7 @@ var CorrectionEntityType = import_zod5.z.tuple([
3009
3105
  import_zod5.z.literal("crm:E33_Linguistic_Object")
3010
3106
  ]);
3011
3107
  var Correction = import_zod5.z.object({
3012
- id: import_zod5.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body."),
3108
+ id: import_zod5.z.string().url().describe(bodyIdDescription),
3013
3109
  type: import_zod5.z.literal("TextualBody"),
3014
3110
  entityType: CorrectionEntityType,
3015
3111
  value: import_zod5.z.string().describe("The correction.")
@@ -3023,15 +3119,31 @@ var correctionEntityTypeSchema = {
3023
3119
  { type: "string", const: "crm:E33_Linguistic_Object" }
3024
3120
  ]
3025
3121
  };
3122
+ var correctionSchema = {
3123
+ type: "object",
3124
+ description: "A correction entity",
3125
+ properties: {
3126
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3127
+ type: { type: "string", const: "TextualBody" },
3128
+ entityType: correctionEntityTypeSchema,
3129
+ value: { type: "string" }
3130
+ },
3131
+ required: ["id", "type", "entityType", "value"]
3132
+ // errorMessage: {
3133
+ // properties: {
3134
+ // type: 'must be exacty "TextualBody"',
3135
+ // },
3136
+ // },
3137
+ };
3026
3138
 
3027
3139
  // src/v1/schema/definitions/body/date.ts
3028
3140
  var import_zod6 = require("zod");
3029
3141
  var DateEntityType = import_zod6.z.tuple([import_zod6.z.literal("xsd:date"), import_zod6.z.literal("crm:E52_Time-Span")]);
3030
3142
  var Date2 = import_zod6.z.object({
3031
- id: import_zod6.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body."),
3143
+ id: import_zod6.z.string().url().describe(bodyIdDescription),
3032
3144
  type: import_zod6.z.literal("TextualBody"),
3033
3145
  entityType: DateEntityType,
3034
- value: import_zod6.z.string().describe("The date time."),
3146
+ value: import_zod6.z.string().regex(new RegExp(DATE_RANGE_PATTERN)).describe("The date time."),
3035
3147
  certainty: Certainty.optional(),
3036
3148
  precision: Precision.optional()
3037
3149
  }).describe("Date");
@@ -3044,18 +3156,76 @@ var dateEntityTypeSchema = {
3044
3156
  { type: "string", const: "crm:E52_Time-Span" }
3045
3157
  ]
3046
3158
  };
3159
+ var dateSchema = {
3160
+ type: "object",
3161
+ description: "A date entity",
3162
+ properties: {
3163
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3164
+ type: { type: "string", const: "TextualBody" },
3165
+ entityType: dateEntityTypeSchema,
3166
+ value: { type: "string", pattern: DATE_RANGE_PATTERN },
3167
+ certainty: { type: "string", $ref: "defs.jsonld#/definitions/certainty" },
3168
+ precision: { type: "string", $ref: "defs.jsonld#/definitions/precision" }
3169
+ },
3170
+ required: ["id", "type", "entityType", "value"]
3171
+ // errorMessage: {
3172
+ // properties: {
3173
+ // type: 'must be exacty "TextualBody"',
3174
+ // },
3175
+ // },
3176
+ };
3047
3177
 
3048
- // src/v1/schema/definitions/body/keyword.ts
3178
+ // src/v1/schema/definitions/body/event.ts
3049
3179
  var import_zod7 = require("zod");
3050
- var KeywordEntityType = import_zod7.z.tuple([
3051
- import_zod7.z.literal("crm:E55_Type"),
3052
- import_zod7.z.literal("crmdig:D1_Digital_Object")
3180
+ var EventEntityType = import_zod7.z.tuple([
3181
+ import_zod7.z.literal("YET TO BE DEFINED EVENT CLASS"),
3182
+ import_zod7.z.union([
3183
+ import_zod7.z.literal("crm:E5_Event").describe("Real Event"),
3184
+ import_zod7.z.literal("crm:E89_Propositional_Object").describe("Fictional Event")
3185
+ ])
3186
+ ]);
3187
+ var Event = import_zod7.z.object({
3188
+ id: import_zod7.z.string().url().describe(bodyIdDescription),
3189
+ entityType: EventEntityType,
3190
+ certainty: Certainty.optional(),
3191
+ label: Label.optional(),
3192
+ description: Description.optional()
3193
+ }).describe("Organization");
3194
+ var eventEntityTypeSchema = {
3195
+ type: "array",
3196
+ minItems: 2,
3197
+ maxItems: 2,
3198
+ items: [
3199
+ { type: "string", const: "YET TO BE DEFINED EVENT CLASS" },
3200
+ {
3201
+ oneOf: [
3202
+ { type: "string", const: "crm:E5_Event", description: "Real Event" },
3203
+ { type: "string", const: "crm:E89_Propositional_Object", description: "Fictional Event" }
3204
+ ]
3205
+ }
3206
+ ]
3207
+ };
3208
+ var eventSchema = {
3209
+ type: "object",
3210
+ description: "A organization entity",
3211
+ properties: {
3212
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3213
+ entityType: eventEntityTypeSchema,
3214
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3215
+ label: { $ref: "defs.jsonld#/definitions/label" },
3216
+ description: { $ref: "defs.jsonld#/definitions/description" }
3217
+ },
3218
+ required: ["id", "entityType"]
3219
+ };
3220
+
3221
+ // src/v1/schema/definitions/body/keyword.ts
3222
+ var import_zod8 = require("zod");
3223
+ var KeywordEntityType = import_zod8.z.tuple([
3224
+ import_zod8.z.literal("crm:E55_Type"),
3225
+ import_zod8.z.literal("crmdig:D1_Digital_Object")
3053
3226
  ]);
3054
- var Keyword = import_zod7.z.object({
3055
- id: import_zod7.z.union([
3056
- import_zod7.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3057
- import_zod7.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3058
- ]),
3227
+ var Keyword = import_zod8.z.object({
3228
+ id: import_zod8.z.string().url().describe(bodyIdDescription),
3059
3229
  entityType: KeywordEntityType,
3060
3230
  certainty: Certainty.optional(),
3061
3231
  label: Label.optional(),
@@ -3070,15 +3240,27 @@ var keywordEntityTypeSchema = {
3070
3240
  { type: "string", const: "crmdig:D1_Digital_Object" }
3071
3241
  ]
3072
3242
  };
3073
- var KeywordFolksnomyEntityType = import_zod7.z.tuple([
3074
- import_zod7.z.literal("crm:E55_Type"),
3075
- import_zod7.z.literal("crm:E33_Linguistic_Object")
3243
+ var keywordSchema = {
3244
+ type: "object",
3245
+ description: "A keyword entity",
3246
+ properties: {
3247
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3248
+ entityType: keywordEntityTypeSchema,
3249
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3250
+ label: { $ref: "defs.jsonld#/definitions/label" },
3251
+ description: { $ref: "defs.jsonld#/definitions/description" }
3252
+ },
3253
+ required: ["id", "entityType"]
3254
+ };
3255
+ var KeywordFolksnomyEntityType = import_zod8.z.tuple([
3256
+ import_zod8.z.literal("crm:E55_Type"),
3257
+ import_zod8.z.literal("crm:E33_Linguistic_Object")
3076
3258
  ]);
3077
- var KeywordFolksnomy = import_zod7.z.object({
3078
- id: import_zod7.z.string().url().describe("The IRI that identifies the Body resource."),
3079
- type: import_zod7.z.literal("TextualBody"),
3259
+ var KeywordFolksnomy = import_zod8.z.object({
3260
+ id: import_zod8.z.string().url().describe(bodyIdDescription),
3261
+ type: import_zod8.z.literal("TextualBody"),
3080
3262
  entityType: KeywordFolksnomyEntityType,
3081
- value: import_zod7.z.string().describe("The keyword.")
3263
+ value: import_zod8.z.string().describe("The keyword.")
3082
3264
  }).describe("Keyword");
3083
3265
  var keywordFolksnomyEntityTypeSchema = {
3084
3266
  type: "array",
@@ -3089,12 +3271,29 @@ var keywordFolksnomyEntityTypeSchema = {
3089
3271
  { type: "string", const: "crm:E33_Linguistic_Object" }
3090
3272
  ]
3091
3273
  };
3274
+ var keywordFolksnomySchema = {
3275
+ type: "object",
3276
+ description: "A keyword entity",
3277
+ properties: {
3278
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3279
+ type: { type: "string", const: "TextualBody" },
3280
+ entityType: keywordFolksnomyEntityTypeSchema,
3281
+ value: { type: "string" }
3282
+ },
3283
+ required: ["id", "type", "entityType", "value"]
3284
+ // errorMessage: {
3285
+ // properties: {
3286
+ // type: 'must be exacty "TextualBody"',
3287
+ // },
3288
+ // },
3289
+ };
3092
3290
 
3093
3291
  // src/v1/schema/definitions/body/link.ts
3094
- var import_zod8 = require("zod");
3095
- var LinkEntityType = import_zod8.z.literal("crmdig:D1_Digital_Object");
3096
- var Link = import_zod8.z.object({
3097
- id: import_zod8.z.string().url().describe("The link URL."),
3292
+ var import_zod9 = require("zod");
3293
+ var idDescription = "The link URL.";
3294
+ var LinkEntityType = import_zod9.z.literal("crmdig:D1_Digital_Object");
3295
+ var Link = import_zod9.z.object({
3296
+ id: import_zod9.z.string().url().describe(idDescription),
3098
3297
  entityType: LinkEntityType,
3099
3298
  certainty: Certainty.optional()
3100
3299
  }).describe("A link to a webpage");
@@ -3102,36 +3301,62 @@ var linkEntityTypeSchema = {
3102
3301
  type: "string",
3103
3302
  const: "crmdig:D1_Digital_Object"
3104
3303
  };
3304
+ var linkSchema = {
3305
+ type: "object",
3306
+ description: "A link entity",
3307
+ properties: {
3308
+ id: { type: "string", format: "uri", description: idDescription },
3309
+ entityType: linkEntityTypeSchema,
3310
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" }
3311
+ },
3312
+ required: ["id", "entityType"]
3313
+ };
3105
3314
 
3106
3315
  // src/v1/schema/definitions/body/note.ts
3107
- var import_zod9 = require("zod");
3108
- var NoteEntityType = import_zod9.z.literal("crm:E33_Linguistic_Object");
3109
- var Note = import_zod9.z.object({
3110
- id: import_zod9.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body."),
3111
- type: import_zod9.z.literal("TextualBody"),
3316
+ var import_zod10 = require("zod");
3317
+ var NoteEntityType = import_zod10.z.literal("crm:E33_Linguistic_Object");
3318
+ var Note = import_zod10.z.object({
3319
+ id: import_zod10.z.string().url().describe(bodyIdDescription),
3320
+ type: import_zod10.z.literal("TextualBody"),
3112
3321
  entityType: NoteEntityType,
3113
- additionalType: import_zod9.z.union([import_zod9.z.string(), import_zod9.z.string().array()]).optional().describe("Extra types that refines the note"),
3114
- value: import_zod9.z.string().describe("The note.")
3322
+ additionalType: import_zod10.z.union([import_zod10.z.string(), import_zod10.z.string().array()]).optional().describe("Extra types that refines the note"),
3323
+ value: import_zod10.z.string().describe("The note.")
3115
3324
  }).describe("Note");
3116
3325
  var noteEntityTypeSchema = {
3117
3326
  type: "string",
3118
3327
  const: "crm:E33_Linguistic_Object"
3119
3328
  };
3329
+ var noteSchema = {
3330
+ type: "object",
3331
+ description: "A note entity",
3332
+ properties: {
3333
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3334
+ type: { type: "string", const: "TextualBody" },
3335
+ entityType: noteEntityTypeSchema,
3336
+ additionalType: {
3337
+ oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
3338
+ },
3339
+ value: { type: "string" }
3340
+ },
3341
+ required: ["id", "type", "entityType", "value"]
3342
+ // errorMessage: {
3343
+ // properties: {
3344
+ // type: 'must be exacty "TextualBody"',
3345
+ // },
3346
+ // },
3347
+ };
3120
3348
 
3121
3349
  // src/v1/schema/definitions/body/organization.ts
3122
- var import_zod10 = require("zod");
3123
- var OrganizationEntityType = import_zod10.z.tuple([
3124
- import_zod10.z.literal("foaf:Organization"),
3125
- import_zod10.z.union([
3126
- import_zod10.z.literal("crm:E74_Group").describe("Real Organization"),
3127
- import_zod10.z.literal("crm:E89_Propositional_Object").describe("Fictional Organization")
3350
+ var import_zod11 = require("zod");
3351
+ var OrganizationEntityType = import_zod11.z.tuple([
3352
+ import_zod11.z.literal("foaf:Organization"),
3353
+ import_zod11.z.union([
3354
+ import_zod11.z.literal("crm:E74_Group").describe("Real Organization"),
3355
+ import_zod11.z.literal("crm:E89_Propositional_Object").describe("Fictional Organization")
3128
3356
  ])
3129
3357
  ]);
3130
- var Organization = import_zod10.z.object({
3131
- id: import_zod10.z.union([
3132
- import_zod10.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3133
- import_zod10.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3134
- ]),
3358
+ var Organization = import_zod11.z.object({
3359
+ id: import_zod11.z.string().url().describe(bodyIdDescription),
3135
3360
  entityType: OrganizationEntityType,
3136
3361
  certainty: Certainty.optional(),
3137
3362
  label: Label.optional(),
@@ -3155,21 +3380,30 @@ var organizationEntityTypeSchema = {
3155
3380
  }
3156
3381
  ]
3157
3382
  };
3383
+ var organizationSchema = {
3384
+ type: "object",
3385
+ description: "A organization entity",
3386
+ properties: {
3387
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3388
+ entityType: organizationEntityTypeSchema,
3389
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3390
+ label: { $ref: "defs.jsonld#/definitions/label" },
3391
+ description: { $ref: "defs.jsonld#/definitions/description" }
3392
+ },
3393
+ required: ["id", "entityType"]
3394
+ };
3158
3395
 
3159
3396
  // src/v1/schema/definitions/body/person.ts
3160
- var import_zod11 = require("zod");
3161
- var PersonEntityType = import_zod11.z.tuple([
3162
- import_zod11.z.literal("Person").describe("foaf:person."),
3163
- import_zod11.z.union([
3164
- import_zod11.z.literal("crm:E21_Person").describe("Real Person"),
3165
- import_zod11.z.literal("crm:E89_Propositional_Object").describe("Fictional Person")
3397
+ var import_zod12 = require("zod");
3398
+ var PersonEntityType = import_zod12.z.tuple([
3399
+ import_zod12.z.literal("Person").describe("foaf:person."),
3400
+ import_zod12.z.union([
3401
+ import_zod12.z.literal("crm:E21_Person").describe("Real Person"),
3402
+ import_zod12.z.literal("crm:E89_Propositional_Object").describe("Fictional Person")
3166
3403
  ])
3167
3404
  ]);
3168
- var Person = import_zod11.z.object({
3169
- id: import_zod11.z.union([
3170
- import_zod11.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3171
- import_zod11.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3172
- ]),
3405
+ var Person = import_zod12.z.object({
3406
+ id: import_zod12.z.string().url().describe(bodyIdDescription),
3173
3407
  entityType: PersonEntityType,
3174
3408
  certainty: Certainty.optional(),
3175
3409
  label: Label.optional(),
@@ -3193,35 +3427,26 @@ var personSchema = {
3193
3427
  type: "object",
3194
3428
  description: "A person entity",
3195
3429
  properties: {
3196
- id: {
3197
- oneOf: [
3198
- { type: "string", format: "uri", description: "The IRI that identifies the Body resource" },
3199
- { type: "string", format: "uuid" }
3200
- ]
3201
- },
3430
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3202
3431
  entityType: personEntityTypeSchema,
3203
3432
  certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3204
3433
  label: { $ref: "defs.jsonld#/definitions/label" },
3205
3434
  description: { $ref: "defs.jsonld#/definitions/description" }
3206
3435
  },
3207
3436
  required: ["id", "entityType"]
3208
- // errorMessage: { properties: { id: 'Must be an URI' } },
3209
3437
  };
3210
3438
 
3211
3439
  // src/v1/schema/definitions/body/physicalThing.ts
3212
- var import_zod12 = require("zod");
3213
- var PhysicalThingEntityType = import_zod12.z.union([
3214
- import_zod12.z.literal("crm:E18_Physical_Thing"),
3215
- import_zod12.z.tuple([
3216
- import_zod12.z.literal("crm:E18_Physical_Thing"),
3217
- import_zod12.z.literal("wikidata:Q15831596").describe("Fictional Physical Thing")
3440
+ var import_zod13 = require("zod");
3441
+ var PhysicalThingEntityType = import_zod13.z.union([
3442
+ import_zod13.z.literal("crm:E18_Physical_Thing"),
3443
+ import_zod13.z.tuple([
3444
+ import_zod13.z.literal("crm:E18_Physical_Thing"),
3445
+ import_zod13.z.literal("wikidata:Q15831596").describe("Fictional Physical Thing")
3218
3446
  ])
3219
3447
  ]);
3220
- var PhysicalThing = import_zod12.z.object({
3221
- id: import_zod12.z.union([
3222
- import_zod12.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3223
- import_zod12.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3224
- ]),
3448
+ var PhysicalThing = import_zod13.z.object({
3449
+ id: import_zod13.z.string().url().describe(bodyIdDescription),
3225
3450
  entityType: PhysicalThingEntityType,
3226
3451
  certainty: Certainty.optional(),
3227
3452
  label: Label.optional(),
@@ -3241,21 +3466,30 @@ var physicalThingEntityTypeSchema = {
3241
3466
  }
3242
3467
  ]
3243
3468
  };
3469
+ var physicalThingSchema = {
3470
+ type: "object",
3471
+ description: "A physical thing entity",
3472
+ properties: {
3473
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3474
+ entityType: physicalThingEntityTypeSchema,
3475
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3476
+ label: { $ref: "defs.jsonld#/definitions/label" },
3477
+ description: { $ref: "defs.jsonld#/definitions/description" }
3478
+ },
3479
+ required: ["id", "entityType"]
3480
+ };
3244
3481
 
3245
3482
  // src/v1/schema/definitions/body/place.ts
3246
- var import_zod13 = require("zod");
3247
- var PlaceEntityType = import_zod13.z.union([
3248
- import_zod13.z.literal("cwrc:place"),
3249
- import_zod13.z.tuple([
3250
- import_zod13.z.literal("cwrc:place"),
3251
- import_zod13.z.literal("crm:E89_Propositional_Object").describe("Fictional Place")
3483
+ var import_zod14 = require("zod");
3484
+ var PlaceEntityType = import_zod14.z.union([
3485
+ import_zod14.z.literal("cwrc:place"),
3486
+ import_zod14.z.tuple([
3487
+ import_zod14.z.literal("cwrc:place"),
3488
+ import_zod14.z.literal("crm:E89_Propositional_Object").describe("Fictional Place")
3252
3489
  ])
3253
3490
  ]);
3254
- var Place = import_zod13.z.object({
3255
- id: import_zod13.z.union([
3256
- import_zod13.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3257
- import_zod13.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3258
- ]),
3491
+ var Place = import_zod14.z.object({
3492
+ id: import_zod14.z.string().url().describe(bodyIdDescription),
3259
3493
  entityType: PlaceEntityType,
3260
3494
  certainty: Certainty.optional(),
3261
3495
  precision: Precision.optional(),
@@ -3276,21 +3510,31 @@ var placeEntityTypeSchema = {
3276
3510
  }
3277
3511
  ]
3278
3512
  };
3513
+ var placeSchema = {
3514
+ type: "object",
3515
+ description: "A place entity",
3516
+ properties: {
3517
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3518
+ entityType: placeEntityTypeSchema,
3519
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3520
+ precision: { $ref: "defs.jsonld#/definitions/precision" },
3521
+ label: { $ref: "defs.jsonld#/definitions/label" },
3522
+ description: { $ref: "defs.jsonld#/definitions/description" }
3523
+ },
3524
+ required: ["id", "entityType"]
3525
+ };
3279
3526
 
3280
3527
  // src/v1/schema/definitions/body/work.ts
3281
- var import_zod14 = require("zod");
3282
- var WorkEntityType = import_zod14.z.tuple([
3283
- import_zod14.z.literal("crm:E89_Propositional_Object"),
3284
- import_zod14.z.union([
3285
- import_zod14.z.literal("frbroo:F1").describe("Real Work"),
3286
- import_zod14.z.literal("wikidata:Q15306849").describe("Fictional Work")
3528
+ var import_zod15 = require("zod");
3529
+ var WorkEntityType = import_zod15.z.tuple([
3530
+ import_zod15.z.literal("crm:E89_Propositional_Object"),
3531
+ import_zod15.z.union([
3532
+ import_zod15.z.literal("frbroo:F1").describe("Real Work"),
3533
+ import_zod15.z.literal("wikidata:Q15306849").describe("Fictional Work")
3287
3534
  ])
3288
3535
  ]);
3289
- var Work = import_zod14.z.object({
3290
- id: import_zod14.z.union([
3291
- import_zod14.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3292
- import_zod14.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3293
- ]),
3536
+ var Work = import_zod15.z.object({
3537
+ id: import_zod15.z.string().url().describe(bodyIdDescription),
3294
3538
  entityType: WorkEntityType,
3295
3539
  certainty: Certainty.optional(),
3296
3540
  label: Label.optional(),
@@ -3310,49 +3554,42 @@ var workEntityTypeSchema = {
3310
3554
  }
3311
3555
  ]
3312
3556
  };
3313
-
3314
- // src/v1/schema/definitions/body/event.ts
3315
- var import_zod15 = require("zod");
3316
- var EventEntityType = import_zod15.z.literal("PLACEHOLDER_FOR_EVENT");
3317
- var Event = import_zod15.z.object({
3318
- id: import_zod15.z.union([
3319
- import_zod15.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3320
- import_zod15.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3321
- ]),
3322
- entityType: EventEntityType,
3323
- certainty: Certainty.optional(),
3324
- label: Label.optional(),
3325
- description: Description.optional()
3326
- }).describe("Organization");
3327
- var eventEntityTypeSchema = {
3328
- type: "string",
3329
- const: "PLACEHOLDER_FOR_EVENT"
3557
+ var workSchema = {
3558
+ type: "object",
3559
+ description: "A work entity",
3560
+ properties: {
3561
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3562
+ entityType: workEntityTypeSchema,
3563
+ certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3564
+ label: { $ref: "defs.jsonld#/definitions/label" },
3565
+ description: { $ref: "defs.jsonld#/definitions/description" }
3566
+ },
3567
+ required: ["id", "entityType"]
3330
3568
  };
3331
3569
 
3332
3570
  // src/v1/schema/definitions/body/index.ts
3333
- var DATE_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)?)$";
3571
+ var bodyIdDescription = "The IRI that identifies the Body resource.";
3572
+ var DATE_RANGE_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)?)$";
3573
+ var BodyEntityType = import_zod16.z.union([
3574
+ PersonEntityType,
3575
+ PlaceEntityType,
3576
+ OrganizationEntityType,
3577
+ WorkEntityType,
3578
+ PhysicalThingEntityType,
3579
+ ConceptualObjectEntityType,
3580
+ CitationEntityType,
3581
+ DateEntityType,
3582
+ NoteEntityType,
3583
+ CorrectionEntityType,
3584
+ KeywordEntityType,
3585
+ KeywordFolksnomyEntityType,
3586
+ LinkEntityType,
3587
+ EventEntityType
3588
+ ]);
3334
3589
  var Body = import_zod16.z.object({
3335
- id: import_zod16.z.union([
3336
- import_zod16.z.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
3337
- import_zod16.z.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
3338
- ]),
3590
+ id: import_zod16.z.string().url().describe(bodyIdDescription),
3339
3591
  type: import_zod16.z.literal("TextualBody").optional(),
3340
- entityType: import_zod16.z.union([
3341
- PersonEntityType,
3342
- PlaceEntityType,
3343
- OrganizationEntityType,
3344
- WorkEntityType,
3345
- PhysicalThingEntityType,
3346
- ConceptualObjectEntityType,
3347
- CitationEntityType,
3348
- DateEntityType,
3349
- NoteEntityType,
3350
- CorrectionEntityType,
3351
- KeywordEntityType,
3352
- KeywordFolksnomyEntityType,
3353
- LinkEntityType,
3354
- EventEntityType
3355
- ]),
3592
+ entityType: BodyEntityType,
3356
3593
  additionalType: import_zod16.z.union([import_zod16.z.string(), import_zod16.z.string().array()]).optional().describe("Extra types that refines the body"),
3357
3594
  value: import_zod16.z.string().describe("The value of the body").optional(),
3358
3595
  certainty: Certainty.optional(),
@@ -3364,12 +3601,7 @@ var bodySchema = {
3364
3601
  type: "object",
3365
3602
  description: "Web Annotation Body",
3366
3603
  properties: {
3367
- id: {
3368
- oneOf: [
3369
- { type: "string", format: "uri", description: "The IRI that identifies the Body resource" },
3370
- { type: "string", format: "uuid" }
3371
- ]
3372
- },
3604
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3373
3605
  type: { type: "string", const: "TextualBody" },
3374
3606
  entityType: {
3375
3607
  oneOf: [
@@ -3401,42 +3633,7 @@ var bodySchema = {
3401
3633
  required: ["id", "entityType"],
3402
3634
  // * Conditional restrictions
3403
3635
  anyOf: [
3404
- //* IF type is TextualBody THEN id = uuid
3405
- //* && IF entityType is date THEN value = date range pattern ELSE value = string
3406
- // {
3407
- // if: {
3408
- // type: 'object',
3409
- // properties: { type: { const: 'TextualBody' } },
3410
- // },
3411
- // then: {
3412
- // type: 'object',
3413
- // required: ['value'],
3414
- // properties: { id: { type: 'string', format: 'uuid' } },
3415
- // if: {
3416
- // type: 'object',
3417
- // properties: {
3418
- // entityType: {
3419
- // type: 'array',
3420
- // minItems: 2,
3421
- // maxItems: 2,
3422
- // items: [
3423
- // { type: 'string', const: 'xsd:date' },
3424
- // { type: 'string', const: 'crm:E52_Time-Span' },
3425
- // ],
3426
- // },
3427
- // },
3428
- // },
3429
- // then: {
3430
- // type: 'object',
3431
- // properties: { value: { type: 'string', pattern: DATE_PATTERN } },
3432
- // },
3433
- // else: {
3434
- // type: 'object',
3435
- // properties: { value: { type: 'string' } },
3436
- // },
3437
- // },
3438
- // },
3439
- //* IF entityType is date OR correction OR keyword THEN id = uuid AND type = TextualBody
3636
+ //* IF entityType is date OR correction OR keyword THEN type = TextualBody
3440
3637
  //* && IF entityType is date THEN value = date range pattern ELSE value = string
3441
3638
  {
3442
3639
  if: {
@@ -3471,7 +3668,6 @@ var bodySchema = {
3471
3668
  type: "object",
3472
3669
  required: ["type", "value"],
3473
3670
  properties: {
3474
- id: { type: "string", format: "uuid" },
3475
3671
  type: { type: "string", const: "TextualBody" }
3476
3672
  },
3477
3673
  if: {
@@ -3490,7 +3686,7 @@ var bodySchema = {
3490
3686
  properties: {
3491
3687
  value: {
3492
3688
  type: "string",
3493
- pattern: DATE_PATTERN
3689
+ pattern: DATE_RANGE_PATTERN
3494
3690
  }
3495
3691
  }
3496
3692
  },
@@ -3498,21 +3694,6 @@ var bodySchema = {
3498
3694
  type: "object",
3499
3695
  properties: { value: { type: "string" } }
3500
3696
  }
3501
- },
3502
- else: {
3503
- type: "object",
3504
- properties: {
3505
- id: {
3506
- oneOf: [
3507
- {
3508
- type: "string",
3509
- format: "uri",
3510
- description: "The IRI that identifies the Body resource"
3511
- },
3512
- { type: "string", format: "uuid" }
3513
- ]
3514
- }
3515
- }
3516
3697
  }
3517
3698
  }
3518
3699
  // ? TODO: Add more restrictions
@@ -3523,33 +3704,35 @@ var bodySchema = {
3523
3704
  };
3524
3705
 
3525
3706
  // src/v1/schema/definitions/target/index.ts
3707
+ var import_zod23 = require("zod");
3708
+
3709
+ // src/v1/schema/definitions/target/selector/index.ts
3526
3710
  var import_zod21 = require("zod");
3527
3711
 
3528
3712
  // src/v1/schema/definitions/target/selector/range.ts
3529
- var import_zod19 = require("zod");
3713
+ var import_zod20 = require("zod");
3530
3714
 
3531
3715
  // src/v1/schema/definitions/target/selector/xpath.ts
3532
- var import_zod18 = require("zod");
3716
+ var import_zod19 = require("zod");
3533
3717
 
3534
3718
  // src/v1/schema/definitions/target/selector/textPosition.ts
3535
3719
  var import_zod17 = require("zod");
3536
3720
  var TextPositionSelector = import_zod17.z.object({
3537
- id: import_zod17.z.string().url().describe("The IRI that identifies the target resource."),
3721
+ id: import_zod17.z.string().url().describe(selectorIdDescription),
3538
3722
  type: import_zod17.z.tuple([import_zod17.z.literal("TextPositionSelector"), import_zod17.z.literal("crm:E73_Information_Object")]),
3539
3723
  start: import_zod17.z.number().min(0).describe("The starting position of the segment. The first byte is character position 0."),
3540
3724
  end: import_zod17.z.number().describe(
3541
3725
  "The end position of the segment. The last character is not included within the segment."
3542
3726
  )
3543
3727
  }).describe("TextPosition Selector");
3728
+ var TextPositionSelectorExtended = TextPositionSelector.extend({
3729
+ refinedBy: import_zod17.z.union([import_zod17.z.lazy(() => TextPositionSelector), import_zod17.z.lazy(() => TextQuoteSelector)]).optional().describe(selectorRefinedByDescription)
3730
+ });
3544
3731
  var textPositionSelectorSchema = {
3545
3732
  type: "object",
3546
3733
  description: "TextPosition Selector",
3547
3734
  properties: {
3548
- id: {
3549
- type: "string",
3550
- format: "uuid",
3551
- description: "UUID that identifies the selector."
3552
- },
3735
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3553
3736
  type: {
3554
3737
  type: "array",
3555
3738
  minItems: 2,
@@ -3572,27 +3755,105 @@ var textPositionSelectorSchema = {
3572
3755
  }
3573
3756
  },
3574
3757
  required: ["id", "type", "start", "end"]
3575
- // errorMessage: { properties: { id: 'Must be an URI' } },
3758
+ };
3759
+ var textPositionSelectorExtendedSchema = {
3760
+ type: "object",
3761
+ description: "TextPosition Selector",
3762
+ properties: {
3763
+ ...textPositionSelectorSchema.properties,
3764
+ refinedBy: {
3765
+ type: "object",
3766
+ description: selectorRefinedByDescription,
3767
+ oneOf: [
3768
+ { $ref: "defs.jsonld#/definitions/textPositionSelector" },
3769
+ { $ref: "defs.jsonld#/definitions/textQuoteSelector" }
3770
+ ],
3771
+ nullable: true,
3772
+ required: []
3773
+ }
3774
+ },
3775
+ required: ["id", "type", "start", "end"]
3576
3776
  };
3577
3777
 
3578
- // src/v1/schema/definitions/target/selector/xpath.ts
3579
- var XpathSelector = import_zod18.z.object({
3580
- id: import_zod18.z.string().uuid().describe("UUID that identifies the selector."),
3581
- type: import_zod18.z.tuple([import_zod18.z.literal("XPathSelector"), import_zod18.z.literal("crm:E73_Information_Object")]),
3582
- value: import_zod18.z.string().min(1).describe("The xpath to the selected segment."),
3583
- refinedBy: TextPositionSelector.optional().describe(
3584
- "The relationship between a broader selector and the more specific selector that should be applied to the results of the first."
3778
+ // src/v1/schema/definitions/target/selector/textQuote.ts
3779
+ var import_zod18 = require("zod");
3780
+ var TextQuoteSelector = import_zod18.z.object({
3781
+ id: import_zod18.z.string().url().describe(selectorIdDescription),
3782
+ type: import_zod18.z.tuple([import_zod18.z.literal("TextQuoteSelector"), import_zod18.z.literal("crm:E33_Linguistic_Object")]),
3783
+ exact: import_zod18.z.string().describe("A copy of the text which is being selected, after normalization."),
3784
+ prefix: import_zod18.z.string().describe(
3785
+ "The snippet of text that occurs immediately before the text which is being selected."
3786
+ ),
3787
+ suffix: import_zod18.z.string().describe(
3788
+ "The snippet of text that occurs immediately after the text which is being selected."
3585
3789
  )
3790
+ }).describe("Quote Selector");
3791
+ var TextQuoteSelectorExtended = TextQuoteSelector.extend({
3792
+ refinedBy: import_zod18.z.union([import_zod18.z.lazy(() => TextPositionSelector), import_zod18.z.lazy(() => TextQuoteSelector)]).optional().describe(selectorRefinedByDescription)
3793
+ });
3794
+ var textQuoteSelectorSchema = {
3795
+ type: "object",
3796
+ description: "Quote Selector",
3797
+ properties: {
3798
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3799
+ type: {
3800
+ type: "array",
3801
+ minItems: 2,
3802
+ maxItems: 2,
3803
+ items: [
3804
+ { type: "string", const: "TextQuoteSelector" },
3805
+ { type: "string", const: "crm:E33_Linguistic_Object" }
3806
+ ],
3807
+ description: "The class of the Selector"
3808
+ },
3809
+ exact: {
3810
+ type: "string",
3811
+ description: "A copy of the text which is being selected, after normalization."
3812
+ },
3813
+ prefix: {
3814
+ type: "string",
3815
+ description: "The snippet of text that occurs immediately before the text which is being selected."
3816
+ },
3817
+ suffix: {
3818
+ type: "string",
3819
+ description: "The snippet of text that occurs immediately after the text which is being selected."
3820
+ }
3821
+ },
3822
+ required: ["id", "type", "exact", "prefix", "suffix"]
3823
+ };
3824
+ var textQuoteSelectorExtendedSchema = {
3825
+ type: "object",
3826
+ description: "Quote Selector",
3827
+ properties: {
3828
+ ...textQuoteSelectorSchema.properties,
3829
+ refinedBy: {
3830
+ type: "object",
3831
+ description: selectorRefinedByDescription,
3832
+ oneOf: [
3833
+ { $ref: "defs.jsonld#/definitions/textPositionSelector" },
3834
+ { $ref: "defs.jsonld#/definitions/textQuoteSelector" }
3835
+ ],
3836
+ nullable: true,
3837
+ required: []
3838
+ }
3839
+ },
3840
+ required: ["id", "type", "exact", "prefix", "suffix"]
3841
+ };
3842
+
3843
+ // src/v1/schema/definitions/target/selector/xpath.ts
3844
+ var XpathSelector = import_zod19.z.object({
3845
+ id: import_zod19.z.string().describe(selectorIdDescription),
3846
+ type: import_zod19.z.tuple([import_zod19.z.literal("XPathSelector"), import_zod19.z.literal("crm:E73_Information_Object")]),
3847
+ value: import_zod19.z.string().min(1).describe("The xpath to the selected segment.")
3586
3848
  }).describe("Xpath Selector");
3849
+ var XpathSelectorExtended = XpathSelector.extend({
3850
+ refinedBy: import_zod19.z.union([TextPositionSelector, TextQuoteSelector]).optional().describe(selectorRefinedByDescription)
3851
+ });
3587
3852
  var xpathSelectorSchema = {
3588
3853
  type: "object",
3589
3854
  description: "Xpath Selector",
3590
3855
  properties: {
3591
- id: {
3592
- type: "string",
3593
- format: "uuid",
3594
- description: "UUID that identifies the selector."
3595
- },
3856
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3596
3857
  type: {
3597
3858
  type: "array",
3598
3859
  minItems: 2,
@@ -3606,20 +3867,33 @@ var xpathSelectorSchema = {
3606
3867
  value: {
3607
3868
  type: "string",
3608
3869
  description: "Web Annotation Target Select Xpath"
3609
- },
3870
+ }
3871
+ },
3872
+ required: ["id", "type", "value"]
3873
+ };
3874
+ var xpathSelectorExtendedSchema = {
3875
+ type: "object",
3876
+ description: "Xpath Selector",
3877
+ properties: {
3878
+ ...xpathSelectorSchema.properties,
3610
3879
  refinedBy: {
3611
- $ref: "defs.jsonld#/definitions/textPositionSelector",
3612
- description: "The relationship between a broader selector and the more specific selector that should be applied to the results of the first."
3880
+ type: "object",
3881
+ description: selectorRefinedByDescription,
3882
+ anyOf: [
3883
+ { $ref: "defs.jsonld#/definitions/textPositionSelector" },
3884
+ { $ref: "defs.jsonld#/definitions/textQuoteSelector" }
3885
+ ],
3886
+ nullable: true,
3887
+ required: []
3613
3888
  }
3614
3889
  },
3615
3890
  required: ["id", "type", "value"]
3616
- // errorMessage: { properties: { id: 'Must be an URI' } },
3617
3891
  };
3618
3892
 
3619
3893
  // src/v1/schema/definitions/target/selector/range.ts
3620
- var RangeSelector = import_zod19.z.object({
3621
- id: import_zod19.z.string().uuid().describe("UUID that identifies the selector."),
3622
- type: import_zod19.z.tuple([import_zod19.z.literal("RangeSelector"), import_zod19.z.literal("crm:E73_Information_Object")]),
3894
+ var RangeSelector = import_zod20.z.object({
3895
+ id: import_zod20.z.string().url().describe(selectorIdDescription),
3896
+ type: import_zod20.z.tuple([import_zod20.z.literal("RangeSelector"), import_zod20.z.literal("crm:E73_Information_Object")]),
3623
3897
  startSelector: XpathSelector,
3624
3898
  endSelector: XpathSelector
3625
3899
  }).describe("Range Selector");
@@ -3627,11 +3901,7 @@ var rangeSelectorSchema = {
3627
3901
  type: "object",
3628
3902
  description: "Range Selector",
3629
3903
  properties: {
3630
- id: {
3631
- type: "string",
3632
- format: "uuid",
3633
- description: "UUID that identifies the selector."
3634
- },
3904
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3635
3905
  type: {
3636
3906
  type: "array",
3637
3907
  minItems: 2,
@@ -3646,106 +3916,113 @@ var rangeSelectorSchema = {
3646
3916
  endSelector: { $ref: "defs.jsonld#/definitions/xpathSelector" }
3647
3917
  },
3648
3918
  required: ["id", "type", "startSelector", "endSelector"]
3649
- // errorMessage: { properties: { id: 'Must be an URI' } },
3650
3919
  };
3651
3920
 
3652
- // src/v1/schema/definitions/target/selector/textQuote.ts
3653
- var import_zod20 = require("zod");
3654
- var TextQuoteSelector = import_zod20.z.object({
3655
- id: import_zod20.z.string().uuid().describe("UUID that identifies the selector."),
3656
- type: import_zod20.z.tuple([import_zod20.z.literal("TextQuoteSelector"), import_zod20.z.literal("crm:E33_Linguistic_Object")]),
3657
- exact: import_zod20.z.string().describe("A copy of the text which is being selected, after normalization."),
3658
- prefix: import_zod20.z.string().optional().describe(
3659
- "The snippet of text that occurs immediately before the text which is being selected."
3921
+ // src/v1/schema/definitions/target/selector/index.ts
3922
+ var selectorIdDescription = "UUID that identifies the selector.";
3923
+ var selectorRefinedByDescription = "The relationship between a broader selector and the more specific selector that should be applied to the results of the first.";
3924
+ var Selector = import_zod21.z.union([
3925
+ TextQuoteSelectorExtended,
3926
+ TextPositionSelectorExtended,
3927
+ XpathSelectorExtended,
3928
+ RangeSelector
3929
+ ]);
3930
+ var selectorSchema = {
3931
+ type: "object",
3932
+ oneOf: [
3933
+ textQuoteSelectorExtendedSchema,
3934
+ textPositionSelectorExtendedSchema,
3935
+ xpathSelectorExtendedSchema,
3936
+ rangeSelectorSchema
3937
+ ],
3938
+ required: []
3939
+ };
3940
+
3941
+ // src/v1/schema/definitions/target/source.ts
3942
+ var import_zod22 = require("zod");
3943
+ var formatDescription = "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.";
3944
+ var Format = import_zod22.z.string().min(1).describe(formatDescription);
3945
+ var formatSchema = {
3946
+ type: "string",
3947
+ description: formatDescription,
3948
+ minLength: 1
3949
+ };
3950
+ var languageDescription = "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification.";
3951
+ var Language = import_zod22.z.string().min(2).max(3).describe(languageDescription);
3952
+ var languageSchema = {
3953
+ type: "string",
3954
+ description: languageDescription,
3955
+ minLength: 2,
3956
+ maxLength: 3
3957
+ };
3958
+ var sourceIdDescription = "The IRI that identifies the Target source.";
3959
+ var Source = import_zod22.z.object({
3960
+ id: import_zod22.z.string().url().describe(sourceIdDescription),
3961
+ format: import_zod22.z.union([Format, import_zod22.z.array(Format).min(1)]).optional().describe(
3962
+ "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."
3660
3963
  ),
3661
- sufix: import_zod20.z.string().optional().describe(
3662
- "The snippet of text that occurs immediately after the text which is being selected."
3964
+ language: import_zod22.z.union([Language, import_zod22.z.array(Language).min(1)]).optional().describe(
3965
+ "The languages of the Web Resource's content. The value of the property should be an array of language code following the [bcp47] specification."
3663
3966
  ),
3664
- refinedBy: import_zod20.z.union([RangeSelector, XpathSelector, TextPositionSelector]).optional().describe(
3665
- "The relationship between a broader selector and the more specific selector that should be applied to the results of the first."
3666
- )
3667
- }).describe("Quote Selector");
3668
- var textQuoteSelectorSchema = {
3967
+ title: import_zod22.z.string().min(1, { message: "The title cannot be empty" }).optional().describe("The title of the document being annotated.")
3968
+ }).describe("Web Annotation Target");
3969
+ var sourceSchema = {
3669
3970
  type: "object",
3670
- description: "Quote Selector",
3971
+ description: `Web Annotation Target's source`,
3671
3972
  properties: {
3672
- id: {
3673
- type: "string",
3674
- format: "uuid",
3675
- description: "UUID that identifies the selector."
3676
- },
3677
- type: {
3678
- type: "array",
3679
- minItems: 2,
3680
- maxItems: 2,
3681
- items: [
3682
- { type: "string", const: "TextQuoteSelector" },
3683
- { type: "string", const: "crm:E33_Linguistic_Object" }
3684
- ],
3685
- description: "The class of the Selector"
3686
- },
3687
- exact: {
3688
- type: "string",
3689
- description: "A copy of the text which is being selected, after normalization."
3973
+ id: { type: "string", format: "uri", description: sourceIdDescription },
3974
+ format: {
3975
+ type: ["string", "array"],
3976
+ nullable: true,
3977
+ anyOf: [
3978
+ formatSchema,
3979
+ {
3980
+ type: "array",
3981
+ minItems: 1,
3982
+ items: formatSchema,
3983
+ 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."
3984
+ }
3985
+ ]
3690
3986
  },
3691
- prefix: {
3692
- type: "string",
3693
- description: "The snippet of text that occurs immediately before the text which is being selected."
3987
+ language: {
3988
+ type: ["string", "array"],
3989
+ nullable: true,
3990
+ anyOf: [
3991
+ languageSchema,
3992
+ {
3993
+ type: "array",
3994
+ minItems: 1,
3995
+ items: languageSchema,
3996
+ 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."
3997
+ }
3998
+ ]
3694
3999
  },
3695
- sufix: {
4000
+ title: {
3696
4001
  type: "string",
3697
- description: "The snippet of text that occurs immediately after the text which is being selected."
3698
- },
3699
- refinedBy: {
3700
- type: "object",
3701
- description: "The relationship between a broader selector and the more specific selector that should be applied to the results of the first.",
3702
- oneOf: [
3703
- { $ref: "defs.jsonld#/definitions/rangeSelector" },
3704
- { $ref: "defs.jsonld#/definitions/xpathSelector" },
3705
- { $ref: "defs.jsonld#/definitions/textPositionSelector" }
3706
- ],
3707
- required: []
4002
+ minLength: 1,
4003
+ nullable: true,
4004
+ description: "The title of the document being annotated."
3708
4005
  }
3709
4006
  },
3710
- required: ["id", "type", "exact"]
3711
- // errorMessage: { properties: { id: 'Must be an URI' } },
4007
+ required: ["id"]
3712
4008
  };
3713
4009
 
3714
4010
  // src/v1/schema/definitions/target/index.ts
3715
- var Target = import_zod21.z.object({
3716
- id: import_zod21.z.union([import_zod21.z.string().url(), import_zod21.z.string().uuid()]).describe("The IRI that identifies the Target resource."),
3717
- type: import_zod21.z.tuple([import_zod21.z.literal("SpecificResource"), import_zod21.z.literal("crm:E73_Information_Object")]).describe("The class of the Specific Resource."),
3718
- format: import_zod21.z.array(
3719
- import_zod21.z.string().min(1).describe(
3720
- "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."
3721
- )
3722
- ).optional().describe(
3723
- "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."
3724
- ),
3725
- language: import_zod21.z.array(
3726
- import_zod21.z.string().min(2).max(3).describe(
3727
- "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification."
3728
- )
3729
- ).min(1).optional().describe(
3730
- "The languages of the Web Resource's content. The value of the property should be an array of language code following the [bcp47] specification."
3731
- ),
3732
- title: import_zod21.z.string().min(1, { message: "The title cannot be empty" }).optional().describe("The title of the document being annotated."),
4011
+ var targetIdDescription = "The IRI that identifies the Target resource.";
4012
+ var Target = import_zod23.z.object({
4013
+ id: import_zod23.z.string().url().describe(targetIdDescription),
4014
+ type: import_zod23.z.tuple([import_zod23.z.literal("SpecificResource"), import_zod23.z.literal("crm:E73_Information_Object")]).describe("The class of the Specific Resource."),
4015
+ source: Source,
3733
4016
  renderedVia: Software.optional().describe(
3734
4017
  "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."
3735
4018
  ),
3736
- selector: import_zod21.z.union([TextQuoteSelector, RangeSelector, XpathSelector, TextPositionSelector]).optional().describe("The relationship between a Specific Resource and a Selector. ")
4019
+ selector: import_zod23.z.union([Selector, import_zod23.z.array(Selector)]).describe("The relationship between a Specific Resource and a Selector. ")
3737
4020
  }).describe("Web Annotation Target");
3738
4021
  var targetSchema = {
3739
4022
  type: "object",
3740
4023
  description: "Web Annotation Target",
3741
4024
  properties: {
3742
- id: {
3743
- anyOf: [
3744
- { type: "string", format: "uri", description: "This document URI" },
3745
- { type: "string", format: "uuid" }
3746
- ],
3747
- description: "The IRI that identifies the Target resource."
3748
- },
4025
+ id: { type: "string", format: "uri", description: targetIdDescription },
3749
4026
  type: {
3750
4027
  type: "array",
3751
4028
  minItems: 2,
@@ -3756,49 +4033,23 @@ var targetSchema = {
3756
4033
  ],
3757
4034
  description: "The class of the Specific Resource."
3758
4035
  },
3759
- format: {
3760
- type: "array",
3761
- items: {
3762
- type: "string",
3763
- minLength: 1,
3764
- 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."
3765
- },
3766
- 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."
3767
- },
3768
- language: {
3769
- type: "array",
3770
- items: {
3771
- type: "string",
3772
- minLength: 2,
3773
- maxLength: 3,
3774
- description: "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification."
3775
- },
3776
- minItems: 1,
3777
- 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."
3778
- },
3779
- title: {
3780
- type: "string",
3781
- minLength: 1,
3782
- description: "The title of the document being annotated."
3783
- },
4036
+ source: sourceSchema,
3784
4037
  renderedVia: {
3785
4038
  $ref: "defs.jsonld#/definitions/software",
3786
4039
  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."
3787
4040
  },
3788
4041
  selector: {
3789
- type: "object",
3790
- oneOf: [
3791
- { $ref: "defs.jsonld#/definitions/textQuoteSelector" },
3792
- { $ref: "defs.jsonld#/definitions/rangeSelector" },
3793
- { $ref: "defs.jsonld#/definitions/xpathSelector" },
3794
- { $ref: "defs.jsonld#/definitions/textPositionSelector" }
3795
- ],
3796
- description: "The relationship between a Specific Resource and a Selector. ",
3797
- required: ["id", "type"]
4042
+ anyOf: [
4043
+ selectorSchema,
4044
+ {
4045
+ type: "array",
4046
+ items: selectorSchema,
4047
+ minItems: 1
4048
+ }
4049
+ ]
3798
4050
  }
3799
4051
  },
3800
- required: ["id", "type"],
3801
- // errorMessage: { properties: { id: 'Must be an URI or an UUID' } },
4052
+ required: ["id", "type", "source", "selector"],
3802
4053
  allOf: [
3803
4054
  {
3804
4055
  if: {
@@ -3823,10 +4074,9 @@ var targetSchema = {
3823
4074
  then: {
3824
4075
  type: "object",
3825
4076
  properties: {
3826
- selector: { type: "object", required: ["type", "exact"] }
4077
+ selector: { type: "object", required: ["id", "type", "exact", "prefix", "suffix"] }
3827
4078
  }
3828
- },
3829
- required: ["selector"]
4079
+ }
3830
4080
  },
3831
4081
  {
3832
4082
  if: {
@@ -3852,8 +4102,7 @@ var targetSchema = {
3852
4102
  type: "object",
3853
4103
  properties: {
3854
4104
  selector: { type: "object", required: ["type", "startSelector", "endSelector"] }
3855
- },
3856
- required: ["selector"]
4105
+ }
3857
4106
  }
3858
4107
  },
3859
4108
  {
@@ -3880,8 +4129,7 @@ var targetSchema = {
3880
4129
  type: "object",
3881
4130
  properties: {
3882
4131
  selector: { type: "object", required: ["type", "value"] }
3883
- },
3884
- required: ["selector"]
4132
+ }
3885
4133
  }
3886
4134
  },
3887
4135
  {
@@ -3908,8 +4156,7 @@ var targetSchema = {
3908
4156
  type: "object",
3909
4157
  properties: {
3910
4158
  selector: { type: "object", required: ["type", "start", "end"] }
3911
- },
3912
- required: ["selector"]
4159
+ }
3913
4160
  }
3914
4161
  }
3915
4162
  ]
@@ -3923,17 +4170,17 @@ var definitionSchema = {
3923
4170
  creator: creatorSchema,
3924
4171
  software: softwareSchema,
3925
4172
  target: targetSchema,
4173
+ textPositionSelector: textPositionSelectorSchema,
3926
4174
  textQuoteSelector: textQuoteSelectorSchema,
3927
- rangeSelector: rangeSelectorSchema,
3928
4175
  xpathSelector: xpathSelectorSchema,
3929
- textPositionSelector: textPositionSelectorSchema,
4176
+ rangeSelector: rangeSelectorSchema,
3930
4177
  body: bodySchema
3931
4178
  },
3932
4179
  required: []
3933
4180
  };
3934
4181
 
3935
4182
  // src/v1/schema/root.ts
3936
- var import_zod22 = require("zod");
4183
+ var import_zod24 = require("zod");
3937
4184
  var Status = ["draft", "approved", "published"];
3938
4185
  var Motivation = [
3939
4186
  "identifying",
@@ -3944,32 +4191,26 @@ var Motivation = [
3944
4191
  "linking",
3945
4192
  "citing"
3946
4193
  ];
3947
- var WebAnnotation = import_zod22.z.object({
3948
- "@context": import_zod22.z.tuple([
3949
- import_zod22.z.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
3950
- import_zod22.z.literal(contextUri).describe("LINCS Web Annotation Context.")
4194
+ var WebAnnotation = import_zod24.z.object({
4195
+ "@context": import_zod24.z.tuple([
4196
+ import_zod24.z.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
4197
+ import_zod24.z.literal(contextUri).describe("LINCS Web Annotation Context.")
3951
4198
  ]).describe(
3952
4199
  "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."
3953
4200
  ),
3954
- id: import_zod22.z.union([
3955
- import_zod22.z.string().url(),
3956
- //? We can improve this making it a regexp to make sure that this URI contains a search params named 'annoID' with n UUID value".])
3957
- import_zod22.z.string().uuid()
3958
- ]).describe(
3959
- "The identity of the Annotation. It must be a UUID or URI containing a UUID in the search params (URI?annoId=URI)"
3960
- ),
3961
- type: import_zod22.z.tuple([import_zod22.z.literal("Annotation"), import_zod22.z.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
3962
- motivation: import_zod22.z.tuple([import_zod22.z.enum(Motivation), import_zod22.z.literal("crm:E55_Type")]).describe("The relationship between an Annotation and a Motivation."),
3963
- created: import_zod22.z.string().datetime().describe("The time at which the resource was created."),
3964
- modified: import_zod22.z.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
3965
- status: import_zod22.z.enum(Status).describe("The status of this annotation in a workflow."),
4201
+ id: import_zod24.z.string().url().describe("The identity of the Annotation."),
4202
+ type: import_zod24.z.tuple([import_zod24.z.literal("Annotation"), import_zod24.z.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
4203
+ motivation: import_zod24.z.tuple([import_zod24.z.enum(Motivation), import_zod24.z.literal("crm:E55_Type")]).describe("The relationship between an Annotation and a Motivation."),
4204
+ created: import_zod24.z.string().datetime().describe("The time at which the resource was created."),
4205
+ modified: import_zod24.z.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
4206
+ status: import_zod24.z.enum(Status).describe("The status of this annotation in a workflow."),
3966
4207
  creator: User.describe("The agent responsible for creating the resource.").optional(),
3967
- contributor: import_zod22.z.array(User.describe("The agents responsible for modifying the resource.")).nonempty().optional().describe("The agents responsible for modifying the resource."),
4208
+ contributor: import_zod24.z.array(User.describe("The agents responsible for modifying the resource.")).nonempty().optional().describe("The agents responsible for modifying the resource."),
3968
4209
  generator: Software.describe(
3969
4210
  "The agent responsible for generating the serialization of the Annotation. "
3970
4211
  ),
3971
4212
  target: Target.describe("The relationship between an Annotation and its Target."),
3972
- body: import_zod22.z.union([Body, import_zod22.z.array(Body)]).describe("The relationship between an Annotation and its Body.")
4213
+ body: import_zod24.z.union([Body, import_zod24.z.array(Body)]).describe("The relationship between an Annotation and its Body.")
3973
4214
  }).describe("Web Annotation Root");
3974
4215
  var webAnnotationSchema = {
3975
4216
  $id: schemaId,
@@ -3987,15 +4228,9 @@ var webAnnotationSchema = {
3987
4228
  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."
3988
4229
  },
3989
4230
  id: {
3990
- anyOf: [
3991
- {
3992
- type: "string",
3993
- format: "uri",
3994
- description: "It must be a UUID or URI containing a UUID in the search params (URI?annoId=URI)."
3995
- },
3996
- { type: "string", format: "uuid" }
3997
- ],
3998
- description: "The identity of the Annotation. It must be a UUID or URI containing a UUID in the search params (URI?annoId=URI)"
4231
+ type: "string",
4232
+ format: "uri",
4233
+ description: "The type of the Annotation."
3999
4234
  },
4000
4235
  type: {
4001
4236
  type: "array",
@@ -4062,28 +4297,6 @@ var webAnnotationSchema = {
4062
4297
  "status"
4063
4298
  ],
4064
4299
  allOf: [
4065
- {
4066
- if: {
4067
- type: "object",
4068
- properties: {
4069
- status: { const: "published" }
4070
- }
4071
- },
4072
- then: {
4073
- type: "object",
4074
- properties: {
4075
- id: { type: "string", format: "uri" }
4076
- },
4077
- required: ["status"]
4078
- },
4079
- else: {
4080
- type: "object",
4081
- properties: {
4082
- id: { type: "string", format: "uuid" }
4083
- },
4084
- required: ["status"]
4085
- }
4086
- },
4087
4300
  {
4088
4301
  if: {
4089
4302
  type: "object",
@@ -4294,24 +4507,25 @@ var import_ajv = __toESM(require("ajv"));
4294
4507
  var import_ajv_formats = __toESM(require("ajv-formats"));
4295
4508
 
4296
4509
  // src/v1/validator/types.ts
4297
- var import_zod23 = require("zod");
4298
- var ValidationError = import_zod23.z.object({
4299
- message: import_zod23.z.string(),
4300
- path: import_zod23.z.string(),
4301
- suggestion: import_zod23.z.string().optional(),
4302
- context: import_zod23.z.object({
4303
- errorType: import_zod23.z.string()
4304
- }).and(import_zod23.z.unknown())
4510
+ var import_zod25 = require("zod");
4511
+ var ValidationError = import_zod25.z.object({
4512
+ message: import_zod25.z.string(),
4513
+ path: import_zod25.z.string(),
4514
+ suggestion: import_zod25.z.string().optional(),
4515
+ context: import_zod25.z.object({
4516
+ errorType: import_zod25.z.string()
4517
+ }).and(import_zod25.z.unknown())
4305
4518
  });
4306
- var ValidateResult = import_zod23.z.object({
4307
- valid: import_zod23.z.boolean(),
4308
- errors: import_zod23.z.array(ValidationError).optional()
4519
+ var ValidateResult = import_zod25.z.object({
4520
+ valid: import_zod25.z.boolean(),
4521
+ errors: import_zod25.z.array(ValidationError).optional()
4309
4522
  });
4310
4523
 
4311
4524
  // src/v1/validator/index.ts
4312
4525
  var ajv = new import_ajv.default({
4313
4526
  code: { source: true },
4314
- allErrors: true
4527
+ allErrors: true,
4528
+ allowUnionTypes: true
4315
4529
  }).addSchema([webAnnotationSchema, definitionSchema]);
4316
4530
  (0, import_ajv_formats.default)(ajv);
4317
4531
  var validator = ajv.compile(webAnnotationSchema);
@@ -4338,33 +4552,119 @@ var getErrors = (annotation) => {
4338
4552
  var v1_exports = {};
4339
4553
  __export(v1_exports, {
4340
4554
  Body: () => Body,
4555
+ BodyEntityType: () => BodyEntityType,
4556
+ Certainty: () => Certainty,
4557
+ Citation: () => Citation,
4558
+ CitationEntityType: () => CitationEntityType,
4559
+ ConceptualObject: () => ConceptualObject,
4560
+ ConceptualObjectEntityType: () => ConceptualObjectEntityType,
4561
+ Correction: () => Correction,
4562
+ CorrectionEntityType: () => CorrectionEntityType,
4563
+ DATE_RANGE_PATTERN: () => DATE_RANGE_PATTERN,
4564
+ Date: () => Date2,
4565
+ DateEntityType: () => DateEntityType,
4566
+ Description: () => Description,
4567
+ Event: () => Event,
4568
+ EventEntityType: () => EventEntityType,
4569
+ Keyword: () => Keyword,
4570
+ KeywordEntityType: () => KeywordEntityType,
4571
+ KeywordFolksnomy: () => KeywordFolksnomy,
4572
+ KeywordFolksnomyEntityType: () => KeywordFolksnomyEntityType,
4573
+ Label: () => Label,
4574
+ Link: () => Link,
4575
+ LinkEntityType: () => LinkEntityType,
4341
4576
  Motivation: () => Motivation,
4577
+ Note: () => Note,
4578
+ NoteEntityType: () => NoteEntityType,
4579
+ Organization: () => Organization,
4580
+ OrganizationEntityType: () => OrganizationEntityType,
4342
4581
  Person: () => Person,
4343
4582
  PersonEntityType: () => PersonEntityType,
4583
+ PhysicalThing: () => PhysicalThing,
4584
+ PhysicalThingEntityType: () => PhysicalThingEntityType,
4585
+ Place: () => Place,
4586
+ PlaceEntityType: () => PlaceEntityType,
4587
+ Precision: () => Precision,
4588
+ Quality: () => Quality,
4589
+ RangeSelector: () => RangeSelector,
4590
+ Selector: () => Selector,
4344
4591
  Software: () => Software,
4592
+ Source: () => Source,
4345
4593
  Status: () => Status,
4346
4594
  Target: () => Target,
4595
+ TextPositionSelector: () => TextPositionSelector,
4596
+ TextPositionSelectorExtended: () => TextPositionSelectorExtended,
4597
+ TextQuoteSelector: () => TextQuoteSelector,
4598
+ TextQuoteSelectorExtended: () => TextQuoteSelectorExtended,
4347
4599
  User: () => User,
4348
4600
  VERSION: () => VERSION,
4349
4601
  ValidateResult: () => ValidateResult,
4350
4602
  ValidationError: () => ValidationError,
4351
4603
  WebAnnotation: () => WebAnnotation,
4604
+ Work: () => Work,
4605
+ WorkEntityType: () => WorkEntityType,
4606
+ XpathSelector: () => XpathSelector,
4607
+ XpathSelectorExtended: () => XpathSelectorExtended,
4352
4608
  ajv: () => ajv,
4609
+ bodyIdDescription: () => bodyIdDescription,
4353
4610
  bodySchema: () => bodySchema,
4611
+ certaintySchema: () => certaintySchema,
4612
+ citationEntityTypeSchema: () => citationEntityTypeSchema,
4613
+ citationSchema: () => citationSchema,
4614
+ conceptualObjectEntityTypeSchema: () => conceptualObjectEntityTypeSchema,
4615
+ conceptualObjectSchema: () => conceptualObjectSchema,
4354
4616
  contextUri: () => contextUri,
4617
+ correctionEntityTypeSchema: () => correctionEntityTypeSchema,
4618
+ correctionSchema: () => correctionSchema,
4355
4619
  creatorSchema: () => creatorSchema,
4620
+ dateEntityTypeSchema: () => dateEntityTypeSchema,
4621
+ dateSchema: () => dateSchema,
4356
4622
  definitionSchema: () => definitionSchema,
4357
4623
  defsId: () => defsId,
4624
+ descriptionSchema: () => descriptionSchema,
4625
+ eventEntityTypeSchema: () => eventEntityTypeSchema,
4626
+ eventSchema: () => eventSchema,
4627
+ formatSchema: () => formatSchema,
4358
4628
  generateAssets: () => generateAssets,
4629
+ keywordEntityTypeSchema: () => keywordEntityTypeSchema,
4630
+ keywordFolksnomyEntityTypeSchema: () => keywordFolksnomyEntityTypeSchema,
4631
+ keywordFolksnomySchema: () => keywordFolksnomySchema,
4632
+ keywordSchema: () => keywordSchema,
4633
+ labelSchema: () => labelSchema,
4634
+ languageSchema: () => languageSchema,
4635
+ linkEntityTypeSchema: () => linkEntityTypeSchema,
4636
+ linkSchema: () => linkSchema,
4637
+ noteEntityTypeSchema: () => noteEntityTypeSchema,
4638
+ noteSchema: () => noteSchema,
4639
+ organizationEntityTypeSchema: () => organizationEntityTypeSchema,
4640
+ organizationSchema: () => organizationSchema,
4359
4641
  personEntityTypeSchema: () => personEntityTypeSchema,
4360
4642
  personSchema: () => personSchema,
4643
+ physicalThingEntityTypeSchema: () => physicalThingEntityTypeSchema,
4644
+ physicalThingSchema: () => physicalThingSchema,
4645
+ placeEntityTypeSchema: () => placeEntityTypeSchema,
4646
+ placeSchema: () => placeSchema,
4647
+ precisionSchema: () => precisionSchema,
4648
+ rangeSelectorSchema: () => rangeSelectorSchema,
4361
4649
  schemaContext: () => schemaContext,
4362
4650
  schemaId: () => schemaId,
4651
+ selectorIdDescription: () => selectorIdDescription,
4652
+ selectorRefinedByDescription: () => selectorRefinedByDescription,
4653
+ selectorSchema: () => selectorSchema,
4363
4654
  softwareSchema: () => softwareSchema,
4655
+ sourceSchema: () => sourceSchema,
4364
4656
  targetSchema: () => targetSchema,
4657
+ textPositionSelectorExtendedSchema: () => textPositionSelectorExtendedSchema,
4658
+ textPositionSelectorSchema: () => textPositionSelectorSchema,
4659
+ textQuoteSelectorExtendedSchema: () => textQuoteSelectorExtendedSchema,
4660
+ textQuoteSelectorSchema: () => textQuoteSelectorSchema,
4365
4661
  validate: () => validate,
4366
4662
  validator: () => validator,
4367
- webAnnotationSchema: () => webAnnotationSchema
4663
+ webAnnotationSchema: () => webAnnotationSchema,
4664
+ workEntityTypeSchema: () => workEntityTypeSchema,
4665
+ workSchema: () => workSchema,
4666
+ xpathSelectorExtendedSchema: () => xpathSelectorExtendedSchema,
4667
+ xpathSelectorSchema: () => xpathSelectorSchema
4368
4668
  });
4369
4669
 
4370
4670
  // src/v1/generate/examples.ts
@@ -4480,45 +4780,49 @@ var commonCreator = {
4480
4780
  name: "user"
4481
4781
  };
4482
4782
  var commonSoftware = {
4483
- id: "htpps://leafwriter.com",
4783
+ id: "https://leafwriter.com",
4484
4784
  type: ["Software", "crm:P16_used_specific_object"],
4485
4785
  label: "LEAF-Writer"
4486
4786
  };
4487
4787
  var commonSelectorTextPosition = {
4488
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4788
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec584",
4489
4789
  type: ["TextPositionSelector", "crm:E73_Information_Object"],
4490
4790
  start: 12,
4491
4791
  end: 30
4492
4792
  };
4493
4793
  var commonSelectorXpath = {
4494
- id: "55369c00-5c43-4d1a-8462-31c74fbec582",
4794
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec582",
4495
4795
  type: ["XPathSelector", "crm:E73_Information_Object"],
4496
4796
  value: "TEI/tex/div/text/p/personName"
4497
4797
  };
4498
4798
  var commonSelectorRange = {
4499
- id: "55369c00-5c43-4d1a-8462-31c74fbec582",
4799
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec581",
4500
4800
  type: ["RangeSelector", "crm:E73_Information_Object"],
4501
4801
  startSelector: commonSelectorXpath,
4502
4802
  endSelector: commonSelectorXpath
4503
4803
  };
4504
4804
  var commonSelectorTextQuote = {
4505
- id: "55369c00-5c43-4d1a-8462-31c74fbec583",
4805
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec583",
4506
4806
  type: ["TextQuoteSelector", "crm:E33_Linguistic_Object"],
4507
- exact: "text",
4508
- prefix: "pre",
4509
- suffix: "suf"
4510
- };
4511
- var commonDetailedSelector = {
4512
- ...commonSelectorTextQuote,
4513
- refinedBy: { ...commonSelectorXpath, refinedBy: commonSelectorTextPosition }
4807
+ exact: "exact text",
4808
+ prefix: "prefix text",
4809
+ suffix: "prefix text"
4514
4810
  };
4515
4811
  var commonTarget = {
4516
- id: "https://document.com",
4812
+ id: "https://wa.lincsproject/target/55369c00-5c43-4d1a-8462-31c74fbec522",
4517
4813
  type: ["SpecificResource", "crm:E73_Information_Object"],
4518
- format: ["application/xml"],
4519
- language: ["eng"],
4520
- renderedVia: commonSoftware,
4521
- selector: commonDetailedSelector
4814
+ source: {
4815
+ id: "https://document-url.com"
4816
+ },
4817
+ selector: commonSelectorTextQuote
4818
+ };
4819
+ var commonTargetMultipleSelectors = {
4820
+ id: "https://wa.lincsproject/target/55369c00-5c43-4d1a-8462-31c74fbec522",
4821
+ type: ["SpecificResource", "crm:E73_Information_Object"],
4822
+ source: {
4823
+ id: "https://document-url.com"
4824
+ },
4825
+ selector: [commonSelectorTextQuote, commonSelectorTextPosition]
4522
4826
  };
4523
4827
  var commonBody = {
4524
4828
  id: "https://www.uo.com/person",
@@ -4526,7 +4830,7 @@ var commonBody = {
4526
4830
  };
4527
4831
  var commonAnnotation = {
4528
4832
  "@context": ["http://www.w3.org/ns/anno.jsonld", "https://wa.lincsproject.ca/v1/ns/anno.jsonld"],
4529
- id: "c7aa1b38-6364-483c-8607-44dc3f510a59",
4833
+ id: "https://wa.lincsproject/c7aa1b38-6364-483c-8607-44dc3f510a59",
4530
4834
  type: ["Annotation", "crm:E33_Linguistic_Object"],
4531
4835
  motivation: ["identifying", "crm:E55_Type"],
4532
4836
  created: "2022-12-21T23:21:02Z",
@@ -4543,7 +4847,10 @@ var common = {
4543
4847
  textPosition: commonSelectorTextPosition,
4544
4848
  xpath: commonSelectorXpath,
4545
4849
  range: commonSelectorRange,
4546
- textQuote: commonSelectorTextQuote
4850
+ textQuote: commonSelectorTextQuote,
4851
+ multipleSelectors: {
4852
+ textQuoteAndTextPosition: commonTargetMultipleSelectors
4853
+ }
4547
4854
  },
4548
4855
  target: commonTarget,
4549
4856
  body: commonBody,
@@ -4654,7 +4961,7 @@ var simple = {
4654
4961
  ...common.annotation,
4655
4962
  motivation: ["citing", "crm:E55_Type"],
4656
4963
  body: {
4657
- id: "https://www.uo.com/conceptualObject",
4964
+ id: "https://www.uo.com/work",
4658
4965
  entityType: ["cito:Citation", "crm:E73_Information_Object"]
4659
4966
  }
4660
4967
  };
@@ -4662,7 +4969,7 @@ var withCertainty3 = {
4662
4969
  ...common.annotation,
4663
4970
  motivation: ["citing", "crm:E55_Type"],
4664
4971
  body: {
4665
- id: "https://www.uo.com/conceptualObject",
4972
+ id: "https://www.uo.com/work",
4666
4973
  entityType: ["cito:Citation", "crm:E73_Information_Object"],
4667
4974
  certainty: "edit:qualityHigh"
4668
4975
  }
@@ -4671,7 +4978,7 @@ var withLabelAndDescription3 = {
4671
4978
  ...common.annotation,
4672
4979
  motivation: ["citing", "crm:E55_Type"],
4673
4980
  body: {
4674
- id: "https://www.uo.com/conceptualObject",
4981
+ id: "https://www.uo.com/work",
4675
4982
  entityType: ["cito:Citation", "crm:E73_Information_Object"],
4676
4983
  label: "Sandman",
4677
4984
  description: "Graphic Novel"
@@ -4731,7 +5038,7 @@ var valid = {
4731
5038
  ...common.annotation,
4732
5039
  motivation: ["correcting", "crm:E55_Type"],
4733
5040
  body: {
4734
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5041
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4735
5042
  type: "TextualBody",
4736
5043
  entityType: ["fabio:Correction", "crm:E33_Linguistic_Object"],
4737
5044
  value: "this is a correction"
@@ -4745,7 +5052,7 @@ var correction = {
4745
5052
  var simple2 = {
4746
5053
  ...common.annotation,
4747
5054
  body: {
4748
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5055
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4749
5056
  type: "TextualBody",
4750
5057
  entityType: ["xsd:date", "crm:E52_Time-Span"],
4751
5058
  value: "2012-03-01T00:00:00/2012-02-01T18:21:07"
@@ -4754,7 +5061,7 @@ var simple2 = {
4754
5061
  var withCertainty5 = {
4755
5062
  ...common.annotation,
4756
5063
  body: {
4757
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5064
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4758
5065
  type: "TextualBody",
4759
5066
  entityType: ["xsd:date", "crm:E52_Time-Span"],
4760
5067
  value: "2012-03-01T00:00:00/2012-02-01T18:21:07",
@@ -4764,7 +5071,7 @@ var withCertainty5 = {
4764
5071
  var withPrecision2 = {
4765
5072
  ...common.annotation,
4766
5073
  body: {
4767
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5074
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4768
5075
  type: "TextualBody",
4769
5076
  entityType: ["xsd:date", "crm:E52_Time-Span"],
4770
5077
  value: "2012-03-01T00:00:00/2012-02-01T18:21:07",
@@ -4811,7 +5118,7 @@ var folksonomy = {
4811
5118
  ...common.annotation,
4812
5119
  motivation: ["tagging", "crm:E55_Type"],
4813
5120
  body: {
4814
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5121
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4815
5122
  type: "TextualBody",
4816
5123
  entityType: ["crm:E55_Type", "crm:E33_Linguistic_Object"],
4817
5124
  value: "a tag"
@@ -4858,7 +5165,7 @@ var simple4 = {
4858
5165
  ...common.annotation,
4859
5166
  motivation: ["describing", "crm:E55_Type"],
4860
5167
  body: {
4861
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5168
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4862
5169
  type: "TextualBody",
4863
5170
  entityType: "crm:E33_Linguistic_Object",
4864
5171
  value: "this is a note"
@@ -4868,7 +5175,7 @@ var additionalType = {
4868
5175
  ...common.annotation,
4869
5176
  motivation: ["describing", "crm:E55_Type"],
4870
5177
  body: {
4871
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5178
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4872
5179
  type: "TextualBody",
4873
5180
  entityType: "crm:E33_Linguistic_Object",
4874
5181
  additionalType: "cwrc:NoteScholarly",
@@ -4879,7 +5186,7 @@ var additionalMultipleTypes = {
4879
5186
  ...common.annotation,
4880
5187
  motivation: ["describing", "crm:E55_Type"],
4881
5188
  body: {
4882
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5189
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4883
5190
  type: "TextualBody",
4884
5191
  entityType: "crm:E33_Linguistic_Object",
4885
5192
  additionalType: ["scholarly", "academic"],
@@ -5017,6 +5324,47 @@ var work = {
5017
5324
  }
5018
5325
  };
5019
5326
 
5327
+ // src/v1/mocks/body/event.ts
5328
+ var real7 = {
5329
+ ...common.annotation,
5330
+ body: {
5331
+ id: "https://www.uo.com/event",
5332
+ entityType: ["YET TO BE DEFINED EVENT CLASS", "crm:E5_Event"]
5333
+ }
5334
+ };
5335
+ var fictional7 = {
5336
+ ...common.annotation,
5337
+ body: {
5338
+ id: "https://www.uo.com/event",
5339
+ entityType: ["YET TO BE DEFINED EVENT CLASS", "crm:E89_Propositional_Object"]
5340
+ }
5341
+ };
5342
+ var withCertainty10 = {
5343
+ ...common.annotation,
5344
+ body: {
5345
+ id: "https://www.uo.com/event",
5346
+ entityType: ["YET TO BE DEFINED EVENT CLASS", "crm:E5_Event"],
5347
+ certainty: "edit:qualityLow"
5348
+ }
5349
+ };
5350
+ var withLabelAndDescription8 = {
5351
+ ...common.annotation,
5352
+ body: {
5353
+ id: "https://www.uo.com/event",
5354
+ entityType: ["YET TO BE DEFINED EVENT CLASS", "crm:E5_Event"],
5355
+ label: "revolution",
5356
+ description: "An event"
5357
+ }
5358
+ };
5359
+ var event = {
5360
+ valid: {
5361
+ real: real7,
5362
+ fictional: fictional7,
5363
+ withCertainty: withCertainty10,
5364
+ withLabelAndDescription: withLabelAndDescription8
5365
+ }
5366
+ };
5367
+
5020
5368
  // src/v1/mocks/body/index.ts
5021
5369
  var personPlace = {
5022
5370
  ...common.annotation,
@@ -5051,7 +5399,6 @@ var generatorWithVersion = {
5051
5399
  ...common.annotation,
5052
5400
  generator: { ...common.software, softwareVersion: "v1.2.5" }
5053
5401
  };
5054
- var { creator } = common.annotation;
5055
5402
  var noCreator = {
5056
5403
  ...common.annotation
5057
5404
  };
@@ -5071,15 +5418,6 @@ var agent = {
5071
5418
  };
5072
5419
 
5073
5420
  // src/v1/mocks/root/root.ts
5074
- var idUri = {
5075
- ...common.annotation,
5076
- id: "http://www.uo.com/wa",
5077
- status: "published"
5078
- };
5079
- var idUUID = {
5080
- ...common.annotation,
5081
- id: "55369c00-5c43-4d1a-8462-31c74fbec584"
5082
- };
5083
5421
  var motivationIdentify = {
5084
5422
  ...common.annotation,
5085
5423
  motivation: ["identifying", "crm:E55_Type"],
@@ -5089,7 +5427,7 @@ var motivationDescribing = {
5089
5427
  ...common.annotation,
5090
5428
  motivation: ["describing", "crm:E55_Type"],
5091
5429
  body: {
5092
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5430
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
5093
5431
  type: "TextualBody",
5094
5432
  entityType: "crm:E33_Linguistic_Object",
5095
5433
  value: "this is a note"
@@ -5099,7 +5437,7 @@ var motivationCorrecting = {
5099
5437
  ...common.annotation,
5100
5438
  motivation: ["correcting", "crm:E55_Type"],
5101
5439
  body: {
5102
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5440
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
5103
5441
  type: "TextualBody",
5104
5442
  entityType: ["fabio:Correction", "crm:E33_Linguistic_Object"],
5105
5443
  value: "this is a correction"
@@ -5109,7 +5447,7 @@ var motivationTagging = {
5109
5447
  ...common.annotation,
5110
5448
  motivation: ["tagging", "crm:E55_Type"],
5111
5449
  body: {
5112
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5450
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
5113
5451
  type: "TextualBody",
5114
5452
  entityType: ["crm:E55_Type", "crm:E33_Linguistic_Object"],
5115
5453
  value: "a tag"
@@ -5158,10 +5496,6 @@ var statusPublished = {
5158
5496
  };
5159
5497
  var root = {
5160
5498
  valid: {
5161
- id: {
5162
- uri: idUri,
5163
- uuid: idUUID
5164
- },
5165
5499
  motivation: {
5166
5500
  identify: motivationIdentify,
5167
5501
  describing: motivationDescribing,
@@ -5181,133 +5515,191 @@ var root = {
5181
5515
  };
5182
5516
 
5183
5517
  // src/v1/mocks/target/selector.ts
5184
- var textQuoteSimple = {
5518
+ var textQuote = {
5185
5519
  ...common.annotation,
5186
5520
  target: {
5187
5521
  ...common.target,
5188
5522
  selector: common.selector.textQuote
5189
5523
  }
5190
5524
  };
5191
- var textQuoteRefinedByXpath = {
5525
+ var textQuoteRefinedByTextPosition = {
5192
5526
  ...common.annotation,
5193
5527
  target: {
5194
5528
  ...common.target,
5195
5529
  selector: {
5196
5530
  ...common.selector.textQuote,
5197
- refinedBy: common.selector.xpath
5531
+ refinedBy: common.selector.textPosition
5198
5532
  }
5199
5533
  }
5200
5534
  };
5201
- var textQuoteRefinedByXapthRefinedByTextPosition = {
5535
+ var textQuoteRefinedByTextQuote = {
5202
5536
  ...common.annotation,
5203
5537
  target: {
5204
5538
  ...common.target,
5205
5539
  selector: {
5206
5540
  ...common.selector.textQuote,
5207
- refinedBy: {
5208
- ...common.selector.xpath,
5209
- refinedBy: common.selector.textPosition
5210
- }
5541
+ refinedBy: common.selector.textQuote
5211
5542
  }
5212
5543
  }
5213
5544
  };
5214
- var textQuoteRefinedByTextPosition = {
5545
+ var xpath = {
5546
+ ...common.annotation,
5547
+ target: {
5548
+ ...common.target,
5549
+ selector: common.selector.xpath
5550
+ }
5551
+ };
5552
+ var xpathRefinedByTextPosition = {
5215
5553
  ...common.annotation,
5216
5554
  target: {
5217
5555
  ...common.target,
5218
5556
  selector: {
5219
- ...common.selector.textQuote,
5557
+ ...common.selector.xpath,
5220
5558
  refinedBy: common.selector.textPosition
5221
5559
  }
5222
5560
  }
5223
5561
  };
5224
- var xpath = {
5562
+ var xpathRefinedByTextQuote = {
5225
5563
  ...common.annotation,
5226
5564
  target: {
5227
5565
  ...common.target,
5228
- selector: common.selector.xpath
5566
+ selector: {
5567
+ ...common.selector.xpath,
5568
+ refinedBy: common.selector.textQuote
5569
+ }
5229
5570
  }
5230
5571
  };
5231
- var xpathRefinedByTextPosition = {
5572
+ var textPosition = {
5573
+ ...common.annotation,
5574
+ target: {
5575
+ ...common.target,
5576
+ selector: common.selector.textPosition
5577
+ }
5578
+ };
5579
+ var textPositionRefinedByTextQuote = {
5232
5580
  ...common.annotation,
5233
5581
  target: {
5234
5582
  ...common.target,
5235
5583
  selector: {
5236
- ...common.selector.xpath,
5584
+ ...common.selector.textPosition,
5585
+ refinedBy: common.selector.textQuote
5586
+ }
5587
+ }
5588
+ };
5589
+ var textPositionRefinedByTextPosition = {
5590
+ ...common.annotation,
5591
+ target: {
5592
+ ...common.target,
5593
+ selector: {
5594
+ ...common.selector.textPosition,
5237
5595
  refinedBy: common.selector.textPosition
5238
5596
  }
5239
5597
  }
5240
5598
  };
5241
- var textPosition = {
5599
+ var range = {
5242
5600
  ...common.annotation,
5243
5601
  target: {
5244
5602
  ...common.target,
5245
- selector: common.selector.textPosition
5603
+ selector: common.selector.range
5604
+ }
5605
+ };
5606
+ var textQuoteAndTextPosition = {
5607
+ ...common.annotation,
5608
+ target: {
5609
+ ...common.target,
5610
+ selector: [common.selector.textQuote, common.selector.textPosition]
5246
5611
  }
5247
5612
  };
5248
5613
  var targetSelector = {
5249
5614
  valid: {
5250
5615
  selector: {
5251
5616
  textQuote: {
5252
- simple: textQuoteSimple,
5253
- refinedByXpath: textQuoteRefinedByXpath,
5254
- refinedByXpathAndTextPosition: textQuoteRefinedByXapthRefinedByTextPosition,
5255
- refinedByTextPositon: textQuoteRefinedByTextPosition
5617
+ simple: textQuote,
5618
+ refinedByTextPositon: textQuoteRefinedByTextPosition,
5619
+ refinedByTextQuote: textQuoteRefinedByTextQuote
5256
5620
  },
5257
5621
  xpath: {
5258
5622
  simple: xpath,
5259
- refinedByTextPositon: xpathRefinedByTextPosition
5623
+ refinedByTextPositon: xpathRefinedByTextPosition,
5624
+ refinedByTextQuote: xpathRefinedByTextQuote
5260
5625
  },
5261
- textPositon: textPosition
5626
+ textPosition: {
5627
+ simple: textPosition,
5628
+ refinedByTextPositon: textPositionRefinedByTextQuote,
5629
+ refinedByTextQuote: textPositionRefinedByTextPosition
5630
+ },
5631
+ range,
5632
+ multipleSelector: {
5633
+ textQuoteAndTextPosition
5634
+ }
5262
5635
  }
5263
5636
  }
5264
5637
  };
5265
5638
 
5266
5639
  // src/v1/mocks/target/target.ts
5267
5640
  var simple5 = {
5641
+ ...common.annotation,
5642
+ target: common.target
5643
+ };
5644
+ var withSourceTitle = {
5268
5645
  ...common.annotation,
5269
5646
  target: {
5270
- id: "https://document.com",
5271
- type: ["SpecificResource", "crm:E73_Information_Object"],
5272
- selector: common.selector.textPosition
5647
+ ...common.target,
5648
+ source: {
5649
+ id: "https://document-url.com",
5650
+ title: "Document Title"
5651
+ }
5273
5652
  }
5274
5653
  };
5275
- var withFormat = {
5654
+ var withSourceFormat = {
5276
5655
  ...common.annotation,
5277
5656
  target: {
5278
- id: "https://document.com",
5279
- type: ["SpecificResource", "crm:E73_Information_Object"],
5280
- format: ["application/xml"],
5281
- selector: common.selector.textPosition
5657
+ ...common.target,
5658
+ source: {
5659
+ id: "https://document-url.com",
5660
+ title: "Document Title",
5661
+ format: ["application/xml"]
5662
+ }
5282
5663
  }
5283
5664
  };
5284
- var withLanguage = {
5665
+ var withSourceLanguage = {
5285
5666
  ...common.annotation,
5286
5667
  target: {
5287
- id: "https://document.com",
5288
- type: ["SpecificResource", "crm:E73_Information_Object"],
5289
- language: ["eng"],
5290
- selector: common.selector.textPosition
5668
+ ...common.target,
5669
+ source: {
5670
+ id: "https://document-url.com",
5671
+ title: "Document Title",
5672
+ format: ["application/xml"],
5673
+ language: ["eng"]
5674
+ }
5291
5675
  }
5292
5676
  };
5293
5677
  var withRendererSoftware = {
5294
5678
  ...common.annotation,
5295
5679
  target: {
5296
- id: "https://document.com",
5297
- type: ["SpecificResource", "crm:E73_Information_Object"],
5298
- renderedVia: common.software,
5299
- selector: common.selector.textPosition
5680
+ ...common.target,
5681
+ renderedVia: common.software
5300
5682
  }
5301
5683
  };
5302
5684
  var complete = {
5303
5685
  ...common.annotation,
5304
- target: common.target
5686
+ target: {
5687
+ ...common.target,
5688
+ source: {
5689
+ id: "https://document-url.com",
5690
+ title: "Document Title",
5691
+ format: ["application/xml"],
5692
+ language: ["eng"]
5693
+ },
5694
+ renderedVia: common.software
5695
+ }
5305
5696
  };
5306
5697
  var target = {
5307
5698
  valid: {
5308
5699
  simple: simple5,
5309
- withFormat,
5310
- withLanguage,
5700
+ withSourceTitle,
5701
+ withSourceFormat,
5702
+ withSourceLanguage,
5311
5703
  withRendererSoftware,
5312
5704
  complete
5313
5705
  }
@@ -5320,8 +5712,6 @@ var generateValidExamples = async () => {
5320
5712
  console.log(kleur_default.cyan(`Generating Web Annotation Examples`));
5321
5713
  if (!import_fs_extra.default.existsSync(FOLDER))
5322
5714
  import_fs_extra.default.mkdirSync(FOLDER, { recursive: true });
5323
- await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "id_uri.jsonld"), root.valid.id.uri, JSON_OPTIONS);
5324
- await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "id_uuid.jsonld"), root.valid.id.uuid, JSON_OPTIONS);
5325
5715
  await import_fs_extra.default.writeJSON(
5326
5716
  import_path.default.join(FOLDER, "motivation_citing.jsonld"),
5327
5717
  root.valid.motivation.citing,
@@ -5401,13 +5791,18 @@ var generateValidExamples = async () => {
5401
5791
  );
5402
5792
  await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "target.jsonld"), target.valid.simple, JSON_OPTIONS);
5403
5793
  await import_fs_extra.default.writeJSON(
5404
- import_path.default.join(FOLDER, "target_with_format.jsonld"),
5405
- target.valid.withFormat,
5794
+ import_path.default.join(FOLDER, "target_with_sourceTitle.jsonld"),
5795
+ target.valid.withSourceTitle,
5796
+ JSON_OPTIONS
5797
+ );
5798
+ await import_fs_extra.default.writeJSON(
5799
+ import_path.default.join(FOLDER, "target_with_source_format.jsonld"),
5800
+ target.valid.withSourceFormat,
5406
5801
  JSON_OPTIONS
5407
5802
  );
5408
5803
  await import_fs_extra.default.writeJSON(
5409
- import_path.default.join(FOLDER, "target_with_language.jsonld"),
5410
- target.valid.withLanguage,
5804
+ import_path.default.join(FOLDER, "target_with_source_language.jsonld"),
5805
+ target.valid.withSourceLanguage,
5411
5806
  JSON_OPTIONS
5412
5807
  );
5413
5808
  await import_fs_extra.default.writeJSON(
@@ -5415,19 +5810,64 @@ var generateValidExamples = async () => {
5415
5810
  target.valid.withRendererSoftware,
5416
5811
  JSON_OPTIONS
5417
5812
  );
5813
+ await import_fs_extra.default.writeJSON(
5814
+ import_path.default.join(FOLDER, "target_complete.jsonld"),
5815
+ target.valid.complete,
5816
+ JSON_OPTIONS
5817
+ );
5418
5818
  await import_fs_extra.default.writeJSON(
5419
5819
  import_path.default.join(FOLDER, "target_selector_textQuote.jsonld"),
5420
5820
  targetSelector.valid.selector.textQuote.simple,
5421
5821
  JSON_OPTIONS
5422
5822
  );
5423
5823
  await import_fs_extra.default.writeJSON(
5424
- import_path.default.join(FOLDER, "target_selector_textQuote_refinedBy_xpath_textPosition.jsonld"),
5425
- targetSelector.valid.selector.textQuote.refinedByXpathAndTextPosition,
5824
+ import_path.default.join(FOLDER, "target_selector_textQuote_refinedBy_textPosition.jsonld"),
5825
+ targetSelector.valid.selector.textQuote.refinedByTextPositon,
5826
+ JSON_OPTIONS
5827
+ );
5828
+ await import_fs_extra.default.writeJSON(
5829
+ import_path.default.join(FOLDER, "target_selector_textQuote_refinedBy_textQuote.jsonld"),
5830
+ targetSelector.valid.selector.textQuote.refinedByTextQuote,
5426
5831
  JSON_OPTIONS
5427
5832
  );
5428
5833
  await import_fs_extra.default.writeJSON(
5429
5834
  import_path.default.join(FOLDER, "target_selector_textPosition.jsonld"),
5430
- targetSelector.valid.selector.textPositon,
5835
+ targetSelector.valid.selector.textPosition.simple,
5836
+ JSON_OPTIONS
5837
+ );
5838
+ await import_fs_extra.default.writeJSON(
5839
+ import_path.default.join(FOLDER, "target_selector_textPosition_refinedBy_textQuote.jsonld"),
5840
+ targetSelector.valid.selector.textPosition.refinedByTextQuote,
5841
+ JSON_OPTIONS
5842
+ );
5843
+ await import_fs_extra.default.writeJSON(
5844
+ import_path.default.join(FOLDER, "target_selector_textPosition_refinedBy_textPosition.jsonld"),
5845
+ targetSelector.valid.selector.textPosition.refinedByTextPositon,
5846
+ JSON_OPTIONS
5847
+ );
5848
+ await import_fs_extra.default.writeJSON(
5849
+ import_path.default.join(FOLDER, "target_selector_range.jsonld"),
5850
+ targetSelector.valid.selector.range,
5851
+ JSON_OPTIONS
5852
+ );
5853
+ await import_fs_extra.default.writeJSON(
5854
+ import_path.default.join(FOLDER, "target_selector_xpath.jsonld"),
5855
+ targetSelector.valid.selector.xpath.simple,
5856
+ JSON_OPTIONS
5857
+ );
5858
+ await import_fs_extra.default.writeJSON(
5859
+ import_path.default.join(FOLDER, "target_selector_xpath_refinedBt_textPosition.jsonld"),
5860
+ targetSelector.valid.selector.xpath.refinedByTextPositon,
5861
+ JSON_OPTIONS
5862
+ );
5863
+ await import_fs_extra.default.writeJSON(
5864
+ import_path.default.join(FOLDER, "target_selector_xpath_refinedBt_textQuote.jsonld"),
5865
+ targetSelector.valid.selector.xpath.refinedByTextQuote,
5866
+ JSON_OPTIONS
5867
+ );
5868
+ await import_fs_extra.default.writeJSON(
5869
+ import_path.default.join(FOLDER, "target_multiple_selectors_textQuote_and_textPosition.jsonld"),
5870
+ targetSelector.valid.selector.multipleSelector.textQuoteAndTextPosition,
5431
5871
  JSON_OPTIONS
5432
5872
  );
5433
5873
  await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "person.jsonld"), person.valid.real, JSON_OPTIONS);
@@ -5483,6 +5923,12 @@ var generateValidExamples = async () => {
5483
5923
  physicalThing.valid.fictional,
5484
5924
  JSON_OPTIONS
5485
5925
  );
5926
+ await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "event.jsonld"), event.valid.real, JSON_OPTIONS);
5927
+ await import_fs_extra.default.writeJSON(
5928
+ import_path.default.join(FOLDER, "event_fictional.jsonld"),
5929
+ event.valid.fictional,
5930
+ JSON_OPTIONS
5931
+ );
5486
5932
  await import_fs_extra.default.writeJSON(
5487
5933
  import_path.default.join(FOLDER, "conceptual_object_real.jsonld"),
5488
5934
  conceptualObject.valid.real,
@@ -5567,31 +6013,117 @@ var generateAssets = async () => {
5567
6013
  // Annotate the CommonJS export names for ESM import in node:
5568
6014
  0 && (module.exports = {
5569
6015
  Body,
6016
+ BodyEntityType,
6017
+ Certainty,
6018
+ Citation,
6019
+ CitationEntityType,
6020
+ ConceptualObject,
6021
+ ConceptualObjectEntityType,
6022
+ Correction,
6023
+ CorrectionEntityType,
6024
+ DATE_RANGE_PATTERN,
6025
+ Date,
6026
+ DateEntityType,
6027
+ Description,
6028
+ Event,
6029
+ EventEntityType,
6030
+ Keyword,
6031
+ KeywordEntityType,
6032
+ KeywordFolksnomy,
6033
+ KeywordFolksnomyEntityType,
6034
+ Label,
6035
+ Link,
6036
+ LinkEntityType,
5570
6037
  Motivation,
6038
+ Note,
6039
+ NoteEntityType,
6040
+ Organization,
6041
+ OrganizationEntityType,
5571
6042
  Person,
5572
6043
  PersonEntityType,
6044
+ PhysicalThing,
6045
+ PhysicalThingEntityType,
6046
+ Place,
6047
+ PlaceEntityType,
6048
+ Precision,
6049
+ Quality,
6050
+ RangeSelector,
6051
+ Selector,
5573
6052
  Software,
6053
+ Source,
5574
6054
  Status,
5575
6055
  Target,
6056
+ TextPositionSelector,
6057
+ TextPositionSelectorExtended,
6058
+ TextQuoteSelector,
6059
+ TextQuoteSelectorExtended,
5576
6060
  User,
5577
6061
  VERSION,
5578
6062
  ValidateResult,
5579
6063
  ValidationError,
5580
6064
  WebAnnotation,
6065
+ Work,
6066
+ WorkEntityType,
6067
+ XpathSelector,
6068
+ XpathSelectorExtended,
5581
6069
  ajv,
6070
+ bodyIdDescription,
5582
6071
  bodySchema,
6072
+ certaintySchema,
6073
+ citationEntityTypeSchema,
6074
+ citationSchema,
6075
+ conceptualObjectEntityTypeSchema,
6076
+ conceptualObjectSchema,
5583
6077
  contextUri,
6078
+ correctionEntityTypeSchema,
6079
+ correctionSchema,
5584
6080
  creatorSchema,
6081
+ dateEntityTypeSchema,
6082
+ dateSchema,
5585
6083
  definitionSchema,
5586
6084
  defsId,
6085
+ descriptionSchema,
6086
+ eventEntityTypeSchema,
6087
+ eventSchema,
6088
+ formatSchema,
6089
+ keywordEntityTypeSchema,
6090
+ keywordFolksnomyEntityTypeSchema,
6091
+ keywordFolksnomySchema,
6092
+ keywordSchema,
6093
+ labelSchema,
6094
+ languageSchema,
6095
+ linkEntityTypeSchema,
6096
+ linkSchema,
6097
+ noteEntityTypeSchema,
6098
+ noteSchema,
6099
+ organizationEntityTypeSchema,
6100
+ organizationSchema,
5587
6101
  personEntityTypeSchema,
5588
6102
  personSchema,
6103
+ physicalThingEntityTypeSchema,
6104
+ physicalThingSchema,
6105
+ placeEntityTypeSchema,
6106
+ placeSchema,
6107
+ precisionSchema,
6108
+ rangeSelectorSchema,
5589
6109
  schemaContext,
5590
6110
  schemaId,
6111
+ selectorIdDescription,
6112
+ selectorRefinedByDescription,
6113
+ selectorSchema,
5591
6114
  softwareSchema,
6115
+ sourceSchema,
5592
6116
  targetSchema,
6117
+ textPositionSelectorExtendedSchema,
6118
+ textPositionSelectorSchema,
6119
+ textQuoteSelectorExtendedSchema,
6120
+ textQuoteSelectorSchema,
5593
6121
  v1,
5594
6122
  validate,
5595
6123
  validator,
5596
- webAnnotationSchema
6124
+ webAnnotationSchema,
6125
+ workEntityTypeSchema,
6126
+ workSchema,
6127
+ xpathSelectorExtendedSchema,
6128
+ xpathSelectorSchema
5597
6129
  });