@rdfx/builder 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.d.ts +32 -12
- package/dist/builder.js +2 -0
- package/dist/sh.d.ts +5 -5
- package/dist/shapes.d.ts +39993 -1327
- package/dist/shapes.js +1331 -408
- package/dist/skos.d.ts +21 -0
- package/dist/skos.js +56 -0
- package/dist/toIri.d.ts +1 -1
- package/package.json +9 -5
package/dist/shapes.js
CHANGED
|
@@ -51,6 +51,20 @@ function $convertToIri(value) {
|
|
|
51
51
|
return Either.of(dataFactory.namedNode(value));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
function $convertToIriIdentifierProperty(identifier) {
|
|
55
|
+
switch (typeof identifier) {
|
|
56
|
+
case "function":
|
|
57
|
+
return Either.of(identifier);
|
|
58
|
+
case "object": {
|
|
59
|
+
const captureIdentifier = identifier;
|
|
60
|
+
return Either.of(() => captureIdentifier);
|
|
61
|
+
}
|
|
62
|
+
case "string": {
|
|
63
|
+
const captureIdentifier = dataFactory.namedNode(identifier);
|
|
64
|
+
return Either.of(() => captureIdentifier);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
54
68
|
function $convertToList(convertToItem, _readonly) {
|
|
55
69
|
return (value) => Either.sequence(value.map(convertToItem));
|
|
56
70
|
}
|
|
@@ -140,6 +154,11 @@ function $monkeyPatchObject(obj, methods) {
|
|
|
140
154
|
return obj;
|
|
141
155
|
}
|
|
142
156
|
const $parseIdentifier = NTriplesIdentifier.parser(dataFactory);
|
|
157
|
+
export function $parseIri(identifier) {
|
|
158
|
+
return $parseIdentifier(identifier).chain((identifier) => identifier.termType === "NamedNode"
|
|
159
|
+
? Right(identifier)
|
|
160
|
+
: Left(new Error("expected identifier to be NamedNode")));
|
|
161
|
+
}
|
|
143
162
|
export var $PropertyPath;
|
|
144
163
|
(function ($PropertyPath) {
|
|
145
164
|
$PropertyPath.schema = {};
|
|
@@ -150,6 +169,7 @@ var $RdfVocabularies;
|
|
|
150
169
|
(function ($RdfVocabularies) {
|
|
151
170
|
$RdfVocabularies.rdf = {
|
|
152
171
|
first: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),
|
|
172
|
+
langString: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),
|
|
153
173
|
nil: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),
|
|
154
174
|
rest: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),
|
|
155
175
|
subject: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject"),
|
|
@@ -231,14 +251,84 @@ function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
|
|
|
231
251
|
return resource;
|
|
232
252
|
};
|
|
233
253
|
}
|
|
254
|
+
export var owl_Ontology;
|
|
255
|
+
(function (owl_Ontology) {
|
|
256
|
+
owl_Ontology.create = (parameters) => $sequenceRecord({
|
|
257
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
258
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.comment.type, value)),
|
|
259
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.label.type, value)),
|
|
260
|
+
})
|
|
261
|
+
.map((properties) => ({
|
|
262
|
+
...properties,
|
|
263
|
+
termType: "owl_Ontology",
|
|
264
|
+
}))
|
|
265
|
+
.map((object) => $monkeyPatchObject(object, { $toString: owl_Ontology.$toString }));
|
|
266
|
+
function createUnsafe(parameters) {
|
|
267
|
+
return owl_Ontology.create(parameters).unsafeCoerce();
|
|
268
|
+
}
|
|
269
|
+
owl_Ontology.createUnsafe = createUnsafe;
|
|
270
|
+
let Identifier;
|
|
271
|
+
(function (Identifier) {
|
|
272
|
+
Identifier.parse = $parseIdentifier;
|
|
273
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
274
|
+
})(Identifier = owl_Ontology.Identifier || (owl_Ontology.Identifier = {}));
|
|
275
|
+
owl_Ontology.isowl_Ontology = (object) => object.termType === "owl_Ontology";
|
|
276
|
+
owl_Ontology.schema = {
|
|
277
|
+
fromRdfType: dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
|
|
278
|
+
properties: {
|
|
279
|
+
$identifier: {
|
|
280
|
+
kind: "Identifier",
|
|
281
|
+
type: { kind: "Identifier" },
|
|
282
|
+
},
|
|
283
|
+
termType: { kind: "Discriminant", value: "owl_Ontology" },
|
|
284
|
+
comment: {
|
|
285
|
+
kind: "Shacl",
|
|
286
|
+
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
287
|
+
type: {
|
|
288
|
+
kind: "Option",
|
|
289
|
+
itemType: { kind: "String" },
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
label: {
|
|
293
|
+
kind: "Shacl",
|
|
294
|
+
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
295
|
+
type: {
|
|
296
|
+
kind: "Option",
|
|
297
|
+
itemType: { kind: "String" },
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
toRdfTypes: [
|
|
302
|
+
dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
|
|
303
|
+
],
|
|
304
|
+
};
|
|
305
|
+
owl_Ontology._toRdfResource = (parameters) => {
|
|
306
|
+
if (!parameters.ignoreRdfType) {
|
|
307
|
+
parameters.resource.add($RdfVocabularies.rdf.type, owl_Ontology.schema.toRdfTypes, parameters.graph);
|
|
308
|
+
}
|
|
309
|
+
parameters.resource.add(owl_Ontology.schema.properties.comment.path, parameters.object.comment
|
|
310
|
+
.toList()
|
|
311
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
312
|
+
parameters.resource.add(owl_Ontology.schema.properties.label.path, parameters.object.label
|
|
313
|
+
.toList()
|
|
314
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
315
|
+
return parameters.resource;
|
|
316
|
+
};
|
|
317
|
+
owl_Ontology.toRdfResource = $wrap_ToRdfResourceFunction(owl_Ontology._toRdfResource);
|
|
318
|
+
owl_Ontology.$toString = (_owlOntology) => `owl_Ontology(${JSON.stringify(owl_Ontology.toStringRecord(_owlOntology))})`;
|
|
319
|
+
owl_Ontology.toStringRecord = (_owlOntology) => $compactRecord({
|
|
320
|
+
$identifier: _owlOntology.$identifier().toString(),
|
|
321
|
+
label: _owlOntology.label.map((item) => item.toString()).extract(),
|
|
322
|
+
});
|
|
323
|
+
})(owl_Ontology || (owl_Ontology = {}));
|
|
234
324
|
export var sh_NodeShape;
|
|
235
325
|
(function (sh_NodeShape) {
|
|
236
326
|
sh_NodeShape.create = (parameters) => $sequenceRecord({
|
|
237
327
|
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
238
|
-
and: $convertToMaybe($convertToList($
|
|
328
|
+
and: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.and.type, value)),
|
|
239
329
|
classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.classes.type, value)),
|
|
240
330
|
closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.closed.type, value)),
|
|
241
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(
|
|
331
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.comment.type, value)),
|
|
242
332
|
datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.datatype.type, value)),
|
|
243
333
|
deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.deactivated.type, value)),
|
|
244
334
|
discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.discriminantValue.type, value)),
|
|
@@ -249,8 +339,8 @@ export var sh_NodeShape;
|
|
|
249
339
|
ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters?.ignore),
|
|
250
340
|
ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.ignoredProperties.type, value)),
|
|
251
341
|
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.in_.type, value)),
|
|
252
|
-
isDefinedBy: $convertToMaybe($
|
|
253
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(
|
|
342
|
+
isDefinedBy: $convertToMaybe($identityConversionFunction)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
343
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.label.type, value)),
|
|
254
344
|
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.languageIn.type, value)),
|
|
255
345
|
maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.maxExclusive.type, value)),
|
|
256
346
|
maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.maxInclusive.type, value)),
|
|
@@ -260,12 +350,12 @@ export var sh_NodeShape;
|
|
|
260
350
|
minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.minInclusive.type, value)),
|
|
261
351
|
minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.minLength.type, value)),
|
|
262
352
|
mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.mutable.type, value)),
|
|
263
|
-
node: $convertToMaybe($
|
|
353
|
+
node: $convertToMaybe($identityConversionFunction)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.node.type, value)),
|
|
264
354
|
nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.nodeKind.type, value)),
|
|
265
|
-
not: $convertToScalarSet($
|
|
266
|
-
or: $convertToMaybe($convertToList($
|
|
355
|
+
not: $convertToScalarSet($identityConversionFunction, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.not.type, value)),
|
|
356
|
+
or: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.or.type, value)),
|
|
267
357
|
pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.pattern.type, value)),
|
|
268
|
-
properties: $convertToScalarSet($
|
|
358
|
+
properties: $convertToScalarSet($identityConversionFunction, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.properties.type, value)),
|
|
269
359
|
rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.rdfType.type, value)),
|
|
270
360
|
severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.severity.type, value)),
|
|
271
361
|
shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.shaclmateName.type, value)),
|
|
@@ -276,10 +366,13 @@ export var sh_NodeShape;
|
|
|
276
366
|
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
277
367
|
toRdfTypes: $convertToScalarSet(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.toRdfTypes.type, value)),
|
|
278
368
|
tsImports: $convertToScalarSet($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.tsImports.type, value)),
|
|
279
|
-
|
|
280
|
-
xone: $convertToMaybe($convertToList($
|
|
369
|
+
type: $convertToScalarSet(($convertToIri), true)(parameters?.type).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.type.type, value)),
|
|
370
|
+
xone: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.xone.type, value)),
|
|
281
371
|
})
|
|
282
|
-
.map((properties) => ({
|
|
372
|
+
.map((properties) => ({
|
|
373
|
+
...properties,
|
|
374
|
+
termType: "sh_NodeShape",
|
|
375
|
+
}))
|
|
283
376
|
.map((object) => $monkeyPatchObject(object, { $toString: sh_NodeShape.$toString }));
|
|
284
377
|
function createUnsafe(parameters) {
|
|
285
378
|
return sh_NodeShape.create(parameters).unsafeCoerce();
|
|
@@ -290,10 +383,7 @@ export var sh_NodeShape;
|
|
|
290
383
|
Identifier.parse = $parseIdentifier;
|
|
291
384
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
292
385
|
})(Identifier = sh_NodeShape.Identifier || (sh_NodeShape.Identifier = {}));
|
|
293
|
-
|
|
294
|
-
return object.$type === "sh_NodeShape";
|
|
295
|
-
}
|
|
296
|
-
sh_NodeShape.issh_NodeShape = issh_NodeShape;
|
|
386
|
+
sh_NodeShape.issh_NodeShape = (object) => object.termType === "sh_NodeShape";
|
|
297
387
|
sh_NodeShape.schema = {
|
|
298
388
|
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"),
|
|
299
389
|
properties: {
|
|
@@ -301,15 +391,37 @@ export var sh_NodeShape;
|
|
|
301
391
|
kind: "Identifier",
|
|
302
392
|
type: { kind: "Identifier" },
|
|
303
393
|
},
|
|
394
|
+
termType: { kind: "Discriminant", value: "sh_NodeShape" },
|
|
304
395
|
and: {
|
|
305
396
|
kind: "Shacl",
|
|
306
397
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
|
|
307
|
-
type
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
398
|
+
get type() {
|
|
399
|
+
return {
|
|
400
|
+
kind: "Option",
|
|
401
|
+
get itemType() {
|
|
402
|
+
return {
|
|
403
|
+
kind: "List",
|
|
404
|
+
get itemType() {
|
|
405
|
+
return {
|
|
406
|
+
kind: "DiscriminatedUnion",
|
|
407
|
+
members: {
|
|
408
|
+
NamedNode: {
|
|
409
|
+
discriminantValues: ["NamedNode"],
|
|
410
|
+
type: { kind: "Iri" },
|
|
411
|
+
},
|
|
412
|
+
sh_NodeShape: {
|
|
413
|
+
discriminantValues: [
|
|
414
|
+
"sh_NodeShape",
|
|
415
|
+
"sh_PropertyShape",
|
|
416
|
+
],
|
|
417
|
+
type: sh_Shape.schema,
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
},
|
|
424
|
+
};
|
|
313
425
|
},
|
|
314
426
|
},
|
|
315
427
|
classes: {
|
|
@@ -420,9 +532,25 @@ export var sh_NodeShape;
|
|
|
420
532
|
isDefinedBy: {
|
|
421
533
|
kind: "Shacl",
|
|
422
534
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
423
|
-
type
|
|
424
|
-
|
|
425
|
-
|
|
535
|
+
get type() {
|
|
536
|
+
return {
|
|
537
|
+
kind: "Option",
|
|
538
|
+
get itemType() {
|
|
539
|
+
return {
|
|
540
|
+
kind: "DiscriminatedUnion",
|
|
541
|
+
members: {
|
|
542
|
+
NamedNode: {
|
|
543
|
+
discriminantValues: ["NamedNode"],
|
|
544
|
+
type: { kind: "Iri" },
|
|
545
|
+
},
|
|
546
|
+
owl_Ontology: {
|
|
547
|
+
discriminantValues: ["owl_Ontology"],
|
|
548
|
+
type: owl_Ontology.schema,
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
};
|
|
552
|
+
},
|
|
553
|
+
};
|
|
426
554
|
},
|
|
427
555
|
},
|
|
428
556
|
label: {
|
|
@@ -511,9 +639,25 @@ export var sh_NodeShape;
|
|
|
511
639
|
node: {
|
|
512
640
|
kind: "Shacl",
|
|
513
641
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
514
|
-
type
|
|
515
|
-
|
|
516
|
-
|
|
642
|
+
get type() {
|
|
643
|
+
return {
|
|
644
|
+
kind: "Option",
|
|
645
|
+
get itemType() {
|
|
646
|
+
return {
|
|
647
|
+
kind: "DiscriminatedUnion",
|
|
648
|
+
members: {
|
|
649
|
+
NamedNode: {
|
|
650
|
+
discriminantValues: ["NamedNode"],
|
|
651
|
+
type: { kind: "Iri" },
|
|
652
|
+
},
|
|
653
|
+
sh_NodeShape: {
|
|
654
|
+
discriminantValues: ["sh_NodeShape"],
|
|
655
|
+
type: sh_NodeShape.schema,
|
|
656
|
+
},
|
|
657
|
+
},
|
|
658
|
+
};
|
|
659
|
+
},
|
|
660
|
+
};
|
|
517
661
|
},
|
|
518
662
|
},
|
|
519
663
|
nodeKind: {
|
|
@@ -537,20 +681,57 @@ export var sh_NodeShape;
|
|
|
537
681
|
not: {
|
|
538
682
|
kind: "Shacl",
|
|
539
683
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
|
|
540
|
-
type
|
|
541
|
-
|
|
542
|
-
|
|
684
|
+
get type() {
|
|
685
|
+
return {
|
|
686
|
+
kind: "Set",
|
|
687
|
+
get itemType() {
|
|
688
|
+
return {
|
|
689
|
+
kind: "DiscriminatedUnion",
|
|
690
|
+
members: {
|
|
691
|
+
NamedNode: {
|
|
692
|
+
discriminantValues: ["NamedNode"],
|
|
693
|
+
type: { kind: "Iri" },
|
|
694
|
+
},
|
|
695
|
+
sh_NodeShape: {
|
|
696
|
+
discriminantValues: ["sh_NodeShape"],
|
|
697
|
+
type: sh_NodeShape.schema,
|
|
698
|
+
},
|
|
699
|
+
},
|
|
700
|
+
};
|
|
701
|
+
},
|
|
702
|
+
};
|
|
543
703
|
},
|
|
544
704
|
},
|
|
545
705
|
or: {
|
|
546
706
|
kind: "Shacl",
|
|
547
707
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
|
|
548
|
-
type
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
708
|
+
get type() {
|
|
709
|
+
return {
|
|
710
|
+
kind: "Option",
|
|
711
|
+
get itemType() {
|
|
712
|
+
return {
|
|
713
|
+
kind: "List",
|
|
714
|
+
get itemType() {
|
|
715
|
+
return {
|
|
716
|
+
kind: "DiscriminatedUnion",
|
|
717
|
+
members: {
|
|
718
|
+
NamedNode: {
|
|
719
|
+
discriminantValues: ["NamedNode"],
|
|
720
|
+
type: { kind: "Iri" },
|
|
721
|
+
},
|
|
722
|
+
sh_NodeShape: {
|
|
723
|
+
discriminantValues: [
|
|
724
|
+
"sh_NodeShape",
|
|
725
|
+
"sh_PropertyShape",
|
|
726
|
+
],
|
|
727
|
+
type: sh_Shape.schema,
|
|
728
|
+
},
|
|
729
|
+
},
|
|
730
|
+
};
|
|
731
|
+
},
|
|
732
|
+
};
|
|
733
|
+
},
|
|
734
|
+
};
|
|
554
735
|
},
|
|
555
736
|
},
|
|
556
737
|
pattern: {
|
|
@@ -564,9 +745,25 @@ export var sh_NodeShape;
|
|
|
564
745
|
properties: {
|
|
565
746
|
kind: "Shacl",
|
|
566
747
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
|
|
567
|
-
type
|
|
568
|
-
|
|
569
|
-
|
|
748
|
+
get type() {
|
|
749
|
+
return {
|
|
750
|
+
kind: "Set",
|
|
751
|
+
get itemType() {
|
|
752
|
+
return {
|
|
753
|
+
kind: "DiscriminatedUnion",
|
|
754
|
+
members: {
|
|
755
|
+
NamedNode: {
|
|
756
|
+
discriminantValues: ["NamedNode"],
|
|
757
|
+
type: { kind: "Iri" },
|
|
758
|
+
},
|
|
759
|
+
sh_PropertyShape: {
|
|
760
|
+
discriminantValues: ["sh_PropertyShape"],
|
|
761
|
+
type: sh_PropertyShape.schema,
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
};
|
|
765
|
+
},
|
|
766
|
+
};
|
|
570
767
|
},
|
|
571
768
|
},
|
|
572
769
|
rdfType: {
|
|
@@ -639,7 +836,7 @@ export var sh_NodeShape;
|
|
|
639
836
|
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"),
|
|
640
837
|
type: { kind: "Set", itemType: { kind: "String" } },
|
|
641
838
|
},
|
|
642
|
-
|
|
839
|
+
type: {
|
|
643
840
|
kind: "Shacl",
|
|
644
841
|
path: $RdfVocabularies.rdf.type,
|
|
645
842
|
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
@@ -647,12 +844,33 @@ export var sh_NodeShape;
|
|
|
647
844
|
xone: {
|
|
648
845
|
kind: "Shacl",
|
|
649
846
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
650
|
-
type
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
847
|
+
get type() {
|
|
848
|
+
return {
|
|
849
|
+
kind: "Option",
|
|
850
|
+
get itemType() {
|
|
851
|
+
return {
|
|
852
|
+
kind: "List",
|
|
853
|
+
get itemType() {
|
|
854
|
+
return {
|
|
855
|
+
kind: "DiscriminatedUnion",
|
|
856
|
+
members: {
|
|
857
|
+
NamedNode: {
|
|
858
|
+
discriminantValues: ["NamedNode"],
|
|
859
|
+
type: { kind: "Iri" },
|
|
860
|
+
},
|
|
861
|
+
sh_NodeShape: {
|
|
862
|
+
discriminantValues: [
|
|
863
|
+
"sh_NodeShape",
|
|
864
|
+
"sh_PropertyShape",
|
|
865
|
+
],
|
|
866
|
+
type: sh_Shape.schema,
|
|
867
|
+
},
|
|
868
|
+
},
|
|
869
|
+
};
|
|
870
|
+
},
|
|
871
|
+
};
|
|
872
|
+
},
|
|
873
|
+
};
|
|
656
874
|
},
|
|
657
875
|
},
|
|
658
876
|
},
|
|
@@ -673,7 +891,25 @@ export var sh_NodeShape;
|
|
|
673
891
|
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
674
892
|
currentSubListResource = newSubListResource;
|
|
675
893
|
}
|
|
676
|
-
currentSubListResource.add($RdfVocabularies.rdf.first,
|
|
894
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, ((value, _options) => {
|
|
895
|
+
if (value["termType"] === "NamedNode") {
|
|
896
|
+
return [value];
|
|
897
|
+
}
|
|
898
|
+
if (sh_Shape.issh_Shape(value)) {
|
|
899
|
+
return sh_Shape.toRdfResourceValues(value, {
|
|
900
|
+
graph: _options.graph,
|
|
901
|
+
propertyPath: _options.propertyPath,
|
|
902
|
+
resource: _options.resource,
|
|
903
|
+
resourceSet: _options.resourceSet,
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
throw new Error("unable to serialize to RDF");
|
|
907
|
+
})(item, {
|
|
908
|
+
graph: parameters.graph,
|
|
909
|
+
propertyPath: $RdfVocabularies.rdf.first,
|
|
910
|
+
resource: currentSubListResource,
|
|
911
|
+
resourceSet: parameters.resourceSet,
|
|
912
|
+
}), parameters.graph);
|
|
677
913
|
if (itemIndex + 1 === list.length) {
|
|
678
914
|
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
679
915
|
}
|
|
@@ -690,7 +926,7 @@ export var sh_NodeShape;
|
|
|
690
926
|
.flatMap((value) => [
|
|
691
927
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
692
928
|
]), parameters.graph);
|
|
693
|
-
parameters.resource.add(
|
|
929
|
+
parameters.resource.add(owl_Ontology.schema.properties.comment.path, parameters.object.comment
|
|
694
930
|
.toList()
|
|
695
931
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
696
932
|
parameters.resource.add(sh_NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
@@ -761,8 +997,26 @@ export var sh_NodeShape;
|
|
|
761
997
|
}).listResource.identifier
|
|
762
998
|
: $RdfVocabularies.rdf.nil,
|
|
763
999
|
]), parameters.graph);
|
|
764
|
-
parameters.resource.add(sh_NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(),
|
|
765
|
-
|
|
1000
|
+
parameters.resource.add(sh_NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList().flatMap((value) => ((value, _options) => {
|
|
1001
|
+
if (value["termType"] === "NamedNode") {
|
|
1002
|
+
return [value];
|
|
1003
|
+
}
|
|
1004
|
+
if (owl_Ontology.isowl_Ontology(value)) {
|
|
1005
|
+
return [
|
|
1006
|
+
owl_Ontology.toRdfResource(value, {
|
|
1007
|
+
graph: _options.graph,
|
|
1008
|
+
resourceSet: _options.resourceSet,
|
|
1009
|
+
}).identifier,
|
|
1010
|
+
];
|
|
1011
|
+
}
|
|
1012
|
+
throw new Error("unable to serialize to RDF");
|
|
1013
|
+
})(value, {
|
|
1014
|
+
graph: parameters.graph,
|
|
1015
|
+
resource: parameters.resource,
|
|
1016
|
+
resourceSet: parameters.resourceSet,
|
|
1017
|
+
propertyPath: sh_NodeShape.schema.properties.isDefinedBy.path,
|
|
1018
|
+
})), parameters.graph);
|
|
1019
|
+
parameters.resource.add(owl_Ontology.schema.properties.label.path, parameters.object.label
|
|
766
1020
|
.toList()
|
|
767
1021
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
768
1022
|
parameters.resource.add(sh_NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
@@ -809,9 +1063,45 @@ export var sh_NodeShape;
|
|
|
809
1063
|
.flatMap((value) => [
|
|
810
1064
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
811
1065
|
]), parameters.graph);
|
|
812
|
-
parameters.resource.add(sh_NodeShape.schema.properties.node.path, parameters.object.node.toList(),
|
|
1066
|
+
parameters.resource.add(sh_NodeShape.schema.properties.node.path, parameters.object.node.toList().flatMap((value) => ((value, _options) => {
|
|
1067
|
+
if (value["termType"] === "NamedNode") {
|
|
1068
|
+
return [value];
|
|
1069
|
+
}
|
|
1070
|
+
if (sh_NodeShape.issh_NodeShape(value)) {
|
|
1071
|
+
return [
|
|
1072
|
+
sh_NodeShape.toRdfResource(value, {
|
|
1073
|
+
graph: _options.graph,
|
|
1074
|
+
resourceSet: _options.resourceSet,
|
|
1075
|
+
}).identifier,
|
|
1076
|
+
];
|
|
1077
|
+
}
|
|
1078
|
+
throw new Error("unable to serialize to RDF");
|
|
1079
|
+
})(value, {
|
|
1080
|
+
graph: parameters.graph,
|
|
1081
|
+
resource: parameters.resource,
|
|
1082
|
+
resourceSet: parameters.resourceSet,
|
|
1083
|
+
propertyPath: sh_NodeShape.schema.properties.node.path,
|
|
1084
|
+
})), parameters.graph);
|
|
813
1085
|
parameters.resource.add(sh_NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
814
|
-
parameters.resource.add(sh_NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) =>
|
|
1086
|
+
parameters.resource.add(sh_NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => ((value, _options) => {
|
|
1087
|
+
if (value["termType"] === "NamedNode") {
|
|
1088
|
+
return [value];
|
|
1089
|
+
}
|
|
1090
|
+
if (sh_NodeShape.issh_NodeShape(value)) {
|
|
1091
|
+
return [
|
|
1092
|
+
sh_NodeShape.toRdfResource(value, {
|
|
1093
|
+
graph: _options.graph,
|
|
1094
|
+
resourceSet: _options.resourceSet,
|
|
1095
|
+
}).identifier,
|
|
1096
|
+
];
|
|
1097
|
+
}
|
|
1098
|
+
throw new Error("unable to serialize to RDF");
|
|
1099
|
+
})(item, {
|
|
1100
|
+
graph: parameters.graph,
|
|
1101
|
+
resource: parameters.resource,
|
|
1102
|
+
resourceSet: parameters.resourceSet,
|
|
1103
|
+
propertyPath: sh_NodeShape.schema.properties.not.path,
|
|
1104
|
+
})), parameters.graph);
|
|
815
1105
|
parameters.resource.add(sh_NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
816
1106
|
value.length > 0
|
|
817
1107
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
@@ -823,7 +1113,25 @@ export var sh_NodeShape;
|
|
|
823
1113
|
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
824
1114
|
currentSubListResource = newSubListResource;
|
|
825
1115
|
}
|
|
826
|
-
currentSubListResource.add($RdfVocabularies.rdf.first,
|
|
1116
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, ((value, _options) => {
|
|
1117
|
+
if (value["termType"] === "NamedNode") {
|
|
1118
|
+
return [value];
|
|
1119
|
+
}
|
|
1120
|
+
if (sh_Shape.issh_Shape(value)) {
|
|
1121
|
+
return sh_Shape.toRdfResourceValues(value, {
|
|
1122
|
+
graph: _options.graph,
|
|
1123
|
+
propertyPath: _options.propertyPath,
|
|
1124
|
+
resource: _options.resource,
|
|
1125
|
+
resourceSet: _options.resourceSet,
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
throw new Error("unable to serialize to RDF");
|
|
1129
|
+
})(item, {
|
|
1130
|
+
graph: parameters.graph,
|
|
1131
|
+
propertyPath: $RdfVocabularies.rdf.first,
|
|
1132
|
+
resource: currentSubListResource,
|
|
1133
|
+
resourceSet: parameters.resourceSet,
|
|
1134
|
+
}), parameters.graph);
|
|
827
1135
|
if (itemIndex + 1 === list.length) {
|
|
828
1136
|
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
829
1137
|
}
|
|
@@ -837,7 +1145,25 @@ export var sh_NodeShape;
|
|
|
837
1145
|
parameters.resource.add(sh_NodeShape.schema.properties.pattern.path, parameters.object.pattern
|
|
838
1146
|
.toList()
|
|
839
1147
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
840
|
-
parameters.resource.add(sh_NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) =>
|
|
1148
|
+
parameters.resource.add(sh_NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => ((value, _options) => {
|
|
1149
|
+
if (value["termType"] === "NamedNode") {
|
|
1150
|
+
return [value];
|
|
1151
|
+
}
|
|
1152
|
+
if (sh_PropertyShape.issh_PropertyShape(value)) {
|
|
1153
|
+
return [
|
|
1154
|
+
sh_PropertyShape.toRdfResource(value, {
|
|
1155
|
+
graph: _options.graph,
|
|
1156
|
+
resourceSet: _options.resourceSet,
|
|
1157
|
+
}).identifier,
|
|
1158
|
+
];
|
|
1159
|
+
}
|
|
1160
|
+
throw new Error("unable to serialize to RDF");
|
|
1161
|
+
})(item, {
|
|
1162
|
+
graph: parameters.graph,
|
|
1163
|
+
resource: parameters.resource,
|
|
1164
|
+
resourceSet: parameters.resourceSet,
|
|
1165
|
+
propertyPath: sh_NodeShape.schema.properties.properties.path,
|
|
1166
|
+
})), parameters.graph);
|
|
841
1167
|
parameters.resource.add(sh_NodeShape.schema.properties.rdfType.path, parameters.object.rdfType.toList(), parameters.graph);
|
|
842
1168
|
parameters.resource.add(sh_NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
|
|
843
1169
|
parameters.resource.add(sh_NodeShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
|
|
@@ -852,7 +1178,7 @@ export var sh_NodeShape;
|
|
|
852
1178
|
parameters.resource.add(sh_NodeShape.schema.properties.tsImports.path, parameters.object.tsImports.flatMap((item) => [
|
|
853
1179
|
$literalFactory.string(item),
|
|
854
1180
|
]), parameters.graph);
|
|
855
|
-
parameters.resource.add(sh_NodeShape.schema.properties.
|
|
1181
|
+
parameters.resource.add(sh_NodeShape.schema.properties.type.path, parameters.object.type.flatMap((item) => [item]), parameters.graph);
|
|
856
1182
|
parameters.resource.add(sh_NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
|
|
857
1183
|
value.length > 0
|
|
858
1184
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
@@ -864,7 +1190,25 @@ export var sh_NodeShape;
|
|
|
864
1190
|
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
865
1191
|
currentSubListResource = newSubListResource;
|
|
866
1192
|
}
|
|
867
|
-
currentSubListResource.add($RdfVocabularies.rdf.first,
|
|
1193
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, ((value, _options) => {
|
|
1194
|
+
if (value["termType"] === "NamedNode") {
|
|
1195
|
+
return [value];
|
|
1196
|
+
}
|
|
1197
|
+
if (sh_Shape.issh_Shape(value)) {
|
|
1198
|
+
return sh_Shape.toRdfResourceValues(value, {
|
|
1199
|
+
graph: _options.graph,
|
|
1200
|
+
propertyPath: _options.propertyPath,
|
|
1201
|
+
resource: _options.resource,
|
|
1202
|
+
resourceSet: _options.resourceSet,
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
throw new Error("unable to serialize to RDF");
|
|
1206
|
+
})(item, {
|
|
1207
|
+
graph: parameters.graph,
|
|
1208
|
+
propertyPath: $RdfVocabularies.rdf.first,
|
|
1209
|
+
resource: currentSubListResource,
|
|
1210
|
+
resourceSet: parameters.resourceSet,
|
|
1211
|
+
}), parameters.graph);
|
|
868
1212
|
if (itemIndex + 1 === list.length) {
|
|
869
1213
|
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
870
1214
|
}
|
|
@@ -887,85 +1231,16 @@ export var sh_NodeShape;
|
|
|
887
1231
|
.extract(),
|
|
888
1232
|
});
|
|
889
1233
|
})(sh_NodeShape || (sh_NodeShape = {}));
|
|
890
|
-
export var sh_Ontology;
|
|
891
|
-
(function (sh_Ontology) {
|
|
892
|
-
sh_Ontology.create = (parameters) => $sequenceRecord({
|
|
893
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
894
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.comment.type, value)),
|
|
895
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.label.type, value)),
|
|
896
|
-
})
|
|
897
|
-
.map((properties) => ({ ...properties, $type: "sh_Ontology" }))
|
|
898
|
-
.map((object) => $monkeyPatchObject(object, { $toString: sh_Ontology.$toString }));
|
|
899
|
-
function createUnsafe(parameters) {
|
|
900
|
-
return sh_Ontology.create(parameters).unsafeCoerce();
|
|
901
|
-
}
|
|
902
|
-
sh_Ontology.createUnsafe = createUnsafe;
|
|
903
|
-
let Identifier;
|
|
904
|
-
(function (Identifier) {
|
|
905
|
-
Identifier.parse = $parseIdentifier;
|
|
906
|
-
Identifier.stringify = NTriplesTerm.stringify;
|
|
907
|
-
})(Identifier = sh_Ontology.Identifier || (sh_Ontology.Identifier = {}));
|
|
908
|
-
function issh_Ontology(object) {
|
|
909
|
-
return object.$type === "sh_Ontology";
|
|
910
|
-
}
|
|
911
|
-
sh_Ontology.issh_Ontology = issh_Ontology;
|
|
912
|
-
sh_Ontology.schema = {
|
|
913
|
-
fromRdfType: dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
|
|
914
|
-
properties: {
|
|
915
|
-
$identifier: {
|
|
916
|
-
kind: "Identifier",
|
|
917
|
-
type: { kind: "Identifier" },
|
|
918
|
-
},
|
|
919
|
-
comment: {
|
|
920
|
-
kind: "Shacl",
|
|
921
|
-
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
922
|
-
type: {
|
|
923
|
-
kind: "Option",
|
|
924
|
-
itemType: { kind: "String" },
|
|
925
|
-
},
|
|
926
|
-
},
|
|
927
|
-
label: {
|
|
928
|
-
kind: "Shacl",
|
|
929
|
-
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
930
|
-
type: {
|
|
931
|
-
kind: "Option",
|
|
932
|
-
itemType: { kind: "String" },
|
|
933
|
-
},
|
|
934
|
-
},
|
|
935
|
-
},
|
|
936
|
-
toRdfTypes: [
|
|
937
|
-
dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
|
|
938
|
-
],
|
|
939
|
-
};
|
|
940
|
-
sh_Ontology._toRdfResource = (parameters) => {
|
|
941
|
-
if (!parameters.ignoreRdfType) {
|
|
942
|
-
parameters.resource.add($RdfVocabularies.rdf.type, sh_Ontology.schema.toRdfTypes, parameters.graph);
|
|
943
|
-
}
|
|
944
|
-
parameters.resource.add(sh_NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
945
|
-
.toList()
|
|
946
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
947
|
-
parameters.resource.add(sh_NodeShape.schema.properties.label.path, parameters.object.label
|
|
948
|
-
.toList()
|
|
949
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
950
|
-
return parameters.resource;
|
|
951
|
-
};
|
|
952
|
-
sh_Ontology.toRdfResource = $wrap_ToRdfResourceFunction(sh_Ontology._toRdfResource);
|
|
953
|
-
sh_Ontology.$toString = (_shOntology) => `sh_Ontology(${JSON.stringify(sh_Ontology.toStringRecord(_shOntology))})`;
|
|
954
|
-
sh_Ontology.toStringRecord = (_shOntology) => $compactRecord({
|
|
955
|
-
$identifier: _shOntology.$identifier().toString(),
|
|
956
|
-
label: _shOntology.label.map((item) => item.toString()).extract(),
|
|
957
|
-
});
|
|
958
|
-
})(sh_Ontology || (sh_Ontology = {}));
|
|
959
1234
|
export var sh_PropertyGroup;
|
|
960
1235
|
(function (sh_PropertyGroup) {
|
|
961
1236
|
sh_PropertyGroup.create = (parameters) => $sequenceRecord({
|
|
962
1237
|
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
963
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(
|
|
964
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(
|
|
1238
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.comment.type, value)),
|
|
1239
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.label.type, value)),
|
|
965
1240
|
})
|
|
966
1241
|
.map((properties) => ({
|
|
967
1242
|
...properties,
|
|
968
|
-
|
|
1243
|
+
termType: "sh_PropertyGroup",
|
|
969
1244
|
}))
|
|
970
1245
|
.map((object) => $monkeyPatchObject(object, { $toString: sh_PropertyGroup.$toString }));
|
|
971
1246
|
function createUnsafe(parameters) {
|
|
@@ -977,10 +1252,7 @@ export var sh_PropertyGroup;
|
|
|
977
1252
|
Identifier.parse = $parseIdentifier;
|
|
978
1253
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
979
1254
|
})(Identifier = sh_PropertyGroup.Identifier || (sh_PropertyGroup.Identifier = {}));
|
|
980
|
-
|
|
981
|
-
return object.$type === "sh_PropertyGroup";
|
|
982
|
-
}
|
|
983
|
-
sh_PropertyGroup.issh_PropertyGroup = issh_PropertyGroup;
|
|
1255
|
+
sh_PropertyGroup.issh_PropertyGroup = (object) => object.termType === "sh_PropertyGroup";
|
|
984
1256
|
sh_PropertyGroup.schema = {
|
|
985
1257
|
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"),
|
|
986
1258
|
properties: {
|
|
@@ -988,6 +1260,7 @@ export var sh_PropertyGroup;
|
|
|
988
1260
|
kind: "Identifier",
|
|
989
1261
|
type: { kind: "Identifier" },
|
|
990
1262
|
},
|
|
1263
|
+
termType: { kind: "Discriminant", value: "sh_PropertyGroup" },
|
|
991
1264
|
comment: {
|
|
992
1265
|
kind: "Shacl",
|
|
993
1266
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
@@ -1013,10 +1286,10 @@ export var sh_PropertyGroup;
|
|
|
1013
1286
|
if (!parameters.ignoreRdfType) {
|
|
1014
1287
|
parameters.resource.add($RdfVocabularies.rdf.type, sh_PropertyGroup.schema.toRdfTypes, parameters.graph);
|
|
1015
1288
|
}
|
|
1016
|
-
parameters.resource.add(
|
|
1289
|
+
parameters.resource.add(owl_Ontology.schema.properties.comment.path, parameters.object.comment
|
|
1017
1290
|
.toList()
|
|
1018
1291
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1019
|
-
parameters.resource.add(
|
|
1292
|
+
parameters.resource.add(owl_Ontology.schema.properties.label.path, parameters.object.label
|
|
1020
1293
|
.toList()
|
|
1021
1294
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1022
1295
|
return parameters.resource;
|
|
@@ -1032,9 +1305,9 @@ export var sh_PropertyShape;
|
|
|
1032
1305
|
(function (sh_PropertyShape) {
|
|
1033
1306
|
sh_PropertyShape.create = (parameters) => $sequenceRecord({
|
|
1034
1307
|
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
1035
|
-
and: $convertToMaybe($convertToList($
|
|
1308
|
+
and: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.and.type, value)),
|
|
1036
1309
|
classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.classes.type, value)),
|
|
1037
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(
|
|
1310
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.comment.type, value)),
|
|
1038
1311
|
datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.datatype.type, value)),
|
|
1039
1312
|
deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.deactivated.type, value)),
|
|
1040
1313
|
defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(sh_PropertyShape.schema.properties.defaultValue.type, value)),
|
|
@@ -1043,12 +1316,12 @@ export var sh_PropertyShape;
|
|
|
1043
1316
|
display: $convertWithDefaultValue($identityConversionFunction, false)(parameters.display),
|
|
1044
1317
|
equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(sh_PropertyShape.schema.properties.equals.type, value)),
|
|
1045
1318
|
flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.flags.type, value)),
|
|
1046
|
-
groups: $convertToScalarSet($
|
|
1319
|
+
groups: $convertToScalarSet($identityConversionFunction, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(sh_PropertyShape.schema.properties.groups.type, value)),
|
|
1047
1320
|
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.hasValues.type, value)),
|
|
1048
1321
|
ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters.ignore),
|
|
1049
1322
|
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.in_.type, value)),
|
|
1050
|
-
isDefinedBy: $convertToMaybe($
|
|
1051
|
-
label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(
|
|
1323
|
+
isDefinedBy: $convertToMaybe($identityConversionFunction)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
1324
|
+
label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(owl_Ontology.schema.properties.label.type, value)),
|
|
1052
1325
|
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.languageIn.type, value)),
|
|
1053
1326
|
lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(sh_PropertyShape.schema.properties.lessThan.type, value)),
|
|
1054
1327
|
lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(sh_PropertyShape.schema.properties.lessThanOrEquals.type, value)),
|
|
@@ -1063,10 +1336,10 @@ export var sh_PropertyShape;
|
|
|
1063
1336
|
minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.minLength.type, value)),
|
|
1064
1337
|
mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.mutable.type, value)),
|
|
1065
1338
|
name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(sh_PropertyShape.schema.properties.name.type, value)),
|
|
1066
|
-
node: $convertToMaybe($
|
|
1339
|
+
node: $convertToMaybe($identityConversionFunction)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.node.type, value)),
|
|
1067
1340
|
nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.nodeKind.type, value)),
|
|
1068
|
-
not: $convertToScalarSet($
|
|
1069
|
-
or: $convertToMaybe($convertToList($
|
|
1341
|
+
not: $convertToScalarSet($identityConversionFunction, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.not.type, value)),
|
|
1342
|
+
or: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.or.type, value)),
|
|
1070
1343
|
order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(sh_PropertyShape.schema.properties.order.type, value)),
|
|
1071
1344
|
path: Either.of(parameters.path),
|
|
1072
1345
|
pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(sh_NodeShape.schema.properties.pattern.type, value)),
|
|
@@ -1082,11 +1355,11 @@ export var sh_PropertyShape;
|
|
|
1082
1355
|
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
1083
1356
|
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
1084
1357
|
uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(sh_PropertyShape.schema.properties.uniqueLang.type, value)),
|
|
1085
|
-
xone: $convertToMaybe($convertToList($
|
|
1358
|
+
xone: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(sh_NodeShape.schema.properties.xone.type, value)),
|
|
1086
1359
|
})
|
|
1087
1360
|
.map((properties) => ({
|
|
1088
1361
|
...properties,
|
|
1089
|
-
|
|
1362
|
+
termType: "sh_PropertyShape",
|
|
1090
1363
|
}))
|
|
1091
1364
|
.map((object) => $monkeyPatchObject(object, { $toString: sh_PropertyShape.$toString }));
|
|
1092
1365
|
function createUnsafe(parameters) {
|
|
@@ -1098,10 +1371,7 @@ export var sh_PropertyShape;
|
|
|
1098
1371
|
Identifier.parse = $parseIdentifier;
|
|
1099
1372
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
1100
1373
|
})(Identifier = sh_PropertyShape.Identifier || (sh_PropertyShape.Identifier = {}));
|
|
1101
|
-
|
|
1102
|
-
return object.$type === "sh_PropertyShape";
|
|
1103
|
-
}
|
|
1104
|
-
sh_PropertyShape.issh_PropertyShape = issh_PropertyShape;
|
|
1374
|
+
sh_PropertyShape.issh_PropertyShape = (object) => object.termType === "sh_PropertyShape";
|
|
1105
1375
|
sh_PropertyShape.schema = {
|
|
1106
1376
|
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"),
|
|
1107
1377
|
properties: {
|
|
@@ -1109,15 +1379,37 @@ export var sh_PropertyShape;
|
|
|
1109
1379
|
kind: "Identifier",
|
|
1110
1380
|
type: { kind: "Identifier" },
|
|
1111
1381
|
},
|
|
1382
|
+
termType: { kind: "Discriminant", value: "sh_PropertyShape" },
|
|
1112
1383
|
and: {
|
|
1113
1384
|
kind: "Shacl",
|
|
1114
1385
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
|
|
1115
|
-
type
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1386
|
+
get type() {
|
|
1387
|
+
return {
|
|
1388
|
+
kind: "Option",
|
|
1389
|
+
get itemType() {
|
|
1390
|
+
return {
|
|
1391
|
+
kind: "List",
|
|
1392
|
+
get itemType() {
|
|
1393
|
+
return {
|
|
1394
|
+
kind: "DiscriminatedUnion",
|
|
1395
|
+
members: {
|
|
1396
|
+
NamedNode: {
|
|
1397
|
+
discriminantValues: ["NamedNode"],
|
|
1398
|
+
type: { kind: "Iri" },
|
|
1399
|
+
},
|
|
1400
|
+
sh_NodeShape: {
|
|
1401
|
+
discriminantValues: [
|
|
1402
|
+
"sh_NodeShape",
|
|
1403
|
+
"sh_PropertyShape",
|
|
1404
|
+
],
|
|
1405
|
+
type: sh_Shape.schema,
|
|
1406
|
+
},
|
|
1407
|
+
},
|
|
1408
|
+
};
|
|
1409
|
+
},
|
|
1410
|
+
};
|
|
1411
|
+
},
|
|
1412
|
+
};
|
|
1121
1413
|
},
|
|
1122
1414
|
},
|
|
1123
1415
|
classes: {
|
|
@@ -1192,9 +1484,25 @@ export var sh_PropertyShape;
|
|
|
1192
1484
|
groups: {
|
|
1193
1485
|
kind: "Shacl",
|
|
1194
1486
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
|
|
1195
|
-
type
|
|
1196
|
-
|
|
1197
|
-
|
|
1487
|
+
get type() {
|
|
1488
|
+
return {
|
|
1489
|
+
kind: "Set",
|
|
1490
|
+
get itemType() {
|
|
1491
|
+
return {
|
|
1492
|
+
kind: "DiscriminatedUnion",
|
|
1493
|
+
members: {
|
|
1494
|
+
NamedNode: {
|
|
1495
|
+
discriminantValues: ["NamedNode"],
|
|
1496
|
+
type: { kind: "Iri" },
|
|
1497
|
+
},
|
|
1498
|
+
sh_PropertyGroup: {
|
|
1499
|
+
discriminantValues: ["sh_PropertyGroup"],
|
|
1500
|
+
type: sh_PropertyGroup.schema,
|
|
1501
|
+
},
|
|
1502
|
+
},
|
|
1503
|
+
};
|
|
1504
|
+
},
|
|
1505
|
+
};
|
|
1198
1506
|
},
|
|
1199
1507
|
},
|
|
1200
1508
|
hasValues: {
|
|
@@ -1231,9 +1539,25 @@ export var sh_PropertyShape;
|
|
|
1231
1539
|
isDefinedBy: {
|
|
1232
1540
|
kind: "Shacl",
|
|
1233
1541
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
1234
|
-
type
|
|
1235
|
-
|
|
1236
|
-
|
|
1542
|
+
get type() {
|
|
1543
|
+
return {
|
|
1544
|
+
kind: "Option",
|
|
1545
|
+
get itemType() {
|
|
1546
|
+
return {
|
|
1547
|
+
kind: "DiscriminatedUnion",
|
|
1548
|
+
members: {
|
|
1549
|
+
NamedNode: {
|
|
1550
|
+
discriminantValues: ["NamedNode"],
|
|
1551
|
+
type: { kind: "Iri" },
|
|
1552
|
+
},
|
|
1553
|
+
owl_Ontology: {
|
|
1554
|
+
discriminantValues: ["owl_Ontology"],
|
|
1555
|
+
type: owl_Ontology.schema,
|
|
1556
|
+
},
|
|
1557
|
+
},
|
|
1558
|
+
};
|
|
1559
|
+
},
|
|
1560
|
+
};
|
|
1237
1561
|
},
|
|
1238
1562
|
},
|
|
1239
1563
|
label: {
|
|
@@ -1356,9 +1680,25 @@ export var sh_PropertyShape;
|
|
|
1356
1680
|
node: {
|
|
1357
1681
|
kind: "Shacl",
|
|
1358
1682
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
1359
|
-
type
|
|
1360
|
-
|
|
1361
|
-
|
|
1683
|
+
get type() {
|
|
1684
|
+
return {
|
|
1685
|
+
kind: "Option",
|
|
1686
|
+
get itemType() {
|
|
1687
|
+
return {
|
|
1688
|
+
kind: "DiscriminatedUnion",
|
|
1689
|
+
members: {
|
|
1690
|
+
NamedNode: {
|
|
1691
|
+
discriminantValues: ["NamedNode"],
|
|
1692
|
+
type: { kind: "Iri" },
|
|
1693
|
+
},
|
|
1694
|
+
sh_NodeShape: {
|
|
1695
|
+
discriminantValues: ["sh_NodeShape"],
|
|
1696
|
+
type: sh_NodeShape.schema,
|
|
1697
|
+
},
|
|
1698
|
+
},
|
|
1699
|
+
};
|
|
1700
|
+
},
|
|
1701
|
+
};
|
|
1362
1702
|
},
|
|
1363
1703
|
},
|
|
1364
1704
|
nodeKind: {
|
|
@@ -1382,20 +1722,57 @@ export var sh_PropertyShape;
|
|
|
1382
1722
|
not: {
|
|
1383
1723
|
kind: "Shacl",
|
|
1384
1724
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
|
|
1385
|
-
type
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1725
|
+
get type() {
|
|
1726
|
+
return {
|
|
1727
|
+
kind: "Set",
|
|
1728
|
+
get itemType() {
|
|
1729
|
+
return {
|
|
1730
|
+
kind: "DiscriminatedUnion",
|
|
1731
|
+
members: {
|
|
1732
|
+
NamedNode: {
|
|
1733
|
+
discriminantValues: ["NamedNode"],
|
|
1734
|
+
type: { kind: "Iri" },
|
|
1735
|
+
},
|
|
1736
|
+
sh_NodeShape: {
|
|
1737
|
+
discriminantValues: ["sh_NodeShape"],
|
|
1738
|
+
type: sh_NodeShape.schema,
|
|
1739
|
+
},
|
|
1740
|
+
},
|
|
1741
|
+
};
|
|
1742
|
+
},
|
|
1743
|
+
};
|
|
1744
|
+
},
|
|
1389
1745
|
},
|
|
1390
1746
|
or: {
|
|
1391
1747
|
kind: "Shacl",
|
|
1392
1748
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
|
|
1393
|
-
type
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1749
|
+
get type() {
|
|
1750
|
+
return {
|
|
1751
|
+
kind: "Option",
|
|
1752
|
+
get itemType() {
|
|
1753
|
+
return {
|
|
1754
|
+
kind: "List",
|
|
1755
|
+
get itemType() {
|
|
1756
|
+
return {
|
|
1757
|
+
kind: "DiscriminatedUnion",
|
|
1758
|
+
members: {
|
|
1759
|
+
NamedNode: {
|
|
1760
|
+
discriminantValues: ["NamedNode"],
|
|
1761
|
+
type: { kind: "Iri" },
|
|
1762
|
+
},
|
|
1763
|
+
sh_NodeShape: {
|
|
1764
|
+
discriminantValues: [
|
|
1765
|
+
"sh_NodeShape",
|
|
1766
|
+
"sh_PropertyShape",
|
|
1767
|
+
],
|
|
1768
|
+
type: sh_Shape.schema,
|
|
1769
|
+
},
|
|
1770
|
+
},
|
|
1771
|
+
};
|
|
1772
|
+
},
|
|
1773
|
+
};
|
|
1774
|
+
},
|
|
1775
|
+
};
|
|
1399
1776
|
},
|
|
1400
1777
|
},
|
|
1401
1778
|
order: {
|
|
@@ -1519,12 +1896,33 @@ export var sh_PropertyShape;
|
|
|
1519
1896
|
xone: {
|
|
1520
1897
|
kind: "Shacl",
|
|
1521
1898
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
1522
|
-
type
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1899
|
+
get type() {
|
|
1900
|
+
return {
|
|
1901
|
+
kind: "Option",
|
|
1902
|
+
get itemType() {
|
|
1903
|
+
return {
|
|
1904
|
+
kind: "List",
|
|
1905
|
+
get itemType() {
|
|
1906
|
+
return {
|
|
1907
|
+
kind: "DiscriminatedUnion",
|
|
1908
|
+
members: {
|
|
1909
|
+
NamedNode: {
|
|
1910
|
+
discriminantValues: ["NamedNode"],
|
|
1911
|
+
type: { kind: "Iri" },
|
|
1912
|
+
},
|
|
1913
|
+
sh_NodeShape: {
|
|
1914
|
+
discriminantValues: [
|
|
1915
|
+
"sh_NodeShape",
|
|
1916
|
+
"sh_PropertyShape",
|
|
1917
|
+
],
|
|
1918
|
+
type: sh_Shape.schema,
|
|
1919
|
+
},
|
|
1920
|
+
},
|
|
1921
|
+
};
|
|
1922
|
+
},
|
|
1923
|
+
};
|
|
1924
|
+
},
|
|
1925
|
+
};
|
|
1528
1926
|
},
|
|
1529
1927
|
},
|
|
1530
1928
|
},
|
|
@@ -1547,7 +1945,25 @@ export var sh_PropertyShape;
|
|
|
1547
1945
|
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1548
1946
|
currentSubListResource = newSubListResource;
|
|
1549
1947
|
}
|
|
1550
|
-
currentSubListResource.add($RdfVocabularies.rdf.first,
|
|
1948
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, ((value, _options) => {
|
|
1949
|
+
if (value["termType"] === "NamedNode") {
|
|
1950
|
+
return [value];
|
|
1951
|
+
}
|
|
1952
|
+
if (sh_Shape.issh_Shape(value)) {
|
|
1953
|
+
return sh_Shape.toRdfResourceValues(value, {
|
|
1954
|
+
graph: _options.graph,
|
|
1955
|
+
propertyPath: _options.propertyPath,
|
|
1956
|
+
resource: _options.resource,
|
|
1957
|
+
resourceSet: _options.resourceSet,
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
throw new Error("unable to serialize to RDF");
|
|
1961
|
+
})(item, {
|
|
1962
|
+
graph: parameters.graph,
|
|
1963
|
+
propertyPath: $RdfVocabularies.rdf.first,
|
|
1964
|
+
resource: currentSubListResource,
|
|
1965
|
+
resourceSet: parameters.resourceSet,
|
|
1966
|
+
}), parameters.graph);
|
|
1551
1967
|
if (itemIndex + 1 === list.length) {
|
|
1552
1968
|
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1553
1969
|
}
|
|
@@ -1559,7 +1975,7 @@ export var sh_PropertyShape;
|
|
|
1559
1975
|
: $RdfVocabularies.rdf.nil,
|
|
1560
1976
|
]), parameters.graph);
|
|
1561
1977
|
parameters.resource.add(sh_NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
1562
|
-
parameters.resource.add(
|
|
1978
|
+
parameters.resource.add(owl_Ontology.schema.properties.comment.path, parameters.object.comment
|
|
1563
1979
|
.toList()
|
|
1564
1980
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1565
1981
|
parameters.resource.add(sh_NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
@@ -1582,7 +1998,25 @@ export var sh_PropertyShape;
|
|
|
1582
1998
|
parameters.resource.add(sh_NodeShape.schema.properties.flags.path, parameters.object.flags
|
|
1583
1999
|
.toList()
|
|
1584
2000
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1585
|
-
parameters.resource.add(sh_PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) =>
|
|
2001
|
+
parameters.resource.add(sh_PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => ((value, _options) => {
|
|
2002
|
+
if (value["termType"] === "NamedNode") {
|
|
2003
|
+
return [value];
|
|
2004
|
+
}
|
|
2005
|
+
if (sh_PropertyGroup.issh_PropertyGroup(value)) {
|
|
2006
|
+
return [
|
|
2007
|
+
sh_PropertyGroup.toRdfResource(value, {
|
|
2008
|
+
graph: _options.graph,
|
|
2009
|
+
resourceSet: _options.resourceSet,
|
|
2010
|
+
}).identifier,
|
|
2011
|
+
];
|
|
2012
|
+
}
|
|
2013
|
+
throw new Error("unable to serialize to RDF");
|
|
2014
|
+
})(item, {
|
|
2015
|
+
graph: parameters.graph,
|
|
2016
|
+
resource: parameters.resource,
|
|
2017
|
+
resourceSet: parameters.resourceSet,
|
|
2018
|
+
propertyPath: sh_PropertyShape.schema.properties.groups.path,
|
|
2019
|
+
})), parameters.graph);
|
|
1586
2020
|
parameters.resource.add(sh_NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
1587
2021
|
parameters.resource.add(sh_NodeShape.schema.properties.ignore.path, $strictEquals(parameters.object.ignore, false).isLeft()
|
|
1588
2022
|
? [
|
|
@@ -1611,8 +2045,26 @@ export var sh_PropertyShape;
|
|
|
1611
2045
|
}).listResource.identifier
|
|
1612
2046
|
: $RdfVocabularies.rdf.nil,
|
|
1613
2047
|
]), parameters.graph);
|
|
1614
|
-
parameters.resource.add(sh_NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(),
|
|
1615
|
-
|
|
2048
|
+
parameters.resource.add(sh_NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList().flatMap((value) => ((value, _options) => {
|
|
2049
|
+
if (value["termType"] === "NamedNode") {
|
|
2050
|
+
return [value];
|
|
2051
|
+
}
|
|
2052
|
+
if (owl_Ontology.isowl_Ontology(value)) {
|
|
2053
|
+
return [
|
|
2054
|
+
owl_Ontology.toRdfResource(value, {
|
|
2055
|
+
graph: _options.graph,
|
|
2056
|
+
resourceSet: _options.resourceSet,
|
|
2057
|
+
}).identifier,
|
|
2058
|
+
];
|
|
2059
|
+
}
|
|
2060
|
+
throw new Error("unable to serialize to RDF");
|
|
2061
|
+
})(value, {
|
|
2062
|
+
graph: parameters.graph,
|
|
2063
|
+
resource: parameters.resource,
|
|
2064
|
+
resourceSet: parameters.resourceSet,
|
|
2065
|
+
propertyPath: sh_NodeShape.schema.properties.isDefinedBy.path,
|
|
2066
|
+
})), parameters.graph);
|
|
2067
|
+
parameters.resource.add(owl_Ontology.schema.properties.label.path, parameters.object.label
|
|
1616
2068
|
.toList()
|
|
1617
2069
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1618
2070
|
parameters.resource.add(sh_NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
@@ -1674,9 +2126,45 @@ export var sh_PropertyShape;
|
|
|
1674
2126
|
parameters.resource.add(sh_PropertyShape.schema.properties.name.path, parameters.object.name
|
|
1675
2127
|
.toList()
|
|
1676
2128
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1677
|
-
parameters.resource.add(sh_NodeShape.schema.properties.node.path, parameters.object.node.toList(),
|
|
2129
|
+
parameters.resource.add(sh_NodeShape.schema.properties.node.path, parameters.object.node.toList().flatMap((value) => ((value, _options) => {
|
|
2130
|
+
if (value["termType"] === "NamedNode") {
|
|
2131
|
+
return [value];
|
|
2132
|
+
}
|
|
2133
|
+
if (sh_NodeShape.issh_NodeShape(value)) {
|
|
2134
|
+
return [
|
|
2135
|
+
sh_NodeShape.toRdfResource(value, {
|
|
2136
|
+
graph: _options.graph,
|
|
2137
|
+
resourceSet: _options.resourceSet,
|
|
2138
|
+
}).identifier,
|
|
2139
|
+
];
|
|
2140
|
+
}
|
|
2141
|
+
throw new Error("unable to serialize to RDF");
|
|
2142
|
+
})(value, {
|
|
2143
|
+
graph: parameters.graph,
|
|
2144
|
+
resource: parameters.resource,
|
|
2145
|
+
resourceSet: parameters.resourceSet,
|
|
2146
|
+
propertyPath: sh_NodeShape.schema.properties.node.path,
|
|
2147
|
+
})), parameters.graph);
|
|
1678
2148
|
parameters.resource.add(sh_NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
1679
|
-
parameters.resource.add(sh_NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) =>
|
|
2149
|
+
parameters.resource.add(sh_NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => ((value, _options) => {
|
|
2150
|
+
if (value["termType"] === "NamedNode") {
|
|
2151
|
+
return [value];
|
|
2152
|
+
}
|
|
2153
|
+
if (sh_NodeShape.issh_NodeShape(value)) {
|
|
2154
|
+
return [
|
|
2155
|
+
sh_NodeShape.toRdfResource(value, {
|
|
2156
|
+
graph: _options.graph,
|
|
2157
|
+
resourceSet: _options.resourceSet,
|
|
2158
|
+
}).identifier,
|
|
2159
|
+
];
|
|
2160
|
+
}
|
|
2161
|
+
throw new Error("unable to serialize to RDF");
|
|
2162
|
+
})(item, {
|
|
2163
|
+
graph: parameters.graph,
|
|
2164
|
+
resource: parameters.resource,
|
|
2165
|
+
resourceSet: parameters.resourceSet,
|
|
2166
|
+
propertyPath: sh_NodeShape.schema.properties.not.path,
|
|
2167
|
+
})), parameters.graph);
|
|
1680
2168
|
parameters.resource.add(sh_NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
1681
2169
|
value.length > 0
|
|
1682
2170
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
@@ -1688,7 +2176,25 @@ export var sh_PropertyShape;
|
|
|
1688
2176
|
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1689
2177
|
currentSubListResource = newSubListResource;
|
|
1690
2178
|
}
|
|
1691
|
-
currentSubListResource.add($RdfVocabularies.rdf.first,
|
|
2179
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, ((value, _options) => {
|
|
2180
|
+
if (value["termType"] === "NamedNode") {
|
|
2181
|
+
return [value];
|
|
2182
|
+
}
|
|
2183
|
+
if (sh_Shape.issh_Shape(value)) {
|
|
2184
|
+
return sh_Shape.toRdfResourceValues(value, {
|
|
2185
|
+
graph: _options.graph,
|
|
2186
|
+
propertyPath: _options.propertyPath,
|
|
2187
|
+
resource: _options.resource,
|
|
2188
|
+
resourceSet: _options.resourceSet,
|
|
2189
|
+
});
|
|
2190
|
+
}
|
|
2191
|
+
throw new Error("unable to serialize to RDF");
|
|
2192
|
+
})(item, {
|
|
2193
|
+
graph: parameters.graph,
|
|
2194
|
+
propertyPath: $RdfVocabularies.rdf.first,
|
|
2195
|
+
resource: currentSubListResource,
|
|
2196
|
+
resourceSet: parameters.resourceSet,
|
|
2197
|
+
}), parameters.graph);
|
|
1692
2198
|
if (itemIndex + 1 === list.length) {
|
|
1693
2199
|
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1694
2200
|
}
|
|
@@ -1754,7 +2260,25 @@ export var sh_PropertyShape;
|
|
|
1754
2260
|
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1755
2261
|
currentSubListResource = newSubListResource;
|
|
1756
2262
|
}
|
|
1757
|
-
currentSubListResource.add($RdfVocabularies.rdf.first,
|
|
2263
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, ((value, _options) => {
|
|
2264
|
+
if (value["termType"] === "NamedNode") {
|
|
2265
|
+
return [value];
|
|
2266
|
+
}
|
|
2267
|
+
if (sh_Shape.issh_Shape(value)) {
|
|
2268
|
+
return sh_Shape.toRdfResourceValues(value, {
|
|
2269
|
+
graph: _options.graph,
|
|
2270
|
+
propertyPath: _options.propertyPath,
|
|
2271
|
+
resource: _options.resource,
|
|
2272
|
+
resourceSet: _options.resourceSet,
|
|
2273
|
+
});
|
|
2274
|
+
}
|
|
2275
|
+
throw new Error("unable to serialize to RDF");
|
|
2276
|
+
})(item, {
|
|
2277
|
+
graph: parameters.graph,
|
|
2278
|
+
propertyPath: $RdfVocabularies.rdf.first,
|
|
2279
|
+
resource: currentSubListResource,
|
|
2280
|
+
resourceSet: parameters.resourceSet,
|
|
2281
|
+
}), parameters.graph);
|
|
1758
2282
|
if (itemIndex + 1 === list.length) {
|
|
1759
2283
|
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1760
2284
|
}
|
|
@@ -1779,246 +2303,534 @@ export var sh_PropertyShape;
|
|
|
1779
2303
|
.extract(),
|
|
1780
2304
|
});
|
|
1781
2305
|
})(sh_PropertyShape || (sh_PropertyShape = {}));
|
|
1782
|
-
export var
|
|
1783
|
-
(function (
|
|
1784
|
-
|
|
1785
|
-
$identifier: $
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
2306
|
+
export var skos_Concept;
|
|
2307
|
+
(function (skos_Concept) {
|
|
2308
|
+
skos_Concept.create = (parameters) => $sequenceRecord({
|
|
2309
|
+
$identifier: $convertToIriIdentifierProperty(parameters.$identifier),
|
|
2310
|
+
altLabel: $convertToScalarSet($identityConversionFunction, true)(parameters.altLabel).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.altLabel.type, value)),
|
|
2311
|
+
broader: $convertToScalarSet($identityConversionFunction, true)(parameters.broader).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.broader.type, value)),
|
|
2312
|
+
definition: $convertToScalarSet($identityConversionFunction, true)(parameters.definition).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.definition.type, value)),
|
|
2313
|
+
hiddenLabel: $convertToScalarSet($identityConversionFunction, true)(parameters.hiddenLabel).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.hiddenLabel.type, value)),
|
|
2314
|
+
notation: $convertToScalarSet($convertToLiteral, true)(parameters.notation).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.notation.type, value)),
|
|
2315
|
+
prefLabel: $convertToScalarSet($identityConversionFunction, true)(parameters.prefLabel).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.prefLabel.type, value)),
|
|
2316
|
+
type: $convertToScalarSet(($convertToIri), true)(parameters.type).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.type.type, value)),
|
|
1789
2317
|
})
|
|
1790
2318
|
.map((properties) => ({
|
|
1791
2319
|
...properties,
|
|
1792
|
-
|
|
2320
|
+
termType: "skos_Concept",
|
|
1793
2321
|
}))
|
|
1794
|
-
.map((object) => $monkeyPatchObject(object, {
|
|
1795
|
-
$toString: sh_ValidationReport.$toString,
|
|
1796
|
-
}));
|
|
2322
|
+
.map((object) => $monkeyPatchObject(object, { $toString: skos_Concept.$toString }));
|
|
1797
2323
|
function createUnsafe(parameters) {
|
|
1798
|
-
return
|
|
2324
|
+
return skos_Concept.create(parameters).unsafeCoerce();
|
|
1799
2325
|
}
|
|
1800
|
-
|
|
2326
|
+
skos_Concept.createUnsafe = createUnsafe;
|
|
1801
2327
|
let Identifier;
|
|
1802
2328
|
(function (Identifier) {
|
|
1803
|
-
Identifier.parse = $
|
|
2329
|
+
Identifier.parse = $parseIri;
|
|
1804
2330
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
1805
|
-
})(Identifier =
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
sh_ValidationReport.issh_ValidationReport = issh_ValidationReport;
|
|
1810
|
-
sh_ValidationReport.schema = {
|
|
1811
|
-
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#ValidationReport"),
|
|
2331
|
+
})(Identifier = skos_Concept.Identifier || (skos_Concept.Identifier = {}));
|
|
2332
|
+
skos_Concept.isskos_Concept = (object) => object.termType === "skos_Concept";
|
|
2333
|
+
skos_Concept.schema = {
|
|
2334
|
+
fromRdfType: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#Concept"),
|
|
1812
2335
|
properties: {
|
|
1813
|
-
$identifier: {
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
},
|
|
1817
|
-
conforms: {
|
|
2336
|
+
$identifier: { kind: "Identifier", type: { kind: "Iri" } },
|
|
2337
|
+
termType: { kind: "Discriminant", value: "skos_Concept" },
|
|
2338
|
+
altLabel: {
|
|
1818
2339
|
kind: "Shacl",
|
|
1819
|
-
path: dataFactory.namedNode("http://www.w3.org/
|
|
1820
|
-
type: {
|
|
2340
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#altLabel"),
|
|
2341
|
+
type: {
|
|
2342
|
+
kind: "Set",
|
|
2343
|
+
itemType: {
|
|
2344
|
+
kind: "DiscriminatedUnion",
|
|
2345
|
+
members: {
|
|
2346
|
+
string: {
|
|
2347
|
+
discriminantValues: ["string"],
|
|
2348
|
+
type: { kind: "String" },
|
|
2349
|
+
},
|
|
2350
|
+
object: {
|
|
2351
|
+
discriminantValues: ["object"],
|
|
2352
|
+
type: { kind: "LangString" },
|
|
2353
|
+
},
|
|
2354
|
+
},
|
|
2355
|
+
},
|
|
2356
|
+
},
|
|
1821
2357
|
},
|
|
1822
|
-
|
|
2358
|
+
broader: {
|
|
1823
2359
|
kind: "Shacl",
|
|
1824
|
-
path: dataFactory.namedNode("http://www.w3.org/
|
|
2360
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#broader"),
|
|
1825
2361
|
get type() {
|
|
1826
2362
|
return {
|
|
1827
2363
|
kind: "Set",
|
|
1828
2364
|
get itemType() {
|
|
1829
|
-
return
|
|
2365
|
+
return {
|
|
2366
|
+
kind: "DiscriminatedUnion",
|
|
2367
|
+
members: {
|
|
2368
|
+
NamedNode: {
|
|
2369
|
+
discriminantValues: ["NamedNode"],
|
|
2370
|
+
type: { kind: "Iri" },
|
|
2371
|
+
},
|
|
2372
|
+
skos_Concept: {
|
|
2373
|
+
discriminantValues: ["skos_Concept"],
|
|
2374
|
+
type: skos_Concept.schema,
|
|
2375
|
+
},
|
|
2376
|
+
},
|
|
2377
|
+
};
|
|
1830
2378
|
},
|
|
1831
2379
|
};
|
|
1832
2380
|
},
|
|
1833
2381
|
},
|
|
1834
|
-
|
|
2382
|
+
definition: {
|
|
1835
2383
|
kind: "Shacl",
|
|
1836
|
-
path: dataFactory.namedNode("http://www.w3.org/
|
|
2384
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#definition"),
|
|
1837
2385
|
type: {
|
|
1838
|
-
kind: "
|
|
1839
|
-
itemType: {
|
|
2386
|
+
kind: "Set",
|
|
2387
|
+
itemType: {
|
|
2388
|
+
kind: "DiscriminatedUnion",
|
|
2389
|
+
members: {
|
|
2390
|
+
string: {
|
|
2391
|
+
discriminantValues: ["string"],
|
|
2392
|
+
type: { kind: "String" },
|
|
2393
|
+
},
|
|
2394
|
+
object: {
|
|
2395
|
+
discriminantValues: ["object"],
|
|
2396
|
+
type: { kind: "LangString" },
|
|
2397
|
+
},
|
|
2398
|
+
},
|
|
2399
|
+
},
|
|
1840
2400
|
},
|
|
1841
2401
|
},
|
|
2402
|
+
hiddenLabel: {
|
|
2403
|
+
kind: "Shacl",
|
|
2404
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#hiddenLabel"),
|
|
2405
|
+
type: {
|
|
2406
|
+
kind: "Set",
|
|
2407
|
+
itemType: {
|
|
2408
|
+
kind: "DiscriminatedUnion",
|
|
2409
|
+
members: {
|
|
2410
|
+
string: {
|
|
2411
|
+
discriminantValues: ["string"],
|
|
2412
|
+
type: { kind: "String" },
|
|
2413
|
+
},
|
|
2414
|
+
object: {
|
|
2415
|
+
discriminantValues: ["object"],
|
|
2416
|
+
type: { kind: "LangString" },
|
|
2417
|
+
},
|
|
2418
|
+
},
|
|
2419
|
+
},
|
|
2420
|
+
},
|
|
2421
|
+
},
|
|
2422
|
+
notation: {
|
|
2423
|
+
kind: "Shacl",
|
|
2424
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#notation"),
|
|
2425
|
+
type: { kind: "Set", itemType: { kind: "Literal" } },
|
|
2426
|
+
},
|
|
2427
|
+
prefLabel: {
|
|
2428
|
+
kind: "Shacl",
|
|
2429
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#prefLabel"),
|
|
2430
|
+
type: {
|
|
2431
|
+
kind: "Set",
|
|
2432
|
+
itemType: {
|
|
2433
|
+
kind: "DiscriminatedUnion",
|
|
2434
|
+
members: {
|
|
2435
|
+
string: {
|
|
2436
|
+
discriminantValues: ["string"],
|
|
2437
|
+
type: { kind: "String" },
|
|
2438
|
+
},
|
|
2439
|
+
object: {
|
|
2440
|
+
discriminantValues: ["object"],
|
|
2441
|
+
type: { kind: "LangString" },
|
|
2442
|
+
},
|
|
2443
|
+
},
|
|
2444
|
+
},
|
|
2445
|
+
},
|
|
2446
|
+
},
|
|
2447
|
+
type: {
|
|
2448
|
+
kind: "Shacl",
|
|
2449
|
+
path: $RdfVocabularies.rdf.type,
|
|
2450
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2451
|
+
},
|
|
1842
2452
|
},
|
|
1843
2453
|
toRdfTypes: [
|
|
1844
|
-
dataFactory.namedNode("http://www.w3.org/
|
|
2454
|
+
dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#Concept"),
|
|
1845
2455
|
],
|
|
1846
2456
|
};
|
|
1847
|
-
|
|
2457
|
+
skos_Concept._toRdfResource = (parameters) => {
|
|
1848
2458
|
if (!parameters.ignoreRdfType) {
|
|
1849
|
-
parameters.resource.add($RdfVocabularies.rdf.type,
|
|
2459
|
+
parameters.resource.add($RdfVocabularies.rdf.type, skos_Concept.schema.toRdfTypes, parameters.graph);
|
|
1850
2460
|
}
|
|
1851
|
-
parameters.resource.add(
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
.
|
|
1862
|
-
.
|
|
1863
|
-
|
|
1864
|
-
|
|
2461
|
+
parameters.resource.add(skos_Concept.schema.properties.altLabel.path, parameters.object.altLabel.flatMap((item) => ((value, _options) => {
|
|
2462
|
+
if (typeof value === "string") {
|
|
2463
|
+
return [$literalFactory.string(value)];
|
|
2464
|
+
}
|
|
2465
|
+
if (typeof value === "object") {
|
|
2466
|
+
return [value];
|
|
2467
|
+
}
|
|
2468
|
+
throw new Error("unable to serialize to RDF");
|
|
2469
|
+
})(item, {
|
|
2470
|
+
graph: parameters.graph,
|
|
2471
|
+
resource: parameters.resource,
|
|
2472
|
+
resourceSet: parameters.resourceSet,
|
|
2473
|
+
propertyPath: skos_Concept.schema.properties.altLabel.path,
|
|
2474
|
+
})), parameters.graph);
|
|
2475
|
+
parameters.resource.add(skos_Concept.schema.properties.broader.path, parameters.object.broader.flatMap((item) => ((value, _options) => {
|
|
2476
|
+
if (value["termType"] === "NamedNode") {
|
|
2477
|
+
return [value];
|
|
2478
|
+
}
|
|
2479
|
+
if (skos_Concept.isskos_Concept(value)) {
|
|
2480
|
+
return [
|
|
2481
|
+
skos_Concept.toRdfResource(value, {
|
|
2482
|
+
graph: _options.graph,
|
|
2483
|
+
resourceSet: _options.resourceSet,
|
|
2484
|
+
}).identifier,
|
|
2485
|
+
];
|
|
2486
|
+
}
|
|
2487
|
+
throw new Error("unable to serialize to RDF");
|
|
2488
|
+
})(item, {
|
|
2489
|
+
graph: parameters.graph,
|
|
2490
|
+
resource: parameters.resource,
|
|
2491
|
+
resourceSet: parameters.resourceSet,
|
|
2492
|
+
propertyPath: skos_Concept.schema.properties.broader.path,
|
|
2493
|
+
})), parameters.graph);
|
|
2494
|
+
parameters.resource.add(skos_Concept.schema.properties.definition.path, parameters.object.definition.flatMap((item) => ((value, _options) => {
|
|
2495
|
+
if (typeof value === "string") {
|
|
2496
|
+
return [$literalFactory.string(value)];
|
|
2497
|
+
}
|
|
2498
|
+
if (typeof value === "object") {
|
|
2499
|
+
return [value];
|
|
2500
|
+
}
|
|
2501
|
+
throw new Error("unable to serialize to RDF");
|
|
2502
|
+
})(item, {
|
|
2503
|
+
graph: parameters.graph,
|
|
2504
|
+
resource: parameters.resource,
|
|
2505
|
+
resourceSet: parameters.resourceSet,
|
|
2506
|
+
propertyPath: skos_Concept.schema.properties.definition.path,
|
|
2507
|
+
})), parameters.graph);
|
|
2508
|
+
parameters.resource.add(skos_Concept.schema.properties.hiddenLabel.path, parameters.object.hiddenLabel.flatMap((item) => ((value, _options) => {
|
|
2509
|
+
if (typeof value === "string") {
|
|
2510
|
+
return [$literalFactory.string(value)];
|
|
2511
|
+
}
|
|
2512
|
+
if (typeof value === "object") {
|
|
2513
|
+
return [value];
|
|
2514
|
+
}
|
|
2515
|
+
throw new Error("unable to serialize to RDF");
|
|
2516
|
+
})(item, {
|
|
2517
|
+
graph: parameters.graph,
|
|
2518
|
+
resource: parameters.resource,
|
|
2519
|
+
resourceSet: parameters.resourceSet,
|
|
2520
|
+
propertyPath: skos_Concept.schema.properties.hiddenLabel.path,
|
|
2521
|
+
})), parameters.graph);
|
|
2522
|
+
parameters.resource.add(skos_Concept.schema.properties.notation.path, parameters.object.notation.flatMap((item) => [item]), parameters.graph);
|
|
2523
|
+
parameters.resource.add(skos_Concept.schema.properties.prefLabel.path, parameters.object.prefLabel.flatMap((item) => ((value, _options) => {
|
|
2524
|
+
if (typeof value === "string") {
|
|
2525
|
+
return [$literalFactory.string(value)];
|
|
2526
|
+
}
|
|
2527
|
+
if (typeof value === "object") {
|
|
2528
|
+
return [value];
|
|
2529
|
+
}
|
|
2530
|
+
throw new Error("unable to serialize to RDF");
|
|
2531
|
+
})(item, {
|
|
2532
|
+
graph: parameters.graph,
|
|
2533
|
+
resource: parameters.resource,
|
|
2534
|
+
resourceSet: parameters.resourceSet,
|
|
2535
|
+
propertyPath: skos_Concept.schema.properties.prefLabel.path,
|
|
2536
|
+
})), parameters.graph);
|
|
2537
|
+
parameters.resource.add(sh_NodeShape.schema.properties.type.path, parameters.object.type.flatMap((item) => [item]), parameters.graph);
|
|
1865
2538
|
return parameters.resource;
|
|
1866
2539
|
};
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
sourceShape: $convertToMaybe($convertToIdentifier)(parameters.sourceShape).chain((value) => $validateMaybe($identityValidationFunction)(sh_ValidationResult.schema.properties.sourceShape.type, value)),
|
|
1884
|
-
value: $convertToMaybe($identityConversionFunction)(parameters.value).chain((value) => $validateMaybe($identityValidationFunction)(sh_ValidationResult.schema.properties.value.type, value)),
|
|
2540
|
+
skos_Concept.toRdfResource = $wrap_ToRdfResourceFunction(skos_Concept._toRdfResource);
|
|
2541
|
+
skos_Concept.$toString = (_skosConcept) => `skos_Concept(${JSON.stringify(skos_Concept.toStringRecord(_skosConcept))})`;
|
|
2542
|
+
skos_Concept.toStringRecord = (_skosConcept) => $compactRecord({ $identifier: _skosConcept.$identifier().toString() });
|
|
2543
|
+
})(skos_Concept || (skos_Concept = {}));
|
|
2544
|
+
export var skos_ConceptScheme;
|
|
2545
|
+
(function (skos_ConceptScheme) {
|
|
2546
|
+
skos_ConceptScheme.create = (parameters) => $sequenceRecord({
|
|
2547
|
+
$identifier: $convertToIriIdentifierProperty(parameters.$identifier),
|
|
2548
|
+
altLabel: $convertToScalarSet($identityConversionFunction, true)(parameters.altLabel).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.altLabel.type, value)),
|
|
2549
|
+
concepts: $convertToScalarSet($identityConversionFunction, true)(parameters.concepts).chain((value) => $validateArray($identityValidationFunction, true)(skos_ConceptScheme.schema.properties.concepts.type, value)),
|
|
2550
|
+
definition: $convertToScalarSet($identityConversionFunction, true)(parameters.definition).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.definition.type, value)),
|
|
2551
|
+
hiddenLabel: $convertToScalarSet($identityConversionFunction, true)(parameters.hiddenLabel).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.hiddenLabel.type, value)),
|
|
2552
|
+
notation: $convertToScalarSet($convertToLiteral, true)(parameters.notation).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.notation.type, value)),
|
|
2553
|
+
prefLabel: $convertToScalarSet($identityConversionFunction, true)(parameters.prefLabel).chain((value) => $validateArray($identityValidationFunction, true)(skos_Concept.schema.properties.prefLabel.type, value)),
|
|
2554
|
+
topConcepts: $convertToScalarSet($identityConversionFunction, true)(parameters.topConcepts).chain((value) => $validateArray($identityValidationFunction, true)(skos_ConceptScheme.schema.properties.topConcepts.type, value)),
|
|
2555
|
+
type: $convertToScalarSet(($convertToIri), true)(parameters.type).chain((value) => $validateArray($identityValidationFunction, true)(sh_NodeShape.schema.properties.type.type, value)),
|
|
1885
2556
|
})
|
|
1886
2557
|
.map((properties) => ({
|
|
1887
2558
|
...properties,
|
|
1888
|
-
|
|
2559
|
+
termType: "skos_ConceptScheme",
|
|
1889
2560
|
}))
|
|
1890
|
-
.map((object) => $monkeyPatchObject(object, {
|
|
1891
|
-
$toString: sh_ValidationResult.$toString,
|
|
1892
|
-
}));
|
|
2561
|
+
.map((object) => $monkeyPatchObject(object, { $toString: skos_ConceptScheme.$toString }));
|
|
1893
2562
|
function createUnsafe(parameters) {
|
|
1894
|
-
return
|
|
2563
|
+
return skos_ConceptScheme.create(parameters).unsafeCoerce();
|
|
1895
2564
|
}
|
|
1896
|
-
|
|
2565
|
+
skos_ConceptScheme.createUnsafe = createUnsafe;
|
|
1897
2566
|
let Identifier;
|
|
1898
2567
|
(function (Identifier) {
|
|
1899
|
-
Identifier.parse = $
|
|
2568
|
+
Identifier.parse = $parseIri;
|
|
1900
2569
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
1901
|
-
})(Identifier =
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
sh_ValidationResult.issh_ValidationResult = issh_ValidationResult;
|
|
1906
|
-
sh_ValidationResult.schema = {
|
|
1907
|
-
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#ValidationResult"),
|
|
2570
|
+
})(Identifier = skos_ConceptScheme.Identifier || (skos_ConceptScheme.Identifier = {}));
|
|
2571
|
+
skos_ConceptScheme.isskos_ConceptScheme = (object) => object.termType === "skos_ConceptScheme";
|
|
2572
|
+
skos_ConceptScheme.schema = {
|
|
2573
|
+
fromRdfType: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#ConceptScheme"),
|
|
1908
2574
|
properties: {
|
|
1909
|
-
$identifier: {
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
},
|
|
1913
|
-
details: {
|
|
2575
|
+
$identifier: { kind: "Identifier", type: { kind: "Iri" } },
|
|
2576
|
+
termType: { kind: "Discriminant", value: "skos_ConceptScheme" },
|
|
2577
|
+
altLabel: {
|
|
1914
2578
|
kind: "Shacl",
|
|
1915
|
-
path: dataFactory.namedNode("http://www.w3.org/
|
|
2579
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#altLabel"),
|
|
1916
2580
|
type: {
|
|
1917
2581
|
kind: "Set",
|
|
1918
2582
|
itemType: {
|
|
1919
|
-
kind: "
|
|
1920
|
-
|
|
2583
|
+
kind: "DiscriminatedUnion",
|
|
2584
|
+
members: {
|
|
2585
|
+
string: {
|
|
2586
|
+
discriminantValues: ["string"],
|
|
2587
|
+
type: { kind: "String" },
|
|
2588
|
+
},
|
|
2589
|
+
object: {
|
|
2590
|
+
discriminantValues: ["object"],
|
|
2591
|
+
type: { kind: "LangString" },
|
|
2592
|
+
},
|
|
2593
|
+
},
|
|
1921
2594
|
},
|
|
1922
2595
|
},
|
|
1923
2596
|
},
|
|
1924
|
-
|
|
1925
|
-
kind: "Shacl",
|
|
1926
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#focusNode"),
|
|
1927
|
-
type: {
|
|
1928
|
-
kind: "Term",
|
|
1929
|
-
types: ["BlankNode", "NamedNode", "Literal"],
|
|
1930
|
-
},
|
|
1931
|
-
},
|
|
1932
|
-
message: {
|
|
2597
|
+
concepts: {
|
|
1933
2598
|
kind: "Shacl",
|
|
1934
|
-
path:
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
itemType: { kind: "String" },
|
|
2599
|
+
path: {
|
|
2600
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#inScheme"),
|
|
2601
|
+
termType: "InversePath",
|
|
1938
2602
|
},
|
|
1939
|
-
},
|
|
1940
|
-
path: {
|
|
1941
|
-
kind: "Shacl",
|
|
1942
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#resultPath"),
|
|
1943
2603
|
get type() {
|
|
1944
2604
|
return {
|
|
1945
|
-
kind: "
|
|
2605
|
+
kind: "Set",
|
|
1946
2606
|
get itemType() {
|
|
1947
|
-
return
|
|
2607
|
+
return {
|
|
2608
|
+
kind: "DiscriminatedUnion",
|
|
2609
|
+
members: {
|
|
2610
|
+
NamedNode: {
|
|
2611
|
+
discriminantValues: ["NamedNode"],
|
|
2612
|
+
type: { kind: "Iri" },
|
|
2613
|
+
},
|
|
2614
|
+
skos_Concept: {
|
|
2615
|
+
discriminantValues: ["skos_Concept"],
|
|
2616
|
+
type: skos_Concept.schema,
|
|
2617
|
+
},
|
|
2618
|
+
},
|
|
2619
|
+
};
|
|
1948
2620
|
},
|
|
1949
2621
|
};
|
|
1950
2622
|
},
|
|
1951
2623
|
},
|
|
1952
|
-
|
|
2624
|
+
definition: {
|
|
1953
2625
|
kind: "Shacl",
|
|
1954
|
-
path: dataFactory.namedNode("http://www.w3.org/
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
2626
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#definition"),
|
|
2627
|
+
type: {
|
|
2628
|
+
kind: "Set",
|
|
2629
|
+
itemType: {
|
|
2630
|
+
kind: "DiscriminatedUnion",
|
|
2631
|
+
members: {
|
|
2632
|
+
string: {
|
|
2633
|
+
discriminantValues: ["string"],
|
|
2634
|
+
type: { kind: "String" },
|
|
2635
|
+
},
|
|
2636
|
+
object: {
|
|
2637
|
+
discriminantValues: ["object"],
|
|
2638
|
+
type: { kind: "LangString" },
|
|
2639
|
+
},
|
|
2640
|
+
},
|
|
2641
|
+
},
|
|
1964
2642
|
},
|
|
1965
2643
|
},
|
|
1966
|
-
|
|
1967
|
-
kind: "Shacl",
|
|
1968
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#sourceConstraintComponent"),
|
|
1969
|
-
type: { kind: "Iri" },
|
|
1970
|
-
},
|
|
1971
|
-
sourceShape: {
|
|
2644
|
+
hiddenLabel: {
|
|
1972
2645
|
kind: "Shacl",
|
|
1973
|
-
path: dataFactory.namedNode("http://www.w3.org/
|
|
2646
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#hiddenLabel"),
|
|
1974
2647
|
type: {
|
|
1975
|
-
kind: "
|
|
1976
|
-
itemType: {
|
|
2648
|
+
kind: "Set",
|
|
2649
|
+
itemType: {
|
|
2650
|
+
kind: "DiscriminatedUnion",
|
|
2651
|
+
members: {
|
|
2652
|
+
string: {
|
|
2653
|
+
discriminantValues: ["string"],
|
|
2654
|
+
type: { kind: "String" },
|
|
2655
|
+
},
|
|
2656
|
+
object: {
|
|
2657
|
+
discriminantValues: ["object"],
|
|
2658
|
+
type: { kind: "LangString" },
|
|
2659
|
+
},
|
|
2660
|
+
},
|
|
2661
|
+
},
|
|
1977
2662
|
},
|
|
1978
2663
|
},
|
|
1979
|
-
|
|
2664
|
+
notation: {
|
|
2665
|
+
kind: "Shacl",
|
|
2666
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#notation"),
|
|
2667
|
+
type: { kind: "Set", itemType: { kind: "Literal" } },
|
|
2668
|
+
},
|
|
2669
|
+
prefLabel: {
|
|
1980
2670
|
kind: "Shacl",
|
|
1981
|
-
path: dataFactory.namedNode("http://www.w3.org/
|
|
2671
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#prefLabel"),
|
|
1982
2672
|
type: {
|
|
1983
|
-
kind: "
|
|
2673
|
+
kind: "Set",
|
|
1984
2674
|
itemType: {
|
|
1985
|
-
kind: "
|
|
1986
|
-
|
|
2675
|
+
kind: "DiscriminatedUnion",
|
|
2676
|
+
members: {
|
|
2677
|
+
string: {
|
|
2678
|
+
discriminantValues: ["string"],
|
|
2679
|
+
type: { kind: "String" },
|
|
2680
|
+
},
|
|
2681
|
+
object: {
|
|
2682
|
+
discriminantValues: ["object"],
|
|
2683
|
+
type: { kind: "LangString" },
|
|
2684
|
+
},
|
|
2685
|
+
},
|
|
1987
2686
|
},
|
|
1988
2687
|
},
|
|
1989
2688
|
},
|
|
2689
|
+
topConcepts: {
|
|
2690
|
+
kind: "Shacl",
|
|
2691
|
+
path: {
|
|
2692
|
+
path: dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#topConceptOf"),
|
|
2693
|
+
termType: "InversePath",
|
|
2694
|
+
},
|
|
2695
|
+
get type() {
|
|
2696
|
+
return {
|
|
2697
|
+
kind: "Set",
|
|
2698
|
+
get itemType() {
|
|
2699
|
+
return {
|
|
2700
|
+
kind: "DiscriminatedUnion",
|
|
2701
|
+
members: {
|
|
2702
|
+
NamedNode: {
|
|
2703
|
+
discriminantValues: ["NamedNode"],
|
|
2704
|
+
type: { kind: "Iri" },
|
|
2705
|
+
},
|
|
2706
|
+
skos_Concept: {
|
|
2707
|
+
discriminantValues: ["skos_Concept"],
|
|
2708
|
+
type: skos_Concept.schema,
|
|
2709
|
+
},
|
|
2710
|
+
},
|
|
2711
|
+
};
|
|
2712
|
+
},
|
|
2713
|
+
};
|
|
2714
|
+
},
|
|
2715
|
+
},
|
|
2716
|
+
type: {
|
|
2717
|
+
kind: "Shacl",
|
|
2718
|
+
path: $RdfVocabularies.rdf.type,
|
|
2719
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2720
|
+
},
|
|
1990
2721
|
},
|
|
1991
2722
|
toRdfTypes: [
|
|
1992
|
-
dataFactory.namedNode("http://www.w3.org/
|
|
2723
|
+
dataFactory.namedNode("http://www.w3.org/2004/02/skos/core#ConceptScheme"),
|
|
1993
2724
|
],
|
|
1994
2725
|
};
|
|
1995
|
-
|
|
2726
|
+
skos_ConceptScheme._toRdfResource = (parameters) => {
|
|
1996
2727
|
if (!parameters.ignoreRdfType) {
|
|
1997
|
-
parameters.resource.add($RdfVocabularies.rdf.type,
|
|
2728
|
+
parameters.resource.add($RdfVocabularies.rdf.type, skos_ConceptScheme.schema.toRdfTypes, parameters.graph);
|
|
1998
2729
|
}
|
|
1999
|
-
parameters.resource.add(
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
parameters.resource.add(
|
|
2730
|
+
parameters.resource.add(skos_Concept.schema.properties.altLabel.path, parameters.object.altLabel.flatMap((item) => ((value, _options) => {
|
|
2731
|
+
if (typeof value === "string") {
|
|
2732
|
+
return [$literalFactory.string(value)];
|
|
2733
|
+
}
|
|
2734
|
+
if (typeof value === "object") {
|
|
2735
|
+
return [value];
|
|
2736
|
+
}
|
|
2737
|
+
throw new Error("unable to serialize to RDF");
|
|
2738
|
+
})(item, {
|
|
2739
|
+
graph: parameters.graph,
|
|
2740
|
+
resource: parameters.resource,
|
|
2741
|
+
resourceSet: parameters.resourceSet,
|
|
2742
|
+
propertyPath: skos_Concept.schema.properties.altLabel.path,
|
|
2743
|
+
})), parameters.graph);
|
|
2744
|
+
parameters.resource.add(skos_ConceptScheme.schema.properties.concepts.path, parameters.object.concepts.flatMap((item) => ((value, _options) => {
|
|
2745
|
+
if (value["termType"] === "NamedNode") {
|
|
2746
|
+
return [value];
|
|
2747
|
+
}
|
|
2748
|
+
if (skos_Concept.isskos_Concept(value)) {
|
|
2749
|
+
return [
|
|
2750
|
+
skos_Concept.toRdfResource(value, {
|
|
2751
|
+
graph: _options.graph,
|
|
2752
|
+
resourceSet: _options.resourceSet,
|
|
2753
|
+
}).identifier,
|
|
2754
|
+
];
|
|
2755
|
+
}
|
|
2756
|
+
throw new Error("unable to serialize to RDF");
|
|
2757
|
+
})(item, {
|
|
2758
|
+
graph: parameters.graph,
|
|
2759
|
+
resource: parameters.resource,
|
|
2760
|
+
resourceSet: parameters.resourceSet,
|
|
2761
|
+
propertyPath: skos_ConceptScheme.schema.properties.concepts.path,
|
|
2762
|
+
})), parameters.graph);
|
|
2763
|
+
parameters.resource.add(skos_Concept.schema.properties.definition.path, parameters.object.definition.flatMap((item) => ((value, _options) => {
|
|
2764
|
+
if (typeof value === "string") {
|
|
2765
|
+
return [$literalFactory.string(value)];
|
|
2766
|
+
}
|
|
2767
|
+
if (typeof value === "object") {
|
|
2768
|
+
return [value];
|
|
2769
|
+
}
|
|
2770
|
+
throw new Error("unable to serialize to RDF");
|
|
2771
|
+
})(item, {
|
|
2772
|
+
graph: parameters.graph,
|
|
2773
|
+
resource: parameters.resource,
|
|
2774
|
+
resourceSet: parameters.resourceSet,
|
|
2775
|
+
propertyPath: skos_Concept.schema.properties.definition.path,
|
|
2776
|
+
})), parameters.graph);
|
|
2777
|
+
parameters.resource.add(skos_Concept.schema.properties.hiddenLabel.path, parameters.object.hiddenLabel.flatMap((item) => ((value, _options) => {
|
|
2778
|
+
if (typeof value === "string") {
|
|
2779
|
+
return [$literalFactory.string(value)];
|
|
2780
|
+
}
|
|
2781
|
+
if (typeof value === "object") {
|
|
2782
|
+
return [value];
|
|
2783
|
+
}
|
|
2784
|
+
throw new Error("unable to serialize to RDF");
|
|
2785
|
+
})(item, {
|
|
2786
|
+
graph: parameters.graph,
|
|
2787
|
+
resource: parameters.resource,
|
|
2788
|
+
resourceSet: parameters.resourceSet,
|
|
2789
|
+
propertyPath: skos_Concept.schema.properties.hiddenLabel.path,
|
|
2790
|
+
})), parameters.graph);
|
|
2791
|
+
parameters.resource.add(skos_Concept.schema.properties.notation.path, parameters.object.notation.flatMap((item) => [item]), parameters.graph);
|
|
2792
|
+
parameters.resource.add(skos_Concept.schema.properties.prefLabel.path, parameters.object.prefLabel.flatMap((item) => ((value, _options) => {
|
|
2793
|
+
if (typeof value === "string") {
|
|
2794
|
+
return [$literalFactory.string(value)];
|
|
2795
|
+
}
|
|
2796
|
+
if (typeof value === "object") {
|
|
2797
|
+
return [value];
|
|
2798
|
+
}
|
|
2799
|
+
throw new Error("unable to serialize to RDF");
|
|
2800
|
+
})(item, {
|
|
2801
|
+
graph: parameters.graph,
|
|
2802
|
+
resource: parameters.resource,
|
|
2803
|
+
resourceSet: parameters.resourceSet,
|
|
2804
|
+
propertyPath: skos_Concept.schema.properties.prefLabel.path,
|
|
2805
|
+
})), parameters.graph);
|
|
2806
|
+
parameters.resource.add(skos_ConceptScheme.schema.properties.topConcepts.path, parameters.object.topConcepts.flatMap((item) => ((value, _options) => {
|
|
2807
|
+
if (value["termType"] === "NamedNode") {
|
|
2808
|
+
return [value];
|
|
2809
|
+
}
|
|
2810
|
+
if (skos_Concept.isskos_Concept(value)) {
|
|
2811
|
+
return [
|
|
2812
|
+
skos_Concept.toRdfResource(value, {
|
|
2813
|
+
graph: _options.graph,
|
|
2814
|
+
resourceSet: _options.resourceSet,
|
|
2815
|
+
}).identifier,
|
|
2816
|
+
];
|
|
2817
|
+
}
|
|
2818
|
+
throw new Error("unable to serialize to RDF");
|
|
2819
|
+
})(item, {
|
|
2820
|
+
graph: parameters.graph,
|
|
2821
|
+
resource: parameters.resource,
|
|
2822
|
+
resourceSet: parameters.resourceSet,
|
|
2823
|
+
propertyPath: skos_ConceptScheme.schema.properties.topConcepts.path,
|
|
2824
|
+
})), parameters.graph);
|
|
2825
|
+
parameters.resource.add(sh_NodeShape.schema.properties.type.path, parameters.object.type.flatMap((item) => [item]), parameters.graph);
|
|
2014
2826
|
return parameters.resource;
|
|
2015
2827
|
};
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
$identifier:
|
|
2828
|
+
skos_ConceptScheme.toRdfResource = $wrap_ToRdfResourceFunction(skos_ConceptScheme._toRdfResource);
|
|
2829
|
+
skos_ConceptScheme.$toString = (_skosConceptScheme) => `skos_ConceptScheme(${JSON.stringify(skos_ConceptScheme.toStringRecord(_skosConceptScheme))})`;
|
|
2830
|
+
skos_ConceptScheme.toStringRecord = (_skosConceptScheme) => $compactRecord({
|
|
2831
|
+
$identifier: _skosConceptScheme.$identifier().toString(),
|
|
2020
2832
|
});
|
|
2021
|
-
})(
|
|
2833
|
+
})(skos_ConceptScheme || (skos_ConceptScheme = {}));
|
|
2022
2834
|
export var sh_Shape;
|
|
2023
2835
|
(function (sh_Shape) {
|
|
2024
2836
|
sh_Shape.$toString = (value) => {
|
|
@@ -2041,7 +2853,7 @@ export var sh_Shape;
|
|
|
2041
2853
|
}
|
|
2042
2854
|
sh_Shape.issh_Shape = issh_Shape;
|
|
2043
2855
|
sh_Shape.schema = {
|
|
2044
|
-
kind: "
|
|
2856
|
+
kind: "ObjectDiscriminatedUnion",
|
|
2045
2857
|
members: {
|
|
2046
2858
|
sh_NodeShape: {
|
|
2047
2859
|
discriminantValues: ["sh_NodeShape"],
|
|
@@ -2056,12 +2868,33 @@ export var sh_Shape;
|
|
|
2056
2868
|
and: {
|
|
2057
2869
|
kind: "Shacl",
|
|
2058
2870
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
|
|
2059
|
-
type
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2871
|
+
get type() {
|
|
2872
|
+
return {
|
|
2873
|
+
kind: "Option",
|
|
2874
|
+
get itemType() {
|
|
2875
|
+
return {
|
|
2876
|
+
kind: "List",
|
|
2877
|
+
get itemType() {
|
|
2878
|
+
return {
|
|
2879
|
+
kind: "DiscriminatedUnion",
|
|
2880
|
+
members: {
|
|
2881
|
+
NamedNode: {
|
|
2882
|
+
discriminantValues: ["NamedNode"],
|
|
2883
|
+
type: { kind: "Iri" },
|
|
2884
|
+
},
|
|
2885
|
+
sh_NodeShape: {
|
|
2886
|
+
discriminantValues: [
|
|
2887
|
+
"sh_NodeShape",
|
|
2888
|
+
"sh_PropertyShape",
|
|
2889
|
+
],
|
|
2890
|
+
type: sh_Shape.schema,
|
|
2891
|
+
},
|
|
2892
|
+
},
|
|
2893
|
+
};
|
|
2894
|
+
},
|
|
2895
|
+
};
|
|
2896
|
+
},
|
|
2897
|
+
};
|
|
2065
2898
|
},
|
|
2066
2899
|
},
|
|
2067
2900
|
classes: {
|
|
@@ -2132,9 +2965,25 @@ export var sh_Shape;
|
|
|
2132
2965
|
isDefinedBy: {
|
|
2133
2966
|
kind: "Shacl",
|
|
2134
2967
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
2135
|
-
type
|
|
2136
|
-
|
|
2137
|
-
|
|
2968
|
+
get type() {
|
|
2969
|
+
return {
|
|
2970
|
+
kind: "Option",
|
|
2971
|
+
get itemType() {
|
|
2972
|
+
return {
|
|
2973
|
+
kind: "DiscriminatedUnion",
|
|
2974
|
+
members: {
|
|
2975
|
+
NamedNode: {
|
|
2976
|
+
discriminantValues: ["NamedNode"],
|
|
2977
|
+
type: { kind: "Iri" },
|
|
2978
|
+
},
|
|
2979
|
+
owl_Ontology: {
|
|
2980
|
+
discriminantValues: ["owl_Ontology"],
|
|
2981
|
+
type: owl_Ontology.schema,
|
|
2982
|
+
},
|
|
2983
|
+
},
|
|
2984
|
+
};
|
|
2985
|
+
},
|
|
2986
|
+
};
|
|
2138
2987
|
},
|
|
2139
2988
|
},
|
|
2140
2989
|
label: {
|
|
@@ -2223,9 +3072,25 @@ export var sh_Shape;
|
|
|
2223
3072
|
node: {
|
|
2224
3073
|
kind: "Shacl",
|
|
2225
3074
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
2226
|
-
type
|
|
2227
|
-
|
|
2228
|
-
|
|
3075
|
+
get type() {
|
|
3076
|
+
return {
|
|
3077
|
+
kind: "Option",
|
|
3078
|
+
get itemType() {
|
|
3079
|
+
return {
|
|
3080
|
+
kind: "DiscriminatedUnion",
|
|
3081
|
+
members: {
|
|
3082
|
+
NamedNode: {
|
|
3083
|
+
discriminantValues: ["NamedNode"],
|
|
3084
|
+
type: { kind: "Iri" },
|
|
3085
|
+
},
|
|
3086
|
+
sh_NodeShape: {
|
|
3087
|
+
discriminantValues: ["sh_NodeShape"],
|
|
3088
|
+
type: sh_NodeShape.schema,
|
|
3089
|
+
},
|
|
3090
|
+
},
|
|
3091
|
+
};
|
|
3092
|
+
},
|
|
3093
|
+
};
|
|
2229
3094
|
},
|
|
2230
3095
|
},
|
|
2231
3096
|
nodeKind: {
|
|
@@ -2249,20 +3114,57 @@ export var sh_Shape;
|
|
|
2249
3114
|
not: {
|
|
2250
3115
|
kind: "Shacl",
|
|
2251
3116
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
|
|
2252
|
-
type
|
|
2253
|
-
|
|
2254
|
-
|
|
3117
|
+
get type() {
|
|
3118
|
+
return {
|
|
3119
|
+
kind: "Set",
|
|
3120
|
+
get itemType() {
|
|
3121
|
+
return {
|
|
3122
|
+
kind: "DiscriminatedUnion",
|
|
3123
|
+
members: {
|
|
3124
|
+
NamedNode: {
|
|
3125
|
+
discriminantValues: ["NamedNode"],
|
|
3126
|
+
type: { kind: "Iri" },
|
|
3127
|
+
},
|
|
3128
|
+
sh_NodeShape: {
|
|
3129
|
+
discriminantValues: ["sh_NodeShape"],
|
|
3130
|
+
type: sh_NodeShape.schema,
|
|
3131
|
+
},
|
|
3132
|
+
},
|
|
3133
|
+
};
|
|
3134
|
+
},
|
|
3135
|
+
};
|
|
2255
3136
|
},
|
|
2256
3137
|
},
|
|
2257
3138
|
or: {
|
|
2258
3139
|
kind: "Shacl",
|
|
2259
3140
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
|
|
2260
|
-
type
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
3141
|
+
get type() {
|
|
3142
|
+
return {
|
|
3143
|
+
kind: "Option",
|
|
3144
|
+
get itemType() {
|
|
3145
|
+
return {
|
|
3146
|
+
kind: "List",
|
|
3147
|
+
get itemType() {
|
|
3148
|
+
return {
|
|
3149
|
+
kind: "DiscriminatedUnion",
|
|
3150
|
+
members: {
|
|
3151
|
+
NamedNode: {
|
|
3152
|
+
discriminantValues: ["NamedNode"],
|
|
3153
|
+
type: { kind: "Iri" },
|
|
3154
|
+
},
|
|
3155
|
+
sh_NodeShape: {
|
|
3156
|
+
discriminantValues: [
|
|
3157
|
+
"sh_NodeShape",
|
|
3158
|
+
"sh_PropertyShape",
|
|
3159
|
+
],
|
|
3160
|
+
type: sh_Shape.schema,
|
|
3161
|
+
},
|
|
3162
|
+
},
|
|
3163
|
+
};
|
|
3164
|
+
},
|
|
3165
|
+
};
|
|
3166
|
+
},
|
|
3167
|
+
};
|
|
2266
3168
|
},
|
|
2267
3169
|
},
|
|
2268
3170
|
pattern: {
|
|
@@ -2326,12 +3228,33 @@ export var sh_Shape;
|
|
|
2326
3228
|
xone: {
|
|
2327
3229
|
kind: "Shacl",
|
|
2328
3230
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
2329
|
-
type
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
3231
|
+
get type() {
|
|
3232
|
+
return {
|
|
3233
|
+
kind: "Option",
|
|
3234
|
+
get itemType() {
|
|
3235
|
+
return {
|
|
3236
|
+
kind: "List",
|
|
3237
|
+
get itemType() {
|
|
3238
|
+
return {
|
|
3239
|
+
kind: "DiscriminatedUnion",
|
|
3240
|
+
members: {
|
|
3241
|
+
NamedNode: {
|
|
3242
|
+
discriminantValues: ["NamedNode"],
|
|
3243
|
+
type: { kind: "Iri" },
|
|
3244
|
+
},
|
|
3245
|
+
sh_NodeShape: {
|
|
3246
|
+
discriminantValues: [
|
|
3247
|
+
"sh_NodeShape",
|
|
3248
|
+
"sh_PropertyShape",
|
|
3249
|
+
],
|
|
3250
|
+
type: sh_Shape.schema,
|
|
3251
|
+
},
|
|
3252
|
+
},
|
|
3253
|
+
};
|
|
3254
|
+
},
|
|
3255
|
+
};
|
|
3256
|
+
},
|
|
3257
|
+
};
|
|
2335
3258
|
},
|
|
2336
3259
|
},
|
|
2337
3260
|
},
|
|
@@ -2368,23 +3291,23 @@ export var sh_Shape;
|
|
|
2368
3291
|
export var $Object;
|
|
2369
3292
|
(function ($Object) {
|
|
2370
3293
|
$Object.$toString = (value) => {
|
|
3294
|
+
if (owl_Ontology.isowl_Ontology(value)) {
|
|
3295
|
+
return owl_Ontology.$toString(value);
|
|
3296
|
+
}
|
|
2371
3297
|
if (sh_NodeShape.issh_NodeShape(value)) {
|
|
2372
3298
|
return sh_NodeShape.$toString(value);
|
|
2373
3299
|
}
|
|
2374
|
-
if (sh_Ontology.issh_Ontology(value)) {
|
|
2375
|
-
return sh_Ontology.$toString(value);
|
|
2376
|
-
}
|
|
2377
3300
|
if (sh_PropertyGroup.issh_PropertyGroup(value)) {
|
|
2378
3301
|
return sh_PropertyGroup.$toString(value);
|
|
2379
3302
|
}
|
|
2380
3303
|
if (sh_PropertyShape.issh_PropertyShape(value)) {
|
|
2381
3304
|
return sh_PropertyShape.$toString(value);
|
|
2382
3305
|
}
|
|
2383
|
-
if (
|
|
2384
|
-
return
|
|
3306
|
+
if (skos_Concept.isskos_Concept(value)) {
|
|
3307
|
+
return skos_Concept.$toString(value);
|
|
2385
3308
|
}
|
|
2386
|
-
if (
|
|
2387
|
-
return
|
|
3309
|
+
if (skos_ConceptScheme.isskos_ConceptScheme(value)) {
|
|
3310
|
+
return skos_ConceptScheme.$toString(value);
|
|
2388
3311
|
}
|
|
2389
3312
|
throw new Error("unable to serialize to string");
|
|
2390
3313
|
};
|
|
@@ -2394,16 +3317,16 @@ export var $Object;
|
|
|
2394
3317
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
2395
3318
|
})(Identifier = $Object.Identifier || ($Object.Identifier = {}));
|
|
2396
3319
|
$Object.schema = {
|
|
2397
|
-
kind: "
|
|
3320
|
+
kind: "ObjectDiscriminatedUnion",
|
|
2398
3321
|
members: {
|
|
3322
|
+
owl_Ontology: {
|
|
3323
|
+
discriminantValues: ["owl_Ontology"],
|
|
3324
|
+
type: owl_Ontology.schema,
|
|
3325
|
+
},
|
|
2399
3326
|
sh_NodeShape: {
|
|
2400
3327
|
discriminantValues: ["sh_NodeShape"],
|
|
2401
3328
|
type: sh_NodeShape.schema,
|
|
2402
3329
|
},
|
|
2403
|
-
sh_Ontology: {
|
|
2404
|
-
discriminantValues: ["sh_Ontology"],
|
|
2405
|
-
type: sh_Ontology.schema,
|
|
2406
|
-
},
|
|
2407
3330
|
sh_PropertyGroup: {
|
|
2408
3331
|
discriminantValues: ["sh_PropertyGroup"],
|
|
2409
3332
|
type: sh_PropertyGroup.schema,
|
|
@@ -2412,50 +3335,50 @@ export var $Object;
|
|
|
2412
3335
|
discriminantValues: ["sh_PropertyShape"],
|
|
2413
3336
|
type: sh_PropertyShape.schema,
|
|
2414
3337
|
},
|
|
2415
|
-
|
|
2416
|
-
discriminantValues: ["
|
|
2417
|
-
type:
|
|
3338
|
+
skos_Concept: {
|
|
3339
|
+
discriminantValues: ["skos_Concept"],
|
|
3340
|
+
type: skos_Concept.schema,
|
|
2418
3341
|
},
|
|
2419
|
-
|
|
2420
|
-
discriminantValues: ["
|
|
2421
|
-
type:
|
|
3342
|
+
skos_ConceptScheme: {
|
|
3343
|
+
discriminantValues: ["skos_ConceptScheme"],
|
|
3344
|
+
type: skos_ConceptScheme.schema,
|
|
2422
3345
|
},
|
|
2423
3346
|
},
|
|
2424
3347
|
properties: {},
|
|
2425
3348
|
};
|
|
2426
3349
|
$Object.toRdfResource = (object, options) => {
|
|
3350
|
+
if (owl_Ontology.isowl_Ontology(object)) {
|
|
3351
|
+
return owl_Ontology.toRdfResource(object, options);
|
|
3352
|
+
}
|
|
2427
3353
|
if (sh_NodeShape.issh_NodeShape(object)) {
|
|
2428
3354
|
return sh_NodeShape.toRdfResource(object, options);
|
|
2429
3355
|
}
|
|
2430
|
-
if (sh_Ontology.issh_Ontology(object)) {
|
|
2431
|
-
return sh_Ontology.toRdfResource(object, options);
|
|
2432
|
-
}
|
|
2433
3356
|
if (sh_PropertyGroup.issh_PropertyGroup(object)) {
|
|
2434
3357
|
return sh_PropertyGroup.toRdfResource(object, options);
|
|
2435
3358
|
}
|
|
2436
3359
|
if (sh_PropertyShape.issh_PropertyShape(object)) {
|
|
2437
3360
|
return sh_PropertyShape.toRdfResource(object, options);
|
|
2438
3361
|
}
|
|
2439
|
-
if (
|
|
2440
|
-
return
|
|
3362
|
+
if (skos_Concept.isskos_Concept(object)) {
|
|
3363
|
+
return skos_Concept.toRdfResource(object, options);
|
|
2441
3364
|
}
|
|
2442
|
-
if (
|
|
2443
|
-
return
|
|
3365
|
+
if (skos_ConceptScheme.isskos_ConceptScheme(object)) {
|
|
3366
|
+
return skos_ConceptScheme.toRdfResource(object, options);
|
|
2444
3367
|
}
|
|
2445
3368
|
throw new Error("unrecognized type");
|
|
2446
3369
|
};
|
|
2447
3370
|
$Object.toRdfResourceValues = ((value, _options) => {
|
|
2448
|
-
if (
|
|
3371
|
+
if (owl_Ontology.isowl_Ontology(value)) {
|
|
2449
3372
|
return [
|
|
2450
|
-
|
|
3373
|
+
owl_Ontology.toRdfResource(value, {
|
|
2451
3374
|
graph: _options.graph,
|
|
2452
3375
|
resourceSet: _options.resourceSet,
|
|
2453
3376
|
}).identifier,
|
|
2454
3377
|
];
|
|
2455
3378
|
}
|
|
2456
|
-
if (
|
|
3379
|
+
if (sh_NodeShape.issh_NodeShape(value)) {
|
|
2457
3380
|
return [
|
|
2458
|
-
|
|
3381
|
+
sh_NodeShape.toRdfResource(value, {
|
|
2459
3382
|
graph: _options.graph,
|
|
2460
3383
|
resourceSet: _options.resourceSet,
|
|
2461
3384
|
}).identifier,
|
|
@@ -2477,17 +3400,17 @@ export var $Object;
|
|
|
2477
3400
|
}).identifier,
|
|
2478
3401
|
];
|
|
2479
3402
|
}
|
|
2480
|
-
if (
|
|
3403
|
+
if (skos_Concept.isskos_Concept(value)) {
|
|
2481
3404
|
return [
|
|
2482
|
-
|
|
3405
|
+
skos_Concept.toRdfResource(value, {
|
|
2483
3406
|
graph: _options.graph,
|
|
2484
3407
|
resourceSet: _options.resourceSet,
|
|
2485
3408
|
}).identifier,
|
|
2486
3409
|
];
|
|
2487
3410
|
}
|
|
2488
|
-
if (
|
|
3411
|
+
if (skos_ConceptScheme.isskos_ConceptScheme(value)) {
|
|
2489
3412
|
return [
|
|
2490
|
-
|
|
3413
|
+
skos_ConceptScheme.toRdfResource(value, {
|
|
2491
3414
|
graph: _options.graph,
|
|
2492
3415
|
resourceSet: _options.resourceSet,
|
|
2493
3416
|
}).identifier,
|