@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.d.mts +2743 -1755
- package/dist/index.d.ts +2743 -1755
- package/dist/index.js +653 -557
- package/dist/index.mjs +651 -557
- package/dist/v1/jsonld/context.jsonld +41 -0
- package/dist/v1/jsonld/defs.jsonld +1339 -0
- package/dist/v1/jsonld/schema.jsonld +602 -0
- package/dist/v1/standalone/linc-wa-validator.js +1 -0
- package/package.json +6 -8
package/dist/index.mjs
CHANGED
|
@@ -2804,7 +2804,7 @@ var schemaContext = {
|
|
|
2804
2804
|
},
|
|
2805
2805
|
entityType: {
|
|
2806
2806
|
"@type": "@id",
|
|
2807
|
-
"@id": "
|
|
2807
|
+
"@id": "rdf:type"
|
|
2808
2808
|
},
|
|
2809
2809
|
additionalType: {
|
|
2810
2810
|
"@type": "@id",
|
|
@@ -2820,8 +2820,9 @@ var schemaContext = {
|
|
|
2820
2820
|
|
|
2821
2821
|
// src/v1/schema/definitions/agent.ts
|
|
2822
2822
|
import { z } from "zod";
|
|
2823
|
+
var userIdDescription = "The IRI that identifies the agent (Creator or Contributor).";
|
|
2823
2824
|
var User = z.object({
|
|
2824
|
-
id: z.
|
|
2825
|
+
id: z.string().url().describe(userIdDescription),
|
|
2825
2826
|
type: z.literal("crm:E21_Person").describe("The type of the Agent."),
|
|
2826
2827
|
name: z.string().min(1, { message: "Cannot be empty" }).describe("The name of the agent.")
|
|
2827
2828
|
}).describe("Human Agent");
|
|
@@ -2829,20 +2830,15 @@ var creatorSchema = {
|
|
|
2829
2830
|
type: "object",
|
|
2830
2831
|
description: "Software Agent",
|
|
2831
2832
|
properties: {
|
|
2832
|
-
id: {
|
|
2833
|
-
anyOf: [
|
|
2834
|
-
{ type: "string", format: "uri" },
|
|
2835
|
-
{ type: "string", const: "anonymous" }
|
|
2836
|
-
],
|
|
2837
|
-
description: "The URI that identifies the agent (Creator or Contributor)."
|
|
2838
|
-
},
|
|
2833
|
+
id: { type: "string", format: "uri", description: userIdDescription },
|
|
2839
2834
|
type: { type: "string", const: "crm:E21_Person" },
|
|
2840
2835
|
name: { type: "string", minLength: 1, description: "The name of the agent." }
|
|
2841
2836
|
},
|
|
2842
2837
|
required: ["id", "type", "name"]
|
|
2843
2838
|
};
|
|
2839
|
+
var softwareIdDescription = "The IRI that identifies the agent (software).";
|
|
2844
2840
|
var Software = z.object({
|
|
2845
|
-
id: z.string().url(
|
|
2841
|
+
id: z.string().url().describe(softwareIdDescription),
|
|
2846
2842
|
type: z.tuple([z.literal("Software"), z.literal("crm:P16_used_specific_object")]).describe("The type of the Agent."),
|
|
2847
2843
|
label: z.string().min(1).describe("The name of the software."),
|
|
2848
2844
|
softwareVersion: z.string().optional().describe("The software version.")
|
|
@@ -2851,11 +2847,7 @@ var softwareSchema = {
|
|
|
2851
2847
|
type: "object",
|
|
2852
2848
|
description: "Software Agent",
|
|
2853
2849
|
properties: {
|
|
2854
|
-
id: {
|
|
2855
|
-
type: "string",
|
|
2856
|
-
format: "uri",
|
|
2857
|
-
description: "The IRI that identifies the agent (software)."
|
|
2858
|
-
},
|
|
2850
|
+
id: { type: "string", format: "uri", description: softwareIdDescription },
|
|
2859
2851
|
type: {
|
|
2860
2852
|
type: "array",
|
|
2861
2853
|
minItems: 2,
|
|
@@ -2886,32 +2878,32 @@ var Quality = [
|
|
|
2886
2878
|
"edit:qualityHigh",
|
|
2887
2879
|
"edit:qualityUnknown"
|
|
2888
2880
|
];
|
|
2889
|
-
var
|
|
2890
|
-
|
|
2891
|
-
);
|
|
2881
|
+
var certaintyDescription = "Indicates the degree of certainty associated with some aspect of an assertion, description, identification, or entity linked to the annotation body.";
|
|
2882
|
+
var Certainty = z2.enum(Quality).describe(certaintyDescription);
|
|
2892
2883
|
var certaintySchema = {
|
|
2893
2884
|
type: "string",
|
|
2894
2885
|
enum: Quality,
|
|
2895
|
-
description:
|
|
2886
|
+
description: certaintyDescription
|
|
2896
2887
|
};
|
|
2897
|
-
var
|
|
2898
|
-
|
|
2899
|
-
);
|
|
2888
|
+
var precisionDescription = "Indicates the degree of precision associated with the location of the entity linked to the annotation body.";
|
|
2889
|
+
var Precision = z2.enum(Quality).describe(precisionDescription);
|
|
2900
2890
|
var precisionSchema = {
|
|
2901
2891
|
type: "string",
|
|
2902
2892
|
enum: Quality,
|
|
2903
|
-
description:
|
|
2893
|
+
description: precisionDescription
|
|
2904
2894
|
};
|
|
2905
|
-
var
|
|
2895
|
+
var labelDescription = "The title or name of a linked resource or named entity.";
|
|
2896
|
+
var Label = z2.string().min(1, { message: "The label cannot be empty" }).describe(labelDescription);
|
|
2906
2897
|
var labelSchema = {
|
|
2907
2898
|
type: "string",
|
|
2908
2899
|
minLength: 1,
|
|
2909
|
-
description:
|
|
2900
|
+
description: labelDescription
|
|
2910
2901
|
};
|
|
2911
|
-
var
|
|
2902
|
+
var descriptionDescription = "Short description of the linked resources or named entity.";
|
|
2903
|
+
var Description = z2.string().describe(descriptionDescription);
|
|
2912
2904
|
var descriptionSchema = {
|
|
2913
2905
|
type: "string",
|
|
2914
|
-
description:
|
|
2906
|
+
description: descriptionDescription
|
|
2915
2907
|
};
|
|
2916
2908
|
|
|
2917
2909
|
// src/v1/schema/definitions/body/citation.ts
|
|
@@ -2920,11 +2912,8 @@ var CitationEntityType = z3.tuple([
|
|
|
2920
2912
|
z3.literal("crm:E73_Information_Object")
|
|
2921
2913
|
]);
|
|
2922
2914
|
var Citation = z3.object({
|
|
2923
|
-
id: z3.
|
|
2924
|
-
|
|
2925
|
-
z3.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
2926
|
-
]),
|
|
2927
|
-
entityType: z3.tuple([z3.literal("cito:Citation"), z3.literal("crm:E73_Information_Object")]),
|
|
2915
|
+
id: z3.string().url().describe(bodyIdDescription),
|
|
2916
|
+
entityType: CitationEntityType,
|
|
2928
2917
|
certainty: Certainty.optional(),
|
|
2929
2918
|
label: Label.optional(),
|
|
2930
2919
|
description: Description.optional()
|
|
@@ -2949,10 +2938,7 @@ var ConceptualObjectEntityType = z4.union([
|
|
|
2949
2938
|
])
|
|
2950
2939
|
]);
|
|
2951
2940
|
var ConceptualObject = z4.object({
|
|
2952
|
-
id: z4.
|
|
2953
|
-
z4.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
2954
|
-
z4.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
2955
|
-
]),
|
|
2941
|
+
id: z4.string().url().describe(bodyIdDescription),
|
|
2956
2942
|
entityType: ConceptualObjectEntityType,
|
|
2957
2943
|
certainty: Certainty.optional(),
|
|
2958
2944
|
label: Label.optional(),
|
|
@@ -2980,7 +2966,7 @@ var CorrectionEntityType = z5.tuple([
|
|
|
2980
2966
|
z5.literal("crm:E33_Linguistic_Object")
|
|
2981
2967
|
]);
|
|
2982
2968
|
var Correction = z5.object({
|
|
2983
|
-
id: z5.string().
|
|
2969
|
+
id: z5.string().url().describe(bodyIdDescription),
|
|
2984
2970
|
type: z5.literal("TextualBody"),
|
|
2985
2971
|
entityType: CorrectionEntityType,
|
|
2986
2972
|
value: z5.string().describe("The correction.")
|
|
@@ -2999,10 +2985,10 @@ var correctionEntityTypeSchema = {
|
|
|
2999
2985
|
import { z as z6 } from "zod";
|
|
3000
2986
|
var DateEntityType = z6.tuple([z6.literal("xsd:date"), z6.literal("crm:E52_Time-Span")]);
|
|
3001
2987
|
var Date2 = z6.object({
|
|
3002
|
-
id: z6.string().
|
|
2988
|
+
id: z6.string().url().describe(bodyIdDescription),
|
|
3003
2989
|
type: z6.literal("TextualBody"),
|
|
3004
2990
|
entityType: DateEntityType,
|
|
3005
|
-
value: z6.string().describe("The date time."),
|
|
2991
|
+
value: z6.string().regex(new RegExp(DATE_RANGE_PATTERN)).describe("The date time."),
|
|
3006
2992
|
certainty: Certainty.optional(),
|
|
3007
2993
|
precision: Precision.optional()
|
|
3008
2994
|
}).describe("Date");
|
|
@@ -3016,17 +3002,38 @@ var dateEntityTypeSchema = {
|
|
|
3016
3002
|
]
|
|
3017
3003
|
};
|
|
3018
3004
|
|
|
3019
|
-
// src/v1/schema/definitions/body/
|
|
3005
|
+
// src/v1/schema/definitions/body/event.ts
|
|
3020
3006
|
import { z as z7 } from "zod";
|
|
3021
|
-
var
|
|
3022
|
-
z7.literal("crm:
|
|
3023
|
-
z7.literal("
|
|
3007
|
+
var EventEntityType = z7.union([
|
|
3008
|
+
z7.literal("crm:E5_Event"),
|
|
3009
|
+
z7.literal("YET TO BE DEFINED A CLASS FOR FICTIONAL EVENTS")
|
|
3024
3010
|
]);
|
|
3025
|
-
var
|
|
3026
|
-
id: z7.
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3011
|
+
var Event = z7.object({
|
|
3012
|
+
id: z7.string().url().describe(bodyIdDescription),
|
|
3013
|
+
entityType: EventEntityType,
|
|
3014
|
+
certainty: Certainty.optional(),
|
|
3015
|
+
label: Label.optional(),
|
|
3016
|
+
description: Description.optional()
|
|
3017
|
+
}).describe("Organization");
|
|
3018
|
+
var eventEntityTypeSchema = {
|
|
3019
|
+
oneOf: [
|
|
3020
|
+
{ type: "string", const: "crm:E5_Event", description: "Real Event" },
|
|
3021
|
+
{
|
|
3022
|
+
type: "string",
|
|
3023
|
+
const: "YET TO BE DEFINED A CLASS FOR FICTIONAL EVENTS",
|
|
3024
|
+
description: "Fictional Event"
|
|
3025
|
+
}
|
|
3026
|
+
]
|
|
3027
|
+
};
|
|
3028
|
+
|
|
3029
|
+
// src/v1/schema/definitions/body/keyword.ts
|
|
3030
|
+
import { z as z8 } from "zod";
|
|
3031
|
+
var KeywordEntityType = z8.tuple([
|
|
3032
|
+
z8.literal("crm:E55_Type"),
|
|
3033
|
+
z8.literal("crmdig:D1_Digital_Object")
|
|
3034
|
+
]);
|
|
3035
|
+
var Keyword = z8.object({
|
|
3036
|
+
id: z8.string().url().describe(bodyIdDescription),
|
|
3030
3037
|
entityType: KeywordEntityType,
|
|
3031
3038
|
certainty: Certainty.optional(),
|
|
3032
3039
|
label: Label.optional(),
|
|
@@ -3041,15 +3048,15 @@ var keywordEntityTypeSchema = {
|
|
|
3041
3048
|
{ type: "string", const: "crmdig:D1_Digital_Object" }
|
|
3042
3049
|
]
|
|
3043
3050
|
};
|
|
3044
|
-
var KeywordFolksnomyEntityType =
|
|
3045
|
-
|
|
3046
|
-
|
|
3051
|
+
var KeywordFolksnomyEntityType = z8.tuple([
|
|
3052
|
+
z8.literal("crm:E55_Type"),
|
|
3053
|
+
z8.literal("crm:E33_Linguistic_Object")
|
|
3047
3054
|
]);
|
|
3048
|
-
var KeywordFolksnomy =
|
|
3049
|
-
id:
|
|
3050
|
-
type:
|
|
3055
|
+
var KeywordFolksnomy = z8.object({
|
|
3056
|
+
id: z8.string().url().describe(bodyIdDescription),
|
|
3057
|
+
type: z8.literal("TextualBody"),
|
|
3051
3058
|
entityType: KeywordFolksnomyEntityType,
|
|
3052
|
-
value:
|
|
3059
|
+
value: z8.string().describe("The keyword.")
|
|
3053
3060
|
}).describe("Keyword");
|
|
3054
3061
|
var keywordFolksnomyEntityTypeSchema = {
|
|
3055
3062
|
type: "array",
|
|
@@ -3062,10 +3069,11 @@ var keywordFolksnomyEntityTypeSchema = {
|
|
|
3062
3069
|
};
|
|
3063
3070
|
|
|
3064
3071
|
// src/v1/schema/definitions/body/link.ts
|
|
3065
|
-
import { z as
|
|
3066
|
-
var
|
|
3067
|
-
var
|
|
3068
|
-
|
|
3072
|
+
import { z as z9 } from "zod";
|
|
3073
|
+
var idDescription = "The link URL.";
|
|
3074
|
+
var LinkEntityType = z9.literal("crmdig:D1_Digital_Object");
|
|
3075
|
+
var Link = z9.object({
|
|
3076
|
+
id: z9.string().url().describe(idDescription),
|
|
3069
3077
|
entityType: LinkEntityType,
|
|
3070
3078
|
certainty: Certainty.optional()
|
|
3071
3079
|
}).describe("A link to a webpage");
|
|
@@ -3075,14 +3083,14 @@ var linkEntityTypeSchema = {
|
|
|
3075
3083
|
};
|
|
3076
3084
|
|
|
3077
3085
|
// src/v1/schema/definitions/body/note.ts
|
|
3078
|
-
import { z as
|
|
3079
|
-
var NoteEntityType =
|
|
3080
|
-
var Note =
|
|
3081
|
-
id:
|
|
3082
|
-
type:
|
|
3086
|
+
import { z as z10 } from "zod";
|
|
3087
|
+
var NoteEntityType = z10.literal("crm:E33_Linguistic_Object");
|
|
3088
|
+
var Note = z10.object({
|
|
3089
|
+
id: z10.string().url().describe(bodyIdDescription),
|
|
3090
|
+
type: z10.literal("TextualBody"),
|
|
3083
3091
|
entityType: NoteEntityType,
|
|
3084
|
-
additionalType:
|
|
3085
|
-
value:
|
|
3092
|
+
additionalType: z10.union([z10.string(), z10.string().array()]).optional().describe("Extra types that refines the note"),
|
|
3093
|
+
value: z10.string().describe("The note.")
|
|
3086
3094
|
}).describe("Note");
|
|
3087
3095
|
var noteEntityTypeSchema = {
|
|
3088
3096
|
type: "string",
|
|
@@ -3090,19 +3098,16 @@ var noteEntityTypeSchema = {
|
|
|
3090
3098
|
};
|
|
3091
3099
|
|
|
3092
3100
|
// src/v1/schema/definitions/body/organization.ts
|
|
3093
|
-
import { z as
|
|
3094
|
-
var OrganizationEntityType =
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3101
|
+
import { z as z11 } from "zod";
|
|
3102
|
+
var OrganizationEntityType = z11.tuple([
|
|
3103
|
+
z11.literal("foaf:Organization"),
|
|
3104
|
+
z11.union([
|
|
3105
|
+
z11.literal("crm:E74_Group").describe("Real Organization"),
|
|
3106
|
+
z11.literal("crm:E89_Propositional_Object").describe("Fictional Organization")
|
|
3099
3107
|
])
|
|
3100
3108
|
]);
|
|
3101
|
-
var Organization =
|
|
3102
|
-
id:
|
|
3103
|
-
z10.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
3104
|
-
z10.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
3105
|
-
]),
|
|
3109
|
+
var Organization = z11.object({
|
|
3110
|
+
id: z11.string().url().describe(bodyIdDescription),
|
|
3106
3111
|
entityType: OrganizationEntityType,
|
|
3107
3112
|
certainty: Certainty.optional(),
|
|
3108
3113
|
label: Label.optional(),
|
|
@@ -3128,19 +3133,16 @@ var organizationEntityTypeSchema = {
|
|
|
3128
3133
|
};
|
|
3129
3134
|
|
|
3130
3135
|
// src/v1/schema/definitions/body/person.ts
|
|
3131
|
-
import { z as
|
|
3132
|
-
var PersonEntityType =
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3136
|
+
import { z as z12 } from "zod";
|
|
3137
|
+
var PersonEntityType = z12.tuple([
|
|
3138
|
+
z12.literal("Person").describe("foaf:person."),
|
|
3139
|
+
z12.union([
|
|
3140
|
+
z12.literal("crm:E21_Person").describe("Real Person"),
|
|
3141
|
+
z12.literal("crm:E89_Propositional_Object").describe("Fictional Person")
|
|
3137
3142
|
])
|
|
3138
3143
|
]);
|
|
3139
|
-
var Person =
|
|
3140
|
-
id:
|
|
3141
|
-
z11.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
3142
|
-
z11.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
3143
|
-
]),
|
|
3144
|
+
var Person = z12.object({
|
|
3145
|
+
id: z12.string().url().describe(bodyIdDescription),
|
|
3144
3146
|
entityType: PersonEntityType,
|
|
3145
3147
|
certainty: Certainty.optional(),
|
|
3146
3148
|
label: Label.optional(),
|
|
@@ -3164,35 +3166,26 @@ var personSchema = {
|
|
|
3164
3166
|
type: "object",
|
|
3165
3167
|
description: "A person entity",
|
|
3166
3168
|
properties: {
|
|
3167
|
-
id: {
|
|
3168
|
-
oneOf: [
|
|
3169
|
-
{ type: "string", format: "uri", description: "The IRI that identifies the Body resource" },
|
|
3170
|
-
{ type: "string", format: "uuid" }
|
|
3171
|
-
]
|
|
3172
|
-
},
|
|
3169
|
+
id: { type: "string", format: "uri", description: bodyIdDescription },
|
|
3173
3170
|
entityType: personEntityTypeSchema,
|
|
3174
3171
|
certainty: { $ref: "defs.jsonld#/definitions/certainty" },
|
|
3175
3172
|
label: { $ref: "defs.jsonld#/definitions/label" },
|
|
3176
3173
|
description: { $ref: "defs.jsonld#/definitions/description" }
|
|
3177
3174
|
},
|
|
3178
3175
|
required: ["id", "entityType"]
|
|
3179
|
-
// errorMessage: { properties: { id: 'Must be an URI' } },
|
|
3180
3176
|
};
|
|
3181
3177
|
|
|
3182
3178
|
// src/v1/schema/definitions/body/physicalThing.ts
|
|
3183
|
-
import { z as
|
|
3184
|
-
var PhysicalThingEntityType =
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3179
|
+
import { z as z13 } from "zod";
|
|
3180
|
+
var PhysicalThingEntityType = z13.union([
|
|
3181
|
+
z13.literal("crm:E18_Physical_Thing"),
|
|
3182
|
+
z13.tuple([
|
|
3183
|
+
z13.literal("crm:E18_Physical_Thing"),
|
|
3184
|
+
z13.literal("wikidata:Q15831596").describe("Fictional Physical Thing")
|
|
3189
3185
|
])
|
|
3190
3186
|
]);
|
|
3191
|
-
var PhysicalThing =
|
|
3192
|
-
id:
|
|
3193
|
-
z12.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
3194
|
-
z12.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
3195
|
-
]),
|
|
3187
|
+
var PhysicalThing = z13.object({
|
|
3188
|
+
id: z13.string().url().describe(bodyIdDescription),
|
|
3196
3189
|
entityType: PhysicalThingEntityType,
|
|
3197
3190
|
certainty: Certainty.optional(),
|
|
3198
3191
|
label: Label.optional(),
|
|
@@ -3214,19 +3207,16 @@ var physicalThingEntityTypeSchema = {
|
|
|
3214
3207
|
};
|
|
3215
3208
|
|
|
3216
3209
|
// src/v1/schema/definitions/body/place.ts
|
|
3217
|
-
import { z as
|
|
3218
|
-
var PlaceEntityType =
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3210
|
+
import { z as z14 } from "zod";
|
|
3211
|
+
var PlaceEntityType = z14.union([
|
|
3212
|
+
z14.literal("cwrc:place"),
|
|
3213
|
+
z14.tuple([
|
|
3214
|
+
z14.literal("cwrc:place"),
|
|
3215
|
+
z14.literal("crm:E89_Propositional_Object").describe("Fictional Place")
|
|
3223
3216
|
])
|
|
3224
3217
|
]);
|
|
3225
|
-
var Place =
|
|
3226
|
-
id:
|
|
3227
|
-
z13.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
3228
|
-
z13.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
3229
|
-
]),
|
|
3218
|
+
var Place = z14.object({
|
|
3219
|
+
id: z14.string().url().describe(bodyIdDescription),
|
|
3230
3220
|
entityType: PlaceEntityType,
|
|
3231
3221
|
certainty: Certainty.optional(),
|
|
3232
3222
|
precision: Precision.optional(),
|
|
@@ -3249,19 +3239,16 @@ var placeEntityTypeSchema = {
|
|
|
3249
3239
|
};
|
|
3250
3240
|
|
|
3251
3241
|
// src/v1/schema/definitions/body/work.ts
|
|
3252
|
-
import { z as
|
|
3253
|
-
var WorkEntityType =
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3242
|
+
import { z as z15 } from "zod";
|
|
3243
|
+
var WorkEntityType = z15.tuple([
|
|
3244
|
+
z15.literal("crm:E89_Propositional_Object"),
|
|
3245
|
+
z15.union([
|
|
3246
|
+
z15.literal("frbroo:F1").describe("Real Work"),
|
|
3247
|
+
z15.literal("wikidata:Q15306849").describe("Fictional Work")
|
|
3258
3248
|
])
|
|
3259
3249
|
]);
|
|
3260
|
-
var Work =
|
|
3261
|
-
id:
|
|
3262
|
-
z14.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
3263
|
-
z14.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
3264
|
-
]),
|
|
3250
|
+
var Work = z15.object({
|
|
3251
|
+
id: z15.string().url().describe(bodyIdDescription),
|
|
3265
3252
|
entityType: WorkEntityType,
|
|
3266
3253
|
certainty: Certainty.optional(),
|
|
3267
3254
|
label: Label.optional(),
|
|
@@ -3282,31 +3269,11 @@ var workEntityTypeSchema = {
|
|
|
3282
3269
|
]
|
|
3283
3270
|
};
|
|
3284
3271
|
|
|
3285
|
-
// src/v1/schema/definitions/body/event.ts
|
|
3286
|
-
import { z as z15 } from "zod";
|
|
3287
|
-
var EventEntityType = z15.literal("PLACEHOLDER_FOR_EVENT");
|
|
3288
|
-
var Event = z15.object({
|
|
3289
|
-
id: z15.union([
|
|
3290
|
-
z15.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
3291
|
-
z15.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
3292
|
-
]),
|
|
3293
|
-
entityType: EventEntityType,
|
|
3294
|
-
certainty: Certainty.optional(),
|
|
3295
|
-
label: Label.optional(),
|
|
3296
|
-
description: Description.optional()
|
|
3297
|
-
}).describe("Organization");
|
|
3298
|
-
var eventEntityTypeSchema = {
|
|
3299
|
-
type: "string",
|
|
3300
|
-
const: "PLACEHOLDER_FOR_EVENT"
|
|
3301
|
-
};
|
|
3302
|
-
|
|
3303
3272
|
// src/v1/schema/definitions/body/index.ts
|
|
3304
|
-
var
|
|
3273
|
+
var bodyIdDescription = "The IRI that identifies the Body resource.";
|
|
3274
|
+
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)?)$";
|
|
3305
3275
|
var Body = z16.object({
|
|
3306
|
-
id: z16.
|
|
3307
|
-
z16.string().url({ message: "Must be an URI" }).describe("The IRI that identifies the Body resource."),
|
|
3308
|
-
z16.string().uuid({ message: "Must be an UUID" }).describe("UUID that identifies the annotation's body.")
|
|
3309
|
-
]),
|
|
3276
|
+
id: z16.string().url().describe(bodyIdDescription),
|
|
3310
3277
|
type: z16.literal("TextualBody").optional(),
|
|
3311
3278
|
entityType: z16.union([
|
|
3312
3279
|
PersonEntityType,
|
|
@@ -3335,12 +3302,7 @@ var bodySchema = {
|
|
|
3335
3302
|
type: "object",
|
|
3336
3303
|
description: "Web Annotation Body",
|
|
3337
3304
|
properties: {
|
|
3338
|
-
id: {
|
|
3339
|
-
oneOf: [
|
|
3340
|
-
{ type: "string", format: "uri", description: "The IRI that identifies the Body resource" },
|
|
3341
|
-
{ type: "string", format: "uuid" }
|
|
3342
|
-
]
|
|
3343
|
-
},
|
|
3305
|
+
id: { type: "string", format: "uri", description: bodyIdDescription },
|
|
3344
3306
|
type: { type: "string", const: "TextualBody" },
|
|
3345
3307
|
entityType: {
|
|
3346
3308
|
oneOf: [
|
|
@@ -3372,42 +3334,7 @@ var bodySchema = {
|
|
|
3372
3334
|
required: ["id", "entityType"],
|
|
3373
3335
|
// * Conditional restrictions
|
|
3374
3336
|
anyOf: [
|
|
3375
|
-
//* IF
|
|
3376
|
-
//* && IF entityType is date THEN value = date range pattern ELSE value = string
|
|
3377
|
-
// {
|
|
3378
|
-
// if: {
|
|
3379
|
-
// type: 'object',
|
|
3380
|
-
// properties: { type: { const: 'TextualBody' } },
|
|
3381
|
-
// },
|
|
3382
|
-
// then: {
|
|
3383
|
-
// type: 'object',
|
|
3384
|
-
// required: ['value'],
|
|
3385
|
-
// properties: { id: { type: 'string', format: 'uuid' } },
|
|
3386
|
-
// if: {
|
|
3387
|
-
// type: 'object',
|
|
3388
|
-
// properties: {
|
|
3389
|
-
// entityType: {
|
|
3390
|
-
// type: 'array',
|
|
3391
|
-
// minItems: 2,
|
|
3392
|
-
// maxItems: 2,
|
|
3393
|
-
// items: [
|
|
3394
|
-
// { type: 'string', const: 'xsd:date' },
|
|
3395
|
-
// { type: 'string', const: 'crm:E52_Time-Span' },
|
|
3396
|
-
// ],
|
|
3397
|
-
// },
|
|
3398
|
-
// },
|
|
3399
|
-
// },
|
|
3400
|
-
// then: {
|
|
3401
|
-
// type: 'object',
|
|
3402
|
-
// properties: { value: { type: 'string', pattern: DATE_PATTERN } },
|
|
3403
|
-
// },
|
|
3404
|
-
// else: {
|
|
3405
|
-
// type: 'object',
|
|
3406
|
-
// properties: { value: { type: 'string' } },
|
|
3407
|
-
// },
|
|
3408
|
-
// },
|
|
3409
|
-
// },
|
|
3410
|
-
//* IF entityType is date OR correction OR keyword THEN id = uuid AND type = TextualBody
|
|
3337
|
+
//* IF entityType is date OR correction OR keyword THEN type = TextualBody
|
|
3411
3338
|
//* && IF entityType is date THEN value = date range pattern ELSE value = string
|
|
3412
3339
|
{
|
|
3413
3340
|
if: {
|
|
@@ -3442,7 +3369,6 @@ var bodySchema = {
|
|
|
3442
3369
|
type: "object",
|
|
3443
3370
|
required: ["type", "value"],
|
|
3444
3371
|
properties: {
|
|
3445
|
-
id: { type: "string", format: "uuid" },
|
|
3446
3372
|
type: { type: "string", const: "TextualBody" }
|
|
3447
3373
|
},
|
|
3448
3374
|
if: {
|
|
@@ -3461,7 +3387,7 @@ var bodySchema = {
|
|
|
3461
3387
|
properties: {
|
|
3462
3388
|
value: {
|
|
3463
3389
|
type: "string",
|
|
3464
|
-
pattern:
|
|
3390
|
+
pattern: DATE_RANGE_PATTERN
|
|
3465
3391
|
}
|
|
3466
3392
|
}
|
|
3467
3393
|
},
|
|
@@ -3469,21 +3395,6 @@ var bodySchema = {
|
|
|
3469
3395
|
type: "object",
|
|
3470
3396
|
properties: { value: { type: "string" } }
|
|
3471
3397
|
}
|
|
3472
|
-
},
|
|
3473
|
-
else: {
|
|
3474
|
-
type: "object",
|
|
3475
|
-
properties: {
|
|
3476
|
-
id: {
|
|
3477
|
-
oneOf: [
|
|
3478
|
-
{
|
|
3479
|
-
type: "string",
|
|
3480
|
-
format: "uri",
|
|
3481
|
-
description: "The IRI that identifies the Body resource"
|
|
3482
|
-
},
|
|
3483
|
-
{ type: "string", format: "uuid" }
|
|
3484
|
-
]
|
|
3485
|
-
}
|
|
3486
|
-
}
|
|
3487
3398
|
}
|
|
3488
3399
|
}
|
|
3489
3400
|
// ? TODO: Add more restrictions
|
|
@@ -3494,33 +3405,35 @@ var bodySchema = {
|
|
|
3494
3405
|
};
|
|
3495
3406
|
|
|
3496
3407
|
// src/v1/schema/definitions/target/index.ts
|
|
3408
|
+
import { z as z23 } from "zod";
|
|
3409
|
+
|
|
3410
|
+
// src/v1/schema/definitions/target/selector/index.ts
|
|
3497
3411
|
import { z as z21 } from "zod";
|
|
3498
3412
|
|
|
3499
3413
|
// src/v1/schema/definitions/target/selector/range.ts
|
|
3500
|
-
import { z as
|
|
3414
|
+
import { z as z20 } from "zod";
|
|
3501
3415
|
|
|
3502
3416
|
// src/v1/schema/definitions/target/selector/xpath.ts
|
|
3503
|
-
import { z as
|
|
3417
|
+
import { z as z19 } from "zod";
|
|
3504
3418
|
|
|
3505
3419
|
// src/v1/schema/definitions/target/selector/textPosition.ts
|
|
3506
3420
|
import { z as z17 } from "zod";
|
|
3507
3421
|
var TextPositionSelector = z17.object({
|
|
3508
|
-
id: z17.string().url().describe(
|
|
3422
|
+
id: z17.string().url().describe(selectorIdDescription),
|
|
3509
3423
|
type: z17.tuple([z17.literal("TextPositionSelector"), z17.literal("crm:E73_Information_Object")]),
|
|
3510
3424
|
start: z17.number().min(0).describe("The starting position of the segment. The first byte is character position 0."),
|
|
3511
3425
|
end: z17.number().describe(
|
|
3512
3426
|
"The end position of the segment. The last character is not included within the segment."
|
|
3513
3427
|
)
|
|
3514
3428
|
}).describe("TextPosition Selector");
|
|
3429
|
+
var TextPositionSelectorExtended = TextPositionSelector.extend({
|
|
3430
|
+
refinedBy: z17.union([z17.lazy(() => TextPositionSelector), z17.lazy(() => TextQuoteSelector)]).optional().describe(selectorRefinedByDescription)
|
|
3431
|
+
});
|
|
3515
3432
|
var textPositionSelectorSchema = {
|
|
3516
3433
|
type: "object",
|
|
3517
3434
|
description: "TextPosition Selector",
|
|
3518
3435
|
properties: {
|
|
3519
|
-
id: {
|
|
3520
|
-
type: "string",
|
|
3521
|
-
format: "uuid",
|
|
3522
|
-
description: "UUID that identifies the selector."
|
|
3523
|
-
},
|
|
3436
|
+
id: { type: "string", format: "uri", description: selectorIdDescription },
|
|
3524
3437
|
type: {
|
|
3525
3438
|
type: "array",
|
|
3526
3439
|
minItems: 2,
|
|
@@ -3543,27 +3456,105 @@ var textPositionSelectorSchema = {
|
|
|
3543
3456
|
}
|
|
3544
3457
|
},
|
|
3545
3458
|
required: ["id", "type", "start", "end"]
|
|
3546
|
-
|
|
3459
|
+
};
|
|
3460
|
+
var textPositionSelectorExtendedSchema = {
|
|
3461
|
+
type: "object",
|
|
3462
|
+
description: "TextPosition Selector",
|
|
3463
|
+
properties: {
|
|
3464
|
+
...textPositionSelectorSchema.properties,
|
|
3465
|
+
refinedBy: {
|
|
3466
|
+
type: "object",
|
|
3467
|
+
description: selectorRefinedByDescription,
|
|
3468
|
+
oneOf: [
|
|
3469
|
+
{ $ref: "defs.jsonld#/definitions/textPositionSelector" },
|
|
3470
|
+
{ $ref: "defs.jsonld#/definitions/textQuoteSelector" }
|
|
3471
|
+
],
|
|
3472
|
+
nullable: true,
|
|
3473
|
+
required: []
|
|
3474
|
+
}
|
|
3475
|
+
},
|
|
3476
|
+
required: ["id", "type", "start", "end"]
|
|
3547
3477
|
};
|
|
3548
3478
|
|
|
3549
|
-
// src/v1/schema/definitions/target/selector/
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3479
|
+
// src/v1/schema/definitions/target/selector/textQuote.ts
|
|
3480
|
+
import { z as z18 } from "zod";
|
|
3481
|
+
var TextQuoteSelector = z18.object({
|
|
3482
|
+
id: z18.string().url().describe(selectorIdDescription),
|
|
3483
|
+
type: z18.tuple([z18.literal("TextQuoteSelector"), z18.literal("crm:E33_Linguistic_Object")]),
|
|
3484
|
+
exact: z18.string().describe("A copy of the text which is being selected, after normalization."),
|
|
3485
|
+
prefix: z18.string().describe(
|
|
3486
|
+
"The snippet of text that occurs immediately before the text which is being selected."
|
|
3487
|
+
),
|
|
3488
|
+
suffix: z18.string().describe(
|
|
3489
|
+
"The snippet of text that occurs immediately after the text which is being selected."
|
|
3556
3490
|
)
|
|
3491
|
+
}).describe("Quote Selector");
|
|
3492
|
+
var TextQuoteSelectorExtended = TextQuoteSelector.extend({
|
|
3493
|
+
refinedBy: z18.union([z18.lazy(() => TextPositionSelector), z18.lazy(() => TextQuoteSelector)]).optional().describe(selectorRefinedByDescription)
|
|
3494
|
+
});
|
|
3495
|
+
var textQuoteSelectorSchema = {
|
|
3496
|
+
type: "object",
|
|
3497
|
+
description: "Quote Selector",
|
|
3498
|
+
properties: {
|
|
3499
|
+
id: { type: "string", format: "uri", description: selectorIdDescription },
|
|
3500
|
+
type: {
|
|
3501
|
+
type: "array",
|
|
3502
|
+
minItems: 2,
|
|
3503
|
+
maxItems: 2,
|
|
3504
|
+
items: [
|
|
3505
|
+
{ type: "string", const: "TextQuoteSelector" },
|
|
3506
|
+
{ type: "string", const: "crm:E33_Linguistic_Object" }
|
|
3507
|
+
],
|
|
3508
|
+
description: "The class of the Selector"
|
|
3509
|
+
},
|
|
3510
|
+
exact: {
|
|
3511
|
+
type: "string",
|
|
3512
|
+
description: "A copy of the text which is being selected, after normalization."
|
|
3513
|
+
},
|
|
3514
|
+
prefix: {
|
|
3515
|
+
type: "string",
|
|
3516
|
+
description: "The snippet of text that occurs immediately before the text which is being selected."
|
|
3517
|
+
},
|
|
3518
|
+
suffix: {
|
|
3519
|
+
type: "string",
|
|
3520
|
+
description: "The snippet of text that occurs immediately after the text which is being selected."
|
|
3521
|
+
}
|
|
3522
|
+
},
|
|
3523
|
+
required: ["id", "type", "exact", "prefix", "suffix"]
|
|
3524
|
+
};
|
|
3525
|
+
var textQuoteSelectorExtendedSchema = {
|
|
3526
|
+
type: "object",
|
|
3527
|
+
description: "Quote Selector",
|
|
3528
|
+
properties: {
|
|
3529
|
+
...textQuoteSelectorSchema.properties,
|
|
3530
|
+
refinedBy: {
|
|
3531
|
+
type: "object",
|
|
3532
|
+
description: selectorRefinedByDescription,
|
|
3533
|
+
oneOf: [
|
|
3534
|
+
{ $ref: "defs.jsonld#/definitions/textPositionSelector" },
|
|
3535
|
+
{ $ref: "defs.jsonld#/definitions/textQuoteSelector" }
|
|
3536
|
+
],
|
|
3537
|
+
nullable: true,
|
|
3538
|
+
required: []
|
|
3539
|
+
}
|
|
3540
|
+
},
|
|
3541
|
+
required: ["id", "type", "exact", "prefix", "suffix"]
|
|
3542
|
+
};
|
|
3543
|
+
|
|
3544
|
+
// src/v1/schema/definitions/target/selector/xpath.ts
|
|
3545
|
+
var XpathSelector = z19.object({
|
|
3546
|
+
id: z19.string().describe(selectorIdDescription),
|
|
3547
|
+
type: z19.tuple([z19.literal("XPathSelector"), z19.literal("crm:E73_Information_Object")]),
|
|
3548
|
+
value: z19.string().min(1).describe("The xpath to the selected segment.")
|
|
3557
3549
|
}).describe("Xpath Selector");
|
|
3550
|
+
var XpathSelectorExtended = XpathSelector.extend({
|
|
3551
|
+
refinedBy: z19.union([TextPositionSelector, TextQuoteSelector]).optional().describe(selectorRefinedByDescription)
|
|
3552
|
+
});
|
|
3558
3553
|
var xpathSelectorSchema = {
|
|
3559
3554
|
type: "object",
|
|
3560
3555
|
description: "Xpath Selector",
|
|
3561
3556
|
properties: {
|
|
3562
|
-
id: {
|
|
3563
|
-
type: "string",
|
|
3564
|
-
format: "uuid",
|
|
3565
|
-
description: "UUID that identifies the selector."
|
|
3566
|
-
},
|
|
3557
|
+
id: { type: "string", format: "uri", description: selectorIdDescription },
|
|
3567
3558
|
type: {
|
|
3568
3559
|
type: "array",
|
|
3569
3560
|
minItems: 2,
|
|
@@ -3577,20 +3568,33 @@ var xpathSelectorSchema = {
|
|
|
3577
3568
|
value: {
|
|
3578
3569
|
type: "string",
|
|
3579
3570
|
description: "Web Annotation Target Select Xpath"
|
|
3580
|
-
}
|
|
3571
|
+
}
|
|
3572
|
+
},
|
|
3573
|
+
required: ["id", "type", "value"]
|
|
3574
|
+
};
|
|
3575
|
+
var xpathSelectorExtendedSchema = {
|
|
3576
|
+
type: "object",
|
|
3577
|
+
description: "Xpath Selector",
|
|
3578
|
+
properties: {
|
|
3579
|
+
...xpathSelectorSchema.properties,
|
|
3581
3580
|
refinedBy: {
|
|
3582
|
-
|
|
3583
|
-
description:
|
|
3581
|
+
type: "object",
|
|
3582
|
+
description: selectorRefinedByDescription,
|
|
3583
|
+
anyOf: [
|
|
3584
|
+
{ $ref: "defs.jsonld#/definitions/textPositionSelector" },
|
|
3585
|
+
{ $ref: "defs.jsonld#/definitions/textQuoteSelector" }
|
|
3586
|
+
],
|
|
3587
|
+
nullable: true,
|
|
3588
|
+
required: []
|
|
3584
3589
|
}
|
|
3585
3590
|
},
|
|
3586
3591
|
required: ["id", "type", "value"]
|
|
3587
|
-
// errorMessage: { properties: { id: 'Must be an URI' } },
|
|
3588
3592
|
};
|
|
3589
3593
|
|
|
3590
3594
|
// src/v1/schema/definitions/target/selector/range.ts
|
|
3591
|
-
var RangeSelector =
|
|
3592
|
-
id:
|
|
3593
|
-
type:
|
|
3595
|
+
var RangeSelector = z20.object({
|
|
3596
|
+
id: z20.string().url().describe(selectorIdDescription),
|
|
3597
|
+
type: z20.tuple([z20.literal("RangeSelector"), z20.literal("crm:E73_Information_Object")]),
|
|
3594
3598
|
startSelector: XpathSelector,
|
|
3595
3599
|
endSelector: XpathSelector
|
|
3596
3600
|
}).describe("Range Selector");
|
|
@@ -3598,11 +3602,7 @@ var rangeSelectorSchema = {
|
|
|
3598
3602
|
type: "object",
|
|
3599
3603
|
description: "Range Selector",
|
|
3600
3604
|
properties: {
|
|
3601
|
-
id: {
|
|
3602
|
-
type: "string",
|
|
3603
|
-
format: "uuid",
|
|
3604
|
-
description: "UUID that identifies the selector."
|
|
3605
|
-
},
|
|
3605
|
+
id: { type: "string", format: "uri", description: selectorIdDescription },
|
|
3606
3606
|
type: {
|
|
3607
3607
|
type: "array",
|
|
3608
3608
|
minItems: 2,
|
|
@@ -3617,106 +3617,113 @@ var rangeSelectorSchema = {
|
|
|
3617
3617
|
endSelector: { $ref: "defs.jsonld#/definitions/xpathSelector" }
|
|
3618
3618
|
},
|
|
3619
3619
|
required: ["id", "type", "startSelector", "endSelector"]
|
|
3620
|
-
// errorMessage: { properties: { id: 'Must be an URI' } },
|
|
3621
3620
|
};
|
|
3622
3621
|
|
|
3623
|
-
// src/v1/schema/definitions/target/selector/
|
|
3624
|
-
|
|
3625
|
-
var
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3622
|
+
// src/v1/schema/definitions/target/selector/index.ts
|
|
3623
|
+
var selectorIdDescription = "UUID that identifies the selector.";
|
|
3624
|
+
var selectorRefinedByDescription = "The relationship between a broader selector and the more specific selector that should be applied to the results of the first.";
|
|
3625
|
+
var Selector = z21.union([
|
|
3626
|
+
TextQuoteSelectorExtended,
|
|
3627
|
+
TextPositionSelectorExtended,
|
|
3628
|
+
XpathSelectorExtended,
|
|
3629
|
+
RangeSelector
|
|
3630
|
+
]);
|
|
3631
|
+
var selectorSchema = {
|
|
3632
|
+
type: "object",
|
|
3633
|
+
oneOf: [
|
|
3634
|
+
textQuoteSelectorExtendedSchema,
|
|
3635
|
+
textPositionSelectorExtendedSchema,
|
|
3636
|
+
xpathSelectorExtendedSchema,
|
|
3637
|
+
rangeSelectorSchema
|
|
3638
|
+
],
|
|
3639
|
+
required: []
|
|
3640
|
+
};
|
|
3641
|
+
|
|
3642
|
+
// src/v1/schema/definitions/target/source.ts
|
|
3643
|
+
import { z as z22 } from "zod";
|
|
3644
|
+
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.";
|
|
3645
|
+
var Format = z22.string().min(1).describe(formatDescription);
|
|
3646
|
+
var formatSchema = {
|
|
3647
|
+
type: "string",
|
|
3648
|
+
description: formatDescription,
|
|
3649
|
+
minLength: 1
|
|
3650
|
+
};
|
|
3651
|
+
var languageDescription = "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification.";
|
|
3652
|
+
var Language = z22.string().min(2).max(3).describe(languageDescription);
|
|
3653
|
+
var languageSchema = {
|
|
3654
|
+
type: "string",
|
|
3655
|
+
description: languageDescription,
|
|
3656
|
+
minLength: 2,
|
|
3657
|
+
maxLength: 3
|
|
3658
|
+
};
|
|
3659
|
+
var sourceIdDescription = "The IRI that identifies the Target source.";
|
|
3660
|
+
var Source = z22.object({
|
|
3661
|
+
id: z22.string().url().describe(sourceIdDescription),
|
|
3662
|
+
format: z22.union([Format, z22.array(Format).min(1)]).optional().describe(
|
|
3663
|
+
"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."
|
|
3631
3664
|
),
|
|
3632
|
-
|
|
3633
|
-
"The
|
|
3665
|
+
language: z22.union([Language, z22.array(Language).min(1)]).optional().describe(
|
|
3666
|
+
"The languages of the Web Resource's content. The value of the property should be an array of language code following the [bcp47] specification."
|
|
3634
3667
|
),
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
}).describe("Quote Selector");
|
|
3639
|
-
var textQuoteSelectorSchema = {
|
|
3668
|
+
title: z22.string().min(1, { message: "The title cannot be empty" }).optional().describe("The title of the document being annotated.")
|
|
3669
|
+
}).describe("Web Annotation Target");
|
|
3670
|
+
var sourceSchema = {
|
|
3640
3671
|
type: "object",
|
|
3641
|
-
description:
|
|
3672
|
+
description: `Web Annotation Target's source`,
|
|
3642
3673
|
properties: {
|
|
3643
|
-
id: {
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
]
|
|
3656
|
-
description: "The class of the Selector"
|
|
3657
|
-
},
|
|
3658
|
-
exact: {
|
|
3659
|
-
type: "string",
|
|
3660
|
-
description: "A copy of the text which is being selected, after normalization."
|
|
3674
|
+
id: { type: "string", format: "uri", description: sourceIdDescription },
|
|
3675
|
+
format: {
|
|
3676
|
+
type: ["string", "array"],
|
|
3677
|
+
nullable: true,
|
|
3678
|
+
anyOf: [
|
|
3679
|
+
formatSchema,
|
|
3680
|
+
{
|
|
3681
|
+
type: "array",
|
|
3682
|
+
minItems: 1,
|
|
3683
|
+
items: formatSchema,
|
|
3684
|
+
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."
|
|
3685
|
+
}
|
|
3686
|
+
]
|
|
3661
3687
|
},
|
|
3662
|
-
|
|
3663
|
-
type: "string",
|
|
3664
|
-
|
|
3688
|
+
language: {
|
|
3689
|
+
type: ["string", "array"],
|
|
3690
|
+
nullable: true,
|
|
3691
|
+
anyOf: [
|
|
3692
|
+
languageSchema,
|
|
3693
|
+
{
|
|
3694
|
+
type: "array",
|
|
3695
|
+
minItems: 1,
|
|
3696
|
+
items: languageSchema,
|
|
3697
|
+
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."
|
|
3698
|
+
}
|
|
3699
|
+
]
|
|
3665
3700
|
},
|
|
3666
|
-
|
|
3701
|
+
title: {
|
|
3667
3702
|
type: "string",
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
type: "object",
|
|
3672
|
-
description: "The relationship between a broader selector and the more specific selector that should be applied to the results of the first.",
|
|
3673
|
-
oneOf: [
|
|
3674
|
-
{ $ref: "defs.jsonld#/definitions/rangeSelector" },
|
|
3675
|
-
{ $ref: "defs.jsonld#/definitions/xpathSelector" },
|
|
3676
|
-
{ $ref: "defs.jsonld#/definitions/textPositionSelector" }
|
|
3677
|
-
],
|
|
3678
|
-
required: []
|
|
3703
|
+
minLength: 1,
|
|
3704
|
+
nullable: true,
|
|
3705
|
+
description: "The title of the document being annotated."
|
|
3679
3706
|
}
|
|
3680
3707
|
},
|
|
3681
|
-
required: ["id"
|
|
3682
|
-
// errorMessage: { properties: { id: 'Must be an URI' } },
|
|
3708
|
+
required: ["id"]
|
|
3683
3709
|
};
|
|
3684
3710
|
|
|
3685
3711
|
// src/v1/schema/definitions/target/index.ts
|
|
3686
|
-
var
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
"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."
|
|
3692
|
-
)
|
|
3693
|
-
).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."
|
|
3695
|
-
),
|
|
3696
|
-
language: z21.array(
|
|
3697
|
-
z21.string().min(2).max(3).describe(
|
|
3698
|
-
"The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification."
|
|
3699
|
-
)
|
|
3700
|
-
).min(1).optional().describe(
|
|
3701
|
-
"The languages of the Web Resource's content. The value of the property should be an array of language code following the [bcp47] specification."
|
|
3702
|
-
),
|
|
3703
|
-
title: z21.string().min(1, { message: "The title cannot be empty" }).optional().describe("The title of the document being annotated."),
|
|
3712
|
+
var targetIdDescription = "The IRI that identifies the Target resource.";
|
|
3713
|
+
var Target = z23.object({
|
|
3714
|
+
id: z23.string().url().describe(targetIdDescription),
|
|
3715
|
+
type: z23.tuple([z23.literal("SpecificResource"), z23.literal("crm:E73_Information_Object")]).describe("The class of the Specific Resource."),
|
|
3716
|
+
source: Source,
|
|
3704
3717
|
renderedVia: Software.optional().describe(
|
|
3705
3718
|
"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."
|
|
3706
3719
|
),
|
|
3707
|
-
selector:
|
|
3720
|
+
selector: z23.union([Selector, z23.array(Selector)]).describe("The relationship between a Specific Resource and a Selector. ")
|
|
3708
3721
|
}).describe("Web Annotation Target");
|
|
3709
3722
|
var targetSchema = {
|
|
3710
3723
|
type: "object",
|
|
3711
3724
|
description: "Web Annotation Target",
|
|
3712
3725
|
properties: {
|
|
3713
|
-
id: {
|
|
3714
|
-
anyOf: [
|
|
3715
|
-
{ type: "string", format: "uri", description: "This document URI" },
|
|
3716
|
-
{ type: "string", format: "uuid" }
|
|
3717
|
-
],
|
|
3718
|
-
description: "The IRI that identifies the Target resource."
|
|
3719
|
-
},
|
|
3726
|
+
id: { type: "string", format: "uri", description: targetIdDescription },
|
|
3720
3727
|
type: {
|
|
3721
3728
|
type: "array",
|
|
3722
3729
|
minItems: 2,
|
|
@@ -3727,49 +3734,23 @@ var targetSchema = {
|
|
|
3727
3734
|
],
|
|
3728
3735
|
description: "The class of the Specific Resource."
|
|
3729
3736
|
},
|
|
3730
|
-
|
|
3731
|
-
type: "array",
|
|
3732
|
-
items: {
|
|
3733
|
-
type: "string",
|
|
3734
|
-
minLength: 1,
|
|
3735
|
-
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."
|
|
3736
|
-
},
|
|
3737
|
-
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."
|
|
3738
|
-
},
|
|
3739
|
-
language: {
|
|
3740
|
-
type: "array",
|
|
3741
|
-
items: {
|
|
3742
|
-
type: "string",
|
|
3743
|
-
minLength: 2,
|
|
3744
|
-
maxLength: 3,
|
|
3745
|
-
description: "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification."
|
|
3746
|
-
},
|
|
3747
|
-
minItems: 1,
|
|
3748
|
-
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."
|
|
3749
|
-
},
|
|
3750
|
-
title: {
|
|
3751
|
-
type: "string",
|
|
3752
|
-
minLength: 1,
|
|
3753
|
-
description: "The title of the document being annotated."
|
|
3754
|
-
},
|
|
3737
|
+
source: sourceSchema,
|
|
3755
3738
|
renderedVia: {
|
|
3756
3739
|
$ref: "defs.jsonld#/definitions/software",
|
|
3757
3740
|
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."
|
|
3758
3741
|
},
|
|
3759
3742
|
selector: {
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
{
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
required: ["id", "type"]
|
|
3743
|
+
anyOf: [
|
|
3744
|
+
selectorSchema,
|
|
3745
|
+
{
|
|
3746
|
+
type: "array",
|
|
3747
|
+
items: selectorSchema,
|
|
3748
|
+
minItems: 1
|
|
3749
|
+
}
|
|
3750
|
+
]
|
|
3769
3751
|
}
|
|
3770
3752
|
},
|
|
3771
|
-
required: ["id", "type"],
|
|
3772
|
-
// errorMessage: { properties: { id: 'Must be an URI or an UUID' } },
|
|
3753
|
+
required: ["id", "type", "source", "selector"],
|
|
3773
3754
|
allOf: [
|
|
3774
3755
|
{
|
|
3775
3756
|
if: {
|
|
@@ -3794,10 +3775,9 @@ var targetSchema = {
|
|
|
3794
3775
|
then: {
|
|
3795
3776
|
type: "object",
|
|
3796
3777
|
properties: {
|
|
3797
|
-
selector: { type: "object", required: ["type", "exact"] }
|
|
3778
|
+
selector: { type: "object", required: ["id", "type", "exact", "prefix", "suffix"] }
|
|
3798
3779
|
}
|
|
3799
|
-
}
|
|
3800
|
-
required: ["selector"]
|
|
3780
|
+
}
|
|
3801
3781
|
},
|
|
3802
3782
|
{
|
|
3803
3783
|
if: {
|
|
@@ -3823,8 +3803,7 @@ var targetSchema = {
|
|
|
3823
3803
|
type: "object",
|
|
3824
3804
|
properties: {
|
|
3825
3805
|
selector: { type: "object", required: ["type", "startSelector", "endSelector"] }
|
|
3826
|
-
}
|
|
3827
|
-
required: ["selector"]
|
|
3806
|
+
}
|
|
3828
3807
|
}
|
|
3829
3808
|
},
|
|
3830
3809
|
{
|
|
@@ -3851,8 +3830,7 @@ var targetSchema = {
|
|
|
3851
3830
|
type: "object",
|
|
3852
3831
|
properties: {
|
|
3853
3832
|
selector: { type: "object", required: ["type", "value"] }
|
|
3854
|
-
}
|
|
3855
|
-
required: ["selector"]
|
|
3833
|
+
}
|
|
3856
3834
|
}
|
|
3857
3835
|
},
|
|
3858
3836
|
{
|
|
@@ -3879,8 +3857,7 @@ var targetSchema = {
|
|
|
3879
3857
|
type: "object",
|
|
3880
3858
|
properties: {
|
|
3881
3859
|
selector: { type: "object", required: ["type", "start", "end"] }
|
|
3882
|
-
}
|
|
3883
|
-
required: ["selector"]
|
|
3860
|
+
}
|
|
3884
3861
|
}
|
|
3885
3862
|
}
|
|
3886
3863
|
]
|
|
@@ -3894,17 +3871,17 @@ var definitionSchema = {
|
|
|
3894
3871
|
creator: creatorSchema,
|
|
3895
3872
|
software: softwareSchema,
|
|
3896
3873
|
target: targetSchema,
|
|
3874
|
+
textPositionSelector: textPositionSelectorSchema,
|
|
3897
3875
|
textQuoteSelector: textQuoteSelectorSchema,
|
|
3898
|
-
rangeSelector: rangeSelectorSchema,
|
|
3899
3876
|
xpathSelector: xpathSelectorSchema,
|
|
3900
|
-
|
|
3877
|
+
rangeSelector: rangeSelectorSchema,
|
|
3901
3878
|
body: bodySchema
|
|
3902
3879
|
},
|
|
3903
3880
|
required: []
|
|
3904
3881
|
};
|
|
3905
3882
|
|
|
3906
3883
|
// src/v1/schema/root.ts
|
|
3907
|
-
import { z as
|
|
3884
|
+
import { z as z24 } from "zod";
|
|
3908
3885
|
var Status = ["draft", "approved", "published"];
|
|
3909
3886
|
var Motivation = [
|
|
3910
3887
|
"identifying",
|
|
@@ -3915,32 +3892,26 @@ var Motivation = [
|
|
|
3915
3892
|
"linking",
|
|
3916
3893
|
"citing"
|
|
3917
3894
|
];
|
|
3918
|
-
var WebAnnotation =
|
|
3919
|
-
"@context":
|
|
3920
|
-
|
|
3921
|
-
|
|
3895
|
+
var WebAnnotation = z24.object({
|
|
3896
|
+
"@context": z24.tuple([
|
|
3897
|
+
z24.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
|
|
3898
|
+
z24.literal(contextUri).describe("LINCS Web Annotation Context.")
|
|
3922
3899
|
]).describe(
|
|
3923
3900
|
"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."
|
|
3924
3901
|
),
|
|
3925
|
-
id:
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
),
|
|
3932
|
-
type: z22.tuple([z22.literal("Annotation"), z22.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
|
|
3933
|
-
motivation: z22.tuple([z22.enum(Motivation), z22.literal("crm:E33_Linguistic_Object")]).describe("The relationship between an Annotation and a Motivation."),
|
|
3934
|
-
created: z22.string().datetime().describe("The time at which the resource was created."),
|
|
3935
|
-
modified: z22.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
|
|
3936
|
-
status: z22.enum(Status).describe("The status of this annotation in a workflow."),
|
|
3902
|
+
id: z24.string().url().describe("The identity of the Annotation."),
|
|
3903
|
+
type: z24.tuple([z24.literal("Annotation"), z24.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
|
|
3904
|
+
motivation: z24.tuple([z24.enum(Motivation), z24.literal("crm:E55_Type")]).describe("The relationship between an Annotation and a Motivation."),
|
|
3905
|
+
created: z24.string().datetime().describe("The time at which the resource was created."),
|
|
3906
|
+
modified: z24.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
|
|
3907
|
+
status: z24.enum(Status).describe("The status of this annotation in a workflow."),
|
|
3937
3908
|
creator: User.describe("The agent responsible for creating the resource.").optional(),
|
|
3938
|
-
contributor:
|
|
3909
|
+
contributor: z24.array(User.describe("The agents responsible for modifying the resource.")).nonempty().optional().describe("The agents responsible for modifying the resource."),
|
|
3939
3910
|
generator: Software.describe(
|
|
3940
3911
|
"The agent responsible for generating the serialization of the Annotation. "
|
|
3941
3912
|
),
|
|
3942
3913
|
target: Target.describe("The relationship between an Annotation and its Target."),
|
|
3943
|
-
body:
|
|
3914
|
+
body: z24.union([Body, z24.array(Body)]).describe("The relationship between an Annotation and its Body.")
|
|
3944
3915
|
}).describe("Web Annotation Root");
|
|
3945
3916
|
var webAnnotationSchema = {
|
|
3946
3917
|
$id: schemaId,
|
|
@@ -3958,15 +3929,9 @@ var webAnnotationSchema = {
|
|
|
3958
3929
|
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."
|
|
3959
3930
|
},
|
|
3960
3931
|
id: {
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
format: "uri",
|
|
3965
|
-
description: "It must be a UUID or URI containing a UUID in the search params (URI?annoId=URI)."
|
|
3966
|
-
},
|
|
3967
|
-
{ type: "string", format: "uuid" }
|
|
3968
|
-
],
|
|
3969
|
-
description: "The identity of the Annotation. It must be a UUID or URI containing a UUID in the search params (URI?annoId=URI)"
|
|
3932
|
+
type: "string",
|
|
3933
|
+
format: "uri",
|
|
3934
|
+
description: "The type of the Annotation."
|
|
3970
3935
|
},
|
|
3971
3936
|
type: {
|
|
3972
3937
|
type: "array",
|
|
@@ -3984,7 +3949,7 @@ var webAnnotationSchema = {
|
|
|
3984
3949
|
maxItems: 2,
|
|
3985
3950
|
items: [
|
|
3986
3951
|
{ type: "string", enum: Motivation },
|
|
3987
|
-
{ type: "string", const: "crm:
|
|
3952
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
3988
3953
|
],
|
|
3989
3954
|
description: "The relationship between an Annotation and a Motivation."
|
|
3990
3955
|
},
|
|
@@ -4033,28 +3998,6 @@ var webAnnotationSchema = {
|
|
|
4033
3998
|
"status"
|
|
4034
3999
|
],
|
|
4035
4000
|
allOf: [
|
|
4036
|
-
{
|
|
4037
|
-
if: {
|
|
4038
|
-
type: "object",
|
|
4039
|
-
properties: {
|
|
4040
|
-
status: { const: "published" }
|
|
4041
|
-
}
|
|
4042
|
-
},
|
|
4043
|
-
then: {
|
|
4044
|
-
type: "object",
|
|
4045
|
-
properties: {
|
|
4046
|
-
id: { type: "string", format: "uri" }
|
|
4047
|
-
},
|
|
4048
|
-
required: ["status"]
|
|
4049
|
-
},
|
|
4050
|
-
else: {
|
|
4051
|
-
type: "object",
|
|
4052
|
-
properties: {
|
|
4053
|
-
id: { type: "string", format: "uuid" }
|
|
4054
|
-
},
|
|
4055
|
-
required: ["status"]
|
|
4056
|
-
}
|
|
4057
|
-
},
|
|
4058
4001
|
{
|
|
4059
4002
|
if: {
|
|
4060
4003
|
type: "object",
|
|
@@ -4087,7 +4030,7 @@ var webAnnotationSchema = {
|
|
|
4087
4030
|
maxItems: 2,
|
|
4088
4031
|
items: [
|
|
4089
4032
|
{ type: "string", const: "identifying" },
|
|
4090
|
-
{ type: "string", const: "crm:
|
|
4033
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
4091
4034
|
]
|
|
4092
4035
|
}
|
|
4093
4036
|
}
|
|
@@ -4113,7 +4056,7 @@ var webAnnotationSchema = {
|
|
|
4113
4056
|
maxItems: 2,
|
|
4114
4057
|
items: [
|
|
4115
4058
|
{ type: "string", const: "describing" },
|
|
4116
|
-
{ type: "string", const: "crm:
|
|
4059
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
4117
4060
|
]
|
|
4118
4061
|
}
|
|
4119
4062
|
}
|
|
@@ -4139,7 +4082,7 @@ var webAnnotationSchema = {
|
|
|
4139
4082
|
maxItems: 2,
|
|
4140
4083
|
items: [
|
|
4141
4084
|
{ type: "string", const: "correcting" },
|
|
4142
|
-
{ type: "string", const: "crm:
|
|
4085
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
4143
4086
|
]
|
|
4144
4087
|
}
|
|
4145
4088
|
}
|
|
@@ -4165,7 +4108,7 @@ var webAnnotationSchema = {
|
|
|
4165
4108
|
maxItems: 2,
|
|
4166
4109
|
items: [
|
|
4167
4110
|
{ type: "string", const: "tagging" },
|
|
4168
|
-
{ type: "string", const: "crm:
|
|
4111
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
4169
4112
|
]
|
|
4170
4113
|
}
|
|
4171
4114
|
}
|
|
@@ -4191,7 +4134,7 @@ var webAnnotationSchema = {
|
|
|
4191
4134
|
maxItems: 2,
|
|
4192
4135
|
items: [
|
|
4193
4136
|
{ type: "string", const: "classifying" },
|
|
4194
|
-
{ type: "string", const: "crm:
|
|
4137
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
4195
4138
|
]
|
|
4196
4139
|
}
|
|
4197
4140
|
}
|
|
@@ -4217,7 +4160,7 @@ var webAnnotationSchema = {
|
|
|
4217
4160
|
maxItems: 2,
|
|
4218
4161
|
items: [
|
|
4219
4162
|
{ type: "string", const: "linking" },
|
|
4220
|
-
{ type: "string", const: "crm:
|
|
4163
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
4221
4164
|
]
|
|
4222
4165
|
}
|
|
4223
4166
|
}
|
|
@@ -4243,7 +4186,7 @@ var webAnnotationSchema = {
|
|
|
4243
4186
|
maxItems: 2,
|
|
4244
4187
|
items: [
|
|
4245
4188
|
{ type: "string", const: "citing" },
|
|
4246
|
-
{ type: "string", const: "crm:
|
|
4189
|
+
{ type: "string", const: "crm:E55_Type" }
|
|
4247
4190
|
]
|
|
4248
4191
|
}
|
|
4249
4192
|
}
|
|
@@ -4265,24 +4208,25 @@ import Ajv from "ajv";
|
|
|
4265
4208
|
import addFormats from "ajv-formats";
|
|
4266
4209
|
|
|
4267
4210
|
// src/v1/validator/types.ts
|
|
4268
|
-
import { z as
|
|
4269
|
-
var ValidationError =
|
|
4270
|
-
message:
|
|
4271
|
-
path:
|
|
4272
|
-
suggestion:
|
|
4273
|
-
context:
|
|
4274
|
-
errorType:
|
|
4275
|
-
}).and(
|
|
4211
|
+
import { z as z25 } from "zod";
|
|
4212
|
+
var ValidationError = z25.object({
|
|
4213
|
+
message: z25.string(),
|
|
4214
|
+
path: z25.string(),
|
|
4215
|
+
suggestion: z25.string().optional(),
|
|
4216
|
+
context: z25.object({
|
|
4217
|
+
errorType: z25.string()
|
|
4218
|
+
}).and(z25.unknown())
|
|
4276
4219
|
});
|
|
4277
|
-
var ValidateResult =
|
|
4278
|
-
valid:
|
|
4279
|
-
errors:
|
|
4220
|
+
var ValidateResult = z25.object({
|
|
4221
|
+
valid: z25.boolean(),
|
|
4222
|
+
errors: z25.array(ValidationError).optional()
|
|
4280
4223
|
});
|
|
4281
4224
|
|
|
4282
4225
|
// src/v1/validator/index.ts
|
|
4283
4226
|
var ajv = new Ajv({
|
|
4284
4227
|
code: { source: true },
|
|
4285
|
-
allErrors: true
|
|
4228
|
+
allErrors: true,
|
|
4229
|
+
allowUnionTypes: true
|
|
4286
4230
|
}).addSchema([webAnnotationSchema, definitionSchema]);
|
|
4287
4231
|
addFormats(ajv);
|
|
4288
4232
|
var validator = ajv.compile(webAnnotationSchema);
|
|
@@ -4309,6 +4253,7 @@ var getErrors = (annotation) => {
|
|
|
4309
4253
|
var v1_exports = {};
|
|
4310
4254
|
__export(v1_exports, {
|
|
4311
4255
|
Body: () => Body,
|
|
4256
|
+
DATE_RANGE_PATTERN: () => DATE_RANGE_PATTERN,
|
|
4312
4257
|
Motivation: () => Motivation,
|
|
4313
4258
|
Person: () => Person,
|
|
4314
4259
|
PersonEntityType: () => PersonEntityType,
|
|
@@ -4321,6 +4266,7 @@ __export(v1_exports, {
|
|
|
4321
4266
|
ValidationError: () => ValidationError,
|
|
4322
4267
|
WebAnnotation: () => WebAnnotation,
|
|
4323
4268
|
ajv: () => ajv,
|
|
4269
|
+
bodyIdDescription: () => bodyIdDescription,
|
|
4324
4270
|
bodySchema: () => bodySchema,
|
|
4325
4271
|
contextUri: () => contextUri,
|
|
4326
4272
|
creatorSchema: () => creatorSchema,
|
|
@@ -4451,45 +4397,49 @@ var commonCreator = {
|
|
|
4451
4397
|
name: "user"
|
|
4452
4398
|
};
|
|
4453
4399
|
var commonSoftware = {
|
|
4454
|
-
id: "
|
|
4400
|
+
id: "https://leafwriter.com",
|
|
4455
4401
|
type: ["Software", "crm:P16_used_specific_object"],
|
|
4456
4402
|
label: "LEAF-Writer"
|
|
4457
4403
|
};
|
|
4458
4404
|
var commonSelectorTextPosition = {
|
|
4459
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4405
|
+
id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4460
4406
|
type: ["TextPositionSelector", "crm:E73_Information_Object"],
|
|
4461
4407
|
start: 12,
|
|
4462
4408
|
end: 30
|
|
4463
4409
|
};
|
|
4464
4410
|
var commonSelectorXpath = {
|
|
4465
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec582",
|
|
4411
|
+
id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec582",
|
|
4466
4412
|
type: ["XPathSelector", "crm:E73_Information_Object"],
|
|
4467
4413
|
value: "TEI/tex/div/text/p/personName"
|
|
4468
4414
|
};
|
|
4469
4415
|
var commonSelectorRange = {
|
|
4470
|
-
id: "55369c00-5c43-4d1a-8462-
|
|
4416
|
+
id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec581",
|
|
4471
4417
|
type: ["RangeSelector", "crm:E73_Information_Object"],
|
|
4472
4418
|
startSelector: commonSelectorXpath,
|
|
4473
4419
|
endSelector: commonSelectorXpath
|
|
4474
4420
|
};
|
|
4475
4421
|
var commonSelectorTextQuote = {
|
|
4476
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec583",
|
|
4422
|
+
id: "https://wa.lincsproject/selector/55369c00-5c43-4d1a-8462-31c74fbec583",
|
|
4477
4423
|
type: ["TextQuoteSelector", "crm:E33_Linguistic_Object"],
|
|
4478
|
-
exact: "text",
|
|
4479
|
-
prefix: "
|
|
4480
|
-
suffix: "
|
|
4481
|
-
};
|
|
4482
|
-
var commonDetailedSelector = {
|
|
4483
|
-
...commonSelectorTextQuote,
|
|
4484
|
-
refinedBy: { ...commonSelectorXpath, refinedBy: commonSelectorTextPosition }
|
|
4424
|
+
exact: "exact text",
|
|
4425
|
+
prefix: "prefix text",
|
|
4426
|
+
suffix: "prefix text"
|
|
4485
4427
|
};
|
|
4486
4428
|
var commonTarget = {
|
|
4487
|
-
id: "https://
|
|
4429
|
+
id: "https://wa.lincsproject/target/55369c00-5c43-4d1a-8462-31c74fbec522",
|
|
4488
4430
|
type: ["SpecificResource", "crm:E73_Information_Object"],
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
selector:
|
|
4431
|
+
source: {
|
|
4432
|
+
id: "https://document-url.com"
|
|
4433
|
+
},
|
|
4434
|
+
selector: commonSelectorTextQuote
|
|
4435
|
+
};
|
|
4436
|
+
var commonTargetMultipleSelectors = {
|
|
4437
|
+
id: "https://wa.lincsproject/target/55369c00-5c43-4d1a-8462-31c74fbec522",
|
|
4438
|
+
type: ["SpecificResource", "crm:E73_Information_Object"],
|
|
4439
|
+
source: {
|
|
4440
|
+
id: "https://document-url.com"
|
|
4441
|
+
},
|
|
4442
|
+
selector: [commonSelectorTextQuote, commonSelectorTextPosition]
|
|
4493
4443
|
};
|
|
4494
4444
|
var commonBody = {
|
|
4495
4445
|
id: "https://www.uo.com/person",
|
|
@@ -4497,9 +4447,9 @@ var commonBody = {
|
|
|
4497
4447
|
};
|
|
4498
4448
|
var commonAnnotation = {
|
|
4499
4449
|
"@context": ["http://www.w3.org/ns/anno.jsonld", "https://wa.lincsproject.ca/v1/ns/anno.jsonld"],
|
|
4500
|
-
id: "c7aa1b38-6364-483c-8607-44dc3f510a59",
|
|
4450
|
+
id: "https://wa.lincsproject/c7aa1b38-6364-483c-8607-44dc3f510a59",
|
|
4501
4451
|
type: ["Annotation", "crm:E33_Linguistic_Object"],
|
|
4502
|
-
motivation: ["identifying", "crm:
|
|
4452
|
+
motivation: ["identifying", "crm:E55_Type"],
|
|
4503
4453
|
created: "2022-12-21T23:21:02Z",
|
|
4504
4454
|
creator: commonCreator,
|
|
4505
4455
|
generator: commonSoftware,
|
|
@@ -4514,7 +4464,10 @@ var common = {
|
|
|
4514
4464
|
textPosition: commonSelectorTextPosition,
|
|
4515
4465
|
xpath: commonSelectorXpath,
|
|
4516
4466
|
range: commonSelectorRange,
|
|
4517
|
-
textQuote: commonSelectorTextQuote
|
|
4467
|
+
textQuote: commonSelectorTextQuote,
|
|
4468
|
+
multipleSelectors: {
|
|
4469
|
+
textQuoteAndTextPosition: commonTargetMultipleSelectors
|
|
4470
|
+
}
|
|
4518
4471
|
},
|
|
4519
4472
|
target: commonTarget,
|
|
4520
4473
|
body: commonBody,
|
|
@@ -4623,26 +4576,26 @@ var place = {
|
|
|
4623
4576
|
// src/v1/mocks/body/citation.ts
|
|
4624
4577
|
var simple = {
|
|
4625
4578
|
...common.annotation,
|
|
4626
|
-
motivation: ["citing", "crm:
|
|
4579
|
+
motivation: ["citing", "crm:E55_Type"],
|
|
4627
4580
|
body: {
|
|
4628
|
-
id: "https://www.uo.com/
|
|
4581
|
+
id: "https://www.uo.com/work",
|
|
4629
4582
|
entityType: ["cito:Citation", "crm:E73_Information_Object"]
|
|
4630
4583
|
}
|
|
4631
4584
|
};
|
|
4632
4585
|
var withCertainty3 = {
|
|
4633
4586
|
...common.annotation,
|
|
4634
|
-
motivation: ["citing", "crm:
|
|
4587
|
+
motivation: ["citing", "crm:E55_Type"],
|
|
4635
4588
|
body: {
|
|
4636
|
-
id: "https://www.uo.com/
|
|
4589
|
+
id: "https://www.uo.com/work",
|
|
4637
4590
|
entityType: ["cito:Citation", "crm:E73_Information_Object"],
|
|
4638
4591
|
certainty: "edit:qualityHigh"
|
|
4639
4592
|
}
|
|
4640
4593
|
};
|
|
4641
4594
|
var withLabelAndDescription3 = {
|
|
4642
4595
|
...common.annotation,
|
|
4643
|
-
motivation: ["citing", "crm:
|
|
4596
|
+
motivation: ["citing", "crm:E55_Type"],
|
|
4644
4597
|
body: {
|
|
4645
|
-
id: "https://www.uo.com/
|
|
4598
|
+
id: "https://www.uo.com/work",
|
|
4646
4599
|
entityType: ["cito:Citation", "crm:E73_Information_Object"],
|
|
4647
4600
|
label: "Sandman",
|
|
4648
4601
|
description: "Graphic Novel"
|
|
@@ -4700,9 +4653,9 @@ var conceptualObject = {
|
|
|
4700
4653
|
// src/v1/mocks/body/correction.ts
|
|
4701
4654
|
var valid = {
|
|
4702
4655
|
...common.annotation,
|
|
4703
|
-
motivation: ["correcting", "crm:
|
|
4656
|
+
motivation: ["correcting", "crm:E55_Type"],
|
|
4704
4657
|
body: {
|
|
4705
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4658
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4706
4659
|
type: "TextualBody",
|
|
4707
4660
|
entityType: ["fabio:Correction", "crm:E33_Linguistic_Object"],
|
|
4708
4661
|
value: "this is a correction"
|
|
@@ -4716,7 +4669,7 @@ var correction = {
|
|
|
4716
4669
|
var simple2 = {
|
|
4717
4670
|
...common.annotation,
|
|
4718
4671
|
body: {
|
|
4719
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4672
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4720
4673
|
type: "TextualBody",
|
|
4721
4674
|
entityType: ["xsd:date", "crm:E52_Time-Span"],
|
|
4722
4675
|
value: "2012-03-01T00:00:00/2012-02-01T18:21:07"
|
|
@@ -4725,7 +4678,7 @@ var simple2 = {
|
|
|
4725
4678
|
var withCertainty5 = {
|
|
4726
4679
|
...common.annotation,
|
|
4727
4680
|
body: {
|
|
4728
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4681
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4729
4682
|
type: "TextualBody",
|
|
4730
4683
|
entityType: ["xsd:date", "crm:E52_Time-Span"],
|
|
4731
4684
|
value: "2012-03-01T00:00:00/2012-02-01T18:21:07",
|
|
@@ -4735,7 +4688,7 @@ var withCertainty5 = {
|
|
|
4735
4688
|
var withPrecision2 = {
|
|
4736
4689
|
...common.annotation,
|
|
4737
4690
|
body: {
|
|
4738
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4691
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4739
4692
|
type: "TextualBody",
|
|
4740
4693
|
entityType: ["xsd:date", "crm:E52_Time-Span"],
|
|
4741
4694
|
value: "2012-03-01T00:00:00/2012-02-01T18:21:07",
|
|
@@ -4753,7 +4706,7 @@ var date = {
|
|
|
4753
4706
|
// src/v1/mocks/body/keyword.ts
|
|
4754
4707
|
var vocabularySimple = {
|
|
4755
4708
|
...common.annotation,
|
|
4756
|
-
motivation: ["classifying", "crm:
|
|
4709
|
+
motivation: ["classifying", "crm:E55_Type"],
|
|
4757
4710
|
body: {
|
|
4758
4711
|
id: "https://www.uo.com/keyword",
|
|
4759
4712
|
entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"]
|
|
@@ -4761,7 +4714,7 @@ var vocabularySimple = {
|
|
|
4761
4714
|
};
|
|
4762
4715
|
var vocabularyWithCertainty = {
|
|
4763
4716
|
...common.annotation,
|
|
4764
|
-
motivation: ["classifying", "crm:
|
|
4717
|
+
motivation: ["classifying", "crm:E55_Type"],
|
|
4765
4718
|
body: {
|
|
4766
4719
|
id: "https://www.uo.com/keyword",
|
|
4767
4720
|
entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"],
|
|
@@ -4770,7 +4723,7 @@ var vocabularyWithCertainty = {
|
|
|
4770
4723
|
};
|
|
4771
4724
|
var vocabularyWithLabelAndDescription = {
|
|
4772
4725
|
...common.annotation,
|
|
4773
|
-
motivation: ["classifying", "crm:
|
|
4726
|
+
motivation: ["classifying", "crm:E55_Type"],
|
|
4774
4727
|
body: {
|
|
4775
4728
|
id: "https://www.uo.com/keyword",
|
|
4776
4729
|
entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"],
|
|
@@ -4780,9 +4733,9 @@ var vocabularyWithLabelAndDescription = {
|
|
|
4780
4733
|
};
|
|
4781
4734
|
var folksonomy = {
|
|
4782
4735
|
...common.annotation,
|
|
4783
|
-
motivation: ["tagging", "crm:
|
|
4736
|
+
motivation: ["tagging", "crm:E55_Type"],
|
|
4784
4737
|
body: {
|
|
4785
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4738
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4786
4739
|
type: "TextualBody",
|
|
4787
4740
|
entityType: ["crm:E55_Type", "crm:E33_Linguistic_Object"],
|
|
4788
4741
|
value: "a tag"
|
|
@@ -4802,7 +4755,7 @@ var keyword = {
|
|
|
4802
4755
|
// src/v1/mocks/body/link.ts
|
|
4803
4756
|
var simple3 = {
|
|
4804
4757
|
...common.annotation,
|
|
4805
|
-
motivation: ["linking", "crm:
|
|
4758
|
+
motivation: ["linking", "crm:E55_Type"],
|
|
4806
4759
|
body: {
|
|
4807
4760
|
id: "https://www.uo.com/link",
|
|
4808
4761
|
entityType: "crmdig:D1_Digital_Object"
|
|
@@ -4810,7 +4763,7 @@ var simple3 = {
|
|
|
4810
4763
|
};
|
|
4811
4764
|
var withCertainty6 = {
|
|
4812
4765
|
...common.annotation,
|
|
4813
|
-
motivation: ["linking", "crm:
|
|
4766
|
+
motivation: ["linking", "crm:E55_Type"],
|
|
4814
4767
|
body: {
|
|
4815
4768
|
id: "https://www.uo.com/link",
|
|
4816
4769
|
entityType: "crmdig:D1_Digital_Object",
|
|
@@ -4827,9 +4780,9 @@ var link = {
|
|
|
4827
4780
|
// src/v1/mocks/body/note.ts
|
|
4828
4781
|
var simple4 = {
|
|
4829
4782
|
...common.annotation,
|
|
4830
|
-
motivation: ["describing", "crm:
|
|
4783
|
+
motivation: ["describing", "crm:E55_Type"],
|
|
4831
4784
|
body: {
|
|
4832
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4785
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4833
4786
|
type: "TextualBody",
|
|
4834
4787
|
entityType: "crm:E33_Linguistic_Object",
|
|
4835
4788
|
value: "this is a note"
|
|
@@ -4837,9 +4790,9 @@ var simple4 = {
|
|
|
4837
4790
|
};
|
|
4838
4791
|
var additionalType = {
|
|
4839
4792
|
...common.annotation,
|
|
4840
|
-
motivation: ["describing", "crm:
|
|
4793
|
+
motivation: ["describing", "crm:E55_Type"],
|
|
4841
4794
|
body: {
|
|
4842
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4795
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4843
4796
|
type: "TextualBody",
|
|
4844
4797
|
entityType: "crm:E33_Linguistic_Object",
|
|
4845
4798
|
additionalType: "cwrc:NoteScholarly",
|
|
@@ -4848,9 +4801,9 @@ var additionalType = {
|
|
|
4848
4801
|
};
|
|
4849
4802
|
var additionalMultipleTypes = {
|
|
4850
4803
|
...common.annotation,
|
|
4851
|
-
motivation: ["describing", "crm:
|
|
4804
|
+
motivation: ["describing", "crm:E55_Type"],
|
|
4852
4805
|
body: {
|
|
4853
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4806
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
4854
4807
|
type: "TextualBody",
|
|
4855
4808
|
entityType: "crm:E33_Linguistic_Object",
|
|
4856
4809
|
additionalType: ["scholarly", "academic"],
|
|
@@ -4988,6 +4941,47 @@ var work = {
|
|
|
4988
4941
|
}
|
|
4989
4942
|
};
|
|
4990
4943
|
|
|
4944
|
+
// src/v1/mocks/body/event.ts
|
|
4945
|
+
var real7 = {
|
|
4946
|
+
...common.annotation,
|
|
4947
|
+
body: {
|
|
4948
|
+
id: "https://www.uo.com/event",
|
|
4949
|
+
entityType: "crm:E5_Event"
|
|
4950
|
+
}
|
|
4951
|
+
};
|
|
4952
|
+
var fictional7 = {
|
|
4953
|
+
...common.annotation,
|
|
4954
|
+
body: {
|
|
4955
|
+
id: "https://www.uo.com/event",
|
|
4956
|
+
entityType: "YET TO BE DEFINED A CLASS FOR FICTIONAL EVENTS"
|
|
4957
|
+
}
|
|
4958
|
+
};
|
|
4959
|
+
var withCertainty10 = {
|
|
4960
|
+
...common.annotation,
|
|
4961
|
+
body: {
|
|
4962
|
+
id: "https://www.uo.com/event",
|
|
4963
|
+
entityType: "crm:E5_Event",
|
|
4964
|
+
certainty: "edit:qualityLow"
|
|
4965
|
+
}
|
|
4966
|
+
};
|
|
4967
|
+
var withLabelAndDescription8 = {
|
|
4968
|
+
...common.annotation,
|
|
4969
|
+
body: {
|
|
4970
|
+
id: "https://www.uo.com/event",
|
|
4971
|
+
entityType: "crm:E5_Event",
|
|
4972
|
+
label: "revolution",
|
|
4973
|
+
description: "An event"
|
|
4974
|
+
}
|
|
4975
|
+
};
|
|
4976
|
+
var event = {
|
|
4977
|
+
valid: {
|
|
4978
|
+
real: real7,
|
|
4979
|
+
fictional: fictional7,
|
|
4980
|
+
withCertainty: withCertainty10,
|
|
4981
|
+
withLabelAndDescription: withLabelAndDescription8
|
|
4982
|
+
}
|
|
4983
|
+
};
|
|
4984
|
+
|
|
4991
4985
|
// src/v1/mocks/body/index.ts
|
|
4992
4986
|
var personPlace = {
|
|
4993
4987
|
...common.annotation,
|
|
@@ -5022,7 +5016,6 @@ var generatorWithVersion = {
|
|
|
5022
5016
|
...common.annotation,
|
|
5023
5017
|
generator: { ...common.software, softwareVersion: "v1.2.5" }
|
|
5024
5018
|
};
|
|
5025
|
-
var { creator } = common.annotation;
|
|
5026
5019
|
var noCreator = {
|
|
5027
5020
|
...common.annotation
|
|
5028
5021
|
};
|
|
@@ -5042,25 +5035,16 @@ var agent = {
|
|
|
5042
5035
|
};
|
|
5043
5036
|
|
|
5044
5037
|
// src/v1/mocks/root/root.ts
|
|
5045
|
-
var idUri = {
|
|
5046
|
-
...common.annotation,
|
|
5047
|
-
id: "http://www.uo.com/wa",
|
|
5048
|
-
status: "published"
|
|
5049
|
-
};
|
|
5050
|
-
var idUUID = {
|
|
5051
|
-
...common.annotation,
|
|
5052
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584"
|
|
5053
|
-
};
|
|
5054
5038
|
var motivationIdentify = {
|
|
5055
5039
|
...common.annotation,
|
|
5056
|
-
motivation: ["identifying", "crm:
|
|
5040
|
+
motivation: ["identifying", "crm:E55_Type"],
|
|
5057
5041
|
body: commonPersonBody
|
|
5058
5042
|
};
|
|
5059
5043
|
var motivationDescribing = {
|
|
5060
5044
|
...common.annotation,
|
|
5061
|
-
motivation: ["describing", "crm:
|
|
5045
|
+
motivation: ["describing", "crm:E55_Type"],
|
|
5062
5046
|
body: {
|
|
5063
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
5047
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
5064
5048
|
type: "TextualBody",
|
|
5065
5049
|
entityType: "crm:E33_Linguistic_Object",
|
|
5066
5050
|
value: "this is a note"
|
|
@@ -5068,9 +5052,9 @@ var motivationDescribing = {
|
|
|
5068
5052
|
};
|
|
5069
5053
|
var motivationCorrecting = {
|
|
5070
5054
|
...common.annotation,
|
|
5071
|
-
motivation: ["correcting", "crm:
|
|
5055
|
+
motivation: ["correcting", "crm:E55_Type"],
|
|
5072
5056
|
body: {
|
|
5073
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
5057
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
5074
5058
|
type: "TextualBody",
|
|
5075
5059
|
entityType: ["fabio:Correction", "crm:E33_Linguistic_Object"],
|
|
5076
5060
|
value: "this is a correction"
|
|
@@ -5078,9 +5062,9 @@ var motivationCorrecting = {
|
|
|
5078
5062
|
};
|
|
5079
5063
|
var motivationTagging = {
|
|
5080
5064
|
...common.annotation,
|
|
5081
|
-
motivation: ["tagging", "crm:
|
|
5065
|
+
motivation: ["tagging", "crm:E55_Type"],
|
|
5082
5066
|
body: {
|
|
5083
|
-
id: "55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
5067
|
+
id: "https://wa.lincsproject/55369c00-5c43-4d1a-8462-31c74fbec584",
|
|
5084
5068
|
type: "TextualBody",
|
|
5085
5069
|
entityType: ["crm:E55_Type", "crm:E33_Linguistic_Object"],
|
|
5086
5070
|
value: "a tag"
|
|
@@ -5088,7 +5072,7 @@ var motivationTagging = {
|
|
|
5088
5072
|
};
|
|
5089
5073
|
var motivationClassifying = {
|
|
5090
5074
|
...common.annotation,
|
|
5091
|
-
motivation: ["classifying", "crm:
|
|
5075
|
+
motivation: ["classifying", "crm:E55_Type"],
|
|
5092
5076
|
body: {
|
|
5093
5077
|
id: "https://www.uo.com/keyword",
|
|
5094
5078
|
entityType: ["crm:E55_Type", "crmdig:D1_Digital_Object"]
|
|
@@ -5096,7 +5080,7 @@ var motivationClassifying = {
|
|
|
5096
5080
|
};
|
|
5097
5081
|
var motivationLinking = {
|
|
5098
5082
|
...common.annotation,
|
|
5099
|
-
motivation: ["linking", "crm:
|
|
5083
|
+
motivation: ["linking", "crm:E55_Type"],
|
|
5100
5084
|
body: {
|
|
5101
5085
|
id: "https://www.uo.com/link",
|
|
5102
5086
|
entityType: "crmdig:D1_Digital_Object"
|
|
@@ -5104,7 +5088,7 @@ var motivationLinking = {
|
|
|
5104
5088
|
};
|
|
5105
5089
|
var motivationCiting = {
|
|
5106
5090
|
...common.annotation,
|
|
5107
|
-
motivation: ["citing", "crm:
|
|
5091
|
+
motivation: ["citing", "crm:E55_Type"],
|
|
5108
5092
|
body: {
|
|
5109
5093
|
id: "https://www.uo.com/conceptualObject",
|
|
5110
5094
|
entityType: ["cito:Citation", "crm:E73_Information_Object"]
|
|
@@ -5129,10 +5113,6 @@ var statusPublished = {
|
|
|
5129
5113
|
};
|
|
5130
5114
|
var root = {
|
|
5131
5115
|
valid: {
|
|
5132
|
-
id: {
|
|
5133
|
-
uri: idUri,
|
|
5134
|
-
uuid: idUUID
|
|
5135
|
-
},
|
|
5136
5116
|
motivation: {
|
|
5137
5117
|
identify: motivationIdentify,
|
|
5138
5118
|
describing: motivationDescribing,
|
|
@@ -5152,133 +5132,191 @@ var root = {
|
|
|
5152
5132
|
};
|
|
5153
5133
|
|
|
5154
5134
|
// src/v1/mocks/target/selector.ts
|
|
5155
|
-
var
|
|
5135
|
+
var textQuote = {
|
|
5156
5136
|
...common.annotation,
|
|
5157
5137
|
target: {
|
|
5158
5138
|
...common.target,
|
|
5159
5139
|
selector: common.selector.textQuote
|
|
5160
5140
|
}
|
|
5161
5141
|
};
|
|
5162
|
-
var
|
|
5142
|
+
var textQuoteRefinedByTextPosition = {
|
|
5163
5143
|
...common.annotation,
|
|
5164
5144
|
target: {
|
|
5165
5145
|
...common.target,
|
|
5166
5146
|
selector: {
|
|
5167
5147
|
...common.selector.textQuote,
|
|
5168
|
-
refinedBy: common.selector.
|
|
5148
|
+
refinedBy: common.selector.textPosition
|
|
5169
5149
|
}
|
|
5170
5150
|
}
|
|
5171
5151
|
};
|
|
5172
|
-
var
|
|
5152
|
+
var textQuoteRefinedByTextQuote = {
|
|
5173
5153
|
...common.annotation,
|
|
5174
5154
|
target: {
|
|
5175
5155
|
...common.target,
|
|
5176
5156
|
selector: {
|
|
5177
5157
|
...common.selector.textQuote,
|
|
5178
|
-
refinedBy:
|
|
5179
|
-
...common.selector.xpath,
|
|
5180
|
-
refinedBy: common.selector.textPosition
|
|
5181
|
-
}
|
|
5158
|
+
refinedBy: common.selector.textQuote
|
|
5182
5159
|
}
|
|
5183
5160
|
}
|
|
5184
5161
|
};
|
|
5185
|
-
var
|
|
5162
|
+
var xpath = {
|
|
5163
|
+
...common.annotation,
|
|
5164
|
+
target: {
|
|
5165
|
+
...common.target,
|
|
5166
|
+
selector: common.selector.xpath
|
|
5167
|
+
}
|
|
5168
|
+
};
|
|
5169
|
+
var xpathRefinedByTextPosition = {
|
|
5186
5170
|
...common.annotation,
|
|
5187
5171
|
target: {
|
|
5188
5172
|
...common.target,
|
|
5189
5173
|
selector: {
|
|
5190
|
-
...common.selector.
|
|
5174
|
+
...common.selector.xpath,
|
|
5191
5175
|
refinedBy: common.selector.textPosition
|
|
5192
5176
|
}
|
|
5193
5177
|
}
|
|
5194
5178
|
};
|
|
5195
|
-
var
|
|
5179
|
+
var xpathRefinedByTextQuote = {
|
|
5196
5180
|
...common.annotation,
|
|
5197
5181
|
target: {
|
|
5198
5182
|
...common.target,
|
|
5199
|
-
selector:
|
|
5183
|
+
selector: {
|
|
5184
|
+
...common.selector.xpath,
|
|
5185
|
+
refinedBy: common.selector.textQuote
|
|
5186
|
+
}
|
|
5200
5187
|
}
|
|
5201
5188
|
};
|
|
5202
|
-
var
|
|
5189
|
+
var textPosition = {
|
|
5190
|
+
...common.annotation,
|
|
5191
|
+
target: {
|
|
5192
|
+
...common.target,
|
|
5193
|
+
selector: common.selector.textPosition
|
|
5194
|
+
}
|
|
5195
|
+
};
|
|
5196
|
+
var textPositionRefinedByTextQuote = {
|
|
5203
5197
|
...common.annotation,
|
|
5204
5198
|
target: {
|
|
5205
5199
|
...common.target,
|
|
5206
5200
|
selector: {
|
|
5207
|
-
...common.selector.
|
|
5201
|
+
...common.selector.textPosition,
|
|
5202
|
+
refinedBy: common.selector.textQuote
|
|
5203
|
+
}
|
|
5204
|
+
}
|
|
5205
|
+
};
|
|
5206
|
+
var textPositionRefinedByTextPosition = {
|
|
5207
|
+
...common.annotation,
|
|
5208
|
+
target: {
|
|
5209
|
+
...common.target,
|
|
5210
|
+
selector: {
|
|
5211
|
+
...common.selector.textPosition,
|
|
5208
5212
|
refinedBy: common.selector.textPosition
|
|
5209
5213
|
}
|
|
5210
5214
|
}
|
|
5211
5215
|
};
|
|
5212
|
-
var
|
|
5216
|
+
var range = {
|
|
5213
5217
|
...common.annotation,
|
|
5214
5218
|
target: {
|
|
5215
5219
|
...common.target,
|
|
5216
|
-
selector: common.selector.
|
|
5220
|
+
selector: common.selector.range
|
|
5221
|
+
}
|
|
5222
|
+
};
|
|
5223
|
+
var textQuoteAndTextPosition = {
|
|
5224
|
+
...common.annotation,
|
|
5225
|
+
target: {
|
|
5226
|
+
...common.target,
|
|
5227
|
+
selector: [common.selector.textQuote, common.selector.textPosition]
|
|
5217
5228
|
}
|
|
5218
5229
|
};
|
|
5219
5230
|
var targetSelector = {
|
|
5220
5231
|
valid: {
|
|
5221
5232
|
selector: {
|
|
5222
5233
|
textQuote: {
|
|
5223
|
-
simple:
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
refinedByTextPositon: textQuoteRefinedByTextPosition
|
|
5234
|
+
simple: textQuote,
|
|
5235
|
+
refinedByTextPositon: textQuoteRefinedByTextPosition,
|
|
5236
|
+
refinedByTextQuote: textQuoteRefinedByTextQuote
|
|
5227
5237
|
},
|
|
5228
5238
|
xpath: {
|
|
5229
5239
|
simple: xpath,
|
|
5230
|
-
refinedByTextPositon: xpathRefinedByTextPosition
|
|
5240
|
+
refinedByTextPositon: xpathRefinedByTextPosition,
|
|
5241
|
+
refinedByTextQuote: xpathRefinedByTextQuote
|
|
5242
|
+
},
|
|
5243
|
+
textPosition: {
|
|
5244
|
+
simple: textPosition,
|
|
5245
|
+
refinedByTextPositon: textPositionRefinedByTextQuote,
|
|
5246
|
+
refinedByTextQuote: textPositionRefinedByTextPosition
|
|
5231
5247
|
},
|
|
5232
|
-
|
|
5248
|
+
range,
|
|
5249
|
+
multipleSelector: {
|
|
5250
|
+
textQuoteAndTextPosition
|
|
5251
|
+
}
|
|
5233
5252
|
}
|
|
5234
5253
|
}
|
|
5235
5254
|
};
|
|
5236
5255
|
|
|
5237
5256
|
// src/v1/mocks/target/target.ts
|
|
5238
5257
|
var simple5 = {
|
|
5258
|
+
...common.annotation,
|
|
5259
|
+
target: common.target
|
|
5260
|
+
};
|
|
5261
|
+
var withSourceTitle = {
|
|
5239
5262
|
...common.annotation,
|
|
5240
5263
|
target: {
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5264
|
+
...common.target,
|
|
5265
|
+
source: {
|
|
5266
|
+
id: "https://document-url.com",
|
|
5267
|
+
title: "Document Title"
|
|
5268
|
+
}
|
|
5244
5269
|
}
|
|
5245
5270
|
};
|
|
5246
|
-
var
|
|
5271
|
+
var withSourceFormat = {
|
|
5247
5272
|
...common.annotation,
|
|
5248
5273
|
target: {
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5274
|
+
...common.target,
|
|
5275
|
+
source: {
|
|
5276
|
+
id: "https://document-url.com",
|
|
5277
|
+
title: "Document Title",
|
|
5278
|
+
format: ["application/xml"]
|
|
5279
|
+
}
|
|
5253
5280
|
}
|
|
5254
5281
|
};
|
|
5255
|
-
var
|
|
5282
|
+
var withSourceLanguage = {
|
|
5256
5283
|
...common.annotation,
|
|
5257
5284
|
target: {
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5285
|
+
...common.target,
|
|
5286
|
+
source: {
|
|
5287
|
+
id: "https://document-url.com",
|
|
5288
|
+
title: "Document Title",
|
|
5289
|
+
format: ["application/xml"],
|
|
5290
|
+
language: ["eng"]
|
|
5291
|
+
}
|
|
5262
5292
|
}
|
|
5263
5293
|
};
|
|
5264
5294
|
var withRendererSoftware = {
|
|
5265
5295
|
...common.annotation,
|
|
5266
5296
|
target: {
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
renderedVia: common.software,
|
|
5270
|
-
selector: common.selector.textPosition
|
|
5297
|
+
...common.target,
|
|
5298
|
+
renderedVia: common.software
|
|
5271
5299
|
}
|
|
5272
5300
|
};
|
|
5273
5301
|
var complete = {
|
|
5274
5302
|
...common.annotation,
|
|
5275
|
-
target:
|
|
5303
|
+
target: {
|
|
5304
|
+
...common.target,
|
|
5305
|
+
source: {
|
|
5306
|
+
id: "https://document-url.com",
|
|
5307
|
+
title: "Document Title",
|
|
5308
|
+
format: ["application/xml"],
|
|
5309
|
+
language: ["eng"]
|
|
5310
|
+
},
|
|
5311
|
+
renderedVia: common.software
|
|
5312
|
+
}
|
|
5276
5313
|
};
|
|
5277
5314
|
var target = {
|
|
5278
5315
|
valid: {
|
|
5279
5316
|
simple: simple5,
|
|
5280
|
-
|
|
5281
|
-
|
|
5317
|
+
withSourceTitle,
|
|
5318
|
+
withSourceFormat,
|
|
5319
|
+
withSourceLanguage,
|
|
5282
5320
|
withRendererSoftware,
|
|
5283
5321
|
complete
|
|
5284
5322
|
}
|
|
@@ -5291,8 +5329,6 @@ var generateValidExamples = async () => {
|
|
|
5291
5329
|
console.log(kleur_default.cyan(`Generating Web Annotation Examples`));
|
|
5292
5330
|
if (!import_fs_extra.default.existsSync(FOLDER))
|
|
5293
5331
|
import_fs_extra.default.mkdirSync(FOLDER, { recursive: true });
|
|
5294
|
-
await import_fs_extra.default.writeJSON(path.join(FOLDER, "id_uri.jsonld"), root.valid.id.uri, JSON_OPTIONS);
|
|
5295
|
-
await import_fs_extra.default.writeJSON(path.join(FOLDER, "id_uuid.jsonld"), root.valid.id.uuid, JSON_OPTIONS);
|
|
5296
5332
|
await import_fs_extra.default.writeJSON(
|
|
5297
5333
|
path.join(FOLDER, "motivation_citing.jsonld"),
|
|
5298
5334
|
root.valid.motivation.citing,
|
|
@@ -5372,13 +5408,18 @@ var generateValidExamples = async () => {
|
|
|
5372
5408
|
);
|
|
5373
5409
|
await import_fs_extra.default.writeJSON(path.join(FOLDER, "target.jsonld"), target.valid.simple, JSON_OPTIONS);
|
|
5374
5410
|
await import_fs_extra.default.writeJSON(
|
|
5375
|
-
path.join(FOLDER, "
|
|
5376
|
-
target.valid.
|
|
5411
|
+
path.join(FOLDER, "target_with_sourceTitle.jsonld"),
|
|
5412
|
+
target.valid.withSourceTitle,
|
|
5413
|
+
JSON_OPTIONS
|
|
5414
|
+
);
|
|
5415
|
+
await import_fs_extra.default.writeJSON(
|
|
5416
|
+
path.join(FOLDER, "target_with_source_format.jsonld"),
|
|
5417
|
+
target.valid.withSourceFormat,
|
|
5377
5418
|
JSON_OPTIONS
|
|
5378
5419
|
);
|
|
5379
5420
|
await import_fs_extra.default.writeJSON(
|
|
5380
|
-
path.join(FOLDER, "
|
|
5381
|
-
target.valid.
|
|
5421
|
+
path.join(FOLDER, "target_with_source_language.jsonld"),
|
|
5422
|
+
target.valid.withSourceLanguage,
|
|
5382
5423
|
JSON_OPTIONS
|
|
5383
5424
|
);
|
|
5384
5425
|
await import_fs_extra.default.writeJSON(
|
|
@@ -5386,19 +5427,64 @@ var generateValidExamples = async () => {
|
|
|
5386
5427
|
target.valid.withRendererSoftware,
|
|
5387
5428
|
JSON_OPTIONS
|
|
5388
5429
|
);
|
|
5430
|
+
await import_fs_extra.default.writeJSON(
|
|
5431
|
+
path.join(FOLDER, "target_complete.jsonld"),
|
|
5432
|
+
target.valid.complete,
|
|
5433
|
+
JSON_OPTIONS
|
|
5434
|
+
);
|
|
5389
5435
|
await import_fs_extra.default.writeJSON(
|
|
5390
5436
|
path.join(FOLDER, "target_selector_textQuote.jsonld"),
|
|
5391
5437
|
targetSelector.valid.selector.textQuote.simple,
|
|
5392
5438
|
JSON_OPTIONS
|
|
5393
5439
|
);
|
|
5394
5440
|
await import_fs_extra.default.writeJSON(
|
|
5395
|
-
path.join(FOLDER, "
|
|
5396
|
-
targetSelector.valid.selector.textQuote.
|
|
5441
|
+
path.join(FOLDER, "target_selector_textQuote_refinedBy_textPosition.jsonld"),
|
|
5442
|
+
targetSelector.valid.selector.textQuote.refinedByTextPositon,
|
|
5443
|
+
JSON_OPTIONS
|
|
5444
|
+
);
|
|
5445
|
+
await import_fs_extra.default.writeJSON(
|
|
5446
|
+
path.join(FOLDER, "target_selector_textQuote_refinedBy_textQuote.jsonld"),
|
|
5447
|
+
targetSelector.valid.selector.textQuote.refinedByTextQuote,
|
|
5397
5448
|
JSON_OPTIONS
|
|
5398
5449
|
);
|
|
5399
5450
|
await import_fs_extra.default.writeJSON(
|
|
5400
5451
|
path.join(FOLDER, "target_selector_textPosition.jsonld"),
|
|
5401
|
-
targetSelector.valid.selector.
|
|
5452
|
+
targetSelector.valid.selector.textPosition.simple,
|
|
5453
|
+
JSON_OPTIONS
|
|
5454
|
+
);
|
|
5455
|
+
await import_fs_extra.default.writeJSON(
|
|
5456
|
+
path.join(FOLDER, "target_selector_textPosition_refinedBy_textQuote.jsonld"),
|
|
5457
|
+
targetSelector.valid.selector.textPosition.refinedByTextQuote,
|
|
5458
|
+
JSON_OPTIONS
|
|
5459
|
+
);
|
|
5460
|
+
await import_fs_extra.default.writeJSON(
|
|
5461
|
+
path.join(FOLDER, "target_selector_textPosition_refinedBy_textPosition.jsonld"),
|
|
5462
|
+
targetSelector.valid.selector.textPosition.refinedByTextPositon,
|
|
5463
|
+
JSON_OPTIONS
|
|
5464
|
+
);
|
|
5465
|
+
await import_fs_extra.default.writeJSON(
|
|
5466
|
+
path.join(FOLDER, "target_selector_range.jsonld"),
|
|
5467
|
+
targetSelector.valid.selector.range,
|
|
5468
|
+
JSON_OPTIONS
|
|
5469
|
+
);
|
|
5470
|
+
await import_fs_extra.default.writeJSON(
|
|
5471
|
+
path.join(FOLDER, "target_selector_xpath.jsonld"),
|
|
5472
|
+
targetSelector.valid.selector.xpath.simple,
|
|
5473
|
+
JSON_OPTIONS
|
|
5474
|
+
);
|
|
5475
|
+
await import_fs_extra.default.writeJSON(
|
|
5476
|
+
path.join(FOLDER, "target_selector_xpath_refinedBt_textPosition.jsonld"),
|
|
5477
|
+
targetSelector.valid.selector.xpath.refinedByTextPositon,
|
|
5478
|
+
JSON_OPTIONS
|
|
5479
|
+
);
|
|
5480
|
+
await import_fs_extra.default.writeJSON(
|
|
5481
|
+
path.join(FOLDER, "target_selector_xpath_refinedBt_textQuote.jsonld"),
|
|
5482
|
+
targetSelector.valid.selector.xpath.refinedByTextQuote,
|
|
5483
|
+
JSON_OPTIONS
|
|
5484
|
+
);
|
|
5485
|
+
await import_fs_extra.default.writeJSON(
|
|
5486
|
+
path.join(FOLDER, "target_multiple_selectors_textQuote_and_textPosition.jsonld"),
|
|
5487
|
+
targetSelector.valid.selector.multipleSelector.textQuoteAndTextPosition,
|
|
5402
5488
|
JSON_OPTIONS
|
|
5403
5489
|
);
|
|
5404
5490
|
await import_fs_extra.default.writeJSON(path.join(FOLDER, "person.jsonld"), person.valid.real, JSON_OPTIONS);
|
|
@@ -5454,6 +5540,12 @@ var generateValidExamples = async () => {
|
|
|
5454
5540
|
physicalThing.valid.fictional,
|
|
5455
5541
|
JSON_OPTIONS
|
|
5456
5542
|
);
|
|
5543
|
+
await import_fs_extra.default.writeJSON(path.join(FOLDER, "event.jsonld"), event.valid.real, JSON_OPTIONS);
|
|
5544
|
+
await import_fs_extra.default.writeJSON(
|
|
5545
|
+
path.join(FOLDER, "event_fictional.jsonld"),
|
|
5546
|
+
event.valid.fictional,
|
|
5547
|
+
JSON_OPTIONS
|
|
5548
|
+
);
|
|
5457
5549
|
await import_fs_extra.default.writeJSON(
|
|
5458
5550
|
path.join(FOLDER, "conceptual_object_real.jsonld"),
|
|
5459
5551
|
conceptualObject.valid.real,
|
|
@@ -5537,6 +5629,7 @@ var generateAssets = async () => {
|
|
|
5537
5629
|
};
|
|
5538
5630
|
export {
|
|
5539
5631
|
Body,
|
|
5632
|
+
DATE_RANGE_PATTERN,
|
|
5540
5633
|
Motivation,
|
|
5541
5634
|
Person,
|
|
5542
5635
|
PersonEntityType,
|
|
@@ -5549,6 +5642,7 @@ export {
|
|
|
5549
5642
|
ValidationError,
|
|
5550
5643
|
WebAnnotation,
|
|
5551
5644
|
ajv,
|
|
5645
|
+
bodyIdDescription,
|
|
5552
5646
|
bodySchema,
|
|
5553
5647
|
contextUri,
|
|
5554
5648
|
creatorSchema,
|