@lincs.project/webannotation-schema 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2768,6 +2768,7 @@ var require_lib = __commonJS({
2768
2768
  var src_exports = {};
2769
2769
  __export(src_exports, {
2770
2770
  Body: () => Body,
2771
+ DATE_RANGE_PATTERN: () => DATE_RANGE_PATTERN,
2771
2772
  Motivation: () => Motivation,
2772
2773
  Person: () => Person,
2773
2774
  PersonEntityType: () => PersonEntityType,
@@ -2780,6 +2781,7 @@ __export(src_exports, {
2780
2781
  ValidationError: () => ValidationError,
2781
2782
  WebAnnotation: () => WebAnnotation,
2782
2783
  ajv: () => ajv,
2784
+ bodyIdDescription: () => bodyIdDescription,
2783
2785
  bodySchema: () => bodySchema,
2784
2786
  contextUri: () => contextUri,
2785
2787
  creatorSchema: () => creatorSchema,
@@ -2833,7 +2835,7 @@ var schemaContext = {
2833
2835
  },
2834
2836
  entityType: {
2835
2837
  "@type": "@id",
2836
- "@id": "crm:P2_has_type"
2838
+ "@id": "rdf:type"
2837
2839
  },
2838
2840
  additionalType: {
2839
2841
  "@type": "@id",
@@ -2849,8 +2851,9 @@ var schemaContext = {
2849
2851
 
2850
2852
  // src/v1/schema/definitions/agent.ts
2851
2853
  var import_zod = require("zod");
2854
+ var userIdDescription = "The IRI that identifies the agent (Creator or Contributor).";
2852
2855
  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)."),
2856
+ id: import_zod.z.string().url().describe(userIdDescription),
2854
2857
  type: import_zod.z.literal("crm:E21_Person").describe("The type of the Agent."),
2855
2858
  name: import_zod.z.string().min(1, { message: "Cannot be empty" }).describe("The name of the agent.")
2856
2859
  }).describe("Human Agent");
@@ -2858,20 +2861,15 @@ var creatorSchema = {
2858
2861
  type: "object",
2859
2862
  description: "Software Agent",
2860
2863
  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
- },
2864
+ id: { type: "string", format: "uri", description: userIdDescription },
2868
2865
  type: { type: "string", const: "crm:E21_Person" },
2869
2866
  name: { type: "string", minLength: 1, description: "The name of the agent." }
2870
2867
  },
2871
2868
  required: ["id", "type", "name"]
2872
2869
  };
2870
+ var softwareIdDescription = "The IRI that identifies the agent (software).";
2873
2871
  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)."),
2872
+ id: import_zod.z.string().url().describe(softwareIdDescription),
2875
2873
  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
2874
  label: import_zod.z.string().min(1).describe("The name of the software."),
2877
2875
  softwareVersion: import_zod.z.string().optional().describe("The software version.")
@@ -2880,11 +2878,7 @@ var softwareSchema = {
2880
2878
  type: "object",
2881
2879
  description: "Software Agent",
2882
2880
  properties: {
2883
- id: {
2884
- type: "string",
2885
- format: "uri",
2886
- description: "The IRI that identifies the agent (software)."
2887
- },
2881
+ id: { type: "string", format: "uri", description: softwareIdDescription },
2888
2882
  type: {
2889
2883
  type: "array",
2890
2884
  minItems: 2,
@@ -2915,32 +2909,32 @@ var Quality = [
2915
2909
  "edit:qualityHigh",
2916
2910
  "edit:qualityUnknown"
2917
2911
  ];
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
- );
2912
+ var certaintyDescription = "Indicates the degree of certainty associated with some aspect of an assertion, description, identification, or entity linked to the annotation body.";
2913
+ var Certainty = import_zod2.z.enum(Quality).describe(certaintyDescription);
2921
2914
  var certaintySchema = {
2922
2915
  type: "string",
2923
2916
  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."
2917
+ description: certaintyDescription
2925
2918
  };
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
- );
2919
+ var precisionDescription = "Indicates the degree of precision associated with the location of the entity linked to the annotation body.";
2920
+ var Precision = import_zod2.z.enum(Quality).describe(precisionDescription);
2929
2921
  var precisionSchema = {
2930
2922
  type: "string",
2931
2923
  enum: Quality,
2932
- description: "Indicates the degree of precision associated with the location of the entity linked to the annotation body."
2924
+ description: precisionDescription
2933
2925
  };
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.");
2926
+ var labelDescription = "The title or name of a linked resource or named entity.";
2927
+ var Label = import_zod2.z.string().min(1, { message: "The label cannot be empty" }).describe(labelDescription);
2935
2928
  var labelSchema = {
2936
2929
  type: "string",
2937
2930
  minLength: 1,
2938
- description: "The title or name of a linked resource or named entity."
2931
+ description: labelDescription
2939
2932
  };
2940
- var Description = import_zod2.z.string().describe("Short description of the linked resources or named entity.");
2933
+ var descriptionDescription = "Short description of the linked resources or named entity.";
2934
+ var Description = import_zod2.z.string().describe(descriptionDescription);
2941
2935
  var descriptionSchema = {
2942
2936
  type: "string",
2943
- description: "Short description of the linked resources or named entity."
2937
+ description: descriptionDescription
2944
2938
  };
2945
2939
 
2946
2940
  // src/v1/schema/definitions/body/citation.ts
@@ -2949,11 +2943,8 @@ var CitationEntityType = import_zod3.z.tuple([
2949
2943
  import_zod3.z.literal("crm:E73_Information_Object")
2950
2944
  ]);
2951
2945
  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")]),
2946
+ id: import_zod3.z.string().url().describe(bodyIdDescription),
2947
+ entityType: CitationEntityType,
2957
2948
  certainty: Certainty.optional(),
2958
2949
  label: Label.optional(),
2959
2950
  description: Description.optional()
@@ -2978,10 +2969,7 @@ var ConceptualObjectEntityType = import_zod4.z.union([
2978
2969
  ])
2979
2970
  ]);
2980
2971
  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
- ]),
2972
+ id: import_zod4.z.string().url().describe(bodyIdDescription),
2985
2973
  entityType: ConceptualObjectEntityType,
2986
2974
  certainty: Certainty.optional(),
2987
2975
  label: Label.optional(),
@@ -3009,7 +2997,7 @@ var CorrectionEntityType = import_zod5.z.tuple([
3009
2997
  import_zod5.z.literal("crm:E33_Linguistic_Object")
3010
2998
  ]);
3011
2999
  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."),
3000
+ id: import_zod5.z.string().url().describe(bodyIdDescription),
3013
3001
  type: import_zod5.z.literal("TextualBody"),
3014
3002
  entityType: CorrectionEntityType,
3015
3003
  value: import_zod5.z.string().describe("The correction.")
@@ -3028,10 +3016,10 @@ var correctionEntityTypeSchema = {
3028
3016
  var import_zod6 = require("zod");
3029
3017
  var DateEntityType = import_zod6.z.tuple([import_zod6.z.literal("xsd:date"), import_zod6.z.literal("crm:E52_Time-Span")]);
3030
3018
  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."),
3019
+ id: import_zod6.z.string().url().describe(bodyIdDescription),
3032
3020
  type: import_zod6.z.literal("TextualBody"),
3033
3021
  entityType: DateEntityType,
3034
- value: import_zod6.z.string().describe("The date time."),
3022
+ value: import_zod6.z.string().regex(new RegExp(DATE_RANGE_PATTERN)).describe("The date time."),
3035
3023
  certainty: Certainty.optional(),
3036
3024
  precision: Precision.optional()
3037
3025
  }).describe("Date");
@@ -3045,17 +3033,38 @@ var dateEntityTypeSchema = {
3045
3033
  ]
3046
3034
  };
3047
3035
 
3048
- // src/v1/schema/definitions/body/keyword.ts
3036
+ // src/v1/schema/definitions/body/event.ts
3049
3037
  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")
