@twin.org/standards-w3c-odrl 0.9.3-next.2 → 0.10.1-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/es/compiled/validators.js +4120 -0
  2. package/dist/es/compiled/validators.js.map +1 -0
  3. package/dist/es/dataTypes/odrlDataTypes.js +61 -28
  4. package/dist/es/dataTypes/odrlDataTypes.js.map +1 -1
  5. package/dist/es/index.js +1 -0
  6. package/dist/es/index.js.map +1 -1
  7. package/dist/types/compiled/validators.d.ts +105 -0
  8. package/dist/types/index.d.ts +1 -0
  9. package/docs/changelog.md +72 -0
  10. package/docs/reference/index.md +26 -0
  11. package/docs/reference/variables/CompiledOdrlAction.md +5 -0
  12. package/docs/reference/variables/CompiledOdrlActionType.md +5 -0
  13. package/docs/reference/variables/CompiledOdrlAgreement.md +5 -0
  14. package/docs/reference/variables/CompiledOdrlAsset.md +5 -0
  15. package/docs/reference/variables/CompiledOdrlAssetCollection.md +5 -0
  16. package/docs/reference/variables/CompiledOdrlConflictStrategyType.md +5 -0
  17. package/docs/reference/variables/CompiledOdrlConstraint.md +5 -0
  18. package/docs/reference/variables/CompiledOdrlContextType.md +5 -0
  19. package/docs/reference/variables/CompiledOdrlDuty.md +5 -0
  20. package/docs/reference/variables/CompiledOdrlLeftOperandType.md +5 -0
  21. package/docs/reference/variables/CompiledOdrlLogicalConstraint.md +5 -0
  22. package/docs/reference/variables/CompiledOdrlLogicalConstraintOperand.md +5 -0
  23. package/docs/reference/variables/CompiledOdrlLogicalConstraintType.md +5 -0
  24. package/docs/reference/variables/CompiledOdrlOffer.md +5 -0
  25. package/docs/reference/variables/CompiledOdrlOperatorType.md +5 -0
  26. package/docs/reference/variables/CompiledOdrlParty.md +5 -0
  27. package/docs/reference/variables/CompiledOdrlPartyCollection.md +5 -0
  28. package/docs/reference/variables/CompiledOdrlPermission.md +5 -0
  29. package/docs/reference/variables/CompiledOdrlPolicy.md +5 -0
  30. package/docs/reference/variables/CompiledOdrlPolicyType.md +5 -0
  31. package/docs/reference/variables/CompiledOdrlProhibition.md +5 -0
  32. package/docs/reference/variables/CompiledOdrlRightOperandType.md +5 -0
  33. package/docs/reference/variables/CompiledOdrlRule.md +5 -0
  34. package/docs/reference/variables/CompiledOdrlRuleType.md +5 -0
  35. package/docs/reference/variables/CompiledOdrlSet.md +5 -0
  36. package/docs/reference/variables/CompiledOdrlStatusType.md +5 -0
  37. package/package.json +1 -1
