@lincs.project/webannotation-schema 1.11.0 → 1.13.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 +3984 -489
- package/dist/index.d.ts +3984 -489
- package/dist/index.js +215 -92
- package/dist/index.mjs +212 -91
- package/dist/v1/jsonld/context.jsonld +2 -1
- package/dist/v1/jsonld/defs.jsonld +188 -27
- package/dist/v1/jsonld/schema.jsonld +36 -5
- package/dist/v1/standalone/linc-wa-validator.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(src_exports, {
|
|
|
46
46
|
Description: () => Description,
|
|
47
47
|
Event: () => Event,
|
|
48
48
|
EventEntityType: () => EventEntityType,
|
|
49
|
+
Group: () => Group,
|
|
49
50
|
Keyword: () => Keyword,
|
|
50
51
|
KeywordEntityType: () => KeywordEntityType,
|
|
51
52
|
KeywordFolksnomy: () => KeywordFolksnomy,
|
|
@@ -98,7 +99,6 @@ __export(src_exports, {
|
|
|
98
99
|
contextUri: () => contextUri,
|
|
99
100
|
correctionEntityTypeSchema: () => correctionEntityTypeSchema,
|
|
100
101
|
correctionSchema: () => correctionSchema,
|
|
101
|
-
creatorSchema: () => creatorSchema,
|
|
102
102
|
dateEntityTypeSchema: () => dateEntityTypeSchema,
|
|
103
103
|
dateSchema: () => dateSchema,
|
|
104
104
|
definitionSchema: () => definitionSchema,
|
|
@@ -107,6 +107,7 @@ __export(src_exports, {
|
|
|
107
107
|
eventEntityTypeSchema: () => eventEntityTypeSchema,
|
|
108
108
|
eventSchema: () => eventSchema,
|
|
109
109
|
formatSchema: () => formatSchema,
|
|
110
|
+
groupSchema: () => groupSchema,
|
|
110
111
|
isIdentifiedBy: () => isIdentifiedBy,
|
|
111
112
|
isIndentifyBySchema: () => isIndentifyBySchema,
|
|
112
113
|
keywordEntityTypeSchema: () => keywordEntityTypeSchema,
|
|
@@ -142,6 +143,7 @@ __export(src_exports, {
|
|
|
142
143
|
textPositionSelectorSchema: () => textPositionSelectorSchema,
|
|
143
144
|
textQuoteSelectorExtendedSchema: () => textQuoteSelectorExtendedSchema,
|
|
144
145
|
textQuoteSelectorSchema: () => textQuoteSelectorSchema,
|
|
146
|
+
userSchema: () => userSchema,
|
|
145
147
|
v1: () => v1_exports,
|
|
146
148
|
validate: () => validate,
|
|
147
149
|
validator: () => validator,
|
|
@@ -162,14 +164,15 @@ var defsId = `https://wa.lincsproject.ca/${VERSION}/defs.jsonld`;
|
|
|
162
164
|
// src/v1/schema/context.ts
|
|
163
165
|
var schemaContext = {
|
|
164
166
|
"@context": {
|
|
167
|
+
biography: "http://id.lincsproject.ca/biography/",
|
|
165
168
|
bf: "http://www.openlinksw.com/schemas/bif#",
|
|
166
169
|
cito: "http://purl.org/spar/cito/",
|
|
170
|
+
crmdig: "http://www.ics.forth.gr/isl/CRMdig/",
|
|
167
171
|
cwrc: "http://id.lincsproject.ca/cwrc/",
|
|
168
172
|
edit: "http://id.lincsproject.ca/edit/",
|
|
169
173
|
fabio: "https://purl.org/spar/fabio/",
|
|
170
174
|
frbroo: "http://iflastandards.info/ns/fr/frbr/frbroo/",
|
|
171
175
|
wikidata: "http://www.wikidata.org/entity/",
|
|
172
|
-
crmdig: "http://www.ics.forth.gr/isl/CRMdig/",
|
|
173
176
|
citing: "edit:citing",
|
|
174
177
|
correcting: "edit:correcting",
|
|
175
178
|
"oa:identifying": {
|
|
@@ -214,43 +217,64 @@ var schemaContext = {
|
|
|
214
217
|
}
|
|
215
218
|
};
|
|
216
219
|
|
|
217
|
-
// src/v1/schema/definitions/
|
|
220
|
+
// src/v1/schema/definitions/agents.ts
|
|
218
221
|
var import_zod = require("zod");
|
|
219
|
-
var userIdDescription = "The IRI that identifies the agent (Creator or Contributor).";
|
|
220
222
|
var User = import_zod.z.object({
|
|
221
|
-
id: import_zod.z.string().url()
|
|
222
|
-
type: import_zod.z.literal("crm:E21_Person")
|
|
223
|
-
name: import_zod.z.string().min(1, { message: "Cannot be empty" }).describe(
|
|
223
|
+
id: import_zod.z.string().url(),
|
|
224
|
+
type: import_zod.z.literal("crm:E21_Person"),
|
|
225
|
+
name: import_zod.z.string().min(1, { message: "Cannot be empty" }).describe(`The person's name.`)
|
|
224
226
|
}).describe("Human Agent");
|
|
225
|
-
var
|
|
227
|
+
var userSchema = {
|
|
226
228
|
type: "object",
|
|
227
|
-
description: "
|
|
229
|
+
description: "User Agent",
|
|
228
230
|
properties: {
|
|
229
|
-
id: { type: "string", format: "uri"
|
|
231
|
+
id: { type: "string", format: "uri" },
|
|
230
232
|
type: { type: "string", const: "crm:E21_Person" },
|
|
231
|
-
name: { type: "string", minLength: 1, description:
|
|
233
|
+
name: { type: "string", minLength: 1, description: `The person's name.` }
|
|
234
|
+
},
|
|
235
|
+
required: ["id", "type", "name"]
|
|
236
|
+
};
|
|
237
|
+
var Group = import_zod.z.object({
|
|
238
|
+
id: import_zod.z.string().url(),
|
|
239
|
+
type: import_zod.z.literal("crm:E74_Group"),
|
|
240
|
+
name: import_zod.z.string().min(1).describe(`The group's name.`)
|
|
241
|
+
}).describe("Group Agent");
|
|
242
|
+
var groupSchema = {
|
|
243
|
+
type: "object",
|
|
244
|
+
description: "Group Agent",
|
|
245
|
+
properties: {
|
|
246
|
+
id: { type: "string", format: "uri" },
|
|
247
|
+
type: { type: "string", const: "crm:E74_Group" },
|
|
248
|
+
name: { type: "string", minLength: 1, description: `The group's name.` }
|
|
232
249
|
},
|
|
233
250
|
required: ["id", "type", "name"]
|
|
234
251
|
};
|
|
235
|
-
var softwareIdDescription = "The IRI that identifies the agent (software).";
|
|
236
252
|
var Software = import_zod.z.object({
|
|
237
|
-
id: import_zod.z.string().url()
|
|
238
|
-
type: import_zod.z.literal("Software").
|
|
253
|
+
id: import_zod.z.string().url(),
|
|
254
|
+
type: import_zod.z.tuple([import_zod.z.literal("Software"), import_zod.z.literal("crm:E73_Information_Object")]),
|
|
239
255
|
P16_used_specific_object: import_zod.z.string().url().optional().describe("The URI that identifies the agent (software)"),
|
|
240
|
-
|
|
256
|
+
name: import_zod.z.string().min(1).describe(`The software's name.`),
|
|
241
257
|
softwareVersion: import_zod.z.string().optional().describe("The software version.")
|
|
242
258
|
}).describe("Software Agent");
|
|
243
259
|
var softwareSchema = {
|
|
244
260
|
type: "object",
|
|
245
261
|
description: "Software Agent",
|
|
246
262
|
properties: {
|
|
247
|
-
id: { type: "string", format: "uri"
|
|
248
|
-
type: {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
263
|
+
id: { type: "string", format: "uri" },
|
|
264
|
+
type: {
|
|
265
|
+
type: "array",
|
|
266
|
+
minItems: 2,
|
|
267
|
+
maxItems: 2,
|
|
268
|
+
items: [
|
|
269
|
+
{ type: "string", const: "Software" },
|
|
270
|
+
{ type: "string", const: "crm:E73_Information_Object" }
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
P16_used_specific_object: { type: "string", format: "uri", nullable: true },
|
|
274
|
+
name: { type: "string", minLength: 1, description: `The software's name.` },
|
|
275
|
+
softwareVersion: { type: "string", nullable: true, description: "The software version." }
|
|
252
276
|
},
|
|
253
|
-
required: ["id", "type", "
|
|
277
|
+
required: ["id", "type", "name"]
|
|
254
278
|
};
|
|
255
279
|
|
|
256
280
|
// src/v1/schema/definitions/body/index.ts
|
|
@@ -849,8 +873,8 @@ var physicalThingSchema = {
|
|
|
849
873
|
// src/v1/schema/definitions/body/place.ts
|
|
850
874
|
var import_zod14 = require("zod");
|
|
851
875
|
var PlaceEntityType = import_zod14.z.union([
|
|
852
|
-
import_zod14.z.literal("
|
|
853
|
-
import_zod14.z.tuple([import_zod14.z.literal("
|
|
876
|
+
import_zod14.z.literal("crm:E53_Place"),
|
|
877
|
+
import_zod14.z.tuple([import_zod14.z.literal("biography:fictionalPlace"), import_zod14.z.literal("crm:E89_Propositional_Object")])
|
|
854
878
|
]);
|
|
855
879
|
var Place = import_zod14.z.object({
|
|
856
880
|
id: import_zod14.z.string().url().describe(bodyIdDescription),
|
|
@@ -861,13 +885,13 @@ var Place = import_zod14.z.object({
|
|
|
861
885
|
}).describe("Place");
|
|
862
886
|
var placeEntityTypeSchema = {
|
|
863
887
|
oneOf: [
|
|
864
|
-
{ type: "string", const: "
|
|
888
|
+
{ type: "string", const: "crm:E53_Place" },
|
|
865
889
|
{
|
|
866
890
|
type: "array",
|
|
867
891
|
minItems: 2,
|
|
868
892
|
maxItems: 2,
|
|
869
893
|
items: [
|
|
870
|
-
{ type: "string", const: "
|
|
894
|
+
{ type: "string", const: "biography:fictionalPlace" },
|
|
871
895
|
{ type: "string", const: "crm:E89_Propositional_Object" }
|
|
872
896
|
]
|
|
873
897
|
}
|
|
@@ -895,13 +919,13 @@ var placeSchema = {
|
|
|
895
919
|
then: {
|
|
896
920
|
type: "object",
|
|
897
921
|
properties: {
|
|
898
|
-
entityType: "
|
|
922
|
+
entityType: "crm:E53_Place"
|
|
899
923
|
}
|
|
900
924
|
},
|
|
901
925
|
else: {
|
|
902
926
|
type: "object",
|
|
903
927
|
properties: {
|
|
904
|
-
entityType: ["
|
|
928
|
+
entityType: ["biography:fictionalPlace", "crm:E89_Propositional_Object"]
|
|
905
929
|
}
|
|
906
930
|
}
|
|
907
931
|
}
|
|
@@ -1150,10 +1174,10 @@ var bodySchema = {
|
|
|
1150
1174
|
};
|
|
1151
1175
|
|
|
1152
1176
|
// src/v1/schema/definitions/target/index.ts
|
|
1153
|
-
var
|
|
1177
|
+
var import_zod25 = require("zod");
|
|
1154
1178
|
|
|
1155
1179
|
// src/v1/schema/definitions/target/selector/index.ts
|
|
1156
|
-
var
|
|
1180
|
+
var import_zod23 = require("zod");
|
|
1157
1181
|
|
|
1158
1182
|
// src/v1/schema/definitions/target/selector/range.ts
|
|
1159
1183
|
var import_zod21 = require("zod");
|
|
@@ -1361,13 +1385,64 @@ var rangeSelectorSchema = {
|
|
|
1361
1385
|
required: ["id", "type", "startSelector", "endSelector"]
|
|
1362
1386
|
};
|
|
1363
1387
|
|
|
1388
|
+
// src/v1/schema/definitions/target/selector/css.ts
|
|
1389
|
+
var import_zod22 = require("zod");
|
|
1390
|
+
var CssSelector = import_zod22.z.object({
|
|
1391
|
+
id: import_zod22.z.string().describe(selectorIdDescription),
|
|
1392
|
+
type: import_zod22.z.tuple([import_zod22.z.literal("CssSelector"), import_zod22.z.literal("crm:E73_Information_Object")]),
|
|
1393
|
+
value: import_zod22.z.string().min(1).describe("The CSS to the selected a segment.")
|
|
1394
|
+
}).describe("CSS Selector");
|
|
1395
|
+
var CssSelectorExtended = CssSelector.extend({
|
|
1396
|
+
refinedBy: import_zod22.z.union([TextPositionSelector, TextQuoteSelector]).optional().describe(selectorRefinedByDescription)
|
|
1397
|
+
});
|
|
1398
|
+
var cssSelectorSchema = {
|
|
1399
|
+
type: "object",
|
|
1400
|
+
description: "Css Selector",
|
|
1401
|
+
properties: {
|
|
1402
|
+
id: { type: "string", format: "uri", description: selectorIdDescription },
|
|
1403
|
+
type: {
|
|
1404
|
+
type: "array",
|
|
1405
|
+
minItems: 2,
|
|
1406
|
+
maxItems: 2,
|
|
1407
|
+
items: [
|
|
1408
|
+
{ type: "string", const: "CssSelector" },
|
|
1409
|
+
{ type: "string", const: "crm:E73_Information_Object" }
|
|
1410
|
+
],
|
|
1411
|
+
description: "The class of the Selector,"
|
|
1412
|
+
},
|
|
1413
|
+
value: {
|
|
1414
|
+
type: "string",
|
|
1415
|
+
description: "Web Annotation Target Select CSS"
|
|
1416
|
+
}
|
|
1417
|
+
},
|
|
1418
|
+
required: ["id", "type", "value"]
|
|
1419
|
+
};
|
|
1420
|
+
var cssSelectorExtendedSchema = {
|
|
1421
|
+
type: "object",
|
|
1422
|
+
description: "CSS Selector",
|
|
1423
|
+
properties: {
|
|
1424
|
+
...cssSelectorSchema.properties,
|
|
1425
|
+
refinedBy: {
|
|
1426
|
+
type: "object",
|
|
1427
|
+
description: selectorRefinedByDescription,
|
|
1428
|
+
anyOf: [
|
|
1429
|
+
{ $ref: "defs.jsonld#/definitions/textPositionSelector" },
|
|
1430
|
+
{ $ref: "defs.jsonld#/definitions/textQuoteSelector" }
|
|
1431
|
+
],
|
|
1432
|
+
required: []
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
required: ["id", "type", "value"]
|
|
1436
|
+
};
|
|
1437
|
+
|
|
1364
1438
|
// src/v1/schema/definitions/target/selector/index.ts
|
|
1365
1439
|
var selectorIdDescription = "UUID that identifies the selector.";
|
|
1366
1440
|
var selectorRefinedByDescription = "The relationship between a broader selector and the more specific selector that should be applied to the results of the first.";
|
|
1367
|
-
var Selector =
|
|
1441
|
+
var Selector = import_zod23.z.union([
|
|
1368
1442
|
TextQuoteSelectorExtended,
|
|
1369
1443
|
TextPositionSelectorExtended,
|
|
1370
1444
|
XpathSelectorExtended,
|
|
1445
|
+
CssSelectorExtended,
|
|
1371
1446
|
RangeSelector
|
|
1372
1447
|
]);
|
|
1373
1448
|
var selectorSchema = {
|
|
@@ -1376,22 +1451,23 @@ var selectorSchema = {
|
|
|
1376
1451
|
textQuoteSelectorExtendedSchema,
|
|
1377
1452
|
textPositionSelectorExtendedSchema,
|
|
1378
1453
|
xpathSelectorExtendedSchema,
|
|
1454
|
+
cssSelectorExtendedSchema,
|
|
1379
1455
|
rangeSelectorSchema
|
|
1380
1456
|
],
|
|
1381
1457
|
required: []
|
|
1382
1458
|
};
|
|
1383
1459
|
|
|
1384
1460
|
// src/v1/schema/definitions/target/source.ts
|
|
1385
|
-
var
|
|
1461
|
+
var import_zod24 = require("zod");
|
|
1386
1462
|
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.";
|
|
1387
|
-
var Format =
|
|
1463
|
+
var Format = import_zod24.z.string().min(1).describe(formatDescription);
|
|
1388
1464
|
var formatSchema = {
|
|
1389
1465
|
type: "string",
|
|
1390
1466
|
description: formatDescription,
|
|
1391
1467
|
minLength: 1
|
|
1392
1468
|
};
|
|
1393
1469
|
var languageDescription = "The language of the Web Resource's content. The value of the property should be a language code following the [bcp47] specification.";
|
|
1394
|
-
var Language =
|
|
1470
|
+
var Language = import_zod24.z.string().min(2).max(3).describe(languageDescription);
|
|
1395
1471
|
var languageSchema = {
|
|
1396
1472
|
type: "string",
|
|
1397
1473
|
description: languageDescription,
|
|
@@ -1399,19 +1475,19 @@ var languageSchema = {
|
|
|
1399
1475
|
maxLength: 3
|
|
1400
1476
|
};
|
|
1401
1477
|
var sourceIdDescription = "The IRI that identifies the Target source.";
|
|
1402
|
-
var isIdentifiedBy =
|
|
1403
|
-
id:
|
|
1404
|
-
type:
|
|
1405
|
-
title:
|
|
1478
|
+
var isIdentifiedBy = import_zod24.z.object({
|
|
1479
|
+
id: import_zod24.z.string().url(),
|
|
1480
|
+
type: import_zod24.z.literal("crm:E33_E41_Linguistic_Appellation"),
|
|
1481
|
+
title: import_zod24.z.string().min(1).describe("The title of the document being annotated.")
|
|
1406
1482
|
});
|
|
1407
|
-
var Source =
|
|
1408
|
-
id:
|
|
1409
|
-
type:
|
|
1410
|
-
format:
|
|
1483
|
+
var Source = import_zod24.z.object({
|
|
1484
|
+
id: import_zod24.z.string().url().describe(sourceIdDescription),
|
|
1485
|
+
type: import_zod24.z.literal("crm:D1_Digital_Object"),
|
|
1486
|
+
format: import_zod24.z.union([Format, import_zod24.z.array(Format).min(1)]).describe(
|
|
1411
1487
|
"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."
|
|
1412
1488
|
),
|
|
1413
1489
|
P1_is_identified_by: isIdentifiedBy.optional(),
|
|
1414
|
-
language:
|
|
1490
|
+
language: import_zod24.z.union([Language, import_zod24.z.array(Language).min(1)]).optional().describe(
|
|
1415
1491
|
"The languages of the Web Resource's content. The value of the property should be an array of language code following the [bcp47] specification."
|
|
1416
1492
|
)
|
|
1417
1493
|
}).describe("Web Annotation Target");
|
|
@@ -1437,7 +1513,6 @@ var sourceSchema = {
|
|
|
1437
1513
|
type: { type: "string", const: "crm:D1_Digital_Object" },
|
|
1438
1514
|
format: {
|
|
1439
1515
|
type: ["string", "array"],
|
|
1440
|
-
nullable: true,
|
|
1441
1516
|
anyOf: [
|
|
1442
1517
|
formatSchema,
|
|
1443
1518
|
{
|
|
@@ -1461,27 +1536,21 @@ var sourceSchema = {
|
|
|
1461
1536
|
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."
|
|
1462
1537
|
}
|
|
1463
1538
|
]
|
|
1464
|
-
},
|
|
1465
|
-
title: {
|
|
1466
|
-
type: "string",
|
|
1467
|
-
minLength: 1,
|
|
1468
|
-
nullable: true,
|
|
1469
|
-
description: "The title of the document being annotated."
|
|
1470
1539
|
}
|
|
1471
1540
|
},
|
|
1472
|
-
required: ["id", "type"]
|
|
1541
|
+
required: ["id", "type", "format"]
|
|
1473
1542
|
};
|
|
1474
1543
|
|
|
1475
1544
|
// src/v1/schema/definitions/target/index.ts
|
|
1476
1545
|
var targetIdDescription = "The IRI that identifies the Target resource.";
|
|
1477
|
-
var Target =
|
|
1478
|
-
id:
|
|
1479
|
-
type:
|
|
1546
|
+
var Target = import_zod25.z.object({
|
|
1547
|
+
id: import_zod25.z.string().url().describe(targetIdDescription),
|
|
1548
|
+
type: import_zod25.z.tuple([import_zod25.z.literal("SpecificResource"), import_zod25.z.literal("crm:E73_Information_Object")]).describe("The class of the Specific Resource."),
|
|
1480
1549
|
source: Source,
|
|
1481
1550
|
renderedVia: Software.optional().describe(
|
|
1482
1551
|
"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."
|
|
1483
1552
|
),
|
|
1484
|
-
selector:
|
|
1553
|
+
selector: import_zod25.z.union([Selector, import_zod25.z.array(Selector)]).describe("The relationship between a Specific Resource and a Selector.").optional()
|
|
1485
1554
|
}).describe("Web Annotation Target");
|
|
1486
1555
|
var targetSchema = {
|
|
1487
1556
|
type: "object",
|
|
@@ -1597,6 +1666,33 @@ var targetSchema = {
|
|
|
1597
1666
|
}
|
|
1598
1667
|
}
|
|
1599
1668
|
},
|
|
1669
|
+
{
|
|
1670
|
+
if: {
|
|
1671
|
+
type: "object",
|
|
1672
|
+
properties: {
|
|
1673
|
+
selector: {
|
|
1674
|
+
type: "object",
|
|
1675
|
+
properties: {
|
|
1676
|
+
type: {
|
|
1677
|
+
type: "array",
|
|
1678
|
+
minItems: 2,
|
|
1679
|
+
maxItems: 2,
|
|
1680
|
+
items: [
|
|
1681
|
+
{ type: "string", const: "CssSelector" },
|
|
1682
|
+
{ type: "string", const: "crm:E73_Information_Object" }
|
|
1683
|
+
]
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
then: {
|
|
1690
|
+
type: "object",
|
|
1691
|
+
properties: {
|
|
1692
|
+
selector: { type: "object", required: ["type", "value"] }
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
},
|
|
1600
1696
|
{
|
|
1601
1697
|
if: {
|
|
1602
1698
|
type: "object",
|
|
@@ -1628,7 +1724,7 @@ var targetSchema = {
|
|
|
1628
1724
|
};
|
|
1629
1725
|
|
|
1630
1726
|
// src/v1/schema/definitions/common.ts
|
|
1631
|
-
var
|
|
1727
|
+
var import_zod26 = require("zod");
|
|
1632
1728
|
var Quality = [
|
|
1633
1729
|
"edit:qualityLow",
|
|
1634
1730
|
"edit:qualityMedium",
|
|
@@ -1636,14 +1732,14 @@ var Quality = [
|
|
|
1636
1732
|
"edit:qualityUnknown"
|
|
1637
1733
|
];
|
|
1638
1734
|
var certaintyDescription = "Indicates the degree of certainty associated with some aspect of an assertion, description, identification, or entity linked to the annotation body.";
|
|
1639
|
-
var Certainty =
|
|
1735
|
+
var Certainty = import_zod26.z.enum(Quality).describe(certaintyDescription);
|
|
1640
1736
|
var certaintySchema = {
|
|
1641
1737
|
type: "string",
|
|
1642
1738
|
enum: Quality,
|
|
1643
1739
|
description: certaintyDescription
|
|
1644
1740
|
};
|
|
1645
1741
|
var precisionDescription = "Indicates the degree of precision associated with the location of the entity linked to the annotation body.";
|
|
1646
|
-
var Precision =
|
|
1742
|
+
var Precision = import_zod26.z.enum(Quality).describe(precisionDescription);
|
|
1647
1743
|
var precisionSchema = {
|
|
1648
1744
|
type: "string",
|
|
1649
1745
|
enum: Quality,
|
|
@@ -1655,7 +1751,8 @@ var definitionSchema = {
|
|
|
1655
1751
|
$id: defsId,
|
|
1656
1752
|
type: "object",
|
|
1657
1753
|
definitions: {
|
|
1658
|
-
|
|
1754
|
+
user: userSchema,
|
|
1755
|
+
group: groupSchema,
|
|
1659
1756
|
software: softwareSchema,
|
|
1660
1757
|
target: targetSchema,
|
|
1661
1758
|
textPositionSelector: textPositionSelectorSchema,
|
|
@@ -1669,7 +1766,7 @@ var definitionSchema = {
|
|
|
1669
1766
|
};
|
|
1670
1767
|
|
|
1671
1768
|
// src/v1/schema/root.ts
|
|
1672
|
-
var
|
|
1769
|
+
var import_zod27 = require("zod");
|
|
1673
1770
|
var Motivation = [
|
|
1674
1771
|
"oa:identifying",
|
|
1675
1772
|
"oa:describing",
|
|
@@ -1679,30 +1776,30 @@ var Motivation = [
|
|
|
1679
1776
|
"oa:linking",
|
|
1680
1777
|
"citing"
|
|
1681
1778
|
];
|
|
1682
|
-
var WebAnnotation =
|
|
1683
|
-
"@context":
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1779
|
+
var WebAnnotation = import_zod27.z.object({
|
|
1780
|
+
"@context": import_zod27.z.tuple([
|
|
1781
|
+
import_zod27.z.literal("http://www.w3.org/ns/anno.jsonld").describe("W3C Web Annotation Context."),
|
|
1782
|
+
import_zod27.z.literal("https://www.cidoc-crm.org/cidoc-crm/json-ld_context.jsonld").describe("CIDOC Web Annotation Context."),
|
|
1783
|
+
import_zod27.z.literal(contextUri).describe("LINCS Web Annotation Context.")
|
|
1687
1784
|
]).describe(
|
|
1688
1785
|
"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."
|
|
1689
1786
|
),
|
|
1690
|
-
id:
|
|
1691
|
-
type:
|
|
1692
|
-
motivation:
|
|
1693
|
-
created:
|
|
1694
|
-
modified:
|
|
1695
|
-
creator: User.describe("The agent responsible for creating the resource.").optional(),
|
|
1696
|
-
contributor:
|
|
1787
|
+
id: import_zod27.z.string().url().describe("The identity of the Annotation."),
|
|
1788
|
+
type: import_zod27.z.tuple([import_zod27.z.literal("Annotation"), import_zod27.z.literal("crm:E33_Linguistic_Object")]).describe("The type of the Annotation."),
|
|
1789
|
+
motivation: import_zod27.z.enum(Motivation).describe("The relationship between an Annotation and a Motivation."),
|
|
1790
|
+
created: import_zod27.z.string().datetime().describe("The time at which the resource was created."),
|
|
1791
|
+
modified: import_zod27.z.string().datetime().optional().describe("The time at which the resource was modified, after creation."),
|
|
1792
|
+
creator: import_zod27.z.union([User, Group, Software]).describe("The agent responsible for creating the resource.").optional(),
|
|
1793
|
+
contributor: import_zod27.z.array(import_zod27.z.union([User, Group, Software])).nonempty().optional().describe("The agents responsible for modifying the resource."),
|
|
1697
1794
|
generator: Software.describe(
|
|
1698
1795
|
"The agent responsible for generating the serialization of the Annotation. "
|
|
1699
1796
|
),
|
|
1700
|
-
target: Target.describe("The relationship between an Annotation and its Target."),
|
|
1701
|
-
body:
|
|
1797
|
+
target: import_zod27.z.union([Target, import_zod27.z.array(Target)]).describe("The relationship between an Annotation and its Target."),
|
|
1798
|
+
body: import_zod27.z.union([BodyChoice, Body, import_zod27.z.array(Body)]).describe("The relationship between an Annotation and its Body."),
|
|
1702
1799
|
certainty: Certainty.optional(),
|
|
1703
1800
|
precision: Precision.optional(),
|
|
1704
|
-
label:
|
|
1705
|
-
P2_has_type:
|
|
1801
|
+
label: import_zod27.z.string().min(1, { message: "The label cannot be empty" }).optional().describe("The descriptive label for the annotation"),
|
|
1802
|
+
P2_has_type: import_zod27.z.union([import_zod27.z.string().min(3), import_zod27.z.array(import_zod27.z.string().min(3)).min(1)]).optional()
|
|
1706
1803
|
}).describe("Web Annotation Root");
|
|
1707
1804
|
var webAnnotationSchema = {
|
|
1708
1805
|
$id: schemaId,
|
|
@@ -1750,16 +1847,38 @@ var webAnnotationSchema = {
|
|
|
1750
1847
|
format: "date-time",
|
|
1751
1848
|
description: "The time at which the resource was modified, after creation."
|
|
1752
1849
|
},
|
|
1753
|
-
creator: {
|
|
1754
|
-
|
|
1850
|
+
creator: {
|
|
1851
|
+
oneOf: [
|
|
1852
|
+
{ $ref: "defs.jsonld#/definitions/user" },
|
|
1853
|
+
{ $ref: "defs.jsonld#/definitions/group" },
|
|
1854
|
+
{ $ref: "defs.jsonld#/definitions/software" }
|
|
1855
|
+
]
|
|
1856
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1857
|
+
},
|
|
1755
1858
|
contributor: {
|
|
1756
1859
|
type: "array",
|
|
1757
|
-
items: {
|
|
1860
|
+
items: {
|
|
1861
|
+
oneOf: [
|
|
1862
|
+
{ $ref: "defs.jsonld#/definitions/user" },
|
|
1863
|
+
{ $ref: "defs.jsonld#/definitions/group" },
|
|
1864
|
+
{ $ref: "defs.jsonld#/definitions/software" }
|
|
1865
|
+
]
|
|
1866
|
+
},
|
|
1758
1867
|
minItems: 1
|
|
1759
1868
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1760
1869
|
},
|
|
1761
1870
|
generator: { $ref: "defs.jsonld#/definitions/software" },
|
|
1762
|
-
target: {
|
|
1871
|
+
target: {
|
|
1872
|
+
oneOf: [
|
|
1873
|
+
{ $ref: "defs.jsonld#/definitions/target" },
|
|
1874
|
+
{
|
|
1875
|
+
type: "array",
|
|
1876
|
+
items: { $ref: "defs.jsonld#/definitions/target" },
|
|
1877
|
+
minItems: 1
|
|
1878
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1879
|
+
}
|
|
1880
|
+
]
|
|
1881
|
+
},
|
|
1763
1882
|
body: {
|
|
1764
1883
|
oneOf: [
|
|
1765
1884
|
{ $ref: "defs.jsonld#/definitions/bodyChoice" },
|
|
@@ -1946,18 +2065,18 @@ var import_ajv = __toESM(require("ajv"));
|
|
|
1946
2065
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
1947
2066
|
|
|
1948
2067
|
// src/v1/validator/types.ts
|
|
1949
|
-
var
|
|
1950
|
-
var ValidationError =
|
|
1951
|
-
message:
|
|
1952
|
-
path:
|
|
1953
|
-
suggestion:
|
|
1954
|
-
context:
|
|
1955
|
-
errorType:
|
|
1956
|
-
}).and(
|
|
2068
|
+
var import_zod28 = require("zod");
|
|
2069
|
+
var ValidationError = import_zod28.z.object({
|
|
2070
|
+
message: import_zod28.z.string(),
|
|
2071
|
+
path: import_zod28.z.string(),
|
|
2072
|
+
suggestion: import_zod28.z.string().optional(),
|
|
2073
|
+
context: import_zod28.z.object({
|
|
2074
|
+
errorType: import_zod28.z.string()
|
|
2075
|
+
}).and(import_zod28.z.unknown())
|
|
1957
2076
|
});
|
|
1958
|
-
var ValidateResult =
|
|
1959
|
-
valid:
|
|
1960
|
-
errors:
|
|
2077
|
+
var ValidateResult = import_zod28.z.object({
|
|
2078
|
+
valid: import_zod28.z.boolean(),
|
|
2079
|
+
errors: import_zod28.z.array(ValidationError).optional()
|
|
1961
2080
|
});
|
|
1962
2081
|
|
|
1963
2082
|
// src/v1/validator/index.ts
|
|
@@ -2006,6 +2125,7 @@ __export(v1_exports, {
|
|
|
2006
2125
|
Description: () => Description,
|
|
2007
2126
|
Event: () => Event,
|
|
2008
2127
|
EventEntityType: () => EventEntityType,
|
|
2128
|
+
Group: () => Group,
|
|
2009
2129
|
Keyword: () => Keyword,
|
|
2010
2130
|
KeywordEntityType: () => KeywordEntityType,
|
|
2011
2131
|
KeywordFolksnomy: () => KeywordFolksnomy,
|
|
@@ -2058,7 +2178,6 @@ __export(v1_exports, {
|
|
|
2058
2178
|
contextUri: () => contextUri,
|
|
2059
2179
|
correctionEntityTypeSchema: () => correctionEntityTypeSchema,
|
|
2060
2180
|
correctionSchema: () => correctionSchema,
|
|
2061
|
-
creatorSchema: () => creatorSchema,
|
|
2062
2181
|
dateEntityTypeSchema: () => dateEntityTypeSchema,
|
|
2063
2182
|
dateSchema: () => dateSchema,
|
|
2064
2183
|
definitionSchema: () => definitionSchema,
|
|
@@ -2067,6 +2186,7 @@ __export(v1_exports, {
|
|
|
2067
2186
|
eventEntityTypeSchema: () => eventEntityTypeSchema,
|
|
2068
2187
|
eventSchema: () => eventSchema,
|
|
2069
2188
|
formatSchema: () => formatSchema,
|
|
2189
|
+
groupSchema: () => groupSchema,
|
|
2070
2190
|
isIdentifiedBy: () => isIdentifiedBy,
|
|
2071
2191
|
isIndentifyBySchema: () => isIndentifyBySchema,
|
|
2072
2192
|
keywordEntityTypeSchema: () => keywordEntityTypeSchema,
|
|
@@ -2102,6 +2222,7 @@ __export(v1_exports, {
|
|
|
2102
2222
|
textPositionSelectorSchema: () => textPositionSelectorSchema,
|
|
2103
2223
|
textQuoteSelectorExtendedSchema: () => textQuoteSelectorExtendedSchema,
|
|
2104
2224
|
textQuoteSelectorSchema: () => textQuoteSelectorSchema,
|
|
2225
|
+
userSchema: () => userSchema,
|
|
2105
2226
|
validate: () => validate,
|
|
2106
2227
|
validator: () => validator,
|
|
2107
2228
|
webAnnotationSchema: () => webAnnotationSchema,
|
|
@@ -2128,6 +2249,7 @@ __export(v1_exports, {
|
|
|
2128
2249
|
Description,
|
|
2129
2250
|
Event,
|
|
2130
2251
|
EventEntityType,
|
|
2252
|
+
Group,
|
|
2131
2253
|
Keyword,
|
|
2132
2254
|
KeywordEntityType,
|
|
2133
2255
|
KeywordFolksnomy,
|
|
@@ -2180,7 +2302,6 @@ __export(v1_exports, {
|
|
|
2180
2302
|
contextUri,
|
|
2181
2303
|
correctionEntityTypeSchema,
|
|
2182
2304
|
correctionSchema,
|
|
2183
|
-
creatorSchema,
|
|
2184
2305
|
dateEntityTypeSchema,
|
|
2185
2306
|
dateSchema,
|
|
2186
2307
|
definitionSchema,
|
|
@@ -2189,6 +2310,7 @@ __export(v1_exports, {
|
|
|
2189
2310
|
eventEntityTypeSchema,
|
|
2190
2311
|
eventSchema,
|
|
2191
2312
|
formatSchema,
|
|
2313
|
+
groupSchema,
|
|
2192
2314
|
isIdentifiedBy,
|
|
2193
2315
|
isIndentifyBySchema,
|
|
2194
2316
|
keywordEntityTypeSchema,
|
|
@@ -2224,6 +2346,7 @@ __export(v1_exports, {
|
|
|
2224
2346
|
textPositionSelectorSchema,
|
|
2225
2347
|
textQuoteSelectorExtendedSchema,
|
|
2226
2348
|
textQuoteSelectorSchema,
|
|
2349
|
+
userSchema,
|
|
2227
2350
|
v1,
|
|
2228
2351
|
validate,
|
|
2229
2352
|
validator,
|