3038
+ var EventEntityType = import_zod7.z.union([
3039
+ import_zod7.z.literal("crm:E5_Event"),
3040
+ import_zod7.z.literal("YET TO BE DEFINED A CLASS FOR FICTIONAL EVENTS")
3053
3041
  ]);
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
- ]),
3042
+ var Event = import_zod7.z.object({
3043
+ id: import_zod7.z.string().url().describe(bodyIdDescription),
3044
+ entityType: EventEntityType,
3045
+ certainty: Certainty.optional(),
3046
+ label: Label.optional(),
3047
+ description: Description.optional()
3048
+ }).describe("Organization");
3049
+ var eventEntityTypeSchema = {
3050
+ oneOf: [
3051
+ { type: "string", const: "crm:E5_Event", description: "Real Event" },
3052
+ {
3053
+ type: "string",
3054
+ const: "YET TO BE DEFINED A CLASS FOR FICTIONAL EVENTS",
3055
+ description: "Fictional Event"
3056
+ }
3057
+ ]
3058
+ };
3059
+
3060
+ // src/v1/schema/definitions/body/keyword.ts
3061
+ var import_zod8 = require("zod");
3062
+ var KeywordEntityType = import_zod8.z.tuple([
3063
+ import_zod8.z.literal("crm:E55_Type"),
3064
+ import_zod8.z.literal("crmdig:D1_Digital_Object")
3065
+ ]);
3066
+ var Keyword = import_zod8.z.object({
3067
+ id: import_zod8.z.string().url().describe(bodyIdDescription),
3059
3068
  entityType: KeywordEntityType,
3060
3069
  certainty: Certainty.optional(),
3061
3070
  label: Label.optional(),
@@ -3070,15 +3079,15 @@ var keywordEntityTypeSchema = {
3070
3079
  { type: "string", const: "crmdig:D1_Digital_Object" }
3071
3080
  ]
3072
3081
  };
3073
- var KeywordFolksnomyEntityType = import_zod7.z.tuple([
3074
- import_zod7.z.literal("crm:E55_Type"),
3075
- import_zod7.z.literal("crm:E33_Linguistic_Object")
3082
+ var KeywordFolksnomyEntityType = import_zod8.z.tuple([
3083
+ import_zod8.z.literal("crm:E55_Type"),
3084
+ import_zod8.z.literal("crm:E33_Linguistic_Object")
3076
3085
  ]);
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"),
3086
+ var KeywordFolksnomy = import_zod8.z.object({
3087
+ id: import_zod8.z.string().url().describe(bodyIdDescription),
3088
+ type: import_zod8.z.literal("TextualBody"),
3080
3089
  entityType: KeywordFolksnomyEntityType,
3081
- value: import_zod7.z.string().describe("The keyword.")
3090
+ value: import_zod8.z.string().describe("The keyword.")
3082
3091
  }).describe("Keyword");
3083
3092
  var keywordFolksnomyEntityTypeSchema = {
3084
3093
  type: "array",
@@ -3091,10 +3100,11 @@ var keywordFolksnomyEntityTypeSchema = {
3091
3100
  };
3092
3101
 
3093
3102
  // 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."),
3103
+ var import_zod9 = require("zod");
3104
+ var idDescription = "The link URL.";
3105
+ var LinkEntityType = import_zod9.z.literal("crmdig:D1_Digital_Object");
3106
+ var Link = import_zod9.z.object({
3107
+ id: import_zod9.z.string().url().describe(idDescription),
3098
3108
  entityType: LinkEntityType,
3099
3109
  certainty: Certainty.optional()
3100
3110
  }).describe("A link to a webpage");
@@ -3104,14 +3114,14 @@ var linkEntityTypeSchema = {
3104
3114
  };
3105
3115
 
3106
3116
  // 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"),
3117
+ var import_zod10 = require("zod");
3118
+ var NoteEntityType = import_zod10.z.literal("crm:E33_Linguistic_Object");
3119
+ var Note = import_zod10.z.object({
3120
+ id: import_zod10.z.string().url().describe(bodyIdDescription),
3121
+ type: import_zod10.z.literal("TextualBody"),
3112
3122
  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.")
3123
+ additionalType: import_zod10.z.union([import_zod10.z.string(), import_zod10.z.string().array()]).optional().describe("Extra types that refines the note"),
3124
+ value: import_zod10.z.string().describe("The note.")
3115
3125
  }).describe("Note");
3116
3126
  var noteEntityTypeSchema = {
3117
3127
  type: "string",
@@ -3119,19 +3129,16 @@ var noteEntityTypeSchema = {
3119
3129
  };
3120
3130
 
3121
3131
  // 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")
3132
+ var import_zod11 = require("zod");
3133
+ var OrganizationEntityType = import_zod11.z.tuple([
3134
+ import_zod11.z.literal("foaf:Organization"),
3135
+ import_zod11.z.union([
3136
+ import_zod11.z.literal("crm:E74_Group").describe("Real Organization"),
3137
+ import_zod11.z.literal("crm:E89_Propositional_Object").describe("Fictional Organization")
3128
3138
  ])
3129
3139
  ]);
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
- ]),
3140
+ var Organization = import_zod11.z.object({
3141
+ id: import_zod11.z.string().url().describe(bodyIdDescription),
3135
3142
  entityType: OrganizationEntityType,
3136
3143
  certainty: Certainty.optional(),
3137
3144
  label: Label.optional(),
@@ -3157,19 +3164,16 @@ var organizationEntityTypeSchema = {
3157
3164
  };
3158
3165
 
3159
3166
  // 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")
3167
+ var import_zod12 = require("zod");
3168
+ var PersonEntityType = import_zod12.z.tuple([
3169
+ import_zod12.z.literal("Person").describe("foaf:person."),
3170
+ import_zod12.z.union([
3171
+ import_zod12.z.literal("crm:E21_Person").describe("Real Person"),
3172
+ import_zod12.z.literal("crm:E89_Propositional_Object").describe("Fictional Person")
3166
3173
  ])
3167
3174
  ]);
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
- ]),
3175
+ var Person = import_zod12.z.object({
3176
+ id: import_zod12.z.string().url().describe(bodyIdDescription),
3173
3177
  entityType: PersonEntityType,
3174
3178
  certainty: Certainty.optional(),
3175
3179
  label: Label.optional(),
@@ -3193,35 +3197,26 @@ var personSchema = {
3193
3197
  type: "object",
3194
3198
  description: "A person entity",
3195
3199
  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
- },
3200
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3202
3201
  entityType: personEntityTypeSchema,
3203
3202
  certainty: { $ref: "defs.jsonld#/definitions/certainty" },
3204
3203
  label: { $ref: "defs.jsonld#/definitions/label" },
3205
3204
  description: { $ref: "defs.jsonld#/definitions/description" }
3206
3205
  },
3207
3206
  required: ["id", "entityType"]
3208
- // errorMessage: { properties: { id: 'Must be an URI' } },
3209
3207
  };
3210
3208
 
3211
3209
  // 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")
3210
+ var import_zod13 = require("zod");
3211
+ var PhysicalThingEntityType = import_zod13.z.union([
3212
+ import_zod13.z.literal("crm:E18_Physical_Thing"),
3213
+ import_zod13.z.tuple([
3214
+ import_zod13.z.literal("crm:E18_Physical_Thing"),
3215
+ import_zod13.z.literal("wikidata:Q15831596").describe("Fictional Physical Thing")
3218
3216
  ])
3219
3217
  ]);
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
- ]),
3218
+ var PhysicalThing = import_zod13.z.object({
3219
+ id: import_zod13.z.string().url().describe(bodyIdDescription),
3225
3220
  entityType: PhysicalThingEntityType,
3226
3221
  certainty: Certainty.optional(),
3227
3222
  label: Label.optional(),
@@ -3243,19 +3238,16 @@ var physicalThingEntityTypeSchema = {
3243
3238
  };
3244
3239
 
3245
3240
  // 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")
3241
+ var import_zod14 = require("zod");
3242
+ var PlaceEntityType = import_zod14.z.union([
3243
+ import_zod14.z.literal("cwrc:place"),
3244
+ import_zod14.z.tuple([
3245
+ import_zod14.z.literal("cwrc:place"),
3246
+ import_zod14.z.literal("crm:E89_Propositional_Object").describe("Fictional Place")
3252
3247
  ])
3253
3248
  ]);
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
- ]),
3249
+ var Place = import_zod14.z.object({
3250
+ id: import_zod14.z.string().url().describe(bodyIdDescription),
3259
3251
  entityType: PlaceEntityType,
3260
3252
  certainty: Certainty.optional(),
3261
3253
  precision: Precision.optional(),
@@ -3278,19 +3270,16 @@ var placeEntityTypeSchema = {
3278
3270
  };
3279
3271
 
3280
3272
  // 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")
3273
+ var import_zod15 = require("zod");
3274
+ var WorkEntityType = import_zod15.z.tuple([
3275
+ import_zod15.z.literal("crm:E89_Propositional_Object"),
3276
+ import_zod15.z.union([
3277
+ import_zod15.z.literal("frbroo:F1").describe("Real Work"),
3278
+ import_zod15.z.literal("wikidata:Q15306849").describe("Fictional Work")
3287
3279
  ])
3288
3280
  ]);
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
- ]),
3281
+ var Work = import_zod15.z.object({
3282
+ id: import_zod15.z.string().url().describe(bodyIdDescription),
3294
3283
  entityType: WorkEntityType,
3295
3284
  certainty: Certainty.optional(),
3296
3285
  label: Label.optional(),
@@ -3311,31 +3300,11 @@ var workEntityTypeSchema = {
3311
3300
  ]
3312
3301
  };
3313
3302
 
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"
3330
- };
3331
-
3332
3303
  // 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)?)$";
3304
+ var bodyIdDescription = "The IRI that identifies the Body resource.";
3305
+ 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)?)$";
3334
3306
  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
- ]),
3307
+ id: import_zod16.z.string().url().describe(bodyIdDescription),
3339
3308
  type: import_zod16.z.literal("TextualBody").optional(),