@@ -0,0 +1,4120 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ // This file is generated by ts-to-schema, do not edit it directly.
4
+ // @ts-nocheck
5
+ /* cspell:disable */
6
+ import { JsonSchemaFormats } from "@twin.org/data-core";
7
+ import * as external0 from "@twin.org/data-json-ld";
8
+ import * as external1 from "../models/types/odrlLeftOperandType.js";
9
+ import * as external2 from "../models/types/odrlOperatorType.js";
10
+ import * as external3 from "../models/types/odrlStatusType.js";
11
+ import * as external4 from "../models/types/odrlActionType.js";
12
+ import * as external5 from "../models/types/odrlPolicyType.js";
13
+ import * as external6 from "../models/types/odrlConflictStrategyType.js";
14
+ import * as external7 from "../models/types/odrlLogicalConstraintType.js";
15
+ import * as external8 from "../models/types/odrlRuleType.js";
16
+ import * as external9 from "../models/types/odrlRightOperandType.js";
17
+ const MESSAGES = ["must be equal to constant", "must NOT have fewer than 1 items", "must match a schema in anyOf", "must contain at least 1 and no more than 1 valid item(s)", "must be array", "must be string", "must be object"];
18
+ function createError(instancePath, schemaPath, keyword, params, message) {
19
+ return { instancePath, schemaPath, keyword, params, ["message"]: typeof message === "number" ? MESSAGES[message] : message };
20
+ }
21
+ function pushError(errors, error) {
22
+ if (errors === null) {
23
+ return [error];
24
+ }
25
+ errors.push(error);
26
+ return errors;
27
+ }
28
+ /**
29
+ * Compiled validator for the OdrlContextType schema.
30
+ */
31
+ export const CompiledOdrlContextType = validate52;
32
+ const keyword0 = external0["CompiledJsonLdContextDefinitionElement"];
33
+ function validate52(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
34
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlContextType" */ ;
35
+ let vErrors = null;
36
+ let errors = 0;
37
+ const evaluated0 = validate52.evaluated;
38
+ if (evaluated0.dynamicProps) {
39
+ evaluated0.props = undefined;
40
+ }
41
+ if (evaluated0.dynamicItems) {
42
+ evaluated0.items = undefined;
43
+ }
44
+ const _errs0 = errors;
45
+ let valid0 = false;
46
+ const _errs1 = errors;
47
+ if ("http://www.w3.org/ns/odrl.jsonld" !== data) {
48
+ const err0 = createError(instancePath, "#/anyOf/0/const", "const", { allowedValue: "http://www.w3.org/ns/odrl.jsonld" }, 0);
49
+ vErrors = pushError(vErrors, err0);
50
+ errors++;
51
+ }
52
+ var _valid0 = _errs1 === errors;
53
+ valid0 = valid0 || _valid0;
54
+ const _errs2 = errors;
55
+ if (Array.isArray(data)) {
56
+ if (data.length < 1) {
57
+ const err1 = createError(instancePath, "#/anyOf/1/minItems", "minItems", { limit: 1 }, 1);
58
+ vErrors = pushError(vErrors, err1);
59
+ errors++;
60
+ }
61
+ const len0 = data.length;
62
+ for (let i0 = 0; i0 < len0; i0++) {
63
+ let data0 = data[i0];
64
+ const _errs5 = errors;
65
+ let valid3 = false;
66
+ const _errs6 = errors;
67
+ if (!(keyword0(data0, { instancePath: instancePath + "/" + i0, parentData: data, parentDataProperty: i0, rootData, dynamicAnchors }))) {
68
+ vErrors = vErrors === null ? keyword0.errors : vErrors.concat(keyword0.errors);
69
+ errors = vErrors.length;
70
+ }
71
+ var _valid1 = _errs6 === errors;
72
+ valid3 = valid3 || _valid1;
73
+ const _errs7 = errors;
74
+ if ("http://www.w3.org/ns/odrl.jsonld" !== data0) {
75
+ const err2 = createError(instancePath + "/" + i0, "#/anyOf/1/items/anyOf/1/const", "const", { allowedValue: "http://www.w3.org/ns/odrl.jsonld" }, 0);
76
+ vErrors = pushError(vErrors, err2);
77
+ errors++;
78
+ }
79
+ var _valid1 = _errs7 === errors;
80
+ valid3 = valid3 || _valid1;
81
+ if (!valid3) {
82
+ const err3 = createError(instancePath + "/" + i0, "#/anyOf/1/items/anyOf", "anyOf", {}, 2);
83
+ vErrors = pushError(vErrors, err3);
84
+ errors++;
85
+ }
86
+ else {
87
+ errors = _errs5;
88
+ if (vErrors !== null) {
89
+ if (_errs5) {
90
+ vErrors.length = _errs5;
91
+ }
92
+ else {
93
+ vErrors = null;
94
+ }
95
+ }
96
+ }
97
+ }
98
+ const _errs8 = errors;
99
+ const len1 = data.length;
100
+ let valid4 = false;
101
+ let count0 = 0;
102
+ for (let i1 = 0; i1 < len1; i1++) {
103
+ const _errs9 = errors;
104
+ if ("http://www.w3.org/ns/odrl.jsonld" !== data[i1]) {
105
+ const err4 = createError(instancePath + "/" + i1, "#/anyOf/1/contains/const", "const", { allowedValue: "http://www.w3.org/ns/odrl.jsonld" }, 0);
106
+ vErrors = pushError(vErrors, err4);
107
+ errors++;
108
+ }
109
+ var _valid2 = _errs9 === errors;
110
+ if (_valid2) {
111
+ count0++;
112
+ if (count0 > 1) {
113
+ valid4 = false;
114
+ break;
115
+ }
116
+ valid4 = true;
117
+ }
118
+ }
119
+ if (!valid4) {
120
+ const err5 = createError(instancePath, "#/anyOf/1/contains", "contains", { minContains: 1, maxContains: 1 }, 3);
121
+ vErrors = pushError(vErrors, err5);
122
+ errors++;
123
+ }
124
+ else {
125
+ errors = _errs8;
126
+ if (vErrors !== null) {
127
+ if (_errs8) {
128
+ vErrors.length = _errs8;
129
+ }
130
+ else {
131
+ vErrors = null;
132
+ }
133
+ }
134
+ }
135
+ }
136
+ else {
137
+ const err6 = createError(instancePath, "#/anyOf/1/type", "type", { type: "array" }, 4);
138
+ vErrors = pushError(vErrors, err6);
139
+ errors++;
140
+ }
141
+ var _valid0 = _errs2 === errors;
142
+ valid0 = valid0 || _valid0;
143
+ if (_valid0) {
144
+ var items0 = true;
145
+ }
146
+ if (!valid0) {
147
+ const err7 = createError(instancePath, "#/anyOf", "anyOf", {}, 2);
148
+ vErrors = pushError(vErrors, err7);
149
+ errors++;
150
+ }
151
+ else {
152
+ errors = _errs0;
153
+ if (vErrors !== null) {
154
+ if (_errs0) {
155
+ vErrors.length = _errs0;
156
+ }
157
+ else {
158
+ vErrors = null;
159
+ }
160
+ }
161
+ }
162
+ validate52.errors = vErrors;
163
+ evaluated0.items = items0;
164
+ return errors === 0;
165
+ }
166
+ validate52.evaluated = { "dynamicProps": false, "dynamicItems": true };
167
+ /**
168
+ * Compiled validator for the OdrlAction schema.
169
+ */
170
+ export const CompiledOdrlAction = validate53;
171
+ const keyword1 = Object.values(external1["OdrlLeftOperandType"]);
172
+ function validate55(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
173
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlLeftOperandType" */ ;
174
+ let vErrors = null;
175
+ let errors = 0;
176
+ const evaluated0 = validate55.evaluated;
177
+ if (evaluated0.dynamicProps) {
178
+ evaluated0.props = undefined;
179
+ }
180
+ if (evaluated0.dynamicItems) {
181
+ evaluated0.items = undefined;
182
+ }
183
+ if (!keyword1.includes(data)) {
184
+ for (let i0 = 0; i0 < keyword1.length; i0++) {
185
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword1[i0] }, "must be equal to constant"));
186
+ errors++;
187
+ }
188
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
189
+ errors++;
190
+ }
191
+ validate55.errors = vErrors;
192
+ return errors === 0;
193
+ }
194
+ validate55.evaluated = { "dynamicProps": false, "dynamicItems": false };
195
+ const keyword2 = Object.values(external2["OdrlOperatorType"]);
196
+ function validate57(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
197
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlOperatorType" */ ;
198
+ let vErrors = null;
199
+ let errors = 0;
200
+ const evaluated0 = validate57.evaluated;
201
+ if (evaluated0.dynamicProps) {
202
+ evaluated0.props = undefined;
203
+ }
204
+ if (evaluated0.dynamicItems) {
205
+ evaluated0.items = undefined;
206
+ }
207
+ if (!keyword2.includes(data)) {
208
+ for (let i0 = 0; i0 < keyword2.length; i0++) {
209
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword2[i0] }, "must be equal to constant"));
210
+ errors++;
211
+ }
212
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
213
+ errors++;
214
+ }
215
+ validate57.errors = vErrors;
216
+ return errors === 0;
217
+ }
218
+ validate57.evaluated = { "dynamicProps": false, "dynamicItems": false };
219
+ const keyword3 = Object.values(external3["OdrlStatusType"]);
220
+ function validate59(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
221
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlStatusType" */ ;
222
+ let vErrors = null;
223
+ let errors = 0;
224
+ const evaluated0 = validate59.evaluated;
225
+ if (evaluated0.dynamicProps) {
226
+ evaluated0.props = undefined;
227
+ }
228
+ if (evaluated0.dynamicItems) {
229
+ evaluated0.items = undefined;
230
+ }
231
+ if (!keyword3.includes(data)) {
232
+ for (let i0 = 0; i0 < keyword3.length; i0++) {
233
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword3[i0] }, "must be equal to constant"));
234
+ errors++;
235
+ }
236
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
237
+ errors++;
238
+ }
239
+ validate59.errors = vErrors;
240
+ return errors === 0;
241
+ }
242
+ validate59.evaluated = { "dynamicProps": false, "dynamicItems": false };
243
+ function validate54(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
244
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlConstraint" */ ;
245
+ let vErrors = null;
246
+ let errors = 0;
247
+ const evaluated0 = validate54.evaluated;
248
+ if (evaluated0.dynamicProps) {
249
+ evaluated0.props = undefined;
250
+ }
251
+ if (evaluated0.dynamicItems) {
252
+ evaluated0.items = undefined;
253
+ }
254
+ if (data && typeof data == "object" && !Array.isArray(data)) {
255
+ if (data.leftOperand === undefined) {
256
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "leftOperand" }, "must have required property '" + "leftOperand" + "'");
257
+ vErrors = pushError(vErrors, err0);
258
+ errors++;
259
+ }
260
+ if (data.operator === undefined) {
261
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "operator" }, "must have required property '" + "operator" + "'");
262
+ vErrors = pushError(vErrors, err1);
263
+ errors++;
264
+ }
265
+ if (data.uid !== undefined) {
266
+ if (typeof data.uid !== "string") {
267
+ const err2 = createError(instancePath + "/uid", "#/properties/uid/type", "type", { type: "string" }, 5);
268
+ vErrors = pushError(vErrors, err2);
269
+ errors++;
270
+ }
271
+ }
272
+ if (data.leftOperand !== undefined) {
273
+ let data1 = data.leftOperand;
274
+ const _errs4 = errors;
275
+ let valid1 = false;
276
+ const _errs5 = errors;
277
+ if (typeof data1 !== "string") {
278
+ const err3 = createError(instancePath + "/leftOperand", "#/properties/leftOperand/anyOf/0/type", "type", { type: "string" }, 5);
279
+ vErrors = pushError(vErrors, err3);
280
+ errors++;
281
+ }
282
+ var _valid0 = _errs5 === errors;
283
+ valid1 = valid1 || _valid0;
284
+ const _errs7 = errors;
285
+ if (!(validate55(data1, { instancePath: instancePath + "/leftOperand", parentData: data, parentDataProperty: "leftOperand", rootData, dynamicAnchors }))) {
286
+ vErrors = vErrors === null ? validate55.errors : vErrors.concat(validate55.errors);
287
+ errors = vErrors.length;
288
+ }
289
+ var _valid0 = _errs7 === errors;
290
+ valid1 = valid1 || _valid0;
291
+ if (!valid1) {
292
+ const err4 = createError(instancePath + "/leftOperand", "#/properties/leftOperand/anyOf", "anyOf", {}, 2);
293
+ vErrors = pushError(vErrors, err4);
294
+ errors++;
295
+ }
296
+ else {
297
+ errors = _errs4;
298
+ if (vErrors !== null) {
299
+ if (_errs4) {
300
+ vErrors.length = _errs4;
301
+ }
302
+ else {
303
+ vErrors = null;
304
+ }
305
+ }
306
+ }
307
+ }
308
+ if (data.operator !== undefined) {
309
+ if (!(validate57(data.operator, { instancePath: instancePath + "/operator", parentData: data, parentDataProperty: "operator", rootData, dynamicAnchors }))) {
310
+ vErrors = vErrors === null ? validate57.errors : vErrors.concat(validate57.errors);
311
+ errors = vErrors.length;
312
+ }
313
+ }
314
+ if (data.rightOperand !== undefined) {
315
+ let data3 = data.rightOperand;
316
+ const _errs10 = errors;
317
+ let valid2 = false;
318
+ const _errs11 = errors;
319
+ if (typeof data3 !== "string") {
320
+ const err5 = createError(instancePath + "/rightOperand", "#/properties/rightOperand/anyOf/0/type", "type", { type: "string" }, 5);
321
+ vErrors = pushError(vErrors, err5);
322
+ errors++;
323
+ }
324
+ var _valid1 = _errs11 === errors;
325
+ valid2 = valid2 || _valid1;
326
+ const _errs13 = errors;
327
+ if (data3 && typeof data3 == "object" && !Array.isArray(data3)) {
328
+ if (data3["@value"] === undefined) {
329
+ const err6 = createError(instancePath + "/rightOperand", "#/properties/rightOperand/anyOf/1/required", "required", { missingProperty: "@value" }, "must have required property '" + "@value" + "'");
330
+ vErrors = pushError(vErrors, err6);
331
+ errors++;
332
+ }
333
+ if (data3["@value"] !== undefined) {
334
+ if (typeof data3["@value"] !== "string") {
335
+ const err7 = createError(instancePath + "/rightOperand/@value", "#/properties/rightOperand/anyOf/1/properties/%40value/type", "type", { type: "string" }, 5);
336
+ vErrors = pushError(vErrors, err7);
337
+ errors++;
338
+ }
339
+ }
340
+ if (data3["@type"] !== undefined) {
341
+ if (typeof data3["@type"] !== "string") {
342
+ const err8 = createError(instancePath + "/rightOperand/@type", "#/properties/rightOperand/anyOf/1/properties/%40type/type", "type", { type: "string" }, 5);
343
+ vErrors = pushError(vErrors, err8);
344
+ errors++;
345
+ }
346
+ }
347
+ }
348
+ else {
349
+ const err9 = createError(instancePath + "/rightOperand", "#/properties/rightOperand/anyOf/1/type", "type", { type: "object" }, 6);
350
+ vErrors = pushError(vErrors, err9);
351
+ errors++;
352
+ }
353
+ var _valid1 = _errs13 === errors;
354
+ valid2 = valid2 || _valid1;
355
+ if (_valid1) {
356
+ var props0 = {};
357
+ props0["@value"] = true;
358
+ props0["@type"] = true;
359
+ }
360
+ const _errs19 = errors;
361
+ if (data3 && typeof data3 == "object" && !Array.isArray(data3)) {
362
+ if (data3["@id"] === undefined) {
363
+ const err10 = createError(instancePath + "/rightOperand", "#/properties/rightOperand/anyOf/2/required", "required", { missingProperty: "@id" }, "must have required property '" + "@id" + "'");
364
+ vErrors = pushError(vErrors, err10);
365
+ errors++;
366
+ }
367
+ if (data3["@id"] !== undefined) {
368
+ if (typeof data3["@id"] !== "string") {
369
+ const err11 = createError(instancePath + "/rightOperand/@id", "#/properties/rightOperand/anyOf/2/properties/%40id/type", "type", { type: "string" }, 5);
370
+ vErrors = pushError(vErrors, err11);
371
+ errors++;
372
+ }
373
+ }
374
+ }
375
+ else {
376
+ const err12 = createError(instancePath + "/rightOperand", "#/properties/rightOperand/anyOf/2/type", "type", { type: "object" }, 6);
377
+ vErrors = pushError(vErrors, err12);
378
+ errors++;
379
+ }
380
+ var _valid1 = _errs19 === errors;
381
+ valid2 = valid2 || _valid1;
382
+ if (_valid1) {
383
+ if (props0 !== true) {
384
+ props0 = props0 || {};
385
+ props0["@id"] = true;
386
+ }
387
+ }
388
+ const _errs23 = errors;
389
+ if (Array.isArray(data3)) {
390
+ const len0 = data3.length;
391
+ for (let i0 = 0; i0 < len0; i0++) {
392
+ let data7 = data3[i0];
393
+ const _errs26 = errors;
394
+ let valid7 = false;
395
+ const _errs27 = errors;
396
+ if (typeof data7 !== "string") {
397
+ const err13 = createError(instancePath + "/rightOperand/" + i0, "#/properties/rightOperand/anyOf/3/items/anyOf/0/type", "type", { type: "string" }, 5);
398
+ vErrors = pushError(vErrors, err13);
399
+ errors++;
400
+ }
401
+ var _valid2 = _errs27 === errors;
402
+ valid7 = valid7 || _valid2;
403
+ const _errs29 = errors;
404
+ if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
405
+ if (data7["@value"] === undefined) {
406
+ const err14 = createError(instancePath + "/rightOperand/" + i0, "#/properties/rightOperand/anyOf/3/items/anyOf/1/required", "required", { missingProperty: "@value" }, "must have required property '" + "@value" + "'");
407
+ vErrors = pushError(vErrors, err14);
408
+ errors++;
409
+ }
410
+ if (data7["@value"] !== undefined) {
411
+ if (typeof data7["@value"] !== "string") {
412
+ const err15 = createError(instancePath + "/rightOperand/" + i0 + "/@value", "#/properties/rightOperand/anyOf/3/items/anyOf/1/properties/%40value/type", "type", { type: "string" }, 5);
413
+ vErrors = pushError(vErrors, err15);
414
+ errors++;
415
+ }
416
+ }
417
+ if (data7["@type"] !== undefined) {
418
+ if (typeof data7["@type"] !== "string") {
419
+ const err16 = createError(instancePath + "/rightOperand/" + i0 + "/@type", "#/properties/rightOperand/anyOf/3/items/anyOf/1/properties/%40type/type", "type", { type: "string" }, 5);
420
+ vErrors = pushError(vErrors, err16);
421
+ errors++;
422
+ }
423
+ }
424
+ }
425
+ else {
426
+ const err17 = createError(instancePath + "/rightOperand/" + i0, "#/properties/rightOperand/anyOf/3/items/anyOf/1/type", "type", { type: "object" }, 6);
427
+ vErrors = pushError(vErrors, err17);
428
+ errors++;
429
+ }
430
+ var _valid2 = _errs29 === errors;
431
+ valid7 = valid7 || _valid2;
432
+ if (_valid2) {
433
+ var props1 = {};
434
+ props1["@value"] = true;
435
+ props1["@type"] = true;
436
+ }
437
+ const _errs35 = errors;
438
+ if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
439
+ if (data7["@id"] === undefined) {
440
+ const err18 = createError(instancePath + "/rightOperand/" + i0, "#/properties/rightOperand/anyOf/3/items/anyOf/2/required", "required", { missingProperty: "@id" }, "must have required property '" + "@id" + "'");
441
+ vErrors = pushError(vErrors, err18);
442
+ errors++;
443
+ }
444
+ if (data7["@id"] !== undefined) {
445
+ if (typeof data7["@id"] !== "string") {
446
+ const err19 = createError(instancePath + "/rightOperand/" + i0 + "/@id", "#/properties/rightOperand/anyOf/3/items/anyOf/2/properties/%40id/type", "type", { type: "string" }, 5);
447
+ vErrors = pushError(vErrors, err19);
448
+ errors++;
449
+ }
450
+ }
451
+ }
452
+ else {
453
+ const err20 = createError(instancePath + "/rightOperand/" + i0, "#/properties/rightOperand/anyOf/3/items/anyOf/2/type", "type", { type: "object" }, 6);
454
+ vErrors = pushError(vErrors, err20);
455
+ errors++;
456
+ }
457
+ var _valid2 = _errs35 === errors;
458
+ valid7 = valid7 || _valid2;
459
+ if (_valid2) {
460
+ if (props1 !== true) {
461
+ props1 = props1 || {};
462
+ props1["@id"] = true;
463
+ }
464
+ }
465
+ if (!valid7) {
466
+ const err21 = createError(instancePath + "/rightOperand/" + i0, "#/properties/rightOperand/anyOf/3/items/anyOf", "anyOf", {}, 2);
467
+ vErrors = pushError(vErrors, err21);
468
+ errors++;
469
+ }
470
+ else {
471
+ errors = _errs26;
472
+ if (vErrors !== null) {
473
+ if (_errs26) {
474
+ vErrors.length = _errs26;
475
+ }
476
+ else {
477
+ vErrors = null;
478
+ }
479
+ }
480
+ }
481
+ }
482
+ }
483
+ else {
484
+ const err22 = createError(instancePath + "/rightOperand", "#/properties/rightOperand/anyOf/3/type", "type", { type: "array" }, 4);
485
+ vErrors = pushError(vErrors, err22);
486
+ errors++;
487
+ }
488
+ var _valid1 = _errs23 === errors;
489
+ valid2 = valid2 || _valid1;
490
+ if (!valid2) {
491
+ const err23 = createError(instancePath + "/rightOperand", "#/properties/rightOperand/anyOf", "anyOf", {}, 2);
492
+ vErrors = pushError(vErrors, err23);
493
+ errors++;
494
+ }
495
+ else {
496
+ errors = _errs10;
497
+ if (vErrors !== null) {
498
+ if (_errs10) {
499
+ vErrors.length = _errs10;
500
+ }
501
+ else {
502
+ vErrors = null;
503
+ }
504
+ }
505
+ }
506
+ }
507
+ if (data.rightOperandReference !== undefined) {
508
+ let data11 = data.rightOperandReference;
509
+ const _errs40 = errors;
510
+ let valid10 = false;
511
+ const _errs41 = errors;
512
+ if (typeof data11 !== "string") {
513
+ const err24 = createError(instancePath + "/rightOperandReference", "#/properties/rightOperandReference/anyOf/0/type", "type", { type: "string" }, 5);
514
+ vErrors = pushError(vErrors, err24);
515
+ errors++;
516
+ }
517
+ var _valid3 = _errs41 === errors;
518
+ valid10 = valid10 || _valid3;
519
+ const _errs43 = errors;
520
+ if (Array.isArray(data11)) {
521
+ const len1 = data11.length;
522
+ for (let i1 = 0; i1 < len1; i1++) {
523
+ if (typeof data11[i1] !== "string") {
524
+ const err25 = createError(instancePath + "/rightOperandReference/" + i1, "#/properties/rightOperandReference/anyOf/1/items/type", "type", { type: "string" }, 5);
525
+ vErrors = pushError(vErrors, err25);
526
+ errors++;
527
+ }
528
+ }
529
+ }
530
+ else {
531
+ const err26 = createError(instancePath + "/rightOperandReference", "#/properties/rightOperandReference/anyOf/1/type", "type", { type: "array" }, 4);
532
+ vErrors = pushError(vErrors, err26);
533
+ errors++;
534
+ }
535
+ var _valid3 = _errs43 === errors;
536
+ valid10 = valid10 || _valid3;
537
+ if (!valid10) {
538
+ const err27 = createError(instancePath + "/rightOperandReference", "#/properties/rightOperandReference/anyOf", "anyOf", {}, 2);
539
+ vErrors = pushError(vErrors, err27);
540
+ errors++;
541
+ }
542
+ else {
543
+ errors = _errs40;
544
+ if (vErrors !== null) {
545
+ if (_errs40) {
546
+ vErrors.length = _errs40;
547
+ }
548
+ else {
549
+ vErrors = null;
550
+ }
551
+ }
552
+ }
553
+ }
554
+ if (data.dataType !== undefined) {
555
+ if (typeof data.dataType !== "string") {
556
+ const err28 = createError(instancePath + "/dataType", "#/properties/dataType/type", "type", { type: "string" }, 5);
557
+ vErrors = pushError(vErrors, err28);
558
+ errors++;
559
+ }
560
+ }
561
+ if (data.unit !== undefined) {
562
+ if (typeof data.unit !== "string") {
563
+ const err29 = createError(instancePath + "/unit", "#/properties/unit/type", "type", { type: "string" }, 5);
564
+ vErrors = pushError(vErrors, err29);
565
+ errors++;
566
+ }
567
+ }
568
+ if (data.status !== undefined) {
569
+ if (!(validate59(data.status, { instancePath: instancePath + "/status", parentData: data, parentDataProperty: "status", rootData, dynamicAnchors }))) {
570
+ vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);
571
+ errors = vErrors.length;
572
+ }
573
+ }
574
+ }
575
+ else {
576
+ const err30 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
577
+ vErrors = pushError(vErrors, err30);
578
+ errors++;
579
+ }
580
+ validate54.errors = vErrors;
581
+ return errors === 0;
582
+ }
583
+ validate54.evaluated = { "props": { "uid": true, "leftOperand": true, "operator": true, "rightOperand": true, "rightOperandReference": true, "dataType": true, "unit": true, "status": true }, "dynamicProps": false, "dynamicItems": false };
584
+ const formats0 = JsonSchemaFormats.uri;
585
+ function validate63(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
586
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlLogicalConstraintOperand" */ ;
587
+ let vErrors = null;
588
+ let errors = 0;
589
+ const evaluated0 = validate63.evaluated;
590
+ if (evaluated0.dynamicProps) {
591
+ evaluated0.props = undefined;
592
+ }
593
+ if (evaluated0.dynamicItems) {
594
+ evaluated0.items = undefined;
595
+ }
596
+ if (data && typeof data == "object" && !Array.isArray(data)) {
597
+ if (data["@list"] === undefined) {
598
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@list" }, "must have required property '" + "@list" + "'");
599
+ vErrors = pushError(vErrors, err0);
600
+ errors++;
601
+ }
602
+ if (data["@list"] !== undefined) {
603
+ let data0 = data["@list"];
604
+ if (Array.isArray(data0)) {
605
+ const len0 = data0.length;
606
+ for (let i0 = 0; i0 < len0; i0++) {
607
+ let data1 = data0[i0];
608
+ if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
609
+ if (data1["@id"] === undefined) {
610
+ const err1 = createError(instancePath + "/@list/" + i0, "#/properties/%40list/items/required", "required", { missingProperty: "@id" }, "must have required property '" + "@id" + "'");
611
+ vErrors = pushError(vErrors, err1);
612
+ errors++;
613
+ }
614
+ if (data1["@id"] !== undefined) {
615
+ if (typeof data1["@id"] !== "string") {
616
+ const err2 = createError(instancePath + "/@list/" + i0 + "/@id", "#/properties/%40list/items/properties/%40id/type", "type", { type: "string" }, 5);
617
+ vErrors = pushError(vErrors, err2);
618
+ errors++;
619
+ }
620
+ }
621
+ }
622
+ else {
623
+ const err3 = createError(instancePath + "/@list/" + i0, "#/properties/%40list/items/type", "type", { type: "object" }, 6);
624
+ vErrors = pushError(vErrors, err3);
625
+ errors++;
626
+ }
627
+ }
628
+ }
629
+ else {
630
+ const err4 = createError(instancePath + "/@list", "#/properties/%40list/type", "type", { type: "array" }, 4);
631
+ vErrors = pushError(vErrors, err4);
632
+ errors++;
633
+ }
634
+ }
635
+ }
636
+ else {
637
+ const err5 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
638
+ vErrors = pushError(vErrors, err5);
639
+ errors++;
640
+ }
641
+ validate63.errors = vErrors;
642
+ return errors === 0;
643
+ }
644
+ validate63.evaluated = { "props": { "@list": true }, "dynamicProps": false, "dynamicItems": false };
645
+ function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
646
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlLogicalConstraint" */ ;
647
+ let vErrors = null;
648
+ let errors = 0;
649
+ const evaluated0 = validate62.evaluated;
650
+ if (evaluated0.dynamicProps) {
651
+ evaluated0.props = undefined;
652
+ }
653
+ if (evaluated0.dynamicItems) {
654
+ evaluated0.items = undefined;
655
+ }
656
+ if (data && typeof data == "object" && !Array.isArray(data)) {
657
+ if (data.uid !== undefined) {
658
+ let data0 = data.uid;
659
+ if (typeof data0 === "string") {
660
+ if (!(formats0(data0))) {
661
+ const err0 = createError(instancePath + "/uid", "#/properties/uid/format", "format", { format: "uri" }, "must match format \"" + "uri" + "\"");
662
+ vErrors = pushError(vErrors, err0);
663
+ errors++;
664
+ }
665
+ }
666
+ else {
667
+ const err1 = createError(instancePath + "/uid", "#/properties/uid/type", "type", { type: "string" }, 5);
668
+ vErrors = pushError(vErrors, err1);
669
+ errors++;
670
+ }
671
+ }
672
+ if (data.and !== undefined) {
673
+ if (!(validate63(data.and, { instancePath: instancePath + "/and", parentData: data, parentDataProperty: "and", rootData, dynamicAnchors }))) {
674
+ vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);
675
+ errors = vErrors.length;
676
+ }
677
+ }
678
+ if (data.or !== undefined) {
679
+ if (!(validate63(data.or, { instancePath: instancePath + "/or", parentData: data, parentDataProperty: "or", rootData, dynamicAnchors }))) {
680
+ vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);
681
+ errors = vErrors.length;
682
+ }
683
+ }
684
+ if (data.xone !== undefined) {
685
+ if (!(validate63(data.xone, { instancePath: instancePath + "/xone", parentData: data, parentDataProperty: "xone", rootData, dynamicAnchors }))) {
686
+ vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);
687
+ errors = vErrors.length;
688
+ }
689
+ }
690
+ if (data.andSequence !== undefined) {
691
+ if (!(validate63(data.andSequence, { instancePath: instancePath + "/andSequence", parentData: data, parentDataProperty: "andSequence", rootData, dynamicAnchors }))) {
692
+ vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);
693
+ errors = vErrors.length;
694
+ }
695
+ }
696
+ }
697
+ else {
698
+ const err2 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
699
+ vErrors = pushError(vErrors, err2);
700
+ errors++;
701
+ }
702
+ validate62.errors = vErrors;
703
+ return errors === 0;
704
+ }
705
+ validate62.evaluated = { "props": { "uid": true, "and": true, "or": true, "xone": true, "andSequence": true }, "dynamicProps": false, "dynamicItems": false };
706
+ const keyword4 = Object.values(external4["OdrlActionType"]);
707
+ function validate71(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
708
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlActionType" */ ;
709
+ let vErrors = null;
710
+ let errors = 0;
711
+ const evaluated0 = validate71.evaluated;
712
+ if (evaluated0.dynamicProps) {
713
+ evaluated0.props = undefined;
714
+ }
715
+ if (evaluated0.dynamicItems) {
716
+ evaluated0.items = undefined;
717
+ }
718
+ if (!keyword4.includes(data)) {
719
+ for (let i0 = 0; i0 < keyword4.length; i0++) {
720
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword4[i0] }, "must be equal to constant"));
721
+ errors++;
722
+ }
723
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
724
+ errors++;
725
+ }
726
+ validate71.errors = vErrors;
727
+ return errors === 0;
728
+ }
729
+ validate71.evaluated = { "dynamicProps": false, "dynamicItems": false };
730
+ function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
731
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlAction" */ ;
732
+ let vErrors = null;
733
+ let errors = 0;
734
+ const evaluated0 = validate53.evaluated;
735
+ if (evaluated0.dynamicProps) {
736
+ evaluated0.props = undefined;
737
+ }
738
+ if (evaluated0.dynamicItems) {
739
+ evaluated0.items = undefined;
740
+ }
741
+ if (data && typeof data == "object" && !Array.isArray(data)) {
742
+ if (data["rdf:value"] !== undefined) {
743
+ let data0 = data["rdf:value"];
744
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
745
+ if (data0["@id"] === undefined) {
746
+ const err0 = createError(instancePath + "/rdf:value", "#/properties/rdf%3Avalue/required", "required", { missingProperty: "@id" }, "must have required property '" + "@id" + "'");
747
+ vErrors = pushError(vErrors, err0);
748
+ errors++;
749
+ }
750
+ if (data0["@id"] !== undefined) {
751
+ if (typeof data0["@id"] !== "string") {
752
+ const err1 = createError(instancePath + "/rdf:value/@id", "#/properties/rdf%3Avalue/properties/%40id/type", "type", { type: "string" }, 5);
753
+ vErrors = pushError(vErrors, err1);
754
+ errors++;
755
+ }
756
+ }
757
+ }
758
+ else {
759
+ const err2 = createError(instancePath + "/rdf:value", "#/properties/rdf%3Avalue/type", "type", { type: "object" }, 6);
760
+ vErrors = pushError(vErrors, err2);
761
+ errors++;
762
+ }
763
+ }
764
+ if (data["@id"] !== undefined) {
765
+ if (typeof data["@id"] !== "string") {
766
+ const err3 = createError(instancePath + "/@id", "#/properties/%40id/type", "type", { type: "string" }, 5);
767
+ vErrors = pushError(vErrors, err3);
768
+ errors++;
769
+ }
770
+ }
771
+ if (data.refinement !== undefined) {
772
+ let data3 = data.refinement;
773
+ const _errs8 = errors;
774
+ let valid2 = false;
775
+ const _errs9 = errors;
776
+ if (!(validate54(data3, { instancePath: instancePath + "/refinement", parentData: data, parentDataProperty: "refinement", rootData, dynamicAnchors }))) {
777
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
778
+ errors = vErrors.length;
779
+ }
780
+ var _valid0 = _errs9 === errors;
781
+ valid2 = valid2 || _valid0;
782
+ if (_valid0) {
783
+ var props0 = {};
784
+ props0.uid = true;
785
+ props0.leftOperand = true;
786
+ props0.operator = true;
787
+ props0.rightOperand = true;
788
+ props0.rightOperandReference = true;
789
+ props0.dataType = true;
790
+ props0.unit = true;
791
+ props0.status = true;
792
+ }
793
+ const _errs10 = errors;
794
+ if (!(validate62(data3, { instancePath: instancePath + "/refinement", parentData: data, parentDataProperty: "refinement", rootData, dynamicAnchors }))) {
795
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
796
+ errors = vErrors.length;
797
+ }
798
+ var _valid0 = _errs10 === errors;
799
+ valid2 = valid2 || _valid0;
800
+ if (_valid0) {
801
+ if (props0 !== true) {
802
+ props0 = props0 || {};
803
+ props0.uid = true;
804
+ props0.and = true;
805
+ props0.or = true;
806
+ props0.xone = true;
807
+ props0.andSequence = true;
808
+ }
809
+ }
810
+ const _errs11 = errors;
811
+ if (Array.isArray(data3)) {
812
+ const len0 = data3.length;
813
+ for (let i0 = 0; i0 < len0; i0++) {
814
+ let data4 = data3[i0];
815
+ const _errs14 = errors;
816
+ let valid5 = false;
817
+ const _errs15 = errors;
818
+ if (!(validate54(data4, { instancePath: instancePath + "/refinement/" + i0, parentData: data3, parentDataProperty: i0, rootData, dynamicAnchors }))) {
819
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
820
+ errors = vErrors.length;
821
+ }
822
+ var _valid1 = _errs15 === errors;
823
+ valid5 = valid5 || _valid1;
824
+ if (_valid1) {
825
+ var props1 = {};
826
+ props1.uid = true;
827
+ props1.leftOperand = true;
828
+ props1.operator = true;
829
+ props1.rightOperand = true;
830
+ props1.rightOperandReference = true;
831
+ props1.dataType = true;
832
+ props1.unit = true;
833
+ props1.status = true;
834
+ }
835
+ const _errs16 = errors;
836
+ if (!(validate62(data4, { instancePath: instancePath + "/refinement/" + i0, parentData: data3, parentDataProperty: i0, rootData, dynamicAnchors }))) {
837
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
838
+ errors = vErrors.length;
839
+ }
840
+ var _valid1 = _errs16 === errors;
841
+ valid5 = valid5 || _valid1;
842
+ if (_valid1) {
843
+ if (props1 !== true) {
844
+ props1 = props1 || {};
845
+ props1.uid = true;
846
+ props1.and = true;
847
+ props1.or = true;
848
+ props1.xone = true;
849
+ props1.andSequence = true;
850
+ }
851
+ }
852
+ if (!valid5) {
853
+ const err4 = createError(instancePath + "/refinement/" + i0, "#/properties/refinement/anyOf/2/items/anyOf", "anyOf", {}, 2);
854
+ vErrors = pushError(vErrors, err4);
855
+ errors++;
856
+ }
857
+ else {
858
+ errors = _errs14;
859
+ if (vErrors !== null) {
860
+ if (_errs14) {
861
+ vErrors.length = _errs14;
862
+ }
863
+ else {
864
+ vErrors = null;
865
+ }
866
+ }
867
+ }
868
+ }
869
+ }
870
+ else {
871
+ const err5 = createError(instancePath + "/refinement", "#/properties/refinement/anyOf/2/type", "type", { type: "array" }, 4);
872
+ vErrors = pushError(vErrors, err5);
873
+ errors++;
874
+ }
875
+ var _valid0 = _errs11 === errors;
876
+ valid2 = valid2 || _valid0;
877
+ if (!valid2) {
878
+ const err6 = createError(instancePath + "/refinement", "#/properties/refinement/anyOf", "anyOf", {}, 2);
879
+ vErrors = pushError(vErrors, err6);
880
+ errors++;
881
+ }
882
+ else {
883
+ errors = _errs8;
884
+ if (vErrors !== null) {
885
+ if (_errs8) {
886
+ vErrors.length = _errs8;
887
+ }
888
+ else {
889
+ vErrors = null;
890
+ }
891
+ }
892
+ }
893
+ }
894
+ if (data.includedIn !== undefined) {
895
+ let data5 = data.includedIn;
896
+ const _errs18 = errors;
897
+ let valid6 = false;
898
+ const _errs19 = errors;
899
+ if (!(validate71(data5, { instancePath: instancePath + "/includedIn", parentData: data, parentDataProperty: "includedIn", rootData, dynamicAnchors }))) {
900
+ vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);
901
+ errors = vErrors.length;
902
+ }
903
+ var _valid2 = _errs19 === errors;
904
+ valid6 = valid6 || _valid2;
905
+ const _errs20 = errors;
906
+ if (typeof data5 !== "string") {
907
+ const err7 = createError(instancePath + "/includedIn", "#/properties/includedIn/anyOf/1/type", "type", { type: "string" }, 5);
908
+ vErrors = pushError(vErrors, err7);
909
+ errors++;
910
+ }
911
+ var _valid2 = _errs20 === errors;
912
+ valid6 = valid6 || _valid2;
913
+ if (!valid6) {
914
+ const err8 = createError(instancePath + "/includedIn", "#/properties/includedIn/anyOf", "anyOf", {}, 2);
915
+ vErrors = pushError(vErrors, err8);
916
+ errors++;
917
+ }
918
+ else {
919
+ errors = _errs18;
920
+ if (vErrors !== null) {
921
+ if (_errs18) {
922
+ vErrors.length = _errs18;
923
+ }
924
+ else {
925
+ vErrors = null;
926
+ }
927
+ }
928
+ }
929
+ }
930
+ if (data.implies !== undefined) {
931
+ let data6 = data.implies;
932
+ if (Array.isArray(data6)) {
933
+ const len1 = data6.length;
934
+ for (let i1 = 0; i1 < len1; i1++) {
935
+ let data7 = data6[i1];
936
+ const _errs25 = errors;
937
+ let valid9 = false;
938
+ const _errs26 = errors;
939
+ if (!(validate71(data7, { instancePath: instancePath + "/implies/" + i1, parentData: data6, parentDataProperty: i1, rootData, dynamicAnchors }))) {
940
+ vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);
941
+ errors = vErrors.length;
942
+ }
943
+ var _valid3 = _errs26 === errors;
944
+ valid9 = valid9 || _valid3;
945
+ const _errs27 = errors;
946
+ if (typeof data7 !== "string") {
947
+ const err9 = createError(instancePath + "/implies/" + i1, "#/properties/implies/items/anyOf/1/type", "type", { type: "string" }, 5);
948
+ vErrors = pushError(vErrors, err9);
949
+ errors++;
950
+ }
951
+ var _valid3 = _errs27 === errors;
952
+ valid9 = valid9 || _valid3;
953
+ if (!valid9) {
954
+ const err10 = createError(instancePath + "/implies/" + i1, "#/properties/implies/items/anyOf", "anyOf", {}, 2);
955
+ vErrors = pushError(vErrors, err10);
956
+ errors++;
957
+ }
958
+ else {
959
+ errors = _errs25;
960
+ if (vErrors !== null) {
961
+ if (_errs25) {
962
+ vErrors.length = _errs25;
963
+ }
964
+ else {
965
+ vErrors = null;
966
+ }
967
+ }
968
+ }
969
+ }
970
+ }
971
+ else {
972
+ const err11 = createError(instancePath + "/implies", "#/properties/implies/type", "type", { type: "array" }, 4);
973
+ vErrors = pushError(vErrors, err11);
974
+ errors++;
975
+ }
976
+ }
977
+ }
978
+ else {
979
+ const err12 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
980
+ vErrors = pushError(vErrors, err12);
981
+ errors++;
982
+ }
983
+ validate53.errors = vErrors;
984
+ return errors === 0;
985
+ }
986
+ validate53.evaluated = { "props": { "rdf:value": true, "@id": true, "refinement": true, "includedIn": true, "implies": true }, "dynamicProps": false, "dynamicItems": false };
987
+ /**
988
+ * Compiled validator for the OdrlAgreement schema.
989
+ */
990
+ export const CompiledOdrlAgreement = validate74;
991
+ const keyword5 = Object.values(external5["OdrlPolicyType"]);
992
+ function validate77(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
993
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlPolicyType" */ ;
994
+ let vErrors = null;
995
+ let errors = 0;
996
+ const evaluated0 = validate77.evaluated;
997
+ if (evaluated0.dynamicProps) {
998
+ evaluated0.props = undefined;
999
+ }
1000
+ if (evaluated0.dynamicItems) {
1001
+ evaluated0.items = undefined;
1002
+ }
1003
+ if (!keyword5.includes(data)) {
1004
+ for (let i0 = 0; i0 < keyword5.length; i0++) {
1005
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword5[i0] }, "must be equal to constant"));
1006
+ errors++;
1007
+ }
1008
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
1009
+ errors++;
1010
+ }
1011
+ validate77.errors = vErrors;
1012
+ return errors === 0;
1013
+ }
1014
+ validate77.evaluated = { "dynamicProps": false, "dynamicItems": false };
1015
+ const wrapper0 = { validate: validate79 };
1016
+ function validate80(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1017
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlPartyCollection" */ ;
1018
+ let vErrors = null;
1019
+ let errors = 0;
1020
+ const evaluated0 = validate80.evaluated;
1021
+ if (evaluated0.dynamicProps) {
1022
+ evaluated0.props = undefined;
1023
+ }
1024
+ if (evaluated0.dynamicItems) {
1025
+ evaluated0.items = undefined;
1026
+ }
1027
+ if (!(wrapper0.validate(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
1028
+ vErrors = vErrors === null ? wrapper0.validate.errors : vErrors.concat(wrapper0.validate.errors);
1029
+ errors = vErrors.length;
1030
+ }
1031
+ else {
1032
+ var props0 = wrapper0.validate.evaluated.props;
1033
+ var items0 = wrapper0.validate.evaluated.items;
1034
+ }
1035
+ if (data && typeof data == "object" && !Array.isArray(data)) {
1036
+ if (props0 !== true) {
1037
+ props0 = props0 || {};
1038
+ props0.source = true;
1039
+ props0.refinement = true;
1040
+ }
1041
+ if (data.source !== undefined) {
1042
+ if (typeof data.source !== "string") {
1043
+ const err0 = createError(instancePath + "/source", "#/properties/source/type", "type", { type: "string" }, 5);
1044
+ vErrors = pushError(vErrors, err0);
1045
+ errors++;
1046
+ }
1047
+ }
1048
+ if (data.refinement !== undefined) {
1049
+ let data1 = data.refinement;
1050
+ const _errs5 = errors;
1051
+ let valid2 = false;
1052
+ const _errs6 = errors;
1053
+ if (!(validate54(data1, { instancePath: instancePath + "/refinement", parentData: data, parentDataProperty: "refinement", rootData, dynamicAnchors }))) {
1054
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
1055
+ errors = vErrors.length;
1056
+ }
1057
+ var _valid0 = _errs6 === errors;
1058
+ valid2 = valid2 || _valid0;
1059
+ if (_valid0) {
1060
+ var props1 = {};
1061
+ props1.uid = true;
1062
+ props1.leftOperand = true;
1063
+ props1.operator = true;
1064
+ props1.rightOperand = true;
1065
+ props1.rightOperandReference = true;
1066
+ props1.dataType = true;
1067
+ props1.unit = true;
1068
+ props1.status = true;
1069
+ }
1070
+ const _errs7 = errors;
1071
+ if (!(validate62(data1, { instancePath: instancePath + "/refinement", parentData: data, parentDataProperty: "refinement", rootData, dynamicAnchors }))) {
1072
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
1073
+ errors = vErrors.length;
1074
+ }
1075
+ var _valid0 = _errs7 === errors;
1076
+ valid2 = valid2 || _valid0;
1077
+ if (_valid0) {
1078
+ if (props1 !== true) {
1079
+ props1 = props1 || {};
1080
+ props1.uid = true;
1081
+ props1.and = true;
1082
+ props1.or = true;
1083
+ props1.xone = true;
1084
+ props1.andSequence = true;
1085
+ }
1086
+ }
1087
+ const _errs8 = errors;
1088
+ if (Array.isArray(data1)) {
1089
+ const len0 = data1.length;
1090
+ for (let i0 = 0; i0 < len0; i0++) {
1091
+ let data2 = data1[i0];
1092
+ const _errs11 = errors;
1093
+ let valid5 = false;
1094
+ const _errs12 = errors;
1095
+ if (!(validate54(data2, { instancePath: instancePath + "/refinement/" + i0, parentData: data1, parentDataProperty: i0, rootData, dynamicAnchors }))) {
1096
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
1097
+ errors = vErrors.length;
1098
+ }
1099
+ var _valid1 = _errs12 === errors;
1100
+ valid5 = valid5 || _valid1;
1101
+ if (_valid1) {
1102
+ var props2 = {};
1103
+ props2.uid = true;
1104
+ props2.leftOperand = true;
1105
+ props2.operator = true;
1106
+ props2.rightOperand = true;
1107
+ props2.rightOperandReference = true;
1108
+ props2.dataType = true;
1109
+ props2.unit = true;
1110
+ props2.status = true;
1111
+ }
1112
+ const _errs13 = errors;
1113
+ if (!(validate62(data2, { instancePath: instancePath + "/refinement/" + i0, parentData: data1, parentDataProperty: i0, rootData, dynamicAnchors }))) {
1114
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
1115
+ errors = vErrors.length;
1116
+ }
1117
+ var _valid1 = _errs13 === errors;
1118
+ valid5 = valid5 || _valid1;
1119
+ if (_valid1) {
1120
+ if (props2 !== true) {
1121
+ props2 = props2 || {};
1122
+ props2.uid = true;
1123
+ props2.and = true;
1124
+ props2.or = true;
1125
+ props2.xone = true;
1126
+ props2.andSequence = true;
1127
+ }
1128
+ }
1129
+ if (!valid5) {
1130
+ const err1 = createError(instancePath + "/refinement/" + i0, "#/properties/refinement/anyOf/2/items/anyOf", "anyOf", {}, 2);
1131
+ vErrors = pushError(vErrors, err1);
1132
+ errors++;
1133
+ }
1134
+ else {
1135
+ errors = _errs11;
1136
+ if (vErrors !== null) {
1137
+ if (_errs11) {
1138
+ vErrors.length = _errs11;
1139
+ }
1140
+ else {
1141
+ vErrors = null;
1142
+ }
1143
+ }
1144
+ }
1145
+ }
1146
+ }
1147
+ else {
1148
+ const err2 = createError(instancePath + "/refinement", "#/properties/refinement/anyOf/2/type", "type", { type: "array" }, 4);
1149
+ vErrors = pushError(vErrors, err2);
1150
+ errors++;
1151
+ }
1152
+ var _valid0 = _errs8 === errors;
1153
+ valid2 = valid2 || _valid0;
1154
+ if (!valid2) {
1155
+ const err3 = createError(instancePath + "/refinement", "#/properties/refinement/anyOf", "anyOf", {}, 2);
1156
+ vErrors = pushError(vErrors, err3);
1157
+ errors++;
1158
+ }
1159
+ else {
1160
+ errors = _errs5;
1161
+ if (vErrors !== null) {
1162
+ if (_errs5) {
1163
+ vErrors.length = _errs5;
1164
+ }
1165
+ else {
1166
+ vErrors = null;
1167
+ }
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+ else {
1173
+ const err4 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
1174
+ vErrors = pushError(vErrors, err4);
1175
+ errors++;
1176
+ }
1177
+ validate80.errors = vErrors;
1178
+ evaluated0.props = props0;
1179
+ evaluated0.items = items0;
1180
+ return errors === 0;
1181
+ }
1182
+ validate80.evaluated = { "dynamicProps": true, "dynamicItems": true };
1183
+ function validate79(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1184
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlParty" */ ;
1185
+ let vErrors = null;
1186
+ let errors = 0;
1187
+ const evaluated0 = validate79.evaluated;
1188
+ if (evaluated0.dynamicProps) {
1189
+ evaluated0.props = undefined;
1190
+ }
1191
+ if (evaluated0.dynamicItems) {
1192
+ evaluated0.items = undefined;
1193
+ }
1194
+ if (data && typeof data == "object" && !Array.isArray(data)) {
1195
+ if (data.uid !== undefined) {
1196
+ let data0 = data.uid;
1197
+ if (typeof data0 === "string") {
1198
+ if (!(formats0(data0))) {
1199
+ const err0 = createError(instancePath + "/uid", "#/properties/uid/format", "format", { format: "uri" }, "must match format \"" + "uri" + "\"");
1200
+ vErrors = pushError(vErrors, err0);
1201
+ errors++;
1202
+ }
1203
+ }
1204
+ else {
1205
+ const err1 = createError(instancePath + "/uid", "#/properties/uid/type", "type", { type: "string" }, 5);
1206
+ vErrors = pushError(vErrors, err1);
1207
+ errors++;
1208
+ }
1209
+ }
1210
+ if (data["@type"] !== undefined) {
1211
+ let data1 = data["@type"];
1212
+ const _errs4 = errors;
1213
+ let valid1 = false;
1214
+ const _errs5 = errors;
1215
+ if (typeof data1 !== "string") {
1216
+ const err2 = createError(instancePath + "/@type", "#/properties/%40type/anyOf/0/type", "type", { type: "string" }, 5);
1217
+ vErrors = pushError(vErrors, err2);
1218
+ errors++;
1219
+ }
1220
+ var _valid0 = _errs5 === errors;
1221
+ valid1 = valid1 || _valid0;
1222
+ const _errs7 = errors;
1223
+ if (Array.isArray(data1)) {
1224
+ const len0 = data1.length;
1225
+ for (let i0 = 0; i0 < len0; i0++) {
1226
+ if (typeof data1[i0] !== "string") {
1227
+ const err3 = createError(instancePath + "/@type/" + i0, "#/properties/%40type/anyOf/1/items/type", "type", { type: "string" }, 5);
1228
+ vErrors = pushError(vErrors, err3);
1229
+ errors++;
1230
+ }
1231
+ }
1232
+ }
1233
+ else {
1234
+ const err4 = createError(instancePath + "/@type", "#/properties/%40type/anyOf/1/type", "type", { type: "array" }, 4);
1235
+ vErrors = pushError(vErrors, err4);
1236
+ errors++;
1237
+ }
1238
+ var _valid0 = _errs7 === errors;
1239
+ valid1 = valid1 || _valid0;
1240
+ if (!valid1) {
1241
+ const err5 = createError(instancePath + "/@type", "#/properties/%40type/anyOf", "anyOf", {}, 2);
1242
+ vErrors = pushError(vErrors, err5);
1243
+ errors++;
1244
+ }
1245
+ else {
1246
+ errors = _errs4;
1247
+ if (vErrors !== null) {
1248
+ if (_errs4) {
1249
+ vErrors.length = _errs4;
1250
+ }
1251
+ else {
1252
+ vErrors = null;
1253
+ }
1254
+ }
1255
+ }
1256
+ }
1257
+ if (data.partOf !== undefined) {
1258
+ let data3 = data.partOf;
1259
+ const _errs12 = errors;
1260
+ let valid4 = false;
1261
+ const _errs13 = errors;
1262
+ if (typeof data3 !== "string") {
1263
+ const err6 = createError(instancePath + "/partOf", "#/properties/partOf/anyOf/0/type", "type", { type: "string" }, 5);
1264
+ vErrors = pushError(vErrors, err6);
1265
+ errors++;
1266
+ }
1267
+ var _valid1 = _errs13 === errors;
1268
+ valid4 = valid4 || _valid1;
1269
+ const _errs15 = errors;
1270
+ if (!(validate80(data3, { instancePath: instancePath + "/partOf", parentData: data, parentDataProperty: "partOf", rootData, dynamicAnchors }))) {
1271
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
1272
+ errors = vErrors.length;
1273
+ }
1274
+ else {
1275
+ var items1 = validate80.evaluated.items;
1276
+ }
1277
+ var _valid1 = _errs15 === errors;
1278
+ valid4 = valid4 || _valid1;
1279
+ const _errs16 = errors;
1280
+ if (Array.isArray(data3)) {
1281
+ const len1 = data3.length;
1282
+ for (let i1 = 0; i1 < len1; i1++) {
1283
+ let data4 = data3[i1];
1284
+ const _errs19 = errors;
1285
+ let valid7 = false;
1286
+ const _errs20 = errors;
1287
+ if (typeof data4 !== "string") {
1288
+ const err7 = createError(instancePath + "/partOf/" + i1, "#/properties/partOf/anyOf/2/items/anyOf/0/type", "type", { type: "string" }, 5);
1289
+ vErrors = pushError(vErrors, err7);
1290
+ errors++;
1291
+ }
1292
+ var _valid2 = _errs20 === errors;
1293
+ valid7 = valid7 || _valid2;
1294
+ const _errs22 = errors;
1295
+ if (!(validate80(data4, { instancePath: instancePath + "/partOf/" + i1, parentData: data3, parentDataProperty: i1, rootData, dynamicAnchors }))) {
1296
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
1297
+ errors = vErrors.length;
1298
+ }
1299
+ var _valid2 = _errs22 === errors;
1300
+ valid7 = valid7 || _valid2;
1301
+ if (!valid7) {
1302
+ const err8 = createError(instancePath + "/partOf/" + i1, "#/properties/partOf/anyOf/2/items/anyOf", "anyOf", {}, 2);
1303
+ vErrors = pushError(vErrors, err8);
1304
+ errors++;
1305
+ }
1306
+ else {
1307
+ errors = _errs19;
1308
+ if (vErrors !== null) {
1309
+ if (_errs19) {
1310
+ vErrors.length = _errs19;
1311
+ }
1312
+ else {
1313
+ vErrors = null;
1314
+ }
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+ else {
1320
+ const err9 = createError(instancePath + "/partOf", "#/properties/partOf/anyOf/2/type", "type", { type: "array" }, 4);
1321
+ vErrors = pushError(vErrors, err9);
1322
+ errors++;
1323
+ }
1324
+ var _valid1 = _errs16 === errors;
1325
+ valid4 = valid4 || _valid1;
1326
+ if (_valid1) {
1327
+ if (items1 !== true) {
1328
+ items1 = true;
1329
+ }
1330
+ }
1331
+ if (!valid4) {
1332
+ const err10 = createError(instancePath + "/partOf", "#/properties/partOf/anyOf", "anyOf", {}, 2);
1333
+ vErrors = pushError(vErrors, err10);
1334
+ errors++;
1335
+ }
1336
+ else {
1337
+ errors = _errs12;
1338
+ if (vErrors !== null) {
1339
+ if (_errs12) {
1340
+ vErrors.length = _errs12;
1341
+ }
1342
+ else {
1343
+ vErrors = null;
1344
+ }
1345
+ }
1346
+ }
1347
+ }
1348
+ if (data.assigneeOf !== undefined) {
1349
+ let data5 = data.assigneeOf;
1350
+ const _errs24 = errors;
1351
+ let valid8 = false;
1352
+ const _errs25 = errors;
1353
+ if (typeof data5 !== "string") {
1354
+ const err11 = createError(instancePath + "/assigneeOf", "#/properties/assigneeOf/anyOf/0/type", "type", { type: "string" }, 5);
1355
+ vErrors = pushError(vErrors, err11);
1356
+ errors++;
1357
+ }
1358
+ var _valid3 = _errs25 === errors;
1359
+ valid8 = valid8 || _valid3;
1360
+ const _errs27 = errors;
1361
+ if (Array.isArray(data5)) {
1362
+ const len2 = data5.length;
1363
+ for (let i2 = 0; i2 < len2; i2++) {
1364
+ if (typeof data5[i2] !== "string") {
1365
+ const err12 = createError(instancePath + "/assigneeOf/" + i2, "#/properties/assigneeOf/anyOf/1/items/type", "type", { type: "string" }, 5);
1366
+ vErrors = pushError(vErrors, err12);
1367
+ errors++;
1368
+ }
1369
+ }
1370
+ }
1371
+ else {
1372
+ const err13 = createError(instancePath + "/assigneeOf", "#/properties/assigneeOf/anyOf/1/type", "type", { type: "array" }, 4);
1373
+ vErrors = pushError(vErrors, err13);
1374
+ errors++;
1375
+ }
1376
+ var _valid3 = _errs27 === errors;
1377
+ valid8 = valid8 || _valid3;
1378
+ if (!valid8) {
1379
+ const err14 = createError(instancePath + "/assigneeOf", "#/properties/assigneeOf/anyOf", "anyOf", {}, 2);
1380
+ vErrors = pushError(vErrors, err14);
1381
+ errors++;
1382
+ }
1383
+ else {
1384
+ errors = _errs24;
1385
+ if (vErrors !== null) {
1386
+ if (_errs24) {
1387
+ vErrors.length = _errs24;
1388
+ }
1389
+ else {
1390
+ vErrors = null;
1391
+ }
1392
+ }
1393
+ }
1394
+ }
1395
+ if (data.assignerOf !== undefined) {
1396
+ let data7 = data.assignerOf;
1397
+ const _errs32 = errors;
1398
+ let valid11 = false;
1399
+ const _errs33 = errors;
1400
+ if (typeof data7 !== "string") {
1401
+ const err15 = createError(instancePath + "/assignerOf", "#/properties/assignerOf/anyOf/0/type", "type", { type: "string" }, 5);
1402
+ vErrors = pushError(vErrors, err15);
1403
+ errors++;
1404
+ }
1405
+ var _valid4 = _errs33 === errors;
1406
+ valid11 = valid11 || _valid4;
1407
+ const _errs35 = errors;
1408
+ if (Array.isArray(data7)) {
1409
+ const len3 = data7.length;
1410
+ for (let i3 = 0; i3 < len3; i3++) {
1411
+ if (typeof data7[i3] !== "string") {
1412
+ const err16 = createError(instancePath + "/assignerOf/" + i3, "#/properties/assignerOf/anyOf/1/items/type", "type", { type: "string" }, 5);
1413
+ vErrors = pushError(vErrors, err16);
1414
+ errors++;
1415
+ }
1416
+ }
1417
+ }
1418
+ else {
1419
+ const err17 = createError(instancePath + "/assignerOf", "#/properties/assignerOf/anyOf/1/type", "type", { type: "array" }, 4);
1420
+ vErrors = pushError(vErrors, err17);
1421
+ errors++;
1422
+ }
1423
+ var _valid4 = _errs35 === errors;
1424
+ valid11 = valid11 || _valid4;
1425
+ if (!valid11) {
1426
+ const err18 = createError(instancePath + "/assignerOf", "#/properties/assignerOf/anyOf", "anyOf", {}, 2);
1427
+ vErrors = pushError(vErrors, err18);
1428
+ errors++;
1429
+ }
1430
+ else {
1431
+ errors = _errs32;
1432
+ if (vErrors !== null) {
1433
+ if (_errs32) {
1434
+ vErrors.length = _errs32;
1435
+ }
1436
+ else {
1437
+ vErrors = null;
1438
+ }
1439
+ }
1440
+ }
1441
+ }
1442
+ }
1443
+ else {
1444
+ const err19 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
1445
+ vErrors = pushError(vErrors, err19);
1446
+ errors++;
1447
+ }
1448
+ validate79.errors = vErrors;
1449
+ return errors === 0;
1450
+ }
1451
+ validate79.evaluated = { "props": { "uid": true, "@type": true, "partOf": true, "assigneeOf": true, "assignerOf": true }, "dynamicProps": false, "dynamicItems": false };
1452
+ const wrapper1 = { validate: validate95 };
1453
+ function validate96(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1454
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlAssetCollection" */ ;
1455
+ let vErrors = null;
1456
+ let errors = 0;
1457
+ const evaluated0 = validate96.evaluated;
1458
+ if (evaluated0.dynamicProps) {
1459
+ evaluated0.props = undefined;
1460
+ }
1461
+ if (evaluated0.dynamicItems) {
1462
+ evaluated0.items = undefined;
1463
+ }
1464
+ if (!(wrapper1.validate(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
1465
+ vErrors = vErrors === null ? wrapper1.validate.errors : vErrors.concat(wrapper1.validate.errors);
1466
+ errors = vErrors.length;
1467
+ }
1468
+ else {
1469
+ var props0 = wrapper1.validate.evaluated.props;
1470
+ var items0 = wrapper1.validate.evaluated.items;
1471
+ }
1472
+ if (data && typeof data == "object" && !Array.isArray(data)) {
1473
+ if (props0 !== true) {
1474
+ props0 = props0 || {};
1475
+ props0.source = true;
1476
+ props0.refinement = true;
1477
+ }
1478
+ if (data.source !== undefined) {
1479
+ let data0 = data.source;
1480
+ if (typeof data0 === "string") {
1481
+ if (!(formats0(data0))) {
1482
+ const err0 = createError(instancePath + "/source", "#/properties/source/format", "format", { format: "uri" }, "must match format \"" + "uri" + "\"");
1483
+ vErrors = pushError(vErrors, err0);
1484
+ errors++;
1485
+ }
1486
+ }
1487
+ else {
1488
+ const err1 = createError(instancePath + "/source", "#/properties/source/type", "type", { type: "string" }, 5);
1489
+ vErrors = pushError(vErrors, err1);
1490
+ errors++;
1491
+ }
1492
+ }
1493
+ if (data.refinement !== undefined) {
1494
+ let data1 = data.refinement;
1495
+ const _errs5 = errors;
1496
+ let valid2 = false;
1497
+ const _errs6 = errors;
1498
+ if (!(validate54(data1, { instancePath: instancePath + "/refinement", parentData: data, parentDataProperty: "refinement", rootData, dynamicAnchors }))) {
1499
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
1500
+ errors = vErrors.length;
1501
+ }
1502
+ var _valid0 = _errs6 === errors;
1503
+ valid2 = valid2 || _valid0;
1504
+ if (_valid0) {
1505
+ var props1 = {};
1506
+ props1.uid = true;
1507
+ props1.leftOperand = true;
1508
+ props1.operator = true;
1509
+ props1.rightOperand = true;
1510
+ props1.rightOperandReference = true;
1511
+ props1.dataType = true;
1512
+ props1.unit = true;
1513
+ props1.status = true;
1514
+ }
1515
+ const _errs7 = errors;
1516
+ if (!(validate62(data1, { instancePath: instancePath + "/refinement", parentData: data, parentDataProperty: "refinement", rootData, dynamicAnchors }))) {
1517
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
1518
+ errors = vErrors.length;
1519
+ }
1520
+ var _valid0 = _errs7 === errors;
1521
+ valid2 = valid2 || _valid0;
1522
+ if (_valid0) {
1523
+ if (props1 !== true) {
1524
+ props1 = props1 || {};
1525
+ props1.uid = true;
1526
+ props1.and = true;
1527
+ props1.or = true;
1528
+ props1.xone = true;
1529
+ props1.andSequence = true;
1530
+ }
1531
+ }
1532
+ const _errs8 = errors;
1533
+ if (Array.isArray(data1)) {
1534
+ const len0 = data1.length;
1535
+ for (let i0 = 0; i0 < len0; i0++) {
1536
+ let data2 = data1[i0];
1537
+ const _errs11 = errors;
1538
+ let valid5 = false;
1539
+ const _errs12 = errors;
1540
+ if (!(validate54(data2, { instancePath: instancePath + "/refinement/" + i0, parentData: data1, parentDataProperty: i0, rootData, dynamicAnchors }))) {
1541
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
1542
+ errors = vErrors.length;
1543
+ }
1544
+ var _valid1 = _errs12 === errors;
1545
+ valid5 = valid5 || _valid1;
1546
+ if (_valid1) {
1547
+ var props2 = {};
1548
+ props2.uid = true;
1549
+ props2.leftOperand = true;
1550
+ props2.operator = true;
1551
+ props2.rightOperand = true;
1552
+ props2.rightOperandReference = true;
1553
+ props2.dataType = true;
1554
+ props2.unit = true;
1555
+ props2.status = true;
1556
+ }
1557
+ const _errs13 = errors;
1558
+ if (!(validate62(data2, { instancePath: instancePath + "/refinement/" + i0, parentData: data1, parentDataProperty: i0, rootData, dynamicAnchors }))) {
1559
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
1560
+ errors = vErrors.length;
1561
+ }
1562
+ var _valid1 = _errs13 === errors;
1563
+ valid5 = valid5 || _valid1;
1564
+ if (_valid1) {
1565
+ if (props2 !== true) {
1566
+ props2 = props2 || {};
1567
+ props2.uid = true;
1568
+ props2.and = true;
1569
+ props2.or = true;
1570
+ props2.xone = true;
1571
+ props2.andSequence = true;
1572
+ }
1573
+ }
1574
+ if (!valid5) {
1575
+ const err2 = createError(instancePath + "/refinement/" + i0, "#/properties/refinement/anyOf/2/items/anyOf", "anyOf", {}, 2);
1576
+ vErrors = pushError(vErrors, err2);
1577
+ errors++;
1578
+ }
1579
+ else {
1580
+ errors = _errs11;
1581
+ if (vErrors !== null) {
1582
+ if (_errs11) {
1583
+ vErrors.length = _errs11;
1584
+ }
1585
+ else {
1586
+ vErrors = null;
1587
+ }
1588
+ }
1589
+ }
1590
+ }
1591
+ }
1592
+ else {
1593
+ const err3 = createError(instancePath + "/refinement", "#/properties/refinement/anyOf/2/type", "type", { type: "array" }, 4);
1594
+ vErrors = pushError(vErrors, err3);
1595
+ errors++;
1596
+ }
1597
+ var _valid0 = _errs8 === errors;
1598
+ valid2 = valid2 || _valid0;
1599
+ if (!valid2) {
1600
+ const err4 = createError(instancePath + "/refinement", "#/properties/refinement/anyOf", "anyOf", {}, 2);
1601
+ vErrors = pushError(vErrors, err4);
1602
+ errors++;
1603
+ }
1604
+ else {
1605
+ errors = _errs5;
1606
+ if (vErrors !== null) {
1607
+ if (_errs5) {
1608
+ vErrors.length = _errs5;
1609
+ }
1610
+ else {
1611
+ vErrors = null;
1612
+ }
1613
+ }
1614
+ }
1615
+ }
1616
+ }
1617
+ else {
1618
+ const err5 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
1619
+ vErrors = pushError(vErrors, err5);
1620
+ errors++;
1621
+ }
1622
+ validate96.errors = vErrors;
1623
+ evaluated0.props = props0;
1624
+ evaluated0.items = items0;
1625
+ return errors === 0;
1626
+ }
1627
+ validate96.evaluated = { "dynamicProps": true, "dynamicItems": true };
1628
+ function validate95(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1629
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlAsset" */ ;
1630
+ let vErrors = null;
1631
+ let errors = 0;
1632
+ const evaluated0 = validate95.evaluated;
1633
+ if (evaluated0.dynamicProps) {
1634
+ evaluated0.props = undefined;
1635
+ }
1636
+ if (evaluated0.dynamicItems) {
1637
+ evaluated0.items = undefined;
1638
+ }
1639
+ if (data && typeof data == "object" && !Array.isArray(data)) {
1640
+ if (data.uid !== undefined) {
1641
+ if (typeof data.uid !== "string") {
1642
+ const err0 = createError(instancePath + "/uid", "#/properties/uid/type", "type", { type: "string" }, 5);
1643
+ vErrors = pushError(vErrors, err0);
1644
+ errors++;
1645
+ }
1646
+ }
1647
+ if (data["@type"] !== undefined) {
1648
+ if (typeof data["@type"] !== "string") {
1649
+ const err1 = createError(instancePath + "/@type", "#/properties/%40type/type", "type", { type: "string" }, 5);
1650
+ vErrors = pushError(vErrors, err1);
1651
+ errors++;
1652
+ }
1653
+ }
1654
+ if (data.partOf !== undefined) {
1655
+ let data2 = data.partOf;
1656
+ const _errs6 = errors;
1657
+ let valid1 = false;
1658
+ const _errs7 = errors;
1659
+ if (typeof data2 !== "string") {
1660
+ const err2 = createError(instancePath + "/partOf", "#/properties/partOf/anyOf/0/type", "type", { type: "string" }, 5);
1661
+ vErrors = pushError(vErrors, err2);
1662
+ errors++;
1663
+ }
1664
+ var _valid0 = _errs7 === errors;
1665
+ valid1 = valid1 || _valid0;
1666
+ const _errs9 = errors;
1667
+ if (!(validate96(data2, { instancePath: instancePath + "/partOf", parentData: data, parentDataProperty: "partOf", rootData, dynamicAnchors }))) {
1668
+ vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);
1669
+ errors = vErrors.length;
1670
+ }
1671
+ else {
1672
+ var items0 = validate96.evaluated.items;
1673
+ }
1674
+ var _valid0 = _errs9 === errors;
1675
+ valid1 = valid1 || _valid0;
1676
+ const _errs10 = errors;
1677
+ if (Array.isArray(data2)) {
1678
+ const len0 = data2.length;
1679
+ for (let i0 = 0; i0 < len0; i0++) {
1680
+ let data3 = data2[i0];
1681
+ const _errs13 = errors;
1682
+ let valid4 = false;
1683
+ const _errs14 = errors;
1684
+ if (typeof data3 !== "string") {
1685
+ const err3 = createError(instancePath + "/partOf/" + i0, "#/properties/partOf/anyOf/2/items/anyOf/0/type", "type", { type: "string" }, 5);
1686
+ vErrors = pushError(vErrors, err3);
1687
+ errors++;
1688
+ }
1689
+ var _valid1 = _errs14 === errors;
1690
+ valid4 = valid4 || _valid1;
1691
+ const _errs16 = errors;
1692
+ if (!(validate96(data3, { instancePath: instancePath + "/partOf/" + i0, parentData: data2, parentDataProperty: i0, rootData, dynamicAnchors }))) {
1693
+ vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);
1694
+ errors = vErrors.length;
1695
+ }
1696
+ var _valid1 = _errs16 === errors;
1697
+ valid4 = valid4 || _valid1;
1698
+ if (!valid4) {
1699
+ const err4 = createError(instancePath + "/partOf/" + i0, "#/properties/partOf/anyOf/2/items/anyOf", "anyOf", {}, 2);
1700
+ vErrors = pushError(vErrors, err4);
1701
+ errors++;
1702
+ }
1703
+ else {
1704
+ errors = _errs13;
1705
+ if (vErrors !== null) {
1706
+ if (_errs13) {
1707
+ vErrors.length = _errs13;
1708
+ }
1709
+ else {
1710
+ vErrors = null;
1711
+ }
1712
+ }
1713
+ }
1714
+ }
1715
+ }
1716
+ else {
1717
+ const err5 = createError(instancePath + "/partOf", "#/properties/partOf/anyOf/2/type", "type", { type: "array" }, 4);
1718
+ vErrors = pushError(vErrors, err5);
1719
+ errors++;
1720
+ }
1721
+ var _valid0 = _errs10 === errors;
1722
+ valid1 = valid1 || _valid0;
1723
+ if (_valid0) {
1724
+ if (items0 !== true) {
1725
+ items0 = true;
1726
+ }
1727
+ }
1728
+ if (!valid1) {
1729
+ const err6 = createError(instancePath + "/partOf", "#/properties/partOf/anyOf", "anyOf", {}, 2);
1730
+ vErrors = pushError(vErrors, err6);
1731
+ errors++;
1732
+ }
1733
+ else {
1734
+ errors = _errs6;
1735
+ if (vErrors !== null) {
1736
+ if (_errs6) {
1737
+ vErrors.length = _errs6;
1738
+ }
1739
+ else {
1740
+ vErrors = null;
1741
+ }
1742
+ }
1743
+ }
1744
+ }
1745
+ if (data.hasPolicy !== undefined) {
1746
+ let data4 = data.hasPolicy;
1747
+ const _errs18 = errors;
1748
+ let valid5 = false;
1749
+ const _errs19 = errors;
1750
+ if (typeof data4 !== "string") {
1751
+ const err7 = createError(instancePath + "/hasPolicy", "#/properties/hasPolicy/anyOf/0/type", "type", { type: "string" }, 5);
1752
+ vErrors = pushError(vErrors, err7);
1753
+ errors++;
1754
+ }
1755
+ var _valid2 = _errs19 === errors;
1756
+ valid5 = valid5 || _valid2;
1757
+ const _errs21 = errors;
1758
+ if (Array.isArray(data4)) {
1759
+ const len1 = data4.length;
1760
+ for (let i1 = 0; i1 < len1; i1++) {
1761
+ if (typeof data4[i1] !== "string") {
1762
+ const err8 = createError(instancePath + "/hasPolicy/" + i1, "#/properties/hasPolicy/anyOf/1/items/type", "type", { type: "string" }, 5);
1763
+ vErrors = pushError(vErrors, err8);
1764
+ errors++;
1765
+ }
1766
+ }
1767
+ }
1768
+ else {
1769
+ const err9 = createError(instancePath + "/hasPolicy", "#/properties/hasPolicy/anyOf/1/type", "type", { type: "array" }, 4);
1770
+ vErrors = pushError(vErrors, err9);
1771
+ errors++;
1772
+ }
1773
+ var _valid2 = _errs21 === errors;
1774
+ valid5 = valid5 || _valid2;
1775
+ if (!valid5) {
1776
+ const err10 = createError(instancePath + "/hasPolicy", "#/properties/hasPolicy/anyOf", "anyOf", {}, 2);
1777
+ vErrors = pushError(vErrors, err10);
1778
+ errors++;
1779
+ }
1780
+ else {
1781
+ errors = _errs18;
1782
+ if (vErrors !== null) {
1783
+ if (_errs18) {
1784
+ vErrors.length = _errs18;
1785
+ }
1786
+ else {
1787
+ vErrors = null;
1788
+ }
1789
+ }
1790
+ }
1791
+ }
1792
+ }
1793
+ else {
1794
+ const err11 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
1795
+ vErrors = pushError(vErrors, err11);
1796
+ errors++;
1797
+ }
1798
+ validate95.errors = vErrors;
1799
+ return errors === 0;
1800
+ }
1801
+ validate95.evaluated = { "props": { "uid": true, "@type": true, "partOf": true, "hasPolicy": true }, "dynamicProps": false, "dynamicItems": false };
1802
+ const keyword6 = Object.values(external6["OdrlConflictStrategyType"]);
1803
+ function validate111(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1804
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlConflictStrategyType" */ ;
1805
+ let vErrors = null;
1806
+ let errors = 0;
1807
+ const evaluated0 = validate111.evaluated;
1808
+ if (evaluated0.dynamicProps) {
1809
+ evaluated0.props = undefined;
1810
+ }
1811
+ if (evaluated0.dynamicItems) {
1812
+ evaluated0.items = undefined;
1813
+ }
1814
+ if (!keyword6.includes(data)) {
1815
+ for (let i0 = 0; i0 < keyword6.length; i0++) {
1816
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword6[i0] }, "must be equal to constant"));
1817
+ errors++;
1818
+ }
1819
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
1820
+ errors++;
1821
+ }
1822
+ validate111.errors = vErrors;
1823
+ return errors === 0;
1824
+ }
1825
+ validate111.evaluated = { "dynamicProps": false, "dynamicItems": false };
1826
+ function validate114(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1827
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlRule" */ ;
1828
+ let vErrors = null;
1829
+ let errors = 0;
1830
+ const evaluated0 = validate114.evaluated;
1831
+ if (evaluated0.dynamicProps) {
1832
+ evaluated0.props = undefined;
1833
+ }
1834
+ if (evaluated0.dynamicItems) {
1835
+ evaluated0.items = undefined;
1836
+ }
1837
+ if (data && typeof data == "object" && !Array.isArray(data)) {
1838
+ if (data.uid !== undefined) {
1839
+ if (typeof data.uid !== "string") {
1840
+ const err0 = createError(instancePath + "/uid", "#/properties/uid/type", "type", { type: "string" }, 5);
1841
+ vErrors = pushError(vErrors, err0);
1842
+ errors++;
1843
+ }
1844
+ }
1845
+ if (data.action !== undefined) {
1846
+ let data1 = data.action;
1847
+ const _errs4 = errors;
1848
+ let valid1 = false;
1849
+ const _errs5 = errors;
1850
+ if (!(validate71(data1, { instancePath: instancePath + "/action", parentData: data, parentDataProperty: "action", rootData, dynamicAnchors }))) {
1851
+ vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);
1852
+ errors = vErrors.length;
1853
+ }
1854
+ var _valid0 = _errs5 === errors;
1855
+ valid1 = valid1 || _valid0;
1856
+ const _errs6 = errors;
1857
+ if (typeof data1 !== "string") {
1858
+ const err1 = createError(instancePath + "/action", "#/properties/action/anyOf/1/type", "type", { type: "string" }, 5);
1859
+ vErrors = pushError(vErrors, err1);
1860
+ errors++;
1861
+ }
1862
+ var _valid0 = _errs6 === errors;
1863
+ valid1 = valid1 || _valid0;
1864
+ const _errs8 = errors;
1865
+ if (!(validate53(data1, { instancePath: instancePath + "/action", parentData: data, parentDataProperty: "action", rootData, dynamicAnchors }))) {
1866
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
1867
+ errors = vErrors.length;
1868
+ }
1869
+ var _valid0 = _errs8 === errors;
1870
+ valid1 = valid1 || _valid0;
1871
+ if (_valid0) {
1872
+ var props0 = {};
1873
+ props0["rdf:value"] = true;
1874
+ props0["@id"] = true;
1875
+ props0.refinement = true;
1876
+ props0.includedIn = true;
1877
+ props0.implies = true;
1878
+ }
1879
+ const _errs9 = errors;
1880
+ if (Array.isArray(data1)) {
1881
+ const len0 = data1.length;
1882
+ for (let i0 = 0; i0 < len0; i0++) {
1883
+ let data2 = data1[i0];
1884
+ const _errs12 = errors;
1885
+ let valid4 = false;
1886
+ const _errs13 = errors;
1887
+ if (!(validate71(data2, { instancePath: instancePath + "/action/" + i0, parentData: data1, parentDataProperty: i0, rootData, dynamicAnchors }))) {
1888
+ vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);
1889
+ errors = vErrors.length;
1890
+ }
1891
+ var _valid1 = _errs13 === errors;
1892
+ valid4 = valid4 || _valid1;
1893
+ const _errs14 = errors;
1894
+ if (typeof data2 !== "string") {
1895
+ const err2 = createError(instancePath + "/action/" + i0, "#/properties/action/anyOf/3/items/anyOf/1/type", "type", { type: "string" }, 5);
1896
+ vErrors = pushError(vErrors, err2);
1897
+ errors++;
1898
+ }
1899
+ var _valid1 = _errs14 === errors;
1900
+ valid4 = valid4 || _valid1;
1901
+ const _errs16 = errors;
1902
+ if (!(validate53(data2, { instancePath: instancePath + "/action/" + i0, parentData: data1, parentDataProperty: i0, rootData, dynamicAnchors }))) {
1903
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
1904
+ errors = vErrors.length;
1905
+ }
1906
+ var _valid1 = _errs16 === errors;
1907
+ valid4 = valid4 || _valid1;
1908
+ if (_valid1) {
1909
+ var props1 = {};
1910
+ props1["rdf:value"] = true;
1911
+ props1["@id"] = true;
1912
+ props1.refinement = true;
1913
+ props1.includedIn = true;
1914
+ props1.implies = true;
1915
+ }
1916
+ if (!valid4) {
1917
+ const err3 = createError(instancePath + "/action/" + i0, "#/properties/action/anyOf/3/items/anyOf", "anyOf", {}, 2);
1918
+ vErrors = pushError(vErrors, err3);
1919
+ errors++;
1920
+ }
1921
+ else {
1922
+ errors = _errs12;
1923
+ if (vErrors !== null) {
1924
+ if (_errs12) {
1925
+ vErrors.length = _errs12;
1926
+ }
1927
+ else {
1928
+ vErrors = null;
1929
+ }
1930
+ }
1931
+ }
1932
+ }
1933
+ }
1934
+ else {
1935
+ const err4 = createError(instancePath + "/action", "#/properties/action/anyOf/3/type", "type", { type: "array" }, 4);
1936
+ vErrors = pushError(vErrors, err4);
1937
+ errors++;
1938
+ }
1939
+ var _valid0 = _errs9 === errors;
1940
+ valid1 = valid1 || _valid0;
1941
+ if (!valid1) {
1942
+ const err5 = createError(instancePath + "/action", "#/properties/action/anyOf", "anyOf", {}, 2);
1943
+ vErrors = pushError(vErrors, err5);
1944
+ errors++;
1945
+ }
1946
+ else {
1947
+ errors = _errs4;
1948
+ if (vErrors !== null) {
1949
+ if (_errs4) {
1950
+ vErrors.length = _errs4;
1951
+ }
1952
+ else {
1953
+ vErrors = null;
1954
+ }
1955
+ }
1956
+ }
1957
+ }
1958
+ if (data.target !== undefined) {
1959
+ let data3 = data.target;
1960
+ const _errs18 = errors;
1961
+ let valid5 = false;
1962
+ const _errs19 = errors;
1963
+ if (typeof data3 !== "string") {
1964
+ const err6 = createError(instancePath + "/target", "#/properties/target/anyOf/0/type", "type", { type: "string" }, 5);
1965
+ vErrors = pushError(vErrors, err6);
1966
+ errors++;
1967
+ }
1968
+ var _valid2 = _errs19 === errors;
1969
+ valid5 = valid5 || _valid2;
1970
+ const _errs21 = errors;
1971
+ if (!(validate95(data3, { instancePath: instancePath + "/target", parentData: data, parentDataProperty: "target", rootData, dynamicAnchors }))) {
1972
+ vErrors = vErrors === null ? validate95.errors : vErrors.concat(validate95.errors);
1973
+ errors = vErrors.length;
1974
+ }
1975
+ var _valid2 = _errs21 === errors;
1976
+ valid5 = valid5 || _valid2;
1977
+ if (_valid2) {
1978
+ var props2 = {};
1979
+ props2.uid = true;
1980
+ props2["@type"] = true;
1981
+ props2.partOf = true;
1982
+ props2.hasPolicy = true;
1983
+ }
1984
+ const _errs22 = errors;
1985
+ if (!(validate96(data3, { instancePath: instancePath + "/target", parentData: data, parentDataProperty: "target", rootData, dynamicAnchors }))) {
1986
+ vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);
1987
+ errors = vErrors.length;
1988
+ }
1989
+ else {
1990
+ var props3 = validate96.evaluated.props;
1991
+ var items1 = validate96.evaluated.items;
1992
+ }
1993
+ var _valid2 = _errs22 === errors;
1994
+ valid5 = valid5 || _valid2;
1995
+ if (_valid2) {
1996
+ if (props2 !== true && props3 !== undefined) {
1997
+ if (props3 === true) {
1998
+ props2 = true;
1999
+ }
2000
+ else {
2001
+ props2 = props2 || {};
2002
+ Object.assign(props2, props3);
2003
+ }
2004
+ }
2005
+ }
2006
+ const _errs23 = errors;
2007
+ if (Array.isArray(data3)) {
2008
+ const len1 = data3.length;
2009
+ for (let i1 = 0; i1 < len1; i1++) {
2010
+ let data4 = data3[i1];
2011
+ const _errs26 = errors;
2012
+ let valid8 = false;
2013
+ const _errs27 = errors;
2014
+ if (typeof data4 !== "string") {
2015
+ const err7 = createError(instancePath + "/target/" + i1, "#/properties/target/anyOf/3/items/anyOf/0/type", "type", { type: "string" }, 5);
2016
+ vErrors = pushError(vErrors, err7);
2017
+ errors++;
2018
+ }
2019
+ var _valid3 = _errs27 === errors;
2020
+ valid8 = valid8 || _valid3;
2021
+ const _errs29 = errors;
2022
+ if (!(validate95(data4, { instancePath: instancePath + "/target/" + i1, parentData: data3, parentDataProperty: i1, rootData, dynamicAnchors }))) {
2023
+ vErrors = vErrors === null ? validate95.errors : vErrors.concat(validate95.errors);
2024
+ errors = vErrors.length;
2025
+ }
2026
+ var _valid3 = _errs29 === errors;
2027
+ valid8 = valid8 || _valid3;
2028
+ if (_valid3) {
2029
+ var props4 = {};
2030
+ props4.uid = true;
2031
+ props4["@type"] = true;
2032
+ props4.partOf = true;
2033
+ props4.hasPolicy = true;
2034
+ }
2035
+ const _errs30 = errors;
2036
+ if (!(validate96(data4, { instancePath: instancePath + "/target/" + i1, parentData: data3, parentDataProperty: i1, rootData, dynamicAnchors }))) {
2037
+ vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);
2038
+ errors = vErrors.length;
2039
+ }
2040
+ else {
2041
+ var props5 = validate96.evaluated.props;
2042
+ }
2043
+ var _valid3 = _errs30 === errors;
2044
+ valid8 = valid8 || _valid3;
2045
+ if (_valid3) {
2046
+ if (props4 !== true && props5 !== undefined) {
2047
+ if (props5 === true) {
2048
+ props4 = true;
2049
+ }
2050
+ else {
2051
+ props4 = props4 || {};
2052
+ Object.assign(props4, props5);
2053
+ }
2054
+ }
2055
+ }
2056
+ if (!valid8) {
2057
+ const err8 = createError(instancePath + "/target/" + i1, "#/properties/target/anyOf/3/items/anyOf", "anyOf", {}, 2);
2058
+ vErrors = pushError(vErrors, err8);
2059
+ errors++;
2060
+ }
2061
+ else {
2062
+ errors = _errs26;
2063
+ if (vErrors !== null) {
2064
+ if (_errs26) {
2065
+ vErrors.length = _errs26;
2066
+ }
2067
+ else {
2068
+ vErrors = null;
2069
+ }
2070
+ }
2071
+ }
2072
+ }
2073
+ }
2074
+ else {
2075
+ const err9 = createError(instancePath + "/target", "#/properties/target/anyOf/3/type", "type", { type: "array" }, 4);
2076
+ vErrors = pushError(vErrors, err9);
2077
+ errors++;
2078
+ }
2079
+ var _valid2 = _errs23 === errors;
2080
+ valid5 = valid5 || _valid2;
2081
+ if (_valid2) {
2082
+ if (items1 !== true) {
2083
+ items1 = true;
2084
+ }
2085
+ }
2086
+ if (!valid5) {
2087
+ const err10 = createError(instancePath + "/target", "#/properties/target/anyOf", "anyOf", {}, 2);
2088
+ vErrors = pushError(vErrors, err10);
2089
+ errors++;
2090
+ }
2091
+ else {
2092
+ errors = _errs18;
2093
+ if (vErrors !== null) {
2094
+ if (_errs18) {
2095
+ vErrors.length = _errs18;
2096
+ }
2097
+ else {
2098
+ vErrors = null;
2099
+ }
2100
+ }
2101
+ }
2102
+ }
2103
+ if (data.assigner !== undefined) {
2104
+ let data5 = data.assigner;
2105
+ const _errs32 = errors;
2106
+ let valid9 = false;
2107
+ const _errs33 = errors;
2108
+ if (typeof data5 !== "string") {
2109
+ const err11 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf/0/type", "type", { type: "string" }, 5);
2110
+ vErrors = pushError(vErrors, err11);
2111
+ errors++;
2112
+ }
2113
+ var _valid4 = _errs33 === errors;
2114
+ valid9 = valid9 || _valid4;
2115
+ const _errs35 = errors;
2116
+ if (!(validate79(data5, { instancePath: instancePath + "/assigner", parentData: data, parentDataProperty: "assigner", rootData, dynamicAnchors }))) {
2117
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
2118
+ errors = vErrors.length;
2119
+ }
2120
+ var _valid4 = _errs35 === errors;
2121
+ valid9 = valid9 || _valid4;
2122
+ if (_valid4) {
2123
+ var props6 = {};
2124
+ props6.uid = true;
2125
+ props6["@type"] = true;
2126
+ props6.partOf = true;
2127
+ props6.assigneeOf = true;
2128
+ props6.assignerOf = true;
2129
+ }
2130
+ const _errs36 = errors;
2131
+ if (!(validate80(data5, { instancePath: instancePath + "/assigner", parentData: data, parentDataProperty: "assigner", rootData, dynamicAnchors }))) {
2132
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
2133
+ errors = vErrors.length;
2134
+ }
2135
+ else {
2136
+ var props7 = validate80.evaluated.props;
2137
+ var items3 = validate80.evaluated.items;
2138
+ }
2139
+ var _valid4 = _errs36 === errors;
2140
+ valid9 = valid9 || _valid4;
2141
+ if (_valid4) {
2142
+ if (props6 !== true && props7 !== undefined) {
2143
+ if (props7 === true) {
2144
+ props6 = true;
2145
+ }
2146
+ else {
2147
+ props6 = props6 || {};
2148
+ Object.assign(props6, props7);
2149
+ }
2150
+ }
2151
+ }
2152
+ const _errs37 = errors;
2153
+ if (Array.isArray(data5)) {
2154
+ const len2 = data5.length;
2155
+ for (let i2 = 0; i2 < len2; i2++) {
2156
+ let data6 = data5[i2];
2157
+ const _errs40 = errors;
2158
+ let valid12 = false;
2159
+ const _errs41 = errors;
2160
+ if (typeof data6 !== "string") {
2161
+ const err12 = createError(instancePath + "/assigner/" + i2, "#/properties/assigner/anyOf/3/items/anyOf/0/type", "type", { type: "string" }, 5);
2162
+ vErrors = pushError(vErrors, err12);
2163
+ errors++;
2164
+ }
2165
+ var _valid5 = _errs41 === errors;
2166
+ valid12 = valid12 || _valid5;
2167
+ const _errs43 = errors;
2168
+ if (!(validate79(data6, { instancePath: instancePath + "/assigner/" + i2, parentData: data5, parentDataProperty: i2, rootData, dynamicAnchors }))) {
2169
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
2170
+ errors = vErrors.length;
2171
+ }
2172
+ var _valid5 = _errs43 === errors;
2173
+ valid12 = valid12 || _valid5;
2174
+ if (_valid5) {
2175
+ var props8 = {};
2176
+ props8.uid = true;
2177
+ props8["@type"] = true;
2178
+ props8.partOf = true;
2179
+ props8.assigneeOf = true;
2180
+ props8.assignerOf = true;
2181
+ }
2182
+ const _errs44 = errors;
2183
+ if (!(validate80(data6, { instancePath: instancePath + "/assigner/" + i2, parentData: data5, parentDataProperty: i2, rootData, dynamicAnchors }))) {
2184
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
2185
+ errors = vErrors.length;
2186
+ }
2187
+ else {
2188
+ var props9 = validate80.evaluated.props;
2189
+ }
2190
+ var _valid5 = _errs44 === errors;
2191
+ valid12 = valid12 || _valid5;
2192
+ if (_valid5) {
2193
+ if (props8 !== true && props9 !== undefined) {
2194
+ if (props9 === true) {
2195
+ props8 = true;
2196
+ }
2197
+ else {
2198
+ props8 = props8 || {};
2199
+ Object.assign(props8, props9);
2200
+ }
2201
+ }
2202
+ }
2203
+ if (!valid12) {
2204
+ const err13 = createError(instancePath + "/assigner/" + i2, "#/properties/assigner/anyOf/3/items/anyOf", "anyOf", {}, 2);
2205
+ vErrors = pushError(vErrors, err13);
2206
+ errors++;
2207
+ }
2208
+ else {
2209
+ errors = _errs40;
2210
+ if (vErrors !== null) {
2211
+ if (_errs40) {
2212
+ vErrors.length = _errs40;
2213
+ }
2214
+ else {
2215
+ vErrors = null;
2216
+ }
2217
+ }
2218
+ }
2219
+ }
2220
+ }
2221
+ else {
2222
+ const err14 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf/3/type", "type", { type: "array" }, 4);
2223
+ vErrors = pushError(vErrors, err14);
2224
+ errors++;
2225
+ }
2226
+ var _valid4 = _errs37 === errors;
2227
+ valid9 = valid9 || _valid4;
2228
+ if (_valid4) {
2229
+ if (items3 !== true) {
2230
+ items3 = true;
2231
+ }
2232
+ }
2233
+ if (!valid9) {
2234
+ const err15 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf", "anyOf", {}, 2);
2235
+ vErrors = pushError(vErrors, err15);
2236
+ errors++;
2237
+ }
2238
+ else {
2239
+ errors = _errs32;
2240
+ if (vErrors !== null) {
2241
+ if (_errs32) {
2242
+ vErrors.length = _errs32;
2243
+ }
2244
+ else {
2245
+ vErrors = null;
2246
+ }
2247
+ }
2248
+ }
2249
+ }
2250
+ if (data.assignee !== undefined) {
2251
+ let data7 = data.assignee;
2252
+ const _errs46 = errors;
2253
+ let valid13 = false;
2254
+ const _errs47 = errors;
2255
+ if (typeof data7 !== "string") {
2256
+ const err16 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf/0/type", "type", { type: "string" }, 5);
2257
+ vErrors = pushError(vErrors, err16);
2258
+ errors++;
2259
+ }
2260
+ var _valid6 = _errs47 === errors;
2261
+ valid13 = valid13 || _valid6;
2262
+ const _errs49 = errors;
2263
+ if (!(validate79(data7, { instancePath: instancePath + "/assignee", parentData: data, parentDataProperty: "assignee", rootData, dynamicAnchors }))) {
2264
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
2265
+ errors = vErrors.length;
2266
+ }
2267
+ var _valid6 = _errs49 === errors;
2268
+ valid13 = valid13 || _valid6;
2269
+ if (_valid6) {
2270
+ var props10 = {};
2271
+ props10.uid = true;
2272
+ props10["@type"] = true;
2273
+ props10.partOf = true;
2274
+ props10.assigneeOf = true;
2275
+ props10.assignerOf = true;
2276
+ }
2277
+ const _errs50 = errors;
2278
+ if (!(validate80(data7, { instancePath: instancePath + "/assignee", parentData: data, parentDataProperty: "assignee", rootData, dynamicAnchors }))) {
2279
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
2280
+ errors = vErrors.length;
2281
+ }
2282
+ else {
2283
+ var props11 = validate80.evaluated.props;
2284
+ var items5 = validate80.evaluated.items;
2285
+ }
2286
+ var _valid6 = _errs50 === errors;
2287
+ valid13 = valid13 || _valid6;
2288
+ if (_valid6) {
2289
+ if (props10 !== true && props11 !== undefined) {
2290
+ if (props11 === true) {
2291
+ props10 = true;
2292
+ }
2293
+ else {
2294
+ props10 = props10 || {};
2295
+ Object.assign(props10, props11);
2296
+ }
2297
+ }
2298
+ }
2299
+ const _errs51 = errors;
2300
+ if (Array.isArray(data7)) {
2301
+ const len3 = data7.length;
2302
+ for (let i3 = 0; i3 < len3; i3++) {
2303
+ let data8 = data7[i3];
2304
+ const _errs54 = errors;
2305
+ let valid16 = false;
2306
+ const _errs55 = errors;
2307
+ if (typeof data8 !== "string") {
2308
+ const err17 = createError(instancePath + "/assignee/" + i3, "#/properties/assignee/anyOf/3/items/anyOf/0/type", "type", { type: "string" }, 5);
2309
+ vErrors = pushError(vErrors, err17);
2310
+ errors++;
2311
+ }
2312
+ var _valid7 = _errs55 === errors;
2313
+ valid16 = valid16 || _valid7;
2314
+ const _errs57 = errors;
2315
+ if (!(validate79(data8, { instancePath: instancePath + "/assignee/" + i3, parentData: data7, parentDataProperty: i3, rootData, dynamicAnchors }))) {
2316
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
2317
+ errors = vErrors.length;
2318
+ }
2319
+ var _valid7 = _errs57 === errors;
2320
+ valid16 = valid16 || _valid7;
2321
+ if (_valid7) {
2322
+ var props12 = {};
2323
+ props12.uid = true;
2324
+ props12["@type"] = true;
2325
+ props12.partOf = true;
2326
+ props12.assigneeOf = true;
2327
+ props12.assignerOf = true;
2328
+ }
2329
+ const _errs58 = errors;
2330
+ if (!(validate80(data8, { instancePath: instancePath + "/assignee/" + i3, parentData: data7, parentDataProperty: i3, rootData, dynamicAnchors }))) {
2331
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
2332
+ errors = vErrors.length;
2333
+ }
2334
+ else {
2335
+ var props13 = validate80.evaluated.props;
2336
+ }
2337
+ var _valid7 = _errs58 === errors;
2338
+ valid16 = valid16 || _valid7;
2339
+ if (_valid7) {
2340
+ if (props12 !== true && props13 !== undefined) {
2341
+ if (props13 === true) {
2342
+ props12 = true;
2343
+ }
2344
+ else {
2345
+ props12 = props12 || {};
2346
+ Object.assign(props12, props13);
2347
+ }
2348
+ }
2349
+ }
2350
+ if (!valid16) {
2351
+ const err18 = createError(instancePath + "/assignee/" + i3, "#/properties/assignee/anyOf/3/items/anyOf", "anyOf", {}, 2);
2352
+ vErrors = pushError(vErrors, err18);
2353
+ errors++;
2354
+ }
2355
+ else {
2356
+ errors = _errs54;
2357
+ if (vErrors !== null) {
2358
+ if (_errs54) {
2359
+ vErrors.length = _errs54;
2360
+ }
2361
+ else {
2362
+ vErrors = null;
2363
+ }
2364
+ }
2365
+ }
2366
+ }
2367
+ }
2368
+ else {
2369
+ const err19 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf/3/type", "type", { type: "array" }, 4);
2370
+ vErrors = pushError(vErrors, err19);
2371
+ errors++;
2372
+ }
2373
+ var _valid6 = _errs51 === errors;
2374
+ valid13 = valid13 || _valid6;
2375
+ if (_valid6) {
2376
+ if (items5 !== true) {
2377
+ items5 = true;
2378
+ }
2379
+ }
2380
+ if (!valid13) {
2381
+ const err20 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf", "anyOf", {}, 2);
2382
+ vErrors = pushError(vErrors, err20);
2383
+ errors++;
2384
+ }
2385
+ else {
2386
+ errors = _errs46;
2387
+ if (vErrors !== null) {
2388
+ if (_errs46) {
2389
+ vErrors.length = _errs46;
2390
+ }
2391
+ else {
2392
+ vErrors = null;
2393
+ }
2394
+ }
2395
+ }
2396
+ }
2397
+ if (data.constraint !== undefined) {
2398
+ let data9 = data.constraint;
2399
+ const _errs60 = errors;
2400
+ let valid17 = false;
2401
+ const _errs61 = errors;
2402
+ if (!(validate54(data9, { instancePath: instancePath + "/constraint", parentData: data, parentDataProperty: "constraint", rootData, dynamicAnchors }))) {
2403
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
2404
+ errors = vErrors.length;
2405
+ }
2406
+ var _valid8 = _errs61 === errors;
2407
+ valid17 = valid17 || _valid8;
2408
+ if (_valid8) {
2409
+ var props14 = {};
2410
+ props14.uid = true;
2411
+ props14.leftOperand = true;
2412
+ props14.operator = true;
2413
+ props14.rightOperand = true;
2414
+ props14.rightOperandReference = true;
2415
+ props14.dataType = true;
2416
+ props14.unit = true;
2417
+ props14.status = true;
2418
+ }
2419
+ const _errs62 = errors;
2420
+ if (!(validate62(data9, { instancePath: instancePath + "/constraint", parentData: data, parentDataProperty: "constraint", rootData, dynamicAnchors }))) {
2421
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
2422
+ errors = vErrors.length;
2423
+ }
2424
+ var _valid8 = _errs62 === errors;
2425
+ valid17 = valid17 || _valid8;
2426
+ if (_valid8) {
2427
+ if (props14 !== true) {
2428
+ props14 = props14 || {};
2429
+ props14.uid = true;
2430
+ props14.and = true;
2431
+ props14.or = true;
2432
+ props14.xone = true;
2433
+ props14.andSequence = true;
2434
+ }
2435
+ }
2436
+ const _errs63 = errors;
2437
+ if (Array.isArray(data9)) {
2438
+ const len4 = data9.length;
2439
+ for (let i4 = 0; i4 < len4; i4++) {
2440
+ let data10 = data9[i4];
2441
+ const _errs66 = errors;
2442
+ let valid20 = false;
2443
+ const _errs67 = errors;
2444
+ if (!(validate54(data10, { instancePath: instancePath + "/constraint/" + i4, parentData: data9, parentDataProperty: i4, rootData, dynamicAnchors }))) {
2445
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
2446
+ errors = vErrors.length;
2447
+ }
2448
+ var _valid9 = _errs67 === errors;
2449
+ valid20 = valid20 || _valid9;
2450
+ if (_valid9) {
2451
+ var props15 = {};
2452
+ props15.uid = true;
2453
+ props15.leftOperand = true;
2454
+ props15.operator = true;
2455
+ props15.rightOperand = true;
2456
+ props15.rightOperandReference = true;
2457
+ props15.dataType = true;
2458
+ props15.unit = true;
2459
+ props15.status = true;
2460
+ }
2461
+ const _errs68 = errors;
2462
+ if (!(validate62(data10, { instancePath: instancePath + "/constraint/" + i4, parentData: data9, parentDataProperty: i4, rootData, dynamicAnchors }))) {
2463
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
2464
+ errors = vErrors.length;
2465
+ }
2466
+ var _valid9 = _errs68 === errors;
2467
+ valid20 = valid20 || _valid9;
2468
+ if (_valid9) {
2469
+ if (props15 !== true) {
2470
+ props15 = props15 || {};
2471
+ props15.uid = true;
2472
+ props15.and = true;
2473
+ props15.or = true;
2474
+ props15.xone = true;
2475
+ props15.andSequence = true;
2476
+ }
2477
+ }
2478
+ if (!valid20) {
2479
+ const err21 = createError(instancePath + "/constraint/" + i4, "#/properties/constraint/anyOf/2/items/anyOf", "anyOf", {}, 2);
2480
+ vErrors = pushError(vErrors, err21);
2481
+ errors++;
2482
+ }
2483
+ else {
2484
+ errors = _errs66;
2485
+ if (vErrors !== null) {
2486
+ if (_errs66) {
2487
+ vErrors.length = _errs66;
2488
+ }
2489
+ else {
2490
+ vErrors = null;
2491
+ }
2492
+ }
2493
+ }
2494
+ }
2495
+ }
2496
+ else {
2497
+ const err22 = createError(instancePath + "/constraint", "#/properties/constraint/anyOf/2/type", "type", { type: "array" }, 4);
2498
+ vErrors = pushError(vErrors, err22);
2499
+ errors++;
2500
+ }
2501
+ var _valid8 = _errs63 === errors;
2502
+ valid17 = valid17 || _valid8;
2503
+ if (!valid17) {
2504
+ const err23 = createError(instancePath + "/constraint", "#/properties/constraint/anyOf", "anyOf", {}, 2);
2505
+ vErrors = pushError(vErrors, err23);
2506
+ errors++;
2507
+ }
2508
+ else {
2509
+ errors = _errs60;
2510
+ if (vErrors !== null) {
2511
+ if (_errs60) {
2512
+ vErrors.length = _errs60;
2513
+ }
2514
+ else {
2515
+ vErrors = null;
2516
+ }
2517
+ }
2518
+ }
2519
+ }
2520
+ if (data.summary !== undefined) {
2521
+ if (typeof data.summary !== "string") {
2522
+ const err24 = createError(instancePath + "/summary", "#/properties/summary/type", "type", { type: "string" }, 5);
2523
+ vErrors = pushError(vErrors, err24);
2524
+ errors++;
2525
+ }
2526
+ }
2527
+ }
2528
+ else {
2529
+ const err25 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
2530
+ vErrors = pushError(vErrors, err25);
2531
+ errors++;
2532
+ }
2533
+ validate114.errors = vErrors;
2534
+ return errors === 0;
2535
+ }
2536
+ validate114.evaluated = { "props": { "uid": true, "action": true, "target": true, "assigner": true, "assignee": true, "constraint": true, "summary": true }, "dynamicProps": false, "dynamicItems": false };
2537
+ const wrapper2 = { validate: validate136 };
2538
+ function validate136(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
2539
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlDuty" */ ;
2540
+ let vErrors = null;
2541
+ let errors = 0;
2542
+ const evaluated0 = validate136.evaluated;
2543
+ if (evaluated0.dynamicProps) {
2544
+ evaluated0.props = undefined;
2545
+ }
2546
+ if (evaluated0.dynamicItems) {
2547
+ evaluated0.items = undefined;
2548
+ }
2549
+ if (!(validate114(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
2550
+ vErrors = vErrors === null ? validate114.errors : vErrors.concat(validate114.errors);
2551
+ errors = vErrors.length;
2552
+ }
2553
+ if (data && typeof data == "object" && !Array.isArray(data)) {
2554
+ if (data.attributedParty !== undefined) {
2555
+ if (typeof data.attributedParty !== "string") {
2556
+ const err0 = createError(instancePath + "/attributedParty", "#/properties/attributedParty/type", "type", { type: "string" }, 5);
2557
+ vErrors = pushError(vErrors, err0);
2558
+ errors++;
2559
+ }
2560
+ }
2561
+ if (data.trackingParty !== undefined) {
2562
+ if (typeof data.trackingParty !== "string") {
2563
+ const err1 = createError(instancePath + "/trackingParty", "#/properties/trackingParty/type", "type", { type: "string" }, 5);
2564
+ vErrors = pushError(vErrors, err1);
2565
+ errors++;
2566
+ }
2567
+ }
2568
+ if (data.consequence !== undefined) {
2569
+ let data2 = data.consequence;
2570
+ const _errs7 = errors;
2571
+ let valid2 = false;
2572
+ const _errs8 = errors;
2573
+ if (!(wrapper2.validate(data2, { instancePath: instancePath + "/consequence", parentData: data, parentDataProperty: "consequence", rootData, dynamicAnchors }))) {
2574
+ vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);
2575
+ errors = vErrors.length;
2576
+ }
2577
+ else {
2578
+ var items0 = wrapper2.validate.evaluated.items;
2579
+ }
2580
+ var _valid0 = _errs8 === errors;
2581
+ valid2 = valid2 || _valid0;
2582
+ const _errs9 = errors;
2583
+ if (Array.isArray(data2)) {
2584
+ const len0 = data2.length;
2585
+ for (let i0 = 0; i0 < len0; i0++) {
2586
+ if (!(wrapper2.validate(data2[i0], { instancePath: instancePath + "/consequence/" + i0, parentData: data2, parentDataProperty: i0, rootData, dynamicAnchors }))) {
2587
+ vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);
2588
+ errors = vErrors.length;
2589
+ }
2590
+ }
2591
+ }
2592
+ else {
2593
+ const err2 = createError(instancePath + "/consequence", "#/properties/consequence/anyOf/1/type", "type", { type: "array" }, 4);
2594
+ vErrors = pushError(vErrors, err2);
2595
+ errors++;
2596
+ }
2597
+ var _valid0 = _errs9 === errors;
2598
+ valid2 = valid2 || _valid0;
2599
+ if (_valid0) {
2600
+ if (items0 !== true) {
2601
+ items0 = true;
2602
+ }
2603
+ }
2604
+ if (!valid2) {
2605
+ const err3 = createError(instancePath + "/consequence", "#/properties/consequence/anyOf", "anyOf", {}, 2);
2606
+ vErrors = pushError(vErrors, err3);
2607
+ errors++;
2608
+ }
2609
+ else {
2610
+ errors = _errs7;
2611
+ if (vErrors !== null) {
2612
+ if (_errs7) {
2613
+ vErrors.length = _errs7;
2614
+ }
2615
+ else {
2616
+ vErrors = null;
2617
+ }
2618
+ }
2619
+ }
2620
+ }
2621
+ if (data.compensatedParty !== undefined) {
2622
+ if (typeof data.compensatedParty !== "string") {
2623
+ const err4 = createError(instancePath + "/compensatedParty", "#/properties/compensatedParty/type", "type", { type: "string" }, 5);
2624
+ vErrors = pushError(vErrors, err4);
2625
+ errors++;
2626
+ }
2627
+ }
2628
+ }
2629
+ else {
2630
+ const err5 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
2631
+ vErrors = pushError(vErrors, err5);
2632
+ errors++;
2633
+ }
2634
+ validate136.errors = vErrors;
2635
+ return errors === 0;
2636
+ }
2637
+ validate136.evaluated = { "props": { "attributedParty": true, "trackingParty": true, "consequence": true, "compensatedParty": true, "uid": true, "action": true, "target": true, "assigner": true, "assignee": true, "constraint": true, "summary": true }, "dynamicProps": false, "dynamicItems": false };
2638
+ function validate113(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
2639
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlPermission" */ ;
2640
+ let vErrors = null;
2641
+ let errors = 0;
2642
+ const evaluated0 = validate113.evaluated;
2643
+ if (evaluated0.dynamicProps) {
2644
+ evaluated0.props = undefined;
2645
+ }
2646
+ if (evaluated0.dynamicItems) {
2647
+ evaluated0.items = undefined;
2648
+ }
2649
+ if (!(validate114(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
2650
+ vErrors = vErrors === null ? validate114.errors : vErrors.concat(validate114.errors);
2651
+ errors = vErrors.length;
2652
+ }
2653
+ if (data && typeof data == "object" && !Array.isArray(data)) {
2654
+ if (data.duty !== undefined) {
2655
+ let data0 = data.duty;
2656
+ const _errs3 = errors;
2657
+ let valid2 = false;
2658
+ const _errs4 = errors;
2659
+ if (!(validate136(data0, { instancePath: instancePath + "/duty", parentData: data, parentDataProperty: "duty", rootData, dynamicAnchors }))) {
2660
+ vErrors = vErrors === null ? validate136.errors : vErrors.concat(validate136.errors);
2661
+ errors = vErrors.length;
2662
+ }
2663
+ var _valid0 = _errs4 === errors;
2664
+ valid2 = valid2 || _valid0;
2665
+ if (_valid0) {
2666
+ var props0 = {};
2667
+ props0.attributedParty = true;
2668
+ props0.trackingParty = true;
2669
+ props0.consequence = true;
2670
+ props0.compensatedParty = true;
2671
+ props0.uid = true;
2672
+ props0.action = true;
2673
+ props0.target = true;
2674
+ props0.assigner = true;
2675
+ props0.assignee = true;
2676
+ props0.constraint = true;
2677
+ props0.summary = true;
2678
+ }
2679
+ const _errs5 = errors;
2680
+ if (Array.isArray(data0)) {
2681
+ const len0 = data0.length;
2682
+ for (let i0 = 0; i0 < len0; i0++) {
2683
+ if (!(validate136(data0[i0], { instancePath: instancePath + "/duty/" + i0, parentData: data0, parentDataProperty: i0, rootData, dynamicAnchors }))) {
2684
+ vErrors = vErrors === null ? validate136.errors : vErrors.concat(validate136.errors);
2685
+ errors = vErrors.length;
2686
+ }
2687
+ }
2688
+ }
2689
+ else {
2690
+ const err0 = createError(instancePath + "/duty", "#/properties/duty/anyOf/1/type", "type", { type: "array" }, 4);
2691
+ vErrors = pushError(vErrors, err0);
2692
+ errors++;
2693
+ }
2694
+ var _valid0 = _errs5 === errors;
2695
+ valid2 = valid2 || _valid0;
2696
+ if (!valid2) {
2697
+ const err1 = createError(instancePath + "/duty", "#/properties/duty/anyOf", "anyOf", {}, 2);
2698
+ vErrors = pushError(vErrors, err1);
2699
+ errors++;
2700
+ }
2701
+ else {
2702
+ errors = _errs3;
2703
+ if (vErrors !== null) {
2704
+ if (_errs3) {
2705
+ vErrors.length = _errs3;
2706
+ }
2707
+ else {
2708
+ vErrors = null;
2709
+ }
2710
+ }
2711
+ }
2712
+ }
2713
+ }
2714
+ else {
2715
+ const err2 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
2716
+ vErrors = pushError(vErrors, err2);
2717
+ errors++;
2718
+ }
2719
+ validate113.errors = vErrors;
2720
+ return errors === 0;
2721
+ }
2722
+ validate113.evaluated = { "props": { "duty": true, "uid": true, "action": true, "target": true, "assigner": true, "assignee": true, "constraint": true, "summary": true }, "dynamicProps": false, "dynamicItems": false };
2723
+ function validate142(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
2724
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlProhibition" */ ;
2725
+ let vErrors = null;
2726
+ let errors = 0;
2727
+ const evaluated0 = validate142.evaluated;
2728
+ if (evaluated0.dynamicProps) {
2729
+ evaluated0.props = undefined;
2730
+ }
2731
+ if (evaluated0.dynamicItems) {
2732
+ evaluated0.items = undefined;
2733
+ }
2734
+ if (!(validate114(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
2735
+ vErrors = vErrors === null ? validate114.errors : vErrors.concat(validate114.errors);
2736
+ errors = vErrors.length;
2737
+ }
2738
+ if (data && typeof data == "object" && !Array.isArray(data)) {
2739
+ if (data.remedy !== undefined) {
2740
+ let data0 = data.remedy;
2741
+ const _errs3 = errors;
2742
+ let valid2 = false;
2743
+ const _errs4 = errors;
2744
+ if (!(validate136(data0, { instancePath: instancePath + "/remedy", parentData: data, parentDataProperty: "remedy", rootData, dynamicAnchors }))) {
2745
+ vErrors = vErrors === null ? validate136.errors : vErrors.concat(validate136.errors);
2746
+ errors = vErrors.length;
2747
+ }
2748
+ var _valid0 = _errs4 === errors;
2749
+ valid2 = valid2 || _valid0;
2750
+ if (_valid0) {
2751
+ var props0 = {};
2752
+ props0.attributedParty = true;
2753
+ props0.trackingParty = true;
2754
+ props0.consequence = true;
2755
+ props0.compensatedParty = true;
2756
+ props0.uid = true;
2757
+ props0.action = true;
2758
+ props0.target = true;
2759
+ props0.assigner = true;
2760
+ props0.assignee = true;
2761
+ props0.constraint = true;
2762
+ props0.summary = true;
2763
+ }
2764
+ const _errs5 = errors;
2765
+ if (Array.isArray(data0)) {
2766
+ const len0 = data0.length;
2767
+ for (let i0 = 0; i0 < len0; i0++) {
2768
+ if (!(validate136(data0[i0], { instancePath: instancePath + "/remedy/" + i0, parentData: data0, parentDataProperty: i0, rootData, dynamicAnchors }))) {
2769
+ vErrors = vErrors === null ? validate136.errors : vErrors.concat(validate136.errors);
2770
+ errors = vErrors.length;
2771
+ }
2772
+ }
2773
+ }
2774
+ else {
2775
+ const err0 = createError(instancePath + "/remedy", "#/properties/remedy/anyOf/1/type", "type", { type: "array" }, 4);
2776
+ vErrors = pushError(vErrors, err0);
2777
+ errors++;
2778
+ }
2779
+ var _valid0 = _errs5 === errors;
2780
+ valid2 = valid2 || _valid0;
2781
+ if (!valid2) {
2782
+ const err1 = createError(instancePath + "/remedy", "#/properties/remedy/anyOf", "anyOf", {}, 2);
2783
+ vErrors = pushError(vErrors, err1);
2784
+ errors++;
2785
+ }
2786
+ else {
2787
+ errors = _errs3;
2788
+ if (vErrors !== null) {
2789
+ if (_errs3) {
2790
+ vErrors.length = _errs3;
2791
+ }
2792
+ else {
2793
+ vErrors = null;
2794
+ }
2795
+ }
2796
+ }
2797
+ }
2798
+ }
2799
+ else {
2800
+ const err2 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
2801
+ vErrors = pushError(vErrors, err2);
2802
+ errors++;
2803
+ }
2804
+ validate142.errors = vErrors;
2805
+ return errors === 0;
2806
+ }
2807
+ validate142.evaluated = { "props": { "remedy": true, "uid": true, "action": true, "target": true, "assigner": true, "assignee": true, "constraint": true, "summary": true }, "dynamicProps": false, "dynamicItems": false };
2808
+ function validate75(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
2809
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlPolicy" */ ;
2810
+ let vErrors = null;
2811
+ let errors = 0;
2812
+ const evaluated0 = validate75.evaluated;
2813
+ if (evaluated0.dynamicProps) {
2814
+ evaluated0.props = undefined;
2815
+ }
2816
+ if (evaluated0.dynamicItems) {
2817
+ evaluated0.items = undefined;
2818
+ }
2819
+ if (data && typeof data == "object" && !Array.isArray(data)) {
2820
+ if (data["@context"] === undefined) {
2821
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@context" }, "must have required property '" + "@context" + "'");
2822
+ vErrors = pushError(vErrors, err0);
2823
+ errors++;
2824
+ }
2825
+ if (data["@type"] === undefined) {
2826
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "@type" }, "must have required property '" + "@type" + "'");
2827
+ vErrors = pushError(vErrors, err1);
2828
+ errors++;
2829
+ }
2830
+ if (data.uid === undefined) {
2831
+ const err2 = createError(instancePath, "#/required", "required", { missingProperty: "uid" }, "must have required property '" + "uid" + "'");
2832
+ vErrors = pushError(vErrors, err2);
2833
+ errors++;
2834
+ }
2835
+ if (data["@context"] !== undefined) {
2836
+ if (!(validate52(data["@context"], { instancePath: instancePath + "/@context", parentData: data, parentDataProperty: "@context", rootData, dynamicAnchors }))) {
2837
+ vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);
2838
+ errors = vErrors.length;
2839
+ }
2840
+ }
2841
+ if (data["@type"] !== undefined) {
2842
+ if (!(validate77(data["@type"], { instancePath: instancePath + "/@type", parentData: data, parentDataProperty: "@type", rootData, dynamicAnchors }))) {
2843
+ vErrors = vErrors === null ? validate77.errors : vErrors.concat(validate77.errors);
2844
+ errors = vErrors.length;
2845
+ }
2846
+ }
2847
+ if (data.uid !== undefined) {
2848
+ let data2 = data.uid;
2849
+ if (typeof data2 === "string") {
2850
+ if (!(formats0(data2))) {
2851
+ const err3 = createError(instancePath + "/uid", "#/properties/uid/format", "format", { format: "uri" }, "must match format \"" + "uri" + "\"");
2852
+ vErrors = pushError(vErrors, err3);
2853
+ errors++;
2854
+ }
2855
+ }
2856
+ else {
2857
+ const err4 = createError(instancePath + "/uid", "#/properties/uid/type", "type", { type: "string" }, 5);
2858
+ vErrors = pushError(vErrors, err4);
2859
+ errors++;
2860
+ }
2861
+ }
2862
+ if (data.profile !== undefined) {
2863
+ let data3 = data.profile;
2864
+ const _errs6 = errors;
2865
+ let valid1 = false;
2866
+ const _errs7 = errors;
2867
+ if (typeof data3 !== "string") {
2868
+ const err5 = createError(instancePath + "/profile", "#/properties/profile/anyOf/0/type", "type", { type: "string" }, 5);
2869
+ vErrors = pushError(vErrors, err5);
2870
+ errors++;
2871
+ }
2872
+ var _valid0 = _errs7 === errors;
2873
+ valid1 = valid1 || _valid0;
2874
+ const _errs9 = errors;
2875
+ if (Array.isArray(data3)) {
2876
+ const len0 = data3.length;
2877
+ for (let i0 = 0; i0 < len0; i0++) {
2878
+ if (typeof data3[i0] !== "string") {
2879
+ const err6 = createError(instancePath + "/profile/" + i0, "#/properties/profile/anyOf/1/items/type", "type", { type: "string" }, 5);
2880
+ vErrors = pushError(vErrors, err6);
2881
+ errors++;
2882
+ }
2883
+ }
2884
+ }
2885
+ else {
2886
+ const err7 = createError(instancePath + "/profile", "#/properties/profile/anyOf/1/type", "type", { type: "array" }, 4);
2887
+ vErrors = pushError(vErrors, err7);
2888
+ errors++;
2889
+ }
2890
+ var _valid0 = _errs9 === errors;
2891
+ valid1 = valid1 || _valid0;
2892
+ if (!valid1) {
2893
+ const err8 = createError(instancePath + "/profile", "#/properties/profile/anyOf", "anyOf", {}, 2);
2894
+ vErrors = pushError(vErrors, err8);
2895
+ errors++;
2896
+ }
2897
+ else {
2898
+ errors = _errs6;
2899
+ if (vErrors !== null) {
2900
+ if (_errs6) {
2901
+ vErrors.length = _errs6;
2902
+ }
2903
+ else {
2904
+ vErrors = null;
2905
+ }
2906
+ }
2907
+ }
2908
+ }
2909
+ if (data.assigner !== undefined) {
2910
+ let data5 = data.assigner;
2911
+ const _errs14 = errors;
2912
+ let valid4 = false;
2913
+ const _errs15 = errors;
2914
+ if (typeof data5 !== "string") {
2915
+ const err9 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf/0/type", "type", { type: "string" }, 5);
2916
+ vErrors = pushError(vErrors, err9);
2917
+ errors++;
2918
+ }
2919
+ var _valid1 = _errs15 === errors;
2920
+ valid4 = valid4 || _valid1;
2921
+ const _errs17 = errors;
2922
+ if (!(validate79(data5, { instancePath: instancePath + "/assigner", parentData: data, parentDataProperty: "assigner", rootData, dynamicAnchors }))) {
2923
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
2924
+ errors = vErrors.length;
2925
+ }
2926
+ var _valid1 = _errs17 === errors;
2927
+ valid4 = valid4 || _valid1;
2928
+ if (_valid1) {
2929
+ var props0 = {};
2930
+ props0.uid = true;
2931
+ props0["@type"] = true;
2932
+ props0.partOf = true;
2933
+ props0.assigneeOf = true;
2934
+ props0.assignerOf = true;
2935
+ }
2936
+ const _errs18 = errors;
2937
+ if (!(validate80(data5, { instancePath: instancePath + "/assigner", parentData: data, parentDataProperty: "assigner", rootData, dynamicAnchors }))) {
2938
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
2939
+ errors = vErrors.length;
2940
+ }
2941
+ else {
2942
+ var props1 = validate80.evaluated.props;
2943
+ var items2 = validate80.evaluated.items;
2944
+ }
2945
+ var _valid1 = _errs18 === errors;
2946
+ valid4 = valid4 || _valid1;
2947
+ if (_valid1) {
2948
+ if (props0 !== true && props1 !== undefined) {
2949
+ if (props1 === true) {
2950
+ props0 = true;
2951
+ }
2952
+ else {
2953
+ props0 = props0 || {};
2954
+ Object.assign(props0, props1);
2955
+ }
2956
+ }
2957
+ }
2958
+ const _errs19 = errors;
2959
+ if (Array.isArray(data5)) {
2960
+ const len1 = data5.length;
2961
+ for (let i1 = 0; i1 < len1; i1++) {
2962
+ let data6 = data5[i1];
2963
+ const _errs22 = errors;
2964
+ let valid7 = false;
2965
+ const _errs23 = errors;
2966
+ if (typeof data6 !== "string") {
2967
+ const err10 = createError(instancePath + "/assigner/" + i1, "#/properties/assigner/anyOf/3/items/anyOf/0/type", "type", { type: "string" }, 5);
2968
+ vErrors = pushError(vErrors, err10);
2969
+ errors++;
2970
+ }
2971
+ var _valid2 = _errs23 === errors;
2972
+ valid7 = valid7 || _valid2;
2973
+ const _errs25 = errors;
2974
+ if (!(validate79(data6, { instancePath: instancePath + "/assigner/" + i1, parentData: data5, parentDataProperty: i1, rootData, dynamicAnchors }))) {
2975
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
2976
+ errors = vErrors.length;
2977
+ }
2978
+ var _valid2 = _errs25 === errors;
2979
+ valid7 = valid7 || _valid2;
2980
+ if (_valid2) {
2981
+ var props2 = {};
2982
+ props2.uid = true;
2983
+ props2["@type"] = true;
2984
+ props2.partOf = true;
2985
+ props2.assigneeOf = true;
2986
+ props2.assignerOf = true;
2987
+ }
2988
+ const _errs26 = errors;
2989
+ if (!(validate80(data6, { instancePath: instancePath + "/assigner/" + i1, parentData: data5, parentDataProperty: i1, rootData, dynamicAnchors }))) {
2990
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
2991
+ errors = vErrors.length;
2992
+ }
2993
+ else {
2994
+ var props3 = validate80.evaluated.props;
2995
+ }
2996
+ var _valid2 = _errs26 === errors;
2997
+ valid7 = valid7 || _valid2;
2998
+ if (_valid2) {
2999
+ if (props2 !== true && props3 !== undefined) {
3000
+ if (props3 === true) {
3001
+ props2 = true;
3002
+ }
3003
+ else {
3004
+ props2 = props2 || {};
3005
+ Object.assign(props2, props3);
3006
+ }
3007
+ }
3008
+ }
3009
+ if (!valid7) {
3010
+ const err11 = createError(instancePath + "/assigner/" + i1, "#/properties/assigner/anyOf/3/items/anyOf", "anyOf", {}, 2);
3011
+ vErrors = pushError(vErrors, err11);
3012
+ errors++;
3013
+ }
3014
+ else {
3015
+ errors = _errs22;
3016
+ if (vErrors !== null) {
3017
+ if (_errs22) {
3018
+ vErrors.length = _errs22;
3019
+ }
3020
+ else {
3021
+ vErrors = null;
3022
+ }
3023
+ }
3024
+ }
3025
+ }
3026
+ }
3027
+ else {
3028
+ const err12 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf/3/type", "type", { type: "array" }, 4);
3029
+ vErrors = pushError(vErrors, err12);
3030
+ errors++;
3031
+ }
3032
+ var _valid1 = _errs19 === errors;
3033
+ valid4 = valid4 || _valid1;
3034
+ if (_valid1) {
3035
+ if (items2 !== true) {
3036
+ items2 = true;
3037
+ }
3038
+ }
3039
+ if (!valid4) {
3040
+ const err13 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf", "anyOf", {}, 2);
3041
+ vErrors = pushError(vErrors, err13);
3042
+ errors++;
3043
+ }
3044
+ else {
3045
+ errors = _errs14;
3046
+ if (vErrors !== null) {
3047
+ if (_errs14) {
3048
+ vErrors.length = _errs14;
3049
+ }
3050
+ else {
3051
+ vErrors = null;
3052
+ }
3053
+ }
3054
+ }
3055
+ }
3056
+ if (data.assignee !== undefined) {
3057
+ let data7 = data.assignee;
3058
+ const _errs28 = errors;
3059
+ let valid8 = false;
3060
+ const _errs29 = errors;
3061
+ if (typeof data7 !== "string") {
3062
+ const err14 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf/0/type", "type", { type: "string" }, 5);
3063
+ vErrors = pushError(vErrors, err14);
3064
+ errors++;
3065
+ }
3066
+ var _valid3 = _errs29 === errors;
3067
+ valid8 = valid8 || _valid3;
3068
+ const _errs31 = errors;
3069
+ if (!(validate79(data7, { instancePath: instancePath + "/assignee", parentData: data, parentDataProperty: "assignee", rootData, dynamicAnchors }))) {
3070
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
3071
+ errors = vErrors.length;
3072
+ }
3073
+ var _valid3 = _errs31 === errors;
3074
+ valid8 = valid8 || _valid3;
3075
+ if (_valid3) {
3076
+ var props4 = {};
3077
+ props4.uid = true;
3078
+ props4["@type"] = true;
3079
+ props4.partOf = true;
3080
+ props4.assigneeOf = true;
3081
+ props4.assignerOf = true;
3082
+ }
3083
+ const _errs32 = errors;
3084
+ if (!(validate80(data7, { instancePath: instancePath + "/assignee", parentData: data, parentDataProperty: "assignee", rootData, dynamicAnchors }))) {
3085
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
3086
+ errors = vErrors.length;
3087
+ }
3088
+ else {
3089
+ var props5 = validate80.evaluated.props;
3090
+ var items4 = validate80.evaluated.items;
3091
+ }
3092
+ var _valid3 = _errs32 === errors;
3093
+ valid8 = valid8 || _valid3;
3094
+ if (_valid3) {
3095
+ if (props4 !== true && props5 !== undefined) {
3096
+ if (props5 === true) {
3097
+ props4 = true;
3098
+ }
3099
+ else {
3100
+ props4 = props4 || {};
3101
+ Object.assign(props4, props5);
3102
+ }
3103
+ }
3104
+ }
3105
+ const _errs33 = errors;
3106
+ if (Array.isArray(data7)) {
3107
+ const len2 = data7.length;
3108
+ for (let i2 = 0; i2 < len2; i2++) {
3109
+ let data8 = data7[i2];
3110
+ const _errs36 = errors;
3111
+ let valid11 = false;
3112
+ const _errs37 = errors;
3113
+ if (typeof data8 !== "string") {
3114
+ const err15 = createError(instancePath + "/assignee/" + i2, "#/properties/assignee/anyOf/3/items/anyOf/0/type", "type", { type: "string" }, 5);
3115
+ vErrors = pushError(vErrors, err15);
3116
+ errors++;
3117
+ }
3118
+ var _valid4 = _errs37 === errors;
3119
+ valid11 = valid11 || _valid4;
3120
+ const _errs39 = errors;
3121
+ if (!(validate79(data8, { instancePath: instancePath + "/assignee/" + i2, parentData: data7, parentDataProperty: i2, rootData, dynamicAnchors }))) {
3122
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
3123
+ errors = vErrors.length;
3124
+ }
3125
+ var _valid4 = _errs39 === errors;
3126
+ valid11 = valid11 || _valid4;
3127
+ if (_valid4) {
3128
+ var props6 = {};
3129
+ props6.uid = true;
3130
+ props6["@type"] = true;
3131
+ props6.partOf = true;
3132
+ props6.assigneeOf = true;
3133
+ props6.assignerOf = true;
3134
+ }
3135
+ const _errs40 = errors;
3136
+ if (!(validate80(data8, { instancePath: instancePath + "/assignee/" + i2, parentData: data7, parentDataProperty: i2, rootData, dynamicAnchors }))) {
3137
+ vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);
3138
+ errors = vErrors.length;
3139
+ }
3140
+ else {
3141
+ var props7 = validate80.evaluated.props;
3142
+ }
3143
+ var _valid4 = _errs40 === errors;
3144
+ valid11 = valid11 || _valid4;
3145
+ if (_valid4) {
3146
+ if (props6 !== true && props7 !== undefined) {
3147
+ if (props7 === true) {
3148
+ props6 = true;
3149
+ }
3150
+ else {
3151
+ props6 = props6 || {};
3152
+ Object.assign(props6, props7);
3153
+ }
3154
+ }
3155
+ }
3156
+ if (!valid11) {
3157
+ const err16 = createError(instancePath + "/assignee/" + i2, "#/properties/assignee/anyOf/3/items/anyOf", "anyOf", {}, 2);
3158
+ vErrors = pushError(vErrors, err16);
3159
+ errors++;
3160
+ }
3161
+ else {
3162
+ errors = _errs36;
3163
+ if (vErrors !== null) {
3164
+ if (_errs36) {
3165
+ vErrors.length = _errs36;
3166
+ }
3167
+ else {
3168
+ vErrors = null;
3169
+ }
3170
+ }
3171
+ }
3172
+ }
3173
+ }
3174
+ else {
3175
+ const err17 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf/3/type", "type", { type: "array" }, 4);
3176
+ vErrors = pushError(vErrors, err17);
3177
+ errors++;
3178
+ }
3179
+ var _valid3 = _errs33 === errors;
3180
+ valid8 = valid8 || _valid3;
3181
+ if (_valid3) {
3182
+ if (items4 !== true) {
3183
+ items4 = true;
3184
+ }
3185
+ }
3186
+ if (!valid8) {
3187
+ const err18 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf", "anyOf", {}, 2);
3188
+ vErrors = pushError(vErrors, err18);
3189
+ errors++;
3190
+ }
3191
+ else {
3192
+ errors = _errs28;
3193
+ if (vErrors !== null) {
3194
+ if (_errs28) {
3195
+ vErrors.length = _errs28;
3196
+ }
3197
+ else {
3198
+ vErrors = null;
3199
+ }
3200
+ }
3201
+ }
3202
+ }
3203
+ if (data.target !== undefined) {
3204
+ let data9 = data.target;
3205
+ const _errs42 = errors;
3206
+ let valid12 = false;
3207
+ const _errs43 = errors;
3208
+ if (typeof data9 !== "string") {
3209
+ const err19 = createError(instancePath + "/target", "#/properties/target/anyOf/0/type", "type", { type: "string" }, 5);
3210
+ vErrors = pushError(vErrors, err19);
3211
+ errors++;
3212
+ }
3213
+ var _valid5 = _errs43 === errors;
3214
+ valid12 = valid12 || _valid5;
3215
+ const _errs45 = errors;
3216
+ if (!(validate95(data9, { instancePath: instancePath + "/target", parentData: data, parentDataProperty: "target", rootData, dynamicAnchors }))) {
3217
+ vErrors = vErrors === null ? validate95.errors : vErrors.concat(validate95.errors);
3218
+ errors = vErrors.length;
3219
+ }
3220
+ var _valid5 = _errs45 === errors;
3221
+ valid12 = valid12 || _valid5;
3222
+ if (_valid5) {
3223
+ var props8 = {};
3224
+ props8.uid = true;
3225
+ props8["@type"] = true;
3226
+ props8.partOf = true;
3227
+ props8.hasPolicy = true;
3228
+ }
3229
+ const _errs46 = errors;
3230
+ if (!(validate96(data9, { instancePath: instancePath + "/target", parentData: data, parentDataProperty: "target", rootData, dynamicAnchors }))) {
3231
+ vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);
3232
+ errors = vErrors.length;
3233
+ }
3234
+ else {
3235
+ var props9 = validate96.evaluated.props;
3236
+ var items6 = validate96.evaluated.items;
3237
+ }
3238
+ var _valid5 = _errs46 === errors;
3239
+ valid12 = valid12 || _valid5;
3240
+ if (_valid5) {
3241
+ if (props8 !== true && props9 !== undefined) {
3242
+ if (props9 === true) {
3243
+ props8 = true;
3244
+ }
3245
+ else {
3246
+ props8 = props8 || {};
3247
+ Object.assign(props8, props9);
3248
+ }
3249
+ }
3250
+ }
3251
+ const _errs47 = errors;
3252
+ if (Array.isArray(data9)) {
3253
+ const len3 = data9.length;
3254
+ for (let i3 = 0; i3 < len3; i3++) {
3255
+ let data10 = data9[i3];
3256
+ const _errs50 = errors;
3257
+ let valid15 = false;
3258
+ const _errs51 = errors;
3259
+ if (typeof data10 !== "string") {
3260
+ const err20 = createError(instancePath + "/target/" + i3, "#/properties/target/anyOf/3/items/anyOf/0/type", "type", { type: "string" }, 5);
3261
+ vErrors = pushError(vErrors, err20);
3262
+ errors++;
3263
+ }
3264
+ var _valid6 = _errs51 === errors;
3265
+ valid15 = valid15 || _valid6;
3266
+ const _errs53 = errors;
3267
+ if (!(validate95(data10, { instancePath: instancePath + "/target/" + i3, parentData: data9, parentDataProperty: i3, rootData, dynamicAnchors }))) {
3268
+ vErrors = vErrors === null ? validate95.errors : vErrors.concat(validate95.errors);
3269
+ errors = vErrors.length;
3270
+ }
3271
+ var _valid6 = _errs53 === errors;
3272
+ valid15 = valid15 || _valid6;
3273
+ if (_valid6) {
3274
+ var props10 = {};
3275
+ props10.uid = true;
3276
+ props10["@type"] = true;
3277
+ props10.partOf = true;
3278
+ props10.hasPolicy = true;
3279
+ }
3280
+ const _errs54 = errors;
3281
+ if (!(validate96(data10, { instancePath: instancePath + "/target/" + i3, parentData: data9, parentDataProperty: i3, rootData, dynamicAnchors }))) {
3282
+ vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);
3283
+ errors = vErrors.length;
3284
+ }
3285
+ else {
3286
+ var props11 = validate96.evaluated.props;
3287
+ }
3288
+ var _valid6 = _errs54 === errors;
3289
+ valid15 = valid15 || _valid6;
3290
+ if (_valid6) {
3291
+ if (props10 !== true && props11 !== undefined) {
3292
+ if (props11 === true) {
3293
+ props10 = true;
3294
+ }
3295
+ else {
3296
+ props10 = props10 || {};
3297
+ Object.assign(props10, props11);
3298
+ }
3299
+ }
3300
+ }
3301
+ if (!valid15) {
3302
+ const err21 = createError(instancePath + "/target/" + i3, "#/properties/target/anyOf/3/items/anyOf", "anyOf", {}, 2);
3303
+ vErrors = pushError(vErrors, err21);
3304
+ errors++;
3305
+ }
3306
+ else {
3307
+ errors = _errs50;
3308
+ if (vErrors !== null) {
3309
+ if (_errs50) {
3310
+ vErrors.length = _errs50;
3311
+ }
3312
+ else {
3313
+ vErrors = null;
3314
+ }
3315
+ }
3316
+ }
3317
+ }
3318
+ }
3319
+ else {
3320
+ const err22 = createError(instancePath + "/target", "#/properties/target/anyOf/3/type", "type", { type: "array" }, 4);
3321
+ vErrors = pushError(vErrors, err22);
3322
+ errors++;
3323
+ }
3324
+ var _valid5 = _errs47 === errors;
3325
+ valid12 = valid12 || _valid5;
3326
+ if (_valid5) {
3327
+ if (items6 !== true) {
3328
+ items6 = true;
3329
+ }
3330
+ }
3331
+ if (!valid12) {
3332
+ const err23 = createError(instancePath + "/target", "#/properties/target/anyOf", "anyOf", {}, 2);
3333
+ vErrors = pushError(vErrors, err23);
3334
+ errors++;
3335
+ }
3336
+ else {
3337
+ errors = _errs42;
3338
+ if (vErrors !== null) {
3339
+ if (_errs42) {
3340
+ vErrors.length = _errs42;
3341
+ }
3342
+ else {
3343
+ vErrors = null;
3344
+ }
3345
+ }
3346
+ }
3347
+ }
3348
+ if (data.action !== undefined) {
3349
+ let data11 = data.action;
3350
+ const _errs56 = errors;
3351
+ let valid16 = false;
3352
+ const _errs57 = errors;
3353
+ if (!(validate71(data11, { instancePath: instancePath + "/action", parentData: data, parentDataProperty: "action", rootData, dynamicAnchors }))) {
3354
+ vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);
3355
+ errors = vErrors.length;
3356
+ }
3357
+ var _valid7 = _errs57 === errors;
3358
+ valid16 = valid16 || _valid7;
3359
+ const _errs58 = errors;
3360
+ if (typeof data11 !== "string") {
3361
+ const err24 = createError(instancePath + "/action", "#/properties/action/anyOf/1/type", "type", { type: "string" }, 5);
3362
+ vErrors = pushError(vErrors, err24);
3363
+ errors++;
3364
+ }
3365
+ var _valid7 = _errs58 === errors;
3366
+ valid16 = valid16 || _valid7;
3367
+ const _errs60 = errors;
3368
+ if (!(validate53(data11, { instancePath: instancePath + "/action", parentData: data, parentDataProperty: "action", rootData, dynamicAnchors }))) {
3369
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
3370
+ errors = vErrors.length;
3371
+ }
3372
+ var _valid7 = _errs60 === errors;
3373
+ valid16 = valid16 || _valid7;
3374
+ if (_valid7) {
3375
+ var props12 = {};
3376
+ props12["rdf:value"] = true;
3377
+ props12["@id"] = true;
3378
+ props12.refinement = true;
3379
+ props12.includedIn = true;
3380
+ props12.implies = true;
3381
+ }
3382
+ const _errs61 = errors;
3383
+ if (Array.isArray(data11)) {
3384
+ const len4 = data11.length;
3385
+ for (let i4 = 0; i4 < len4; i4++) {
3386
+ let data12 = data11[i4];
3387
+ const _errs64 = errors;
3388
+ let valid19 = false;
3389
+ const _errs65 = errors;
3390
+ if (!(validate71(data12, { instancePath: instancePath + "/action/" + i4, parentData: data11, parentDataProperty: i4, rootData, dynamicAnchors }))) {
3391
+ vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);
3392
+ errors = vErrors.length;
3393
+ }
3394
+ var _valid8 = _errs65 === errors;
3395
+ valid19 = valid19 || _valid8;
3396
+ const _errs66 = errors;
3397
+ if (typeof data12 !== "string") {
3398
+ const err25 = createError(instancePath + "/action/" + i4, "#/properties/action/anyOf/3/items/anyOf/1/type", "type", { type: "string" }, 5);
3399
+ vErrors = pushError(vErrors, err25);
3400
+ errors++;
3401
+ }
3402
+ var _valid8 = _errs66 === errors;
3403
+ valid19 = valid19 || _valid8;
3404
+ const _errs68 = errors;
3405
+ if (!(validate53(data12, { instancePath: instancePath + "/action/" + i4, parentData: data11, parentDataProperty: i4, rootData, dynamicAnchors }))) {
3406
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
3407
+ errors = vErrors.length;
3408
+ }
3409
+ var _valid8 = _errs68 === errors;
3410
+ valid19 = valid19 || _valid8;
3411
+ if (_valid8) {
3412
+ var props13 = {};
3413
+ props13["rdf:value"] = true;
3414
+ props13["@id"] = true;
3415
+ props13.refinement = true;
3416
+ props13.includedIn = true;
3417
+ props13.implies = true;
3418
+ }
3419
+ if (!valid19) {
3420
+ const err26 = createError(instancePath + "/action/" + i4, "#/properties/action/anyOf/3/items/anyOf", "anyOf", {}, 2);
3421
+ vErrors = pushError(vErrors, err26);
3422
+ errors++;
3423
+ }
3424
+ else {
3425
+ errors = _errs64;
3426
+ if (vErrors !== null) {
3427
+ if (_errs64) {
3428
+ vErrors.length = _errs64;
3429
+ }
3430
+ else {
3431
+ vErrors = null;
3432
+ }
3433
+ }
3434
+ }
3435
+ }
3436
+ }
3437
+ else {
3438
+ const err27 = createError(instancePath + "/action", "#/properties/action/anyOf/3/type", "type", { type: "array" }, 4);
3439
+ vErrors = pushError(vErrors, err27);
3440
+ errors++;
3441
+ }
3442
+ var _valid7 = _errs61 === errors;
3443
+ valid16 = valid16 || _valid7;
3444
+ if (!valid16) {
3445
+ const err28 = createError(instancePath + "/action", "#/properties/action/anyOf", "anyOf", {}, 2);
3446
+ vErrors = pushError(vErrors, err28);
3447
+ errors++;
3448
+ }
3449
+ else {
3450
+ errors = _errs56;
3451
+ if (vErrors !== null) {
3452
+ if (_errs56) {
3453
+ vErrors.length = _errs56;
3454
+ }
3455
+ else {
3456
+ vErrors = null;
3457
+ }
3458
+ }
3459
+ }
3460
+ }
3461
+ if (data.inheritFrom !== undefined) {
3462
+ let data13 = data.inheritFrom;
3463
+ const _errs70 = errors;
3464
+ let valid20 = false;
3465
+ const _errs71 = errors;
3466
+ if (typeof data13 !== "string") {
3467
+ const err29 = createError(instancePath + "/inheritFrom", "#/properties/inheritFrom/anyOf/0/type", "type", { type: "string" }, 5);
3468
+ vErrors = pushError(vErrors, err29);
3469
+ errors++;
3470
+ }
3471
+ var _valid9 = _errs71 === errors;
3472
+ valid20 = valid20 || _valid9;
3473
+ const _errs73 = errors;
3474
+ if (Array.isArray(data13)) {
3475
+ const len5 = data13.length;
3476
+ for (let i5 = 0; i5 < len5; i5++) {
3477
+ if (typeof data13[i5] !== "string") {
3478
+ const err30 = createError(instancePath + "/inheritFrom/" + i5, "#/properties/inheritFrom/anyOf/1/items/type", "type", { type: "string" }, 5);
3479
+ vErrors = pushError(vErrors, err30);
3480
+ errors++;
3481
+ }
3482
+ }
3483
+ }
3484
+ else {
3485
+ const err31 = createError(instancePath + "/inheritFrom", "#/properties/inheritFrom/anyOf/1/type", "type", { type: "array" }, 4);
3486
+ vErrors = pushError(vErrors, err31);
3487
+ errors++;
3488
+ }
3489
+ var _valid9 = _errs73 === errors;
3490
+ valid20 = valid20 || _valid9;
3491
+ if (!valid20) {
3492
+ const err32 = createError(instancePath + "/inheritFrom", "#/properties/inheritFrom/anyOf", "anyOf", {}, 2);
3493
+ vErrors = pushError(vErrors, err32);
3494
+ errors++;
3495
+ }
3496
+ else {
3497
+ errors = _errs70;
3498
+ if (vErrors !== null) {
3499
+ if (_errs70) {
3500
+ vErrors.length = _errs70;
3501
+ }
3502
+ else {
3503
+ vErrors = null;
3504
+ }
3505
+ }
3506
+ }
3507
+ }
3508
+ if (data.conflict !== undefined) {
3509
+ if (!(validate111(data.conflict, { instancePath: instancePath + "/conflict", parentData: data, parentDataProperty: "conflict", rootData, dynamicAnchors }))) {
3510
+ vErrors = vErrors === null ? validate111.errors : vErrors.concat(validate111.errors);
3511
+ errors = vErrors.length;
3512
+ }
3513
+ }
3514
+ if (data.permission !== undefined) {
3515
+ let data16 = data.permission;
3516
+ const _errs79 = errors;
3517
+ let valid23 = false;
3518
+ const _errs80 = errors;
3519
+ if (!(validate113(data16, { instancePath: instancePath + "/permission", parentData: data, parentDataProperty: "permission", rootData, dynamicAnchors }))) {
3520
+ vErrors = vErrors === null ? validate113.errors : vErrors.concat(validate113.errors);
3521
+ errors = vErrors.length;
3522
+ }
3523
+ var _valid10 = _errs80 === errors;
3524
+ valid23 = valid23 || _valid10;
3525
+ if (_valid10) {
3526
+ var props14 = {};
3527
+ props14.duty = true;
3528
+ props14.uid = true;
3529
+ props14.action = true;
3530
+ props14.target = true;
3531
+ props14.assigner = true;
3532
+ props14.assignee = true;
3533
+ props14.constraint = true;
3534
+ props14.summary = true;
3535
+ }
3536
+ const _errs81 = errors;
3537
+ if (Array.isArray(data16)) {
3538
+ const len6 = data16.length;
3539
+ for (let i6 = 0; i6 < len6; i6++) {
3540
+ if (!(validate113(data16[i6], { instancePath: instancePath + "/permission/" + i6, parentData: data16, parentDataProperty: i6, rootData, dynamicAnchors }))) {
3541
+ vErrors = vErrors === null ? validate113.errors : vErrors.concat(validate113.errors);
3542
+ errors = vErrors.length;
3543
+ }
3544
+ }
3545
+ }
3546
+ else {
3547
+ const err33 = createError(instancePath + "/permission", "#/properties/permission/anyOf/1/type", "type", { type: "array" }, 4);
3548
+ vErrors = pushError(vErrors, err33);
3549
+ errors++;
3550
+ }
3551
+ var _valid10 = _errs81 === errors;
3552
+ valid23 = valid23 || _valid10;
3553
+ if (!valid23) {
3554
+ const err34 = createError(instancePath + "/permission", "#/properties/permission/anyOf", "anyOf", {}, 2);
3555
+ vErrors = pushError(vErrors, err34);
3556
+ errors++;
3557
+ }
3558
+ else {
3559
+ errors = _errs79;
3560
+ if (vErrors !== null) {
3561
+ if (_errs79) {
3562
+ vErrors.length = _errs79;
3563
+ }
3564
+ else {
3565
+ vErrors = null;
3566
+ }
3567
+ }
3568
+ }
3569
+ }
3570
+ if (data.prohibition !== undefined) {
3571
+ let data18 = data.prohibition;
3572
+ const _errs85 = errors;
3573
+ let valid26 = false;
3574
+ const _errs86 = errors;
3575
+ if (!(validate142(data18, { instancePath: instancePath + "/prohibition", parentData: data, parentDataProperty: "prohibition", rootData, dynamicAnchors }))) {
3576
+ vErrors = vErrors === null ? validate142.errors : vErrors.concat(validate142.errors);
3577
+ errors = vErrors.length;
3578
+ }
3579
+ var _valid11 = _errs86 === errors;
3580
+ valid26 = valid26 || _valid11;
3581
+ if (_valid11) {
3582
+ var props15 = {};
3583
+ props15.remedy = true;
3584
+ props15.uid = true;
3585
+ props15.action = true;
3586
+ props15.target = true;
3587
+ props15.assigner = true;
3588
+ props15.assignee = true;
3589
+ props15.constraint = true;
3590
+ props15.summary = true;
3591
+ }
3592
+ const _errs87 = errors;
3593
+ if (Array.isArray(data18)) {
3594
+ const len7 = data18.length;
3595
+ for (let i7 = 0; i7 < len7; i7++) {
3596
+ if (!(validate142(data18[i7], { instancePath: instancePath + "/prohibition/" + i7, parentData: data18, parentDataProperty: i7, rootData, dynamicAnchors }))) {
3597
+ vErrors = vErrors === null ? validate142.errors : vErrors.concat(validate142.errors);
3598
+ errors = vErrors.length;
3599
+ }
3600
+ }
3601
+ }
3602
+ else {
3603
+ const err35 = createError(instancePath + "/prohibition", "#/properties/prohibition/anyOf/1/type", "type", { type: "array" }, 4);
3604
+ vErrors = pushError(vErrors, err35);
3605
+ errors++;
3606
+ }
3607
+ var _valid11 = _errs87 === errors;
3608
+ valid26 = valid26 || _valid11;
3609
+ if (!valid26) {
3610
+ const err36 = createError(instancePath + "/prohibition", "#/properties/prohibition/anyOf", "anyOf", {}, 2);
3611
+ vErrors = pushError(vErrors, err36);
3612
+ errors++;
3613
+ }
3614
+ else {
3615
+ errors = _errs85;
3616
+ if (vErrors !== null) {
3617
+ if (_errs85) {
3618
+ vErrors.length = _errs85;
3619
+ }
3620
+ else {
3621
+ vErrors = null;
3622
+ }
3623
+ }
3624
+ }
3625
+ }
3626
+ if (data.obligation !== undefined) {
3627
+ let data20 = data.obligation;
3628
+ const _errs91 = errors;
3629
+ let valid29 = false;
3630
+ const _errs92 = errors;
3631
+ if (!(validate136(data20, { instancePath: instancePath + "/obligation", parentData: data, parentDataProperty: "obligation", rootData, dynamicAnchors }))) {
3632
+ vErrors = vErrors === null ? validate136.errors : vErrors.concat(validate136.errors);
3633
+ errors = vErrors.length;
3634
+ }
3635
+ var _valid12 = _errs92 === errors;
3636
+ valid29 = valid29 || _valid12;
3637
+ if (_valid12) {
3638
+ var props16 = {};
3639
+ props16.attributedParty = true;
3640
+ props16.trackingParty = true;
3641
+ props16.consequence = true;
3642
+ props16.compensatedParty = true;
3643
+ props16.uid = true;
3644
+ props16.action = true;
3645
+ props16.target = true;
3646
+ props16.assigner = true;
3647
+ props16.assignee = true;
3648
+ props16.constraint = true;
3649
+ props16.summary = true;
3650
+ }
3651
+ const _errs93 = errors;
3652
+ if (Array.isArray(data20)) {
3653
+ const len8 = data20.length;
3654
+ for (let i8 = 0; i8 < len8; i8++) {
3655
+ if (!(validate136(data20[i8], { instancePath: instancePath + "/obligation/" + i8, parentData: data20, parentDataProperty: i8, rootData, dynamicAnchors }))) {
3656
+ vErrors = vErrors === null ? validate136.errors : vErrors.concat(validate136.errors);
3657
+ errors = vErrors.length;
3658
+ }
3659
+ }
3660
+ }
3661
+ else {
3662
+ const err37 = createError(instancePath + "/obligation", "#/properties/obligation/anyOf/1/type", "type", { type: "array" }, 4);
3663
+ vErrors = pushError(vErrors, err37);
3664
+ errors++;
3665
+ }
3666
+ var _valid12 = _errs93 === errors;
3667
+ valid29 = valid29 || _valid12;
3668
+ if (!valid29) {
3669
+ const err38 = createError(instancePath + "/obligation", "#/properties/obligation/anyOf", "anyOf", {}, 2);
3670
+ vErrors = pushError(vErrors, err38);
3671
+ errors++;
3672
+ }
3673
+ else {
3674
+ errors = _errs91;
3675
+ if (vErrors !== null) {
3676
+ if (_errs91) {
3677
+ vErrors.length = _errs91;
3678
+ }
3679
+ else {
3680
+ vErrors = null;
3681
+ }
3682
+ }
3683
+ }
3684
+ }
3685
+ }
3686
+ else {
3687
+ const err39 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
3688
+ vErrors = pushError(vErrors, err39);
3689
+ errors++;
3690
+ }
3691
+ validate75.errors = vErrors;
3692
+ return errors === 0;
3693
+ }
3694
+ validate75.evaluated = { "props": { "@context": true, "@type": true, "uid": true, "profile": true, "assigner": true, "assignee": true, "target": true, "action": true, "inheritFrom": true, "conflict": true, "permission": true, "prohibition": true, "obligation": true }, "dynamicProps": false, "dynamicItems": false };
3695
+ function validate74(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
3696
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlAgreement" */ ;
3697
+ let vErrors = null;
3698
+ let errors = 0;
3699
+ const evaluated0 = validate74.evaluated;
3700
+ if (evaluated0.dynamicProps) {
3701
+ evaluated0.props = undefined;
3702
+ }
3703
+ if (evaluated0.dynamicItems) {
3704
+ evaluated0.items = undefined;
3705
+ }
3706
+ if (!(validate75(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
3707
+ vErrors = vErrors === null ? validate75.errors : vErrors.concat(validate75.errors);
3708
+ errors = vErrors.length;
3709
+ }
3710
+ if (data && typeof data == "object" && !Array.isArray(data)) {
3711
+ if (data["@type"] === undefined) {
3712
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@type" }, "must have required property '" + "@type" + "'");
3713
+ vErrors = pushError(vErrors, err0);
3714
+ errors++;
3715
+ }
3716
+ if (data.assigner === undefined) {
3717
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "assigner" }, "must have required property '" + "assigner" + "'");
3718
+ vErrors = pushError(vErrors, err1);
3719
+ errors++;
3720
+ }
3721
+ if (data.assignee === undefined) {
3722
+ const err2 = createError(instancePath, "#/required", "required", { missingProperty: "assignee" }, "must have required property '" + "assignee" + "'");
3723
+ vErrors = pushError(vErrors, err2);
3724
+ errors++;
3725
+ }
3726
+ if (data["@type"] !== undefined) {
3727
+ if ("Agreement" !== data["@type"]) {
3728
+ const err3 = createError(instancePath + "/@type", "#/properties/%40type/const", "const", { allowedValue: "Agreement" }, 0);
3729
+ vErrors = pushError(vErrors, err3);
3730
+ errors++;
3731
+ }
3732
+ }
3733
+ if (data.assigner !== undefined) {
3734
+ let data1 = data.assigner;
3735
+ const _errs4 = errors;
3736
+ let valid2 = false;
3737
+ const _errs5 = errors;
3738
+ if (typeof data1 !== "string") {
3739
+ const err4 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf/0/type", "type", { type: "string" }, 5);
3740
+ vErrors = pushError(vErrors, err4);
3741
+ errors++;
3742
+ }
3743
+ var _valid0 = _errs5 === errors;
3744
+ valid2 = valid2 || _valid0;
3745
+ const _errs7 = errors;
3746
+ if (!(validate79(data1, { instancePath: instancePath + "/assigner", parentData: data, parentDataProperty: "assigner", rootData, dynamicAnchors }))) {
3747
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
3748
+ errors = vErrors.length;
3749
+ }
3750
+ var _valid0 = _errs7 === errors;
3751
+ valid2 = valid2 || _valid0;
3752
+ if (_valid0) {
3753
+ var props0 = {};
3754
+ props0.uid = true;
3755
+ props0["@type"] = true;
3756
+ props0.partOf = true;
3757
+ props0.assigneeOf = true;
3758
+ props0.assignerOf = true;
3759
+ }
3760
+ if (!valid2) {
3761
+ const err5 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf", "anyOf", {}, 2);
3762
+ vErrors = pushError(vErrors, err5);
3763
+ errors++;
3764
+ }
3765
+ else {
3766
+ errors = _errs4;
3767
+ if (vErrors !== null) {
3768
+ if (_errs4) {
3769
+ vErrors.length = _errs4;
3770
+ }
3771
+ else {
3772
+ vErrors = null;
3773
+ }
3774
+ }
3775
+ }
3776
+ }
3777
+ if (data.assignee !== undefined) {
3778
+ let data2 = data.assignee;
3779
+ const _errs9 = errors;
3780
+ let valid3 = false;
3781
+ const _errs10 = errors;
3782
+ if (typeof data2 !== "string") {
3783
+ const err6 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf/0/type", "type", { type: "string" }, 5);
3784
+ vErrors = pushError(vErrors, err6);
3785
+ errors++;
3786
+ }
3787
+ var _valid1 = _errs10 === errors;
3788
+ valid3 = valid3 || _valid1;
3789
+ const _errs12 = errors;
3790
+ if (!(validate79(data2, { instancePath: instancePath + "/assignee", parentData: data, parentDataProperty: "assignee", rootData, dynamicAnchors }))) {
3791
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
3792
+ errors = vErrors.length;
3793
+ }
3794
+ var _valid1 = _errs12 === errors;
3795
+ valid3 = valid3 || _valid1;
3796
+ if (_valid1) {
3797
+ var props1 = {};
3798
+ props1.uid = true;
3799
+ props1["@type"] = true;
3800
+ props1.partOf = true;
3801
+ props1.assigneeOf = true;
3802
+ props1.assignerOf = true;
3803
+ }
3804
+ if (!valid3) {
3805
+ const err7 = createError(instancePath + "/assignee", "#/properties/assignee/anyOf", "anyOf", {}, 2);
3806
+ vErrors = pushError(vErrors, err7);
3807
+ errors++;
3808
+ }
3809
+ else {
3810
+ errors = _errs9;
3811
+ if (vErrors !== null) {
3812
+ if (_errs9) {
3813
+ vErrors.length = _errs9;
3814
+ }
3815
+ else {
3816
+ vErrors = null;
3817
+ }
3818
+ }
3819
+ }
3820
+ }
3821
+ }
3822
+ else {
3823
+ const err8 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
3824
+ vErrors = pushError(vErrors, err8);
3825
+ errors++;
3826
+ }
3827
+ validate74.errors = vErrors;
3828
+ return errors === 0;
3829
+ }
3830
+ validate74.evaluated = { "props": { "@type": true, "assigner": true, "assignee": true, "@context": true, "uid": true, "profile": true, "target": true, "action": true, "inheritFrom": true, "conflict": true, "permission": true, "prohibition": true, "obligation": true }, "dynamicProps": false, "dynamicItems": false };
3831
+ /**
3832
+ * Compiled validator for the OdrlAsset schema.
3833
+ */
3834
+ export const CompiledOdrlAsset = validate95;
3835
+ /**
3836
+ * Compiled validator for the OdrlAssetCollection schema.
3837
+ */
3838
+ export const CompiledOdrlAssetCollection = validate96;
3839
+ /**
3840
+ * Compiled validator for the OdrlConstraint schema.
3841
+ */
3842
+ export const CompiledOdrlConstraint = validate54;
3843
+ /**
3844
+ * Compiled validator for the OdrlDuty schema.
3845
+ */
3846
+ export const CompiledOdrlDuty = validate136;
3847
+ /**
3848
+ * Compiled validator for the OdrlLogicalConstraint schema.
3849
+ */
3850
+ export const CompiledOdrlLogicalConstraint = validate62;
3851
+ /**
3852
+ * Compiled validator for the OdrlLogicalConstraintOperand schema.
3853
+ */
3854
+ export const CompiledOdrlLogicalConstraintOperand = validate63;
3855
+ /**
3856
+ * Compiled validator for the OdrlOffer schema.
3857
+ */
3858
+ export const CompiledOdrlOffer = validate153;
3859
+ function validate153(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
3860
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlOffer" */ ;
3861
+ let vErrors = null;
3862
+ let errors = 0;
3863
+ const evaluated0 = validate153.evaluated;
3864
+ if (evaluated0.dynamicProps) {
3865
+ evaluated0.props = undefined;
3866
+ }
3867
+ if (evaluated0.dynamicItems) {
3868
+ evaluated0.items = undefined;
3869
+ }
3870
+ if (!(validate75(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
3871
+ vErrors = vErrors === null ? validate75.errors : vErrors.concat(validate75.errors);
3872
+ errors = vErrors.length;
3873
+ }
3874
+ if (data && typeof data == "object" && !Array.isArray(data)) {
3875
+ if (data["@type"] === undefined) {
3876
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@type" }, "must have required property '" + "@type" + "'");
3877
+ vErrors = pushError(vErrors, err0);
3878
+ errors++;
3879
+ }
3880
+ if (data.assigner === undefined) {
3881
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "assigner" }, "must have required property '" + "assigner" + "'");
3882
+ vErrors = pushError(vErrors, err1);
3883
+ errors++;
3884
+ }
3885
+ if (data["@type"] !== undefined) {
3886
+ if ("Offer" !== data["@type"]) {
3887
+ const err2 = createError(instancePath + "/@type", "#/properties/%40type/const", "const", { allowedValue: "Offer" }, 0);
3888
+ vErrors = pushError(vErrors, err2);
3889
+ errors++;
3890
+ }
3891
+ }
3892
+ if (data.assigner !== undefined) {
3893
+ let data1 = data.assigner;
3894
+ const _errs4 = errors;
3895
+ let valid2 = false;
3896
+ const _errs5 = errors;
3897
+ if (typeof data1 !== "string") {
3898
+ const err3 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf/0/type", "type", { type: "string" }, 5);
3899
+ vErrors = pushError(vErrors, err3);
3900
+ errors++;
3901
+ }
3902
+ var _valid0 = _errs5 === errors;
3903
+ valid2 = valid2 || _valid0;
3904
+ const _errs7 = errors;
3905
+ if (!(validate79(data1, { instancePath: instancePath + "/assigner", parentData: data, parentDataProperty: "assigner", rootData, dynamicAnchors }))) {
3906
+ vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);
3907
+ errors = vErrors.length;
3908
+ }
3909
+ var _valid0 = _errs7 === errors;
3910
+ valid2 = valid2 || _valid0;
3911
+ if (_valid0) {
3912
+ var props0 = {};
3913
+ props0.uid = true;
3914
+ props0["@type"] = true;
3915
+ props0.partOf = true;
3916
+ props0.assigneeOf = true;
3917
+ props0.assignerOf = true;
3918
+ }
3919
+ if (!valid2) {
3920
+ const err4 = createError(instancePath + "/assigner", "#/properties/assigner/anyOf", "anyOf", {}, 2);
3921
+ vErrors = pushError(vErrors, err4);
3922
+ errors++;
3923
+ }
3924
+ else {
3925
+ errors = _errs4;
3926
+ if (vErrors !== null) {
3927
+ if (_errs4) {
3928
+ vErrors.length = _errs4;
3929
+ }
3930
+ else {
3931
+ vErrors = null;
3932
+ }
3933
+ }
3934
+ }
3935
+ }
3936
+ }
3937
+ else {
3938
+ const err5 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
3939
+ vErrors = pushError(vErrors, err5);
3940
+ errors++;
3941
+ }
3942
+ validate153.errors = vErrors;
3943
+ return errors === 0;
3944
+ }
3945
+ validate153.evaluated = { "props": { "@type": true, "assigner": true, "@context": true, "uid": true, "profile": true, "assignee": true, "target": true, "action": true, "inheritFrom": true, "conflict": true, "permission": true, "prohibition": true, "obligation": true }, "dynamicProps": false, "dynamicItems": false };
3946
+ /**
3947
+ * Compiled validator for the OdrlParty schema.
3948
+ */
3949
+ export const CompiledOdrlParty = validate79;
3950
+ /**
3951
+ * Compiled validator for the OdrlPartyCollection schema.
3952
+ */
3953
+ export const CompiledOdrlPartyCollection = validate80;
3954
+ /**
3955
+ * Compiled validator for the OdrlPermission schema.
3956
+ */
3957
+ export const CompiledOdrlPermission = validate113;
3958
+ /**
3959
+ * Compiled validator for the OdrlPolicy schema.
3960
+ */
3961
+ export const CompiledOdrlPolicy = validate75;
3962
+ /**
3963
+ * Compiled validator for the OdrlProhibition schema.
3964
+ */
3965
+ export const CompiledOdrlProhibition = validate142;
3966
+ /**
3967
+ * Compiled validator for the OdrlRule schema.
3968
+ */
3969
+ export const CompiledOdrlRule = validate114;
3970
+ /**
3971
+ * Compiled validator for the OdrlSet schema.
3972
+ */
3973
+ export const CompiledOdrlSet = validate156;
3974
+ function validate156(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
3975
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlSet" */ ;
3976
+ let vErrors = null;
3977
+ let errors = 0;
3978
+ const evaluated0 = validate156.evaluated;
3979
+ if (evaluated0.dynamicProps) {
3980
+ evaluated0.props = undefined;
3981
+ }
3982
+ if (evaluated0.dynamicItems) {
3983
+ evaluated0.items = undefined;
3984
+ }
3985
+ if (!(validate75(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
3986
+ vErrors = vErrors === null ? validate75.errors : vErrors.concat(validate75.errors);
3987
+ errors = vErrors.length;
3988
+ }
3989
+ if (data && typeof data == "object" && !Array.isArray(data)) {
3990
+ if (data["@type"] === undefined) {
3991
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@type" }, "must have required property '" + "@type" + "'");
3992
+ vErrors = pushError(vErrors, err0);
3993
+ errors++;
3994
+ }
3995
+ if (data["@type"] !== undefined) {
3996
+ if ("Set" !== data["@type"]) {
3997
+ const err1 = createError(instancePath + "/@type", "#/properties/%40type/const", "const", { allowedValue: "Set" }, 0);
3998
+ vErrors = pushError(vErrors, err1);
3999
+ errors++;
4000
+ }
4001
+ }
4002
+ }
4003
+ else {
4004
+ const err2 = createError(instancePath, "#/type", "type", { type: "object" }, 6);
4005
+ vErrors = pushError(vErrors, err2);
4006
+ errors++;
4007
+ }
4008
+ validate156.errors = vErrors;
4009
+ return errors === 0;
4010
+ }
4011
+ validate156.evaluated = { "props": { "@type": true, "@context": true, "uid": true, "profile": true, "assigner": true, "assignee": true, "target": true, "action": true, "inheritFrom": true, "conflict": true, "permission": true, "prohibition": true, "obligation": true }, "dynamicProps": false, "dynamicItems": false };
4012
+ /**
4013
+ * Compiled validator for the OdrlLogicalConstraintType schema.
4014
+ */
4015
+ export const CompiledOdrlLogicalConstraintType = validate158;
4016
+ const keyword7 = Object.values(external7["OdrlLogicalConstraintType"]);
4017
+ function validate158(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
4018
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlLogicalConstraintType" */ ;
4019
+ let vErrors = null;
4020
+ let errors = 0;
4021
+ const evaluated0 = validate158.evaluated;
4022
+ if (evaluated0.dynamicProps) {
4023
+ evaluated0.props = undefined;
4024
+ }
4025
+ if (evaluated0.dynamicItems) {
4026
+ evaluated0.items = undefined;
4027
+ }
4028
+ if (!keyword7.includes(data)) {
4029
+ for (let i0 = 0; i0 < keyword7.length; i0++) {
4030
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword7[i0] }, "must be equal to constant"));
4031
+ errors++;
4032
+ }
4033
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
4034
+ errors++;
4035
+ }
4036
+ validate158.errors = vErrors;
4037
+ return errors === 0;
4038
+ }
4039
+ validate158.evaluated = { "dynamicProps": false, "dynamicItems": false };
4040
+ /**
4041
+ * Compiled validator for the OdrlOperatorType schema.
4042
+ */
4043
+ export const CompiledOdrlOperatorType = validate57;
4044
+ /**
4045
+ * Compiled validator for the OdrlPolicyType schema.
4046
+ */
4047
+ export const CompiledOdrlPolicyType = validate77;
4048
+ /**
4049
+ * Compiled validator for the OdrlRuleType schema.
4050
+ */
4051
+ export const CompiledOdrlRuleType = validate159;
4052
+ const keyword8 = Object.values(external8["OdrlRuleType"]);
4053
+ function validate159(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
4054
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlRuleType" */ ;
4055
+ let vErrors = null;
4056
+ let errors = 0;
4057
+ const evaluated0 = validate159.evaluated;
4058
+ if (evaluated0.dynamicProps) {
4059
+ evaluated0.props = undefined;
4060
+ }
4061
+ if (evaluated0.dynamicItems) {
4062
+ evaluated0.items = undefined;
4063
+ }
4064
+ if (!keyword8.includes(data)) {
4065
+ for (let i0 = 0; i0 < keyword8.length; i0++) {
4066
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword8[i0] }, "must be equal to constant"));
4067
+ errors++;
4068
+ }
4069
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
4070
+ errors++;
4071
+ }
4072
+ validate159.errors = vErrors;
4073
+ return errors === 0;
4074
+ }
4075
+ validate159.evaluated = { "dynamicProps": false, "dynamicItems": false };
4076
+ /**
4077
+ * Compiled validator for the OdrlStatusType schema.
4078
+ */
4079
+ export const CompiledOdrlStatusType = validate59;
4080
+ /**
4081
+ * Compiled validator for the OdrlActionType schema.
4082
+ */
4083
+ export const CompiledOdrlActionType = validate71;
4084
+ /**
4085
+ * Compiled validator for the OdrlConflictStrategyType schema.
4086
+ */
4087
+ export const CompiledOdrlConflictStrategyType = validate111;
4088
+ /**
4089
+ * Compiled validator for the OdrlLeftOperandType schema.
4090
+ */
4091
+ export const CompiledOdrlLeftOperandType = validate55;
4092
+ /**
4093
+ * Compiled validator for the OdrlRightOperandType schema.
4094
+ */
4095
+ export const CompiledOdrlRightOperandType = validate160;
4096
+ const keyword9 = Object.values(external9["OdrlRightOperandType"]);
4097
+ function validate160(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
4098
+ /*# sourceURL="https://schema.twindev.org/w3c-odrl/OdrlRightOperandType" */ ;
4099
+ let vErrors = null;
4100
+ let errors = 0;
4101
+ const evaluated0 = validate160.evaluated;
4102
+ if (evaluated0.dynamicProps) {
4103
+ evaluated0.props = undefined;
4104
+ }
4105
+ if (evaluated0.dynamicItems) {
4106
+ evaluated0.items = undefined;
4107
+ }
4108
+ if (!keyword9.includes(data)) {
4109
+ for (let i0 = 0; i0 < keyword9.length; i0++) {
4110
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf" + "/" + i0 + "/const", "const", { allowedValue: keyword9[i0] }, "must be equal to constant"));
4111
+ errors++;
4112
+ }
4113
+ vErrors = pushError(vErrors, createError(instancePath, "#/anyOf", "anyOf", {}, "must match a schema in anyOf"));
4114
+ errors++;
4115
+ }
4116
+ validate160.errors = vErrors;
4117
+ return errors === 0;
4118
+ }
4119
+ validate160.evaluated = { "dynamicProps": false, "dynamicItems": false };
4120
+ //# sourceMappingURL=validators.js.map