3340
3309
  entityType: import_zod16.z.union([
3341
3310
  PersonEntityType,
@@ -3364,12 +3333,7 @@ var bodySchema = {
3364
3333
  type: "object",
3365
3334
  description: "Web Annotation Body",
3366
3335
  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
- },
3336
+ id: { type: "string", format: "uri", description: bodyIdDescription },
3373
3337
  type: { type: "string", const: "TextualBody" },
3374
3338
  entityType: {
3375
3339
  oneOf: [
@@ -3401,42 +3365,7 @@ var bodySchema = {
3401
3365
  required: ["id", "entityType"],
3402
3366
  // * Conditional restrictions
3403
3367
  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
3368
+ //* IF entityType is date OR correction OR keyword THEN type = TextualBody
3440
3369
  //* && IF entityType is date THEN value = date range pattern ELSE value = string
3441
3370
  {
3442
3371
  if: {
@@ -3471,7 +3400,6 @@ var bodySchema = {
3471
3400
  type: "object",
3472
3401
  required: ["type", "value"],
3473
3402
  properties: {
3474
- id: { type: "string", format: "uuid" },
3475
3403
  type: { type: "string", const: "TextualBody" }
3476
3404
  },
3477
3405
  if: {
@@ -3490,7 +3418,7 @@ var bodySchema = {
3490
3418
  properties: {
3491
3419
  value: {
3492
3420
  type: "string",
3493
- pattern: DATE_PATTERN
3421
+ pattern: DATE_RANGE_PATTERN
3494
3422
  }
3495
3423
  }
3496
3424
  },
@@ -3498,21 +3426,6 @@ var bodySchema = {
3498
3426
  type: "object",
3499
3427
  properties: { value: { type: "string" } }
3500
3428
  }
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
3429
  }
3517
3430
  }
3518
3431
  // ? TODO: Add more restrictions
@@ -3523,33 +3436,35 @@ var bodySchema = {
3523
3436
  };
3524
3437
 
3525
3438
  // src/v1/schema/definitions/target/index.ts
3439
+ var import_zod23 = require("zod");
3440
+
3441
+ // src/v1/schema/definitions/target/selector/index.ts
3526
3442
  var import_zod21 = require("zod");
3527
3443
 
3528
3444
  // src/v1/schema/definitions/target/selector/range.ts
3529
- var import_zod19 = require("zod");
3445
+ var import_zod20 = require("zod");
3530
3446
 
3531
3447
  // src/v1/schema/definitions/target/selector/xpath.ts
3532
- var import_zod18 = require("zod");
3448
+ var import_zod19 = require("zod");
3533
3449
 
3534
3450
  // src/v1/schema/definitions/target/selector/textPosition.ts
3535
3451
  var import_zod17 = require("zod");
3536
3452
  var TextPositionSelector = import_zod17.z.object({
3537
- id: import_zod17.z.string().url().describe("The IRI that identifies the target resource."),
3453
+ id: import_zod17.z.string().url().describe(selectorIdDescription),
3538
3454
  type: import_zod17.z.tuple([import_zod17.z.literal("TextPositionSelector"), import_zod17.z.literal("crm:E73_Information_Object")]),
3539
3455
  start: import_zod17.z.number().min(0).describe("The starting position of the segment. The first byte is character position 0."),
3540
3456
  end: import_zod17.z.number().describe(
3541
3457
  "The end position of the segment. The last character is not included within the segment."
3542
3458
  )
3543
3459
  }).describe("TextPosition Selector");
3460
+ var TextPositionSelectorExtended = TextPositionSelector.extend({
3461
+ refinedBy: import_zod17.z.union([import_zod17.z.lazy(() => TextPositionSelector), import_zod17.z.lazy(() => TextQuoteSelector)]).optional().describe(selectorRefinedByDescription)
3462
+ });
3544
3463
  var textPositionSelectorSchema = {
3545
3464
  type: "object",
3546
3465
  description: "TextPosition Selector",
3547
3466
  properties: {
3548
- id: {
3549
- type: "string",
3550
- format: "uuid",
3551
- description: "UUID that identifies the selector."
3552
- },
3467
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3553
3468
  type: {
3554
3469
  type: "array",
3555
3470
  minItems: 2,
@@ -3572,27 +3487,105 @@ var textPositionSelectorSchema = {
3572
3487
  }
3573
3488
  },
3574
3489
  required: ["id", "type", "start", "end"]
3575
- // errorMessage: { properties: { id: 'Must be an URI' } },
3490
+ };
3491
+ var textPositionSelectorExtendedSchema = {
3492
+ type: "object",
3493
+ description: "TextPosition Selector",
3494
+ properties: {
3495
+ ...textPositionSelectorSchema.properties,
3496
+ refinedBy: {
3497
+ type: "object",
3498
+ description: selectorRefinedByDescription,
3499
+ oneOf: [
3500
+ { $ref: "defs.jsonld#/definitions/textPositionSelector" },
3501
+ { $ref: "defs.jsonld#/definitions/textQuoteSelector" }
3502
+ ],
3503
+ nullable: true,
3504
+ required: []
3505
+ }
3506
+ },
3507
+ required: ["id", "type", "start", "end"]
3576
3508
  };
3577
3509
 
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."
3510
+ // src/v1/schema/definitions/target/selector/textQuote.ts
3511
+ var import_zod18 = require("zod");
3512
+ var TextQuoteSelector = import_zod18.z.object({
3513
+ id: import_zod18.z.string().url().describe(selectorIdDescription),
3514
+ type: import_zod18.z.tuple([import_zod18.z.literal("TextQuoteSelector"), import_zod18.z.literal("crm:E33_Linguistic_Object")]),
3515
+ exact: import_zod18.z.string().describe("A copy of the text which is being selected, after normalization."),
3516
+ prefix: import_zod18.z.string().describe(
3517
+ "The snippet of text that occurs immediately before the text which is being selected."
3518
+ ),
3519
+ suffix: import_zod18.z.string().describe(
3520
+ "The snippet of text that occurs immediately after the text which is being selected."
3585
3521
  )
3522
+ }).describe("Quote Selector");
3523
+ var TextQuoteSelectorExtended = TextQuoteSelector.extend({
3524
+ refinedBy: import_zod18.z.union([import_zod18.z.lazy(() => TextPositionSelector), import_zod18.z.lazy(() => TextQuoteSelector)]).optional().describe(selectorRefinedByDescription)
3525
+ });
3526
+ var textQuoteSelectorSchema = {
3527
+ type: "object",
3528
+ description: "Quote Selector",
3529
+ properties: {
3530
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3531
+ type: {
3532
+ type: "array",
3533
+ minItems: 2,
3534
+ maxItems: 2,
3535
+ items: [
3536
+ { type: "string", const: "TextQuoteSelector" },
3537
+ { type: "string", const: "crm:E33_Linguistic_Object" }
3538
+ ],
3539
+ description: "The class of the Selector"
3540
+ },
3541
+ exact: {
3542
+ type: "string",
3543
+ description: "A copy of the text which is being selected, after normalization."
3544
+ },
3545
+ prefix: {
3546
+ type: "string",
3547
+ description: "The snippet of text that occurs immediately before the text which is being selected."
3548
+ },
3549
+ suffix: {
3550
+ type: "string",
3551
+ description: "The snippet of text that occurs immediately after the text which is being selected."
3552
+ }
3553
+ },
3554
+ required: ["id", "type", "exact", "prefix", "suffix"]
3555
+ };
3556
+ var textQuoteSelectorExtendedSchema = {
3557
+ type: "object",
3558
+ description: "Quote Selector",
3559
+ properties: {
3560
+ ...textQuoteSelectorSchema.properties,
3561
+ refinedBy: {
3562
+ type: "object",
3563
+ description: selectorRefinedByDescription,
3564
+ oneOf: [
3565
+ { $ref: "defs.jsonld#/definitions/textPositionSelector" },
3566
+ { $ref: "defs.jsonld#/definitions/textQuoteSelector" }
3567
+ ],
3568
+ nullable: true,
3569
+ required: []
3570
+ }
3571
+ },
3572
+ required: ["id", "type", "exact", "prefix", "suffix"]
3573
+ };
3574
+
3575
+ // src/v1/schema/definitions/target/selector/xpath.ts
3576
+ var XpathSelector = import_zod19.z.object({
3577
+ id: import_zod19.z.string().describe(selectorIdDescription),
3578
+ type: import_zod19.z.tuple([import_zod19.z.literal("XPathSelector"), import_zod19.z.literal("crm:E73_Information_Object")]),
3579
+ value: import_zod19.z.string().min(1).describe("The xpath to the selected segment.")
3586
3580
  }).describe("Xpath Selector");
3581
+ var XpathSelectorExtended = XpathSelector.extend({
3582
+ refinedBy: import_zod19.z.union([TextPositionSelector, TextQuoteSelector]).optional().describe(selectorRefinedByDescription)
3583
+ });
3587
3584
  var xpathSelectorSchema = {
3588
3585
  type: "object",
3589
3586
  description: "Xpath Selector",
3590
3587
  properties: {
3591
- id: {
3592
- type: "string",
3593
- format: "uuid",
3594
- description: "UUID that identifies the selector."
3595
- },
3588
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3596
3589
  type: {
3597
3590
  type: "array",
3598
3591
  minItems: 2,
@@ -3606,20 +3599,33 @@ var xpathSelectorSchema = {
3606
3599
  value: {
3607
3600
  type: "string",
3608
3601
  description: "Web Annotation Target Select Xpath"
3609
- },
3602
+ }
3603
+ },
3604
+ required: ["id", "type", "value"]
3605
+ };
3606
+ var xpathSelectorExtendedSchema = {
3607
+ type: "object",
3608
+ description: "Xpath Selector",
3609
+ properties: {
3610
+ ...xpathSelectorSchema.properties,
3610
3611
  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."
3612
+ type: "object",
3613
+ description: selectorRefinedByDescription,
3614
+ anyOf: [
3615
+ { $ref: "defs.jsonld#/definitions/textPositionSelector" },
3616
+ { $ref: "defs.jsonld#/definitions/textQuoteSelector" }
3617
+ ],
3618
+ nullable: true,
3619
+ required: []
3613
3620
  }
3614
3621
  },
3615
3622
  required: ["id", "type", "value"]
3616
- // errorMessage: { properties: { id: 'Must be an URI' } },
3617
3623
  };
3618
3624
 
3619
3625
  // 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")]),
3626
+ var RangeSelector = import_zod20.z.object({
3627
+ id: import_zod20.z.string().url().describe(selectorIdDescription),
3628
+ type: import_zod20.z.tuple([import_zod20.z.literal("RangeSelector"), import_zod20.z.literal("crm:E73_Information_Object")]),
3623
3629
  startSelector: XpathSelector,
3624
3630
  endSelector: XpathSelector
3625
3631
  }).describe("Range Selector");
@@ -3627,11 +3633,7 @@ var rangeSelectorSchema = {
3627
3633
  type: "object",
3628
3634
  description: "Range Selector",
3629
3635
  properties: {
3630
- id: {
3631
- type: "string",
3632
- format: "uuid",
3633
- description: "UUID that identifies the selector."
3634
- },
3636
+ id: { type: "string", format: "uri", description: selectorIdDescription },
3635
3637
  type: {
3636
3638
  type: "array",
3637
3639
  minItems: 2,
@@ -3646,106 +3648,113 @@ var rangeSelectorSchema = {
3646
3648
  endSelector: { $ref: "defs.jsonld#/definitions/xpathSelector" }
3647
3649
  },
3648
3650
  required: ["id", "type", "startSelector", "endSelector"]
3649
- // errorMessage: { properties: { id: 'Must be an URI' } },
3650
3651
  };
3651
3652
 
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."
3653
+ // src/v1/schema/definitions/target/selector/index.ts
3654
+ var selectorIdDescription = "UUID that identifies the selector.";
3655
+ var selectorRefinedByDescription = "The relationship between a broader selector and the more specific selector that should be applied to the results of the first.";
3656
+ var Selector = import_zod21.z.union([
3657
+ TextQuoteSelectorExtended,
3658
+ TextPositionSelectorExtended,
3659
+ XpathSelectorExtended,
3660
+ RangeSelector
3661
+ ]);
3662
+ var selectorSchema = {
3663
+ type: "object",
3664
+ oneOf: [
3665
+ textQuoteSelectorExtendedSchema,
3666
+ textPositionSelectorExtendedSchema,
3667
+ xpathSelectorExtendedSchema,
3668
+ rangeSelectorSchema
3669
+ ],
3670
+ required: []
3671
+ };
3672
+
3673
+ // src/v1/schema/definitions/target/source.ts
3674
+ var import_zod22 = require("zod");
3675
+ 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.";
3676
+ var Format = import_zod22.z.string().min(1).describe(formatDescription);
3677
+ var formatSchema = {
3678
+ type: "string",
3679
+ description: formatDescription,
3680
+ minLength: 1
3681
+ };
3682
+ var languageDescription = "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification.";
3683
+ var Language = import_zod22.z.string().min(2).max(3).describe(languageDescription);
3684
+ var languageSchema = {
3685
+ type: "string",
3686
+ description: languageDescription,
3687
+ minLength: 2,
3688
+ maxLength: 3
3689
+ };
3690
+ var sourceIdDescription = "The IRI that identifies the Target source.";
3691
+ var Source = import_zod22.z.object({
3692
+ id: import_zod22.z.string().url().describe(sourceIdDescription),
3693
+ format: import_zod22.z.union([Format, import_zod22.z.array(Format).min(1)]).optional().describe(
3694
+ "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
3695
  ),
3661
- sufix: import_zod20.z.string().optional().describe(
3662
- "The snippet of text that occurs immediately after the text which is being selected."
3696
+ language: import_zod22.z.union([Language, import_zod22.z.array(Language).min(1)]).optional().describe(
3697
+ "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
3698
  ),
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 = {
3699
+ title: import_zod22.z.string().min(1, { message: "The title cannot be empty" }).optional().describe("The title of the document being annotated.")
3700
+ }).describe("Web Annotation Target");
3701
+ var sourceSchema = {
3669
3702
  type: "object",
3670
- description: "Quote Selector",
3703
+ description: `Web Annotation Target's source`,
3671
3704
  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."
3705
+ id: { type: "string", format: "uri", description: sourceIdDescription },
3706
+ format: {
3707
+ type: ["string", "array"],
3708
+ nullable: true,
3709
+ anyOf: [
3710
+ formatSchema,
3711
+ {
3712
+ type: "array",
3713
+ minItems: 1,
3714
+ items: formatSchema,
3715
+ 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."
3716
+ }
3717
+ ]
3690
3718
  },
3691
- prefix: {
3692
- type: "string",
3693
- description: "The snippet of text that occurs immediately before the text which is being selected."
3719
+ language: {
3720
+ type: ["string", "array"],
3721
+ nullable: true,
3722
+ anyOf: [
3723
+ languageSchema,
3724
+ {
3725
+ type: "array",
3726
+ minItems: 1,
3727
+ items: languageSchema,
3728
+ 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."
3729
+ }
3730
+ ]
3694
3731
  },
3695
- sufix: {
3732
+ title: {
3696
3733
  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: []
3734
+ minLength: 1,
3735
+ nullable: true,
3736
+ description: "The title of the document being annotated."
3708
3737
  }
3709
3738
  },
3710
- required: ["id", "type", "exact"]
3711
- // errorMessage: { properties: { id: 'Must be an URI' } },
3739
+ required: ["id"]
3712
3740
  };
3713
3741
 
3714
3742
  // 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."),
3743
+ var targetIdDescription = "The IRI that identifies the Target resource.";
3744
+ var Target = import_zod23.z.object({
3745
+ id: import_zod23.z.string().url().describe(targetIdDescription),
3746
+ 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."),
3747
+ source: Source,
3733
3748
  renderedVia: Software.optional().describe(
3734
3749
  "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
3750
  ),
3736
- selector: import_zod21.z.union([TextQuoteSelector, RangeSelector, XpathSelector, TextPositionSelector]).optional().describe("The relationship between a Specific Resource and a Selector. ")
3751
+ selector: import_zod23.z.union([Selector, import_zod23.z.array(Selector)]).describe("The relationship between a Specific Resource and a Selector. ")
3737
3752
  }).describe("Web Annotation Target");
3738
3753
  var targetSchema = {
3739
3754
  type: "object",
3740
3755
  description: "Web Annotation Target",
3741
3756
  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
- },
3757
+ id: { type: "string", format: "uri", description: targetIdDescription },
3749
3758
  type: {
3750
3759
  type: "array",
3751
3760
  minItems: 2,
@@ -3756,49 +3765,23 @@ var targetSchema = {
3756
3765
  ],
3757
3766
  description: "The class of the Specific Resource."
3758
3767
  },
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
- },
3768
+ source: sourceSchema,
3784
3769
  renderedVia: {
3785
3770
  $ref: "defs.jsonld#/definitions/software",
3786
3771
  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
3772
  },
3788
3773
  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"]
3774
+ anyOf: [
3775
+ selectorSchema,
3776
+ {
3777
+ type: "array",
3778
+ items: selectorSchema,
3779
+ minItems: 1
3780
+ }
3781
+ ]
3798
3782
  }
3799
3783
  },
3800
- required: ["id", "type"],
3801
- // errorMessage: { properties: { id: 'Must be an URI or an UUID' } },
3784
+ required: ["id", "type", "source", "selector"],
3802
3785
  allOf: [
3803
3786
  {
3804
3787
  if: {
@@ -3823,10 +3806,9 @@ var targetSchema = {
3823
3806
  then: {
3824
3807
  type: "object",
3825
3808
  properties: {
3826
- selector: { type: "object", required: ["type", "exact"] }
3809
+ selector: { type: "object", required: ["id", "type", "exact", "prefix", "suffix"] }
3827
3810
  }
3828
- },
3829
- required: ["selector"]
3811
+ }
3830
3812
  },
3831
3813
  {
3832
3814
  if: {
@@ -3852,8 +3834,7 @@ var targetSchema = {
3852
3834
  type: "object",
3853
3835
  properties: {
3854
3836
  selector: { type: "object", required: ["type", "startSelector", "endSelector"] }
3855
- },
3856
- required: ["selector"]
3837
+ }
3857
3838
  }
3858
3839
  },
3859
3840
  {
@@ -3880,8 +3861,7 @@ var targetSchema = {
3880
3861
  type: "object",
3881
3862
  properties: {
3882
3863
  selector: { type: "object", required: ["type", "value"] }
3883
- },
3884
- required: ["selector"]
3864
+ }
3885
3865
  }
3886
3866
  },
3887
3867
  {
@@ -3908,8 +3888,7 @@ var targetSchema = {
3908
3888
  type: "object",
3909
3889
  properties: {
3910
3890
  selector: { type: "object", required: ["type", "start", "end"] }
3911
- },
3912
- required: ["selector"]
3891
+ }
3913
3892
  }
3914
3893
  }
3915
3894
  ]
@@ -3923,17 +3902,17 @@ var definitionSchema = {
3923
3902
  creator: creatorSchema,
3924
3903
  software: softwareSchema,
3925
3904
  target: targetSchema,
3905
+ textPositionSelector: textPositionSelectorSchema,
3926
3906
  textQuoteSelector: textQuoteSelectorSchema,
3927
- rangeSelector: rangeSelectorSchema,
3928
3907
  xpathSelector: xpathSelectorSchema,
3929
- textPositionSelector: textPositionSelectorSchema,
3908
+ rangeSelector: rangeSelectorSchema,
3930
3909
  body: bodySchema
3931
3910
  },
3932
3911
  required: []
3933
3912
  };
3934
3913
 
3935
3914
  // src/v1/schema/root.ts
3936
- var import_zod22 = require("zod");
3915
+ var import_zod24 = require("zod");
3937
3916
  var Status = ["draft", "approved", "published"];
3938
3917
  var Motivation = [
3939
3918
  "identifying",
@@ -3944,32 +3923,26 @@ var Motivation = [
3944
3923
  "linking",
3945
3924
  "citing"
3946
3925
  ];
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.")
3926
+ var WebAnnotation = import_zod24.z.object({
3927
+ "@context": import_zod24.z.tuple([
3928
+ import_zod24.z.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
3929
+ import_zod24.z.literal(contextUri).describe("LINCS Web Annotation Context.")
3951
3930
  ]).describe(
3952
3931
  "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
3932
  ),
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:E33_Linguistic_Object")]).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."),
3933
+ id: import_zod24.z.string().url().describe("The identity of the Annotation."),
3934
+ type: import_zod24.z.tuple([import_zod24.z.literal("Annotation"), import_zod24.z.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
3935
+ 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."),
3936
+ created: import_zod24.z.string().datetime().describe("The time at which the resource was created."),
3937
+ modified: import_zod24.z.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
3938
+ status: import_zod24.z.enum(Status).describe("The status of this annotation in a workflow."),
3966
3939
  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."),
3940
+ 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
3941
  generator: Software.describe(
3969
3942
  "The agent responsible for generating the serialization of the Annotation. "
3970
3943
  ),
3971
3944
  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.")
3945
+ body: import_zod24.z.union([Body, import_zod24.z.array(Body)]).describe("The relationship between an Annotation and its Body.")
3973
3946
  }).describe("Web Annotation Root");
3974
3947
  var webAnnotationSchema = {
3975
3948
  $id: schemaId,
@@ -3987,15 +3960,9 @@ var webAnnotationSchema = {
3987
3960
  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
3961
  },
3989
3962
  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)"
3963
+ type: "string",
3964
+ format: "uri",
3965
+ description: "The type of the Annotation."
3999
3966
  },
4000
3967
  type: {
4001
3968
  type: "array",
@@ -4013,7 +3980,7 @@ var webAnnotationSchema = {
4013
3980
  maxItems: 2,
4014
3981
  items: [
4015
3982
  { type: "string", enum: Motivation },
4016
- { type: "string", const: "crm:E33_Linguistic_Object" }
3983
+ { type: "string", const: "crm:E55_Type" }
4017
3984
  ],
4018
3985
  description: "The relationship between an Annotation and a Motivation."
4019
3986
  },
@@ -4062,28 +4029,6 @@ var webAnnotationSchema = {
4062
4029
  "status"
4063
4030
  ],
4064
4031
  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
4032
  {
4088
4033
  if: {
4089
4034
  type: "object",
@@ -4116,7 +4061,7 @@ var webAnnotationSchema = {
4116
4061
  maxItems: 2,
4117
4062
  items: [
4118
4063
  { type: "string", const: "identifying" },
4119
- { type: "string", const: "crm:E33_Linguistic_Object" }
4064
+ { type: "string", const: "crm:E55_Type" }
4120
4065
  ]
4121
4066
  }
4122
4067
  }
@@ -4142,7 +4087,7 @@ var webAnnotationSchema = {
4142
4087
  maxItems: 2,
4143
4088
  items: [
4144
4089
  { type: "string", const: "describing" },
4145
- { type: "string", const: "crm:E33_Linguistic_Object" }
4090
+ { type: "string", const: "crm:E55_Type" }
4146
4091
  ]
4147
4092
  }
4148
4093
  }
@@ -4168,7 +4113,7 @@ var webAnnotationSchema = {
4168
4113
  maxItems: 2,
4169
4114
  items: [
4170
4115
  { type: "string", const: "correcting" },
4171
- { type: "string", const: "crm:E33_Linguistic_Object" }
4116
+ { type: "string", const: "crm:E55_Type" }
4172
4117
  ]
4173
4118
  }
4174
4119
  }
@@ -4194,7 +4139,7 @@ var webAnnotationSchema = {
4194
4139
  maxItems: 2,
4195
4140
  items: [
4196
4141
  { type: "string", const: "tagging" },
4197
- { type: "string", const: "crm:E33_Linguistic_Object" }
4142
+ { type: "string", const: "crm:E55_Type" }
4198
4143
  ]
4199
4144
  }
4200
4145
  }
@@ -4220,7 +4165,7 @@ var webAnnotationSchema = {
4220
4165
  maxItems: 2,
4221
4166
  items: [
4222
4167
  { type: "string", const: "classifying" },
4223
- { type: "string", const: "crm:E33_Linguistic_Object" }
4168
+ { type: "string", const: "crm:E55_Type" }
4224
4169
  ]
4225
4170
  }
4226
4171
  }
@@ -4246,7 +4191,7 @@ var webAnnotationSchema = {
4246
4191
  maxItems: 2,
4247
4192
  items: [
4248
4193
  { type: "string", const: "linking" },
4249
- { type: "string", const: "crm:E33_Linguistic_Object" }
4194
+ { type: "string", const: "crm:E55_Type" }
4250
4195
  ]
4251
4196
  }
4252
4197
  }
@@ -4272,7 +4217,7 @@ var webAnnotationSchema = {
4272
4217
  maxItems: 2,
4273
4218
  items: [
4274
4219
  { type: "string", const: "citing" },
4275
- { type: "string", const: "crm:E33_Linguistic_Object" }
4220
+ { type: "string", const: "crm:E55_Type" }
4276
4221
  ]
4277
4222
  }
4278
4223
  }
@@ -4294,24 +4239,25 @@ var import_ajv = __toESM(require("ajv"));
4294
4239
  var import_ajv_formats = __toESM(require("ajv-formats"));
4295
4240
 
4296
4241
  // 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())
4242
+ var import_zod25 = require("zod");
4243
+ var ValidationError = import_zod25.z.object({
4244
+ message: import_zod25.z.string(),
4245
+ path: import_zod25.z.string(),
4246
+ suggestion: import_zod25.z.string().optional(),
4247
+ context: import_zod25.z.object({
4248
+ errorType: import_zod25.z.string()
4249
+ }).and(import_zod25.z.unknown())
4305
4250
  });
4306
- var ValidateResult = import_zod23.z.object({
4307
- valid: import_zod23.z.boolean(),
4308
- errors: import_zod23.z.array(ValidationError).optional()
4251
+ var ValidateResult = import_zod25.z.object({
4252
+ valid: import_zod25.z.boolean(),
4253
+ errors: import_zod25.z.array(ValidationError).optional()
4309
4254
  });
4310
4255
 
4311
4256
  // src/v1/validator/index.ts
4312
4257
  var ajv = new import_ajv.default({
4313
4258
  code: { source: true },
4314
- allErrors: true
4259
+ allErrors: true,
4260
+ allowUnionTypes: true
4315
4261
  }).addSchema([webAnnotationSchema, definitionSchema]);
4316
4262
  (0, import_ajv_formats.default)(ajv);
4317
4263
  var validator = ajv.compile(webAnnotationSchema);
@@ -4338,6 +4284,7 @@ var getErrors = (annotation) => {
4338
4284
  var v1_exports = {};
4339
4285
  __export(v1_exports, {
4340
4286
  Body: () => Body,
4287
+ DATE_RANGE_PATTERN: () => DATE_RANGE_PATTERN,
4341
4288
  Motivation: () => Motivation,
4342
4289
  Person: () => Person,
4343
4290
  PersonEntityType: () => PersonEntityType,
@@ -4350,6 +4297,7 @@ __export(v1_exports, {
4350
4297
  ValidationError: () => ValidationError,
4351
4298
  WebAnnotation: () => WebAnnotation,
4352
4299
  ajv: () => ajv,
4300
+ bodyIdDescription: () => bodyIdDescription,
4353
4301
  bodySchema: () => bodySchema,
4354
4302
  contextUri: () => contextUri,
4355
4303
  creatorSchema: () => creatorSchema,
@@ -4480,45 +4428,49 @@ var commonCreator = {
4480
4428
  name: "user"
4481
4429
  };
4482
4430
  var commonSoftware = {
4483
- id: "htpps://leafwriter.com",
4431
+ id: "https://leafwriter.com",
4484
4432
  type: ["Software", "crm:P16_used_specific_object"],
4485
4433
  label: "LEAF-Writer"
4486
4434
  };
4487
4435
  var commonSelectorTextPosition = {
4488
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4436
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec584",
4489
4437
  type: ["TextPositionSelector", "crm:E73_Information_Object"],
4490
4438
  start: 12,
4491
4439
  end: 30
4492
4440
  };
4493
4441
  var commonSelectorXpath = {
4494
- id: "55369c00-5c43-4d1a-8462-31c74fbec582",
4442
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec582",
4495
4443
  type: ["XPathSelector", "crm:E73_Information_Object"],
4496
4444
  value: "TEI/tex/div/text/p/personName"
4497
4445
  };
4498
4446
  var commonSelectorRange = {
4499
- id: "55369c00-5c43-4d1a-8462-31c74fbec582",
4447
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec581",
4500
4448
  type: ["RangeSelector", "crm:E73_Information_Object"],
4501
4449
  startSelector: commonSelectorXpath,
4502
4450
  endSelector: commonSelectorXpath
4503
4451
  };
4504
4452
  var commonSelectorTextQuote = {
4505
- id: "55369c00-5c43-4d1a-8462-31c74fbec583",
4453
+ id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec583",
4506
4454
  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 }
4455
+ exact: "exact text",
4456
+ prefix: "prefix text",
4457
+ suffix: "prefix text"
4514
4458
  };
4515
4459
  var commonTarget = {
4516
- id: "https://document.com",
4460
+ id: "https://wa.lincsproject/target/55369c00-5c43-4d1a-8462-31c74fbec522",
4517
4461
  type: ["SpecificResource", "crm:E73_Information_Object"],
4518
- format: ["application/xml"],
4519
- language: ["eng"],
4520
- renderedVia: commonSoftware,
4521
- selector: commonDetailedSelector
4462
+ source: {
4463
+ id: "https://document-url.com"
4464
+ },
4465
+ selector: commonSelectorTextQuote
4466
+ };
4467
+ var commonTargetMultipleSelectors = {
4468
+ id: "https://wa.lincsproject/target/55369c00-5c43-4d1a-8462-31c74fbec522",
4469
+ type: ["SpecificResource", "crm:E73_Information_Object"],
4470
+ source: {
4471
+ id: "https://document-url.com"
4472
+ },
4473
+ selector: [commonSelectorTextQuote, commonSelectorTextPosition]
4522
4474
  };
4523
4475
  var commonBody = {
4524
4476
  id: "https://www.uo.com/person",
@@ -4526,9 +4478,9 @@ var commonBody = {
4526
4478
  };
4527
4479
  var commonAnnotation = {
4528
4480
  "@context": ["http://www.w3.org/ns/anno.jsonld", "https://wa.lincsproject.ca/v1/ns/anno.jsonld"],
4529
- id: "c7aa1b38-6364-483c-8607-44dc3f510a59",
4481
+ id: "https://wa.lincsproject/c7aa1b38-6364-483c-8607-44dc3f510a59",
4530
4482
  type: ["Annotation", "crm:E33_Linguistic_Object"],
4531
- motivation: ["identifying", "crm:E33_Linguistic_Object"],
4483
+ motivation: ["identifying", "crm:E55_Type"],
4532
4484
  created: "2022-12-21T23:21:02Z",
4533
4485
  creator: commonCreator,
4534
4486
  generator: commonSoftware,
@@ -4543,7 +4495,10 @@ var common = {
4543
4495
  textPosition: commonSelectorTextPosition,
4544
4496
  xpath: commonSelectorXpath,
4545
4497
  range: commonSelectorRange,
4546
- textQuote: commonSelectorTextQuote
4498
+ textQuote: commonSelectorTextQuote,
4499
+ multipleSelectors: {
4500
+ textQuoteAndTextPosition: commonTargetMultipleSelectors
4501
+ }
4547
4502
  },
4548
4503
  target: commonTarget,
4549
4504
  body: commonBody,
@@ -4652,26 +4607,26 @@ var place = {
4652
4607
  // src/v1/mocks/body/citation.ts
4653
4608
  var simple = {
4654
4609
  ...common.annotation,
4655
- motivation: ["citing", "crm:E33_Linguistic_Object"],
4610
+ motivation: ["citing", "crm:E55_Type"],
4656
4611
  body: {
4657
- id: "https://www.uo.com/conceptualObject",
4612
+ id: "https://www.uo.com/work",
4658
4613
  entityType: ["cito:Citation", "crm:E73_Information_Object"]
4659
4614
  }
4660
4615
  };
4661
4616
  var withCertainty3 = {
4662
4617
  ...common.annotation,
4663
- motivation: ["citing", "crm:E33_Linguistic_Object"],
4618
+ motivation: ["citing", "crm:E55_Type"],
4664
4619
  body: {
4665
- id: "https://www.uo.com/conceptualObject",
4620
+ id: "https://www.uo.com/work",
4666
4621
  entityType: ["cito:Citation", "crm:E73_Information_Object"],
4667
4622
  certainty: "edit:qualityHigh"
4668
4623
  }
4669
4624
  };
4670
4625
  var withLabelAndDescription3 = {
4671
4626
  ...common.annotation,
4672
- motivation: ["citing", "crm:E33_Linguistic_Object"],
4627
+ motivation: ["citing", "crm:E55_Type"],
4673
4628
  body: {
4674
- id: "https://www.uo.com/conceptualObject",
4629
+ id: "https://www.uo.com/work",
4675
4630
  entityType: ["cito:Citation", "crm:E73_Information_Object"],
4676
4631
  label: "Sandman",
4677
4632
  description: "Graphic Novel"
@@ -4729,9 +4684,9 @@ var conceptualObject = {
4729
4684
  // src/v1/mocks/body/correction.ts
4730
4685
  var valid = {
4731
4686
  ...common.annotation,
4732
- motivation: ["correcting", "crm:E33_Linguistic_Object"],
4687
+ motivation: ["correcting", "crm:E55_Type"],
4733
4688
  body: {
4734
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4689
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4735
4690
  type: "TextualBody",
4736
4691
  entityType: ["fabio:Correction", "crm:E33_Linguistic_Object"],
4737
4692
  value: "this is a correction"
@@ -4745,7 +4700,7 @@ var correction = {
4745
4700
  var simple2 = {
4746
4701
  ...common.annotation,
4747
4702
  body: {
4748
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4703
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4749
4704
  type: "TextualBody",
4750
4705
  entityType: ["xsd:date", "crm:E52_Time-Span"],
4751
4706
  value: "2012-03-01T00:00:00/2012-02-01T18:21:07"
@@ -4754,7 +4709,7 @@ var simple2 = {
4754
4709
  var withCertainty5 = {
4755
4710
  ...common.annotation,
4756
4711
  body: {
4757
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4712
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4758
4713
  type: "TextualBody",
4759
4714
  entityType: ["xsd:date", "crm:E52_Time-Span"],
4760
4715
  value: "2012-03-01T00:00:00/2012-02-01T18:21:07",
@@ -4764,7 +4719,7 @@ var withCertainty5 = {
4764
4719
  var withPrecision2 = {
4765
4720
  ...common.annotation,
4766
4721
  body: {
4767
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4722
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4768
4723
  type: "TextualBody",
4769
4724
  entityType: ["xsd:date", "crm:E52_Time-Span"],
4770
4725
  value: "2012-03-01T00:00:00/2012-02-01T18:21:07",
@@ -4782,7 +4737,7 @@ var date = {
4782
4737
  // src/v1/mocks/body/keyword.ts
4783
4738
  var vocabularySimple = {
4784
4739
  ...common.annotation,
4785
- motivation: ["classifying", "crm:E33_Linguistic_Object"],
4740
+ motivation: ["classifying", "crm:E55_Type"],
4786
4741
  body: {
4787
4742
  id: "https://www.uo.com/keyword",
4788
4743
  entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"]
@@ -4790,7 +4745,7 @@ var vocabularySimple = {
4790
4745
  };
4791
4746
  var vocabularyWithCertainty = {
4792
4747
  ...common.annotation,
4793
- motivation: ["classifying", "crm:E33_Linguistic_Object"],
4748
+ motivation: ["classifying", "crm:E55_Type"],
4794
4749
  body: {
4795
4750
  id: "https://www.uo.com/keyword",
4796
4751
  entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"],
@@ -4799,7 +4754,7 @@ var vocabularyWithCertainty = {
4799
4754
  };
4800
4755
  var vocabularyWithLabelAndDescription = {
4801
4756
  ...common.annotation,
4802
- motivation: ["classifying", "crm:E33_Linguistic_Object"],
4757
+ motivation: ["classifying", "crm:E55_Type"],
4803
4758
  body: {
4804
4759
  id: "https://www.uo.com/keyword",
4805
4760
  entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"],
@@ -4809,9 +4764,9 @@ var vocabularyWithLabelAndDescription = {
4809
4764
  };
4810
4765
  var folksonomy = {
4811
4766
  ...common.annotation,
4812
- motivation: ["tagging", "crm:E33_Linguistic_Object"],
4767
+ motivation: ["tagging", "crm:E55_Type"],
4813
4768
  body: {
4814
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4769
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4815
4770
  type: "TextualBody",
4816
4771
  entityType: ["crm:E55_Type", "crm:E33_Linguistic_Object"],
4817
4772
  value: "a tag"
@@ -4831,7 +4786,7 @@ var keyword = {
4831
4786
  // src/v1/mocks/body/link.ts
4832
4787
  var simple3 = {
4833
4788
  ...common.annotation,
4834
- motivation: ["linking", "crm:E33_Linguistic_Object"],
4789
+ motivation: ["linking", "crm:E55_Type"],
4835
4790
  body: {
4836
4791
  id: "https://www.uo.com/link",
4837
4792
  entityType: "crmdig:D1_Digital_Object"
@@ -4839,7 +4794,7 @@ var simple3 = {
4839
4794
  };
4840
4795
  var withCertainty6 = {
4841
4796
  ...common.annotation,
4842
- motivation: ["linking", "crm:E33_Linguistic_Object"],
4797
+ motivation: ["linking", "crm:E55_Type"],
4843
4798
  body: {
4844
4799
  id: "https://www.uo.com/link",
4845
4800
  entityType: "crmdig:D1_Digital_Object",
@@ -4856,9 +4811,9 @@ var link = {
4856
4811
  // src/v1/mocks/body/note.ts
4857
4812
  var simple4 = {
4858
4813
  ...common.annotation,
4859
- motivation: ["describing", "crm:E33_Linguistic_Object"],
4814
+ motivation: ["describing", "crm:E55_Type"],
4860
4815
  body: {
4861
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4816
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4862
4817
  type: "TextualBody",
4863
4818
  entityType: "crm:E33_Linguistic_Object",
4864
4819
  value: "this is a note"
@@ -4866,9 +4821,9 @@ var simple4 = {
4866
4821
  };
4867
4822
  var additionalType = {
4868
4823
  ...common.annotation,
4869
- motivation: ["describing", "crm:E33_Linguistic_Object"],
4824
+ motivation: ["describing", "crm:E55_Type"],
4870
4825
  body: {
4871
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4826
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4872
4827
  type: "TextualBody",
4873
4828
  entityType: "crm:E33_Linguistic_Object",
4874
4829
  additionalType: "cwrc:NoteScholarly",
@@ -4877,9 +4832,9 @@ var additionalType = {
4877
4832
  };
4878
4833
  var additionalMultipleTypes = {
4879
4834
  ...common.annotation,
4880
- motivation: ["describing", "crm:E33_Linguistic_Object"],
4835
+ motivation: ["describing", "crm:E55_Type"],
4881
4836
  body: {
4882
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
4837
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
4883
4838
  type: "TextualBody",
4884
4839
  entityType: "crm:E33_Linguistic_Object",
4885
4840
  additionalType: ["scholarly", "academic"],
@@ -5017,6 +4972,47 @@ var work = {
5017
4972
  }
5018
4973
  };
5019
4974
 
4975
+ // src/v1/mocks/body/event.ts
4976
+ var real7 = {
4977
+ ...common.annotation,
4978
+ body: {
4979
+ id: "https://www.uo.com/event",
4980
+ entityType: "crm:E5_Event"
4981
+ }
4982
+ };
4983
+ var fictional7 = {
4984
+ ...common.annotation,
4985
+ body: {
4986
+ id: "https://www.uo.com/event",
4987
+ entityType: "YET TO BE DEFINED A CLASS FOR FICTIONAL EVENTS"
4988
+ }
4989
+ };
4990
+ var withCertainty10 = {
4991
+ ...common.annotation,
4992
+ body: {
4993
+ id: "https://www.uo.com/event",
4994
+ entityType: "crm:E5_Event",
4995
+ certainty: "edit:qualityLow"
4996
+ }
4997
+ };
4998
+ var withLabelAndDescription8 = {
4999
+ ...common.annotation,
5000
+ body: {
5001
+ id: "https://www.uo.com/event",
5002
+ entityType: "crm:E5_Event",
5003
+ label: "revolution",
5004
+ description: "An event"
5005
+ }
5006
+ };
5007
+ var event = {
5008
+ valid: {
5009
+ real: real7,
5010
+ fictional: fictional7,
5011
+ withCertainty: withCertainty10,
5012
+ withLabelAndDescription: withLabelAndDescription8
5013
+ }
5014
+ };
5015
+
5020
5016
  // src/v1/mocks/body/index.ts
5021
5017
  var personPlace = {
5022
5018
  ...common.annotation,
@@ -5051,7 +5047,6 @@ var generatorWithVersion = {
5051
5047
  ...common.annotation,
5052
5048
  generator: { ...common.software, softwareVersion: "v1.2.5" }
5053
5049
  };
5054
- var { creator } = common.annotation;
5055
5050
  var noCreator = {
5056
5051
  ...common.annotation
5057
5052
  };
@@ -5071,25 +5066,16 @@ var agent = {
5071
5066
  };
5072
5067
 
5073
5068
  // 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
5069
  var motivationIdentify = {
5084
5070
  ...common.annotation,
5085
- motivation: ["identifying", "crm:E33_Linguistic_Object"],
5071
+ motivation: ["identifying", "crm:E55_Type"],
5086
5072
  body: commonPersonBody
5087
5073
  };
5088
5074
  var motivationDescribing = {
5089
5075
  ...common.annotation,
5090
- motivation: ["describing", "crm:E33_Linguistic_Object"],
5076
+ motivation: ["describing", "crm:E55_Type"],
5091
5077
  body: {
5092
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5078
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
5093
5079
  type: "TextualBody",
5094
5080
  entityType: "crm:E33_Linguistic_Object",
5095
5081
  value: "this is a note"
@@ -5097,9 +5083,9 @@ var motivationDescribing = {
5097
5083
  };
5098
5084
  var motivationCorrecting = {
5099
5085
  ...common.annotation,
5100
- motivation: ["correcting", "crm:E33_Linguistic_Object"],
5086
+ motivation: ["correcting", "crm:E55_Type"],
5101
5087
  body: {
5102
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5088
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
5103
5089
  type: "TextualBody",
5104
5090
  entityType: ["fabio:Correction", "crm:E33_Linguistic_Object"],
5105
5091
  value: "this is a correction"
@@ -5107,9 +5093,9 @@ var motivationCorrecting = {
5107
5093
  };
5108
5094
  var motivationTagging = {
5109
5095
  ...common.annotation,
5110
- motivation: ["tagging", "crm:E33_Linguistic_Object"],
5096
+ motivation: ["tagging", "crm:E55_Type"],
5111
5097
  body: {
5112
- id: "55369c00-5c43-4d1a-8462-31c74fbec584",
5098
+ id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
5113
5099
  type: "TextualBody",
5114
5100
  entityType: ["crm:E55_Type", "crm:E33_Linguistic_Object"],
5115
5101
  value: "a tag"
@@ -5117,7 +5103,7 @@ var motivationTagging = {
5117
5103
  };
5118
5104
  var motivationClassifying = {
5119
5105
  ...common.annotation,
5120
- motivation: ["classifying", "crm:E33_Linguistic_Object"],
5106
+ motivation: ["classifying", "crm:E55_Type"],
5121
5107
  body: {
5122
5108
  id: "https://www.uo.com/keyword",
5123
5109
  entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"]
@@ -5125,7 +5111,7 @@ var motivationClassifying = {
5125
5111
  };
5126
5112
  var motivationLinking = {
5127
5113
  ...common.annotation,
5128
- motivation: ["linking", "crm:E33_Linguistic_Object"],
5114
+ motivation: ["linking", "crm:E55_Type"],
5129
5115
  body: {
5130
5116
  id: "https://www.uo.com/link",
5131
5117
  entityType: "crmdig:D1_Digital_Object"
@@ -5133,7 +5119,7 @@ var motivationLinking = {
5133
5119
  };
5134
5120
  var motivationCiting = {
5135
5121
  ...common.annotation,
5136
- motivation: ["citing", "crm:E33_Linguistic_Object"],
5122
+ motivation: ["citing", "crm:E55_Type"],
5137
5123
  body: {
5138
5124
  id: "https://www.uo.com/conceptualObject",
5139
5125
  entityType: ["cito:Citation", "crm:E73_Information_Object"]
@@ -5158,10 +5144,6 @@ var statusPublished = {
5158
5144
  };
5159
5145
  var root = {
5160
5146
  valid: {
5161
- id: {
5162
- uri: idUri,
5163
- uuid: idUUID
5164
- },
5165
5147
  motivation: {
5166
5148
  identify: motivationIdentify,
5167
5149
  describing: motivationDescribing,
@@ -5181,133 +5163,191 @@ var root = {
5181
5163
  };
5182
5164
 
5183
5165
  // src/v1/mocks/target/selector.ts
5184
- var textQuoteSimple = {
5166
+ var textQuote = {
5185
5167
  ...common.annotation,
5186
5168
  target: {
5187
5169
  ...common.target,
5188
5170
  selector: common.selector.textQuote
5189
5171
  }
5190
5172
  };
5191
- var textQuoteRefinedByXpath = {
5173
+ var textQuoteRefinedByTextPosition = {
5192
5174
  ...common.annotation,
5193
5175
  target: {
5194
5176
  ...common.target,
5195
5177
  selector: {
5196
5178
  ...common.selector.textQuote,
5197
- refinedBy: common.selector.xpath
5179
+ refinedBy: common.selector.textPosition
5198
5180
  }
5199
5181
  }
5200
5182
  };
5201
- var textQuoteRefinedByXapthRefinedByTextPosition = {
5183
+ var textQuoteRefinedByTextQuote = {
5202
5184
  ...common.annotation,
5203
5185
  target: {
5204
5186
  ...common.target,
5205
5187
  selector: {
5206
5188
  ...common.selector.textQuote,
5207
- refinedBy: {
5208
- ...common.selector.xpath,
5209
- refinedBy: common.selector.textPosition
5210
- }
5189
+ refinedBy: common.selector.textQuote
5211
5190
  }
5212
5191
  }
5213
5192
  };
5214
- var textQuoteRefinedByTextPosition = {
5193
+ var xpath = {
5194
+ ...common.annotation,
5195
+ target: {
5196
+ ...common.target,
5197
+ selector: common.selector.xpath
5198
+ }
5199
+ };
5200
+ var xpathRefinedByTextPosition = {
5215
5201
  ...common.annotation,
5216
5202
  target: {
5217
5203
  ...common.target,
5218
5204
  selector: {
5219
- ...common.selector.textQuote,
5205
+ ...common.selector.xpath,
5220
5206
  refinedBy: common.selector.textPosition
5221
5207
  }
5222
5208
  }
5223
5209
  };
5224
- var xpath = {
5210
+ var xpathRefinedByTextQuote = {
5225
5211
  ...common.annotation,
5226
5212
  target: {
5227
5213
  ...common.target,
5228
- selector: common.selector.xpath
5214
+ selector: {
5215
+ ...common.selector.xpath,
5216
+ refinedBy: common.selector.textQuote
5217
+ }
5229
5218
  }
5230
5219
  };
5231
- var xpathRefinedByTextPosition = {
5220
+ var textPosition = {
5221
+ ...common.annotation,
5222
+ target: {
5223
+ ...common.target,
5224
+ selector: common.selector.textPosition
5225
+ }
5226
+ };
5227
+ var textPositionRefinedByTextQuote = {
5232
5228
  ...common.annotation,
5233
5229
  target: {
5234
5230
  ...common.target,
5235
5231
  selector: {
5236
- ...common.selector.xpath,
5232
+ ...common.selector.textPosition,
5233
+ refinedBy: common.selector.textQuote
5234
+ }
5235
+ }
5236
+ };
5237
+ var textPositionRefinedByTextPosition = {
5238
+ ...common.annotation,
5239
+ target: {
5240
+ ...common.target,
5241
+ selector: {
5242
+ ...common.selector.textPosition,
5237
5243
  refinedBy: common.selector.textPosition
5238
5244
  }
5239
5245
  }
5240
5246
  };
5241
- var textPosition = {
5247
+ var range = {
5242
5248
  ...common.annotation,
5243
5249
  target: {
5244
5250
  ...common.target,
5245
- selector: common.selector.textPosition
5251
+ selector: common.selector.range
5252
+ }
5253
+ };
5254
+ var textQuoteAndTextPosition = {
5255
+ ...common.annotation,
5256
+ target: {
5257
+ ...common.target,
5258
+ selector: [common.selector.textQuote, common.selector.textPosition]
5246
5259
  }
5247
5260
  };
5248
5261
  var targetSelector = {
5249
5262
  valid: {
5250
5263
  selector: {
5251
5264
  textQuote: {
5252
- simple: textQuoteSimple,
5253
- refinedByXpath: textQuoteRefinedByXpath,
5254
- refinedByXpathAndTextPosition: textQuoteRefinedByXapthRefinedByTextPosition,
5255
- refinedByTextPositon: textQuoteRefinedByTextPosition
5265
+ simple: textQuote,
5266
+ refinedByTextPositon: textQuoteRefinedByTextPosition,
5267
+ refinedByTextQuote: textQuoteRefinedByTextQuote
5256
5268
  },
5257
5269
  xpath: {
5258
5270
  simple: xpath,
5259
- refinedByTextPositon: xpathRefinedByTextPosition
5271
+ refinedByTextPositon: xpathRefinedByTextPosition,
5272
+ refinedByTextQuote: xpathRefinedByTextQuote
5273
+ },
5274
+ textPosition: {
5275
+ simple: textPosition,
5276
+ refinedByTextPositon: textPositionRefinedByTextQuote,
5277
+ refinedByTextQuote: textPositionRefinedByTextPosition
5260
5278
  },
5261
- textPositon: textPosition
5279
+ range,
5280
+ multipleSelector: {
5281
+ textQuoteAndTextPosition
5282
+ }
5262
5283
  }
5263
5284
  }
5264
5285
  };
5265
5286
 
5266
5287
  // src/v1/mocks/target/target.ts
5267
5288
  var simple5 = {
5289
+ ...common.annotation,
5290
+ target: common.target
5291
+ };
5292
+ var withSourceTitle = {
5268
5293
  ...common.annotation,
5269
5294
  target: {
5270
- id: "https://document.com",
5271
- type: ["SpecificResource", "crm:E73_Information_Object"],
5272
- selector: common.selector.textPosition
5295
+ ...common.target,
5296
+ source: {
5297
+ id: "https://document-url.com",
5298
+ title: "Document Title"
5299
+ }
5273
5300
  }
5274
5301
  };
5275
- var withFormat = {
5302
+ var withSourceFormat = {
5276
5303
  ...common.annotation,
5277
5304
  target: {
5278
- id: "https://document.com",
5279
- type: ["SpecificResource", "crm:E73_Information_Object"],
5280
- format: ["application/xml"],
5281
- selector: common.selector.textPosition
5305
+ ...common.target,
5306
+ source: {
5307
+ id: "https://document-url.com",
5308
+ title: "Document Title",
5309
+ format: ["application/xml"]
5310
+ }
5282
5311
  }
5283
5312
  };
5284
- var withLanguage = {
5313
+ var withSourceLanguage = {
5285
5314
  ...common.annotation,
5286
5315
  target: {
5287
- id: "https://document.com",
5288
- type: ["SpecificResource", "crm:E73_Information_Object"],
5289
- language: ["eng"],
5290
- selector: common.selector.textPosition
5316
+ ...common.target,
5317
+ source: {
5318
+ id: "https://document-url.com",
5319
+ title: "Document Title",
5320
+ format: ["application/xml"],
5321
+ language: ["eng"]
5322
+ }
5291
5323
  }
5292
5324
  };
5293
5325
  var withRendererSoftware = {
5294
5326
  ...common.annotation,
5295
5327
  target: {
5296
- id: "https://document.com",
5297
- type: ["SpecificResource", "crm:E73_Information_Object"],
5298
- renderedVia: common.software,
5299
- selector: common.selector.textPosition
5328
+ ...common.target,
5329
+ renderedVia: common.software
5300
5330
  }
5301
5331
  };
5302
5332
  var complete = {
5303
5333
  ...common.annotation,
5304
- target: common.target
5334
+ target: {
5335
+ ...common.target,
5336
+ source: {
5337
+ id: "https://document-url.com",
5338
+ title: "Document Title",
5339
+ format: ["application/xml"],
5340
+ language: ["eng"]
5341
+ },
5342
+ renderedVia: common.software
5343
+ }
5305
5344
  };
5306
5345
  var target = {
5307
5346
  valid: {
5308
5347
  simple: simple5,
5309
- withFormat,
5310
- withLanguage,
5348
+ withSourceTitle,
5349
+ withSourceFormat,
5350
+ withSourceLanguage,
5311
5351
  withRendererSoftware,
5312
5352
  complete
5313
5353
  }
@@ -5320,8 +5360,6 @@ var generateValidExamples = async () => {
5320
5360
  console.log(kleur_default.cyan(`Generating Web Annotation Examples`));
5321
5361
  if (!import_fs_extra.default.existsSync(FOLDER))
5322
5362
  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
5363
  await import_fs_extra.default.writeJSON(
5326
5364
  import_path.default.join(FOLDER, "motivation_citing.jsonld"),
5327
5365
  root.valid.motivation.citing,
@@ -5401,13 +5439,18 @@ var generateValidExamples = async () => {
5401
5439
  );
5402
5440
  await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "target.jsonld"), target.valid.simple, JSON_OPTIONS);
5403
5441
  await import_fs_extra.default.writeJSON(
5404
- import_path.default.join(FOLDER, "target_with_format.jsonld"),
5405
- target.valid.withFormat,
5442
+ import_path.default.join(FOLDER, "target_with_sourceTitle.jsonld"),
5443
+ target.valid.withSourceTitle,
5444
+ JSON_OPTIONS
5445
+ );
5446
+ await import_fs_extra.default.writeJSON(
5447
+ import_path.default.join(FOLDER, "target_with_source_format.jsonld"),
5448
+ target.valid.withSourceFormat,
5406
5449
  JSON_OPTIONS
5407
5450
  );
5408
5451
  await import_fs_extra.default.writeJSON(
5409
- import_path.default.join(FOLDER, "target_with_language.jsonld"),
5410
- target.valid.withLanguage,
5452
+ import_path.default.join(FOLDER, "target_with_source_language.jsonld"),
5453
+ target.valid.withSourceLanguage,
5411
5454
  JSON_OPTIONS
5412
5455
  );
5413
5456
  await import_fs_extra.default.writeJSON(
@@ -5415,19 +5458,64 @@ var generateValidExamples = async () => {
5415
5458
  target.valid.withRendererSoftware,
5416
5459
  JSON_OPTIONS
5417
5460
  );
5461
+ await import_fs_extra.default.writeJSON(
5462
+ import_path.default.join(FOLDER, "target_complete.jsonld"),
5463
+ target.valid.complete,
5464
+ JSON_OPTIONS
5465
+ );
5418
5466
  await import_fs_extra.default.writeJSON(
5419
5467
  import_path.default.join(FOLDER, "target_selector_textQuote.jsonld"),
5420
5468
  targetSelector.valid.selector.textQuote.simple,
5421
5469
  JSON_OPTIONS
5422
5470
  );
5423
5471
  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,
5472
+ import_path.default.join(FOLDER, "target_selector_textQuote_refinedBy_textPosition.jsonld"),
5473
+ targetSelector.valid.selector.textQuote.refinedByTextPositon,
5474
+ JSON_OPTIONS
5475
+ );
5476
+ await import_fs_extra.default.writeJSON(
5477
+ import_path.default.join(FOLDER, "target_selector_textQuote_refinedBy_textQuote.jsonld"),
5478
+ targetSelector.valid.selector.textQuote.refinedByTextQuote,
5426
5479
  JSON_OPTIONS
5427
5480
  );
5428
5481
  await import_fs_extra.default.writeJSON(
5429
5482
  import_path.default.join(FOLDER, "target_selector_textPosition.jsonld"),
5430
- targetSelector.valid.selector.textPositon,
5483
+ targetSelector.valid.selector.textPosition.simple,
5484
+ JSON_OPTIONS
5485
+ );
5486
+ await import_fs_extra.default.writeJSON(
5487
+ import_path.default.join(FOLDER, "target_selector_textPosition_refinedBy_textQuote.jsonld"),
5488
+ targetSelector.valid.selector.textPosition.refinedByTextQuote,
5489
+ JSON_OPTIONS
5490
+ );
5491
+ await import_fs_extra.default.writeJSON(
5492
+ import_path.default.join(FOLDER, "target_selector_textPosition_refinedBy_textPosition.jsonld"),
5493
+ targetSelector.valid.selector.textPosition.refinedByTextPositon,
5494
+ JSON_OPTIONS
5495
+ );
5496
+ await import_fs_extra.default.writeJSON(
5497
+ import_path.default.join(FOLDER, "target_selector_range.jsonld"),
5498
+ targetSelector.valid.selector.range,
5499
+ JSON_OPTIONS
5500
+ );
5501
+ await import_fs_extra.default.writeJSON(
5502
+ import_path.default.join(FOLDER, "target_selector_xpath.jsonld"),
5503
+ targetSelector.valid.selector.xpath.simple,
5504
+ JSON_OPTIONS
5505
+ );
5506
+ await import_fs_extra.default.writeJSON(
5507
+ import_path.default.join(FOLDER, "target_selector_xpath_refinedBt_textPosition.jsonld"),
5508
+ targetSelector.valid.selector.xpath.refinedByTextPositon,
5509
+ JSON_OPTIONS
5510
+ );
5511
+ await import_fs_extra.default.writeJSON(
5512
+ import_path.default.join(FOLDER, "target_selector_xpath_refinedBt_textQuote.jsonld"),
5513
+ targetSelector.valid.selector.xpath.refinedByTextQuote,
5514
+ JSON_OPTIONS
5515
+ );
5516
+ await import_fs_extra.default.writeJSON(
5517
+ import_path.default.join(FOLDER, "target_multiple_selectors_textQuote_and_textPosition.jsonld"),
5518
+ targetSelector.valid.selector.multipleSelector.textQuoteAndTextPosition,
5431
5519
  JSON_OPTIONS
5432
5520
  );
5433
5521
  await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "person.jsonld"), person.valid.real, JSON_OPTIONS);
@@ -5483,6 +5571,12 @@ var generateValidExamples = async () => {
5483
5571
  physicalThing.valid.fictional,
5484
5572
  JSON_OPTIONS
5485
5573
  );
5574
+ await import_fs_extra.default.writeJSON(import_path.default.join(FOLDER, "event.jsonld"), event.valid.real, JSON_OPTIONS);
5575
+ await import_fs_extra.default.writeJSON(
5576
+ import_path.default.join(FOLDER, "event_fictional.jsonld"),
5577
+ event.valid.fictional,
5578
+ JSON_OPTIONS
5579
+ );
5486
5580
  await import_fs_extra.default.writeJSON(
5487
5581
  import_path.default.join(FOLDER, "conceptual_object_real.jsonld"),
5488
5582
  conceptualObject.valid.real,
@@ -5567,6 +5661,7 @@ var generateAssets = async () => {
5567
5661
  // Annotate the CommonJS export names for ESM import in node:
5568
5662
  0 && (module.exports = {
5569
5663
  Body,
5664
+ DATE_RANGE_PATTERN,
5570
5665
  Motivation,
5571
5666
  Person,
5572
5667
  PersonEntityType,
@@ -5579,6 +5674,7 @@ var generateAssets = async () => {
5579
5674
  ValidationError,
5580
5675
  WebAnnotation,
5581
5676
  ajv,
5677
+ bodyIdDescription,
5582
5678
  bodySchema,
5583
5679
  contextUri,
5584
5680
  creatorSchema,