@shaclmate/compiler 4.0.72 → 4.0.73
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/input/ShapesGraph.d.ts +7 -16
- package/dist/input/ShapesGraph.js +12 -43
- package/dist/input/input.shaclmate.d.ts +41 -107
- package/dist/input/input.shaclmate.js +194 -822
- package/package.json +2 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import datasetFactory from "@rdfjs/dataset";
|
|
2
1
|
import dataFactory from "@rdfx/data-factory";
|
|
3
2
|
import { LiteralFactory } from "@rdfx/literal";
|
|
4
|
-
import { PropertyPath as RdfxResourcePropertyPath, Resource,
|
|
3
|
+
import { PropertyPath as RdfxResourcePropertyPath, Resource, } from "@rdfx/resource";
|
|
5
4
|
import { NTriplesIdentifier, NTriplesTerm } from "@rdfx/string";
|
|
6
5
|
import { Either, Left, Maybe, Right } from "purify-ts";
|
|
7
6
|
function $bigIntFromRdfResourceValues(values, options) {
|
|
@@ -133,20 +132,6 @@ function $ensureRdfResourceType(resource, types, options) {
|
|
|
133
132
|
return Left(new Error(`${resource.identifier} has unexpected RDF type (actual: ${actualRdfType}, expected one of ${types})`));
|
|
134
133
|
});
|
|
135
134
|
}
|
|
136
|
-
export var $EqualsResult;
|
|
137
|
-
(function ($EqualsResult) {
|
|
138
|
-
$EqualsResult.Equal = Right(true);
|
|
139
|
-
function fromBooleanEqualsResult(left, right, equalsResult) {
|
|
140
|
-
if (typeof equalsResult !== "boolean") {
|
|
141
|
-
return equalsResult;
|
|
142
|
-
}
|
|
143
|
-
if (equalsResult) {
|
|
144
|
-
return $EqualsResult.Equal;
|
|
145
|
-
}
|
|
146
|
-
return Left({ left, right, type: "boolean" });
|
|
147
|
-
}
|
|
148
|
-
$EqualsResult.fromBooleanEqualsResult = fromBooleanEqualsResult;
|
|
149
|
-
})($EqualsResult || ($EqualsResult = {}));
|
|
150
135
|
function $floatFromRdfResourceValues(values, options) {
|
|
151
136
|
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
|
|
152
137
|
? value.toFloat(options.schema.in)
|
|
@@ -219,7 +204,6 @@ export var $PropertyPath;
|
|
|
219
204
|
.toResource()
|
|
220
205
|
.chain((resource) => $PropertyPath.fromRdfResource(resource, options)));
|
|
221
206
|
$PropertyPath.schema = {};
|
|
222
|
-
$PropertyPath.toRdfResource = RdfxResourcePropertyPath.toResource;
|
|
223
207
|
$PropertyPath.$toString = RdfxResourcePropertyPath.toString;
|
|
224
208
|
})($PropertyPath || ($PropertyPath = {}));
|
|
225
209
|
function $rdfResourceIdentifierValues(resource) {
|
|
@@ -248,6 +232,7 @@ var $RdfVocabularies;
|
|
|
248
232
|
byte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#byte"),
|
|
249
233
|
date: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#date"),
|
|
250
234
|
dateTime: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),
|
|
235
|
+
dateTimeStamp: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTimeStamp"),
|
|
251
236
|
decimal: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),
|
|
252
237
|
double: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#double"),
|
|
253
238
|
float: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float"),
|
|
@@ -298,12 +283,6 @@ function $shaclPropertyFromRdf({ focusResource, graph, propertySchema, typeFromR
|
|
|
298
283
|
schema: propertySchema.type,
|
|
299
284
|
}).chain((values) => values.head());
|
|
300
285
|
}
|
|
301
|
-
/**
|
|
302
|
-
* Compare two values for strict equality (===), returning an $EqualsResult rather than a boolean.
|
|
303
|
-
*/
|
|
304
|
-
function $strictEquals(left, right) {
|
|
305
|
-
return $EqualsResult.fromBooleanEqualsResult(left, right, left === right);
|
|
306
|
-
}
|
|
307
286
|
function $stringFromRdfResourceValues(values, options) {
|
|
308
287
|
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
|
|
309
288
|
? value.toString(options.schema.in)
|
|
@@ -406,80 +385,8 @@ function $wrap_FromRdfResourceFunction(_fromRdfResourceFunction) {
|
|
|
406
385
|
});
|
|
407
386
|
};
|
|
408
387
|
}
|
|
409
|
-
function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
|
|
410
|
-
return (object, options) => {
|
|
411
|
-
let { graph, ignoreRdfType = false, resourceSet } = options ?? {};
|
|
412
|
-
if (!resourceSet) {
|
|
413
|
-
resourceSet = new ResourceSet({
|
|
414
|
-
dataFactory: dataFactory,
|
|
415
|
-
dataset: datasetFactory.dataset(),
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
const resource = resourceSet.resource(object.$identifier());
|
|
419
|
-
_toRdfResourceFunction({
|
|
420
|
-
graph,
|
|
421
|
-
ignoreRdfType,
|
|
422
|
-
object,
|
|
423
|
-
resource,
|
|
424
|
-
resourceSet,
|
|
425
|
-
});
|
|
426
|
-
return resource;
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
388
|
export var NodeShape;
|
|
430
389
|
(function (NodeShape) {
|
|
431
|
-
NodeShape.create = (parameters) => $sequenceRecord({
|
|
432
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
433
|
-
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
434
|
-
classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
435
|
-
closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
|
|
436
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
437
|
-
datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
438
|
-
deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
439
|
-
discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.discriminantValue.type, value)),
|
|
440
|
-
extern: $convertToMaybe($identityConversionFunction)(parameters?.extern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.extern.type, value)),
|
|
441
|
-
flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
442
|
-
fromRdfType: $convertToMaybe(($convertToIri))(parameters?.fromRdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.fromRdfType.type, value)),
|
|
443
|
-
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
444
|
-
ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters?.ignore),
|
|
445
|
-
ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
|
|
446
|
-
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
447
|
-
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
448
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
449
|
-
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
450
|
-
maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
451
|
-
maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
452
|
-
maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
453
|
-
message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
454
|
-
minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
455
|
-
minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
456
|
-
minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
457
|
-
mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
|
|
458
|
-
node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
459
|
-
nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
460
|
-
not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
461
|
-
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
462
|
-
pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
463
|
-
properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
|
|
464
|
-
rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.rdfType.type, value)),
|
|
465
|
-
severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
466
|
-
shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
|
|
467
|
-
subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
|
|
468
|
-
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
469
|
-
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
470
|
-
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
471
|
-
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
472
|
-
toRdfTypes: $convertToScalarSet(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.toRdfTypes.type, value)),
|
|
473
|
-
tsImports: $convertToScalarSet($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.tsImports.type, value)),
|
|
474
|
-
types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
|
|
475
|
-
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
476
|
-
})
|
|
477
|
-
.map((properties) => ({ ...properties, $type: "NodeShape" }))
|
|
478
|
-
.map((object) => $monkeyPatchObject(object, { $toString: NodeShape.$toString }));
|
|
479
|
-
function createUnsafe(parameters) {
|
|
480
|
-
return NodeShape.create(parameters).unsafeCoerce();
|
|
481
|
-
}
|
|
482
|
-
NodeShape.createUnsafe = createUnsafe;
|
|
483
390
|
NodeShape._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
484
391
|
? $ensureRdfResourceType(resource, [NodeShape.schema.fromRdfType], {
|
|
485
392
|
graph: options.graph,
|
|
@@ -793,6 +700,59 @@ export var NodeShape;
|
|
|
793
700
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
794
701
|
}),
|
|
795
702
|
}).chain((properties) => NodeShape.create(properties)));
|
|
703
|
+
NodeShape.$toString = (_nodeShape) => `NodeShape(${JSON.stringify(NodeShape.toStringRecord(_nodeShape))})`;
|
|
704
|
+
NodeShape.create = (parameters) => $sequenceRecord({
|
|
705
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
706
|
+
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
707
|
+
classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
708
|
+
closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
|
|
709
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
710
|
+
datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
711
|
+
deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
712
|
+
discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.discriminantValue.type, value)),
|
|
713
|
+
extern: $convertToMaybe($identityConversionFunction)(parameters?.extern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.extern.type, value)),
|
|
714
|
+
flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
715
|
+
fromRdfType: $convertToMaybe(($convertToIri))(parameters?.fromRdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.fromRdfType.type, value)),
|
|
716
|
+
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
717
|
+
ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters?.ignore),
|
|
718
|
+
ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
|
|
719
|
+
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
720
|
+
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
721
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
722
|
+
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
723
|
+
maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
724
|
+
maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
725
|
+
maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
726
|
+
message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
727
|
+
minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
728
|
+
minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
729
|
+
minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
730
|
+
mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
|
|
731
|
+
node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
732
|
+
nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
733
|
+
not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
734
|
+
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
735
|
+
pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
736
|
+
properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
|
|
737
|
+
rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.rdfType.type, value)),
|
|
738
|
+
severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
739
|
+
shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
|
|
740
|
+
subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
|
|
741
|
+
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
742
|
+
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
743
|
+
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
744
|
+
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
745
|
+
toRdfTypes: $convertToScalarSet(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.toRdfTypes.type, value)),
|
|
746
|
+
tsImports: $convertToScalarSet($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.tsImports.type, value)),
|
|
747
|
+
types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
|
|
748
|
+
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
749
|
+
})
|
|
750
|
+
.map((properties) => ({ ...properties, $type: "NodeShape" }))
|
|
751
|
+
.map((object) => $monkeyPatchObject(object, { $toString: NodeShape.$toString }));
|
|
752
|
+
function createUnsafe(parameters) {
|
|
753
|
+
return NodeShape.create(parameters).unsafeCoerce();
|
|
754
|
+
}
|
|
755
|
+
NodeShape.createUnsafe = createUnsafe;
|
|
796
756
|
NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
|
|
797
757
|
NodeShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
798
758
|
.toResource()
|
|
@@ -1091,14 +1051,7 @@ export var NodeShape;
|
|
|
1091
1051
|
return {
|
|
1092
1052
|
kind: "Option",
|
|
1093
1053
|
get itemType() {
|
|
1094
|
-
return
|
|
1095
|
-
kind: "Iri",
|
|
1096
|
-
in: [
|
|
1097
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
1098
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
1099
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
1100
|
-
],
|
|
1101
|
-
};
|
|
1054
|
+
return Severity.schema;
|
|
1102
1055
|
},
|
|
1103
1056
|
};
|
|
1104
1057
|
},
|
|
@@ -1168,227 +1121,6 @@ export var NodeShape;
|
|
|
1168
1121
|
},
|
|
1169
1122
|
toRdfTypes: [dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape")],
|
|
1170
1123
|
};
|
|
1171
|
-
NodeShape._toRdfResource = (parameters) => {
|
|
1172
|
-
if (!parameters.ignoreRdfType) {
|
|
1173
|
-
parameters.resource.add($RdfVocabularies.rdf.type, NodeShape.schema.toRdfTypes, parameters.graph);
|
|
1174
|
-
}
|
|
1175
|
-
parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
|
|
1176
|
-
value.length > 0
|
|
1177
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1178
|
-
if (itemIndex === 0) {
|
|
1179
|
-
currentSubListResource = listResource;
|
|
1180
|
-
}
|
|
1181
|
-
else {
|
|
1182
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1183
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1184
|
-
currentSubListResource = newSubListResource;
|
|
1185
|
-
}
|
|
1186
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1187
|
-
if (itemIndex + 1 === list.length) {
|
|
1188
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1189
|
-
}
|
|
1190
|
-
return { currentSubListResource, listResource };
|
|
1191
|
-
}, {
|
|
1192
|
-
currentSubListResource: null,
|
|
1193
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1194
|
-
}).listResource.identifier
|
|
1195
|
-
: $RdfVocabularies.rdf.nil,
|
|
1196
|
-
]), parameters.graph);
|
|
1197
|
-
parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
1198
|
-
parameters.resource.add(NodeShape.schema.properties.closed.path, parameters.object.closed
|
|
1199
|
-
.toList()
|
|
1200
|
-
.flatMap((value) => [
|
|
1201
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1202
|
-
]), parameters.graph);
|
|
1203
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1204
|
-
.toList()
|
|
1205
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1206
|
-
parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
1207
|
-
parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
|
|
1208
|
-
.toList()
|
|
1209
|
-
.flatMap((value) => [
|
|
1210
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1211
|
-
]), parameters.graph);
|
|
1212
|
-
parameters.resource.add(NodeShape.schema.properties.discriminantValue.path, parameters.object.discriminantValue
|
|
1213
|
-
.toList()
|
|
1214
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1215
|
-
parameters.resource.add(NodeShape.schema.properties.extern.path, parameters.object.extern
|
|
1216
|
-
.toList()
|
|
1217
|
-
.flatMap((value) => [
|
|
1218
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1219
|
-
]), parameters.graph);
|
|
1220
|
-
parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
|
|
1221
|
-
.toList()
|
|
1222
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1223
|
-
parameters.resource.add(NodeShape.schema.properties.fromRdfType.path, parameters.object.fromRdfType.toList(), parameters.graph);
|
|
1224
|
-
parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
1225
|
-
parameters.resource.add(NodeShape.schema.properties.ignore.path, $strictEquals(parameters.object.ignore, false).isLeft()
|
|
1226
|
-
? [
|
|
1227
|
-
$literalFactory.boolean(parameters.object.ignore, $RdfVocabularies.xsd.boolean),
|
|
1228
|
-
]
|
|
1229
|
-
: [], parameters.graph);
|
|
1230
|
-
parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
|
|
1231
|
-
value.length > 0
|
|
1232
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1233
|
-
if (itemIndex === 0) {
|
|
1234
|
-
currentSubListResource = listResource;
|
|
1235
|
-
}
|
|
1236
|
-
else {
|
|
1237
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1238
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1239
|
-
currentSubListResource = newSubListResource;
|
|
1240
|
-
}
|
|
1241
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1242
|
-
if (itemIndex + 1 === list.length) {
|
|
1243
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1244
|
-
}
|
|
1245
|
-
return { currentSubListResource, listResource };
|
|
1246
|
-
}, {
|
|
1247
|
-
currentSubListResource: null,
|
|
1248
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1249
|
-
}).listResource.identifier
|
|
1250
|
-
: $RdfVocabularies.rdf.nil,
|
|
1251
|
-
]), parameters.graph);
|
|
1252
|
-
parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
|
|
1253
|
-
value.length > 0
|
|
1254
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1255
|
-
if (itemIndex === 0) {
|
|
1256
|
-
currentSubListResource = listResource;
|
|
1257
|
-
}
|
|
1258
|
-
else {
|
|
1259
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1260
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1261
|
-
currentSubListResource = newSubListResource;
|
|
1262
|
-
}
|
|
1263
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1264
|
-
if (itemIndex + 1 === list.length) {
|
|
1265
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1266
|
-
}
|
|
1267
|
-
return { currentSubListResource, listResource };
|
|
1268
|
-
}, {
|
|
1269
|
-
currentSubListResource: null,
|
|
1270
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1271
|
-
}).listResource.identifier
|
|
1272
|
-
: $RdfVocabularies.rdf.nil,
|
|
1273
|
-
]), parameters.graph);
|
|
1274
|
-
parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
1275
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1276
|
-
.toList()
|
|
1277
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1278
|
-
parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
1279
|
-
value.length > 0
|
|
1280
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1281
|
-
if (itemIndex === 0) {
|
|
1282
|
-
currentSubListResource = listResource;
|
|
1283
|
-
}
|
|
1284
|
-
else {
|
|
1285
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1286
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1287
|
-
currentSubListResource = newSubListResource;
|
|
1288
|
-
}
|
|
1289
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
1290
|
-
if (itemIndex + 1 === list.length) {
|
|
1291
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1292
|
-
}
|
|
1293
|
-
return { currentSubListResource, listResource };
|
|
1294
|
-
}, {
|
|
1295
|
-
currentSubListResource: null,
|
|
1296
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1297
|
-
}).listResource.identifier
|
|
1298
|
-
: $RdfVocabularies.rdf.nil,
|
|
1299
|
-
]), parameters.graph);
|
|
1300
|
-
parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
|
|
1301
|
-
parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
|
|
1302
|
-
parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
|
|
1303
|
-
.toList()
|
|
1304
|
-
.flatMap((value) => [
|
|
1305
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
1306
|
-
]), parameters.graph);
|
|
1307
|
-
parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
|
|
1308
|
-
.toList()
|
|
1309
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1310
|
-
parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
|
|
1311
|
-
parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
|
|
1312
|
-
parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
|
|
1313
|
-
.toList()
|
|
1314
|
-
.flatMap((value) => [
|
|
1315
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
1316
|
-
]), parameters.graph);
|
|
1317
|
-
parameters.resource.add(NodeShape.schema.properties.mutable.path, parameters.object.mutable
|
|
1318
|
-
.toList()
|
|
1319
|
-
.flatMap((value) => [
|
|
1320
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1321
|
-
]), parameters.graph);
|
|
1322
|
-
parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
|
|
1323
|
-
parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
1324
|
-
parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
1325
|
-
parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
1326
|
-
value.length > 0
|
|
1327
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1328
|
-
if (itemIndex === 0) {
|
|
1329
|
-
currentSubListResource = listResource;
|
|
1330
|
-
}
|
|
1331
|
-
else {
|
|
1332
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1333
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1334
|
-
currentSubListResource = newSubListResource;
|
|
1335
|
-
}
|
|
1336
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1337
|
-
if (itemIndex + 1 === list.length) {
|
|
1338
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1339
|
-
}
|
|
1340
|
-
return { currentSubListResource, listResource };
|
|
1341
|
-
}, {
|
|
1342
|
-
currentSubListResource: null,
|
|
1343
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1344
|
-
}).listResource.identifier
|
|
1345
|
-
: $RdfVocabularies.rdf.nil,
|
|
1346
|
-
]), parameters.graph);
|
|
1347
|
-
parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
|
|
1348
|
-
.toList()
|
|
1349
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1350
|
-
parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
|
|
1351
|
-
parameters.resource.add(NodeShape.schema.properties.rdfType.path, parameters.object.rdfType.toList(), parameters.graph);
|
|
1352
|
-
parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
|
|
1353
|
-
parameters.resource.add(NodeShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
|
|
1354
|
-
.toList()
|
|
1355
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1356
|
-
parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
|
|
1357
|
-
parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
|
|
1358
|
-
parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
|
|
1359
|
-
parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
1360
|
-
parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
1361
|
-
parameters.resource.add(NodeShape.schema.properties.toRdfTypes.path, parameters.object.toRdfTypes.flatMap((item) => [item]), parameters.graph);
|
|
1362
|
-
parameters.resource.add(NodeShape.schema.properties.tsImports.path, parameters.object.tsImports.flatMap((item) => [
|
|
1363
|
-
$literalFactory.string(item),
|
|
1364
|
-
]), parameters.graph);
|
|
1365
|
-
parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
|
|
1366
|
-
parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
|
|
1367
|
-
value.length > 0
|
|
1368
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1369
|
-
if (itemIndex === 0) {
|
|
1370
|
-
currentSubListResource = listResource;
|
|
1371
|
-
}
|
|
1372
|
-
else {
|
|
1373
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1374
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1375
|
-
currentSubListResource = newSubListResource;
|
|
1376
|
-
}
|
|
1377
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1378
|
-
if (itemIndex + 1 === list.length) {
|
|
1379
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1380
|
-
}
|
|
1381
|
-
return { currentSubListResource, listResource };
|
|
1382
|
-
}, {
|
|
1383
|
-
currentSubListResource: null,
|
|
1384
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1385
|
-
}).listResource.identifier
|
|
1386
|
-
: $RdfVocabularies.rdf.nil,
|
|
1387
|
-
]), parameters.graph);
|
|
1388
|
-
return parameters.resource;
|
|
1389
|
-
};
|
|
1390
|
-
NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
|
|
1391
|
-
NodeShape.$toString = (_nodeShape) => `NodeShape(${JSON.stringify(NodeShape.toStringRecord(_nodeShape))})`;
|
|
1392
1124
|
NodeShape.toStringRecord = (_nodeShape) => $compactRecord({
|
|
1393
1125
|
$identifier: _nodeShape.$identifier().toString(),
|
|
1394
1126
|
label: _nodeShape.label.map((item) => item.toString()).extract(),
|
|
@@ -1399,17 +1131,6 @@ export var NodeShape;
|
|
|
1399
1131
|
})(NodeShape || (NodeShape = {}));
|
|
1400
1132
|
export var Ontology;
|
|
1401
1133
|
(function (Ontology) {
|
|
1402
|
-
Ontology.create = (parameters) => $sequenceRecord({
|
|
1403
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1404
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1405
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1406
|
-
})
|
|
1407
|
-
.map((properties) => ({ ...properties, $type: "Ontology" }))
|
|
1408
|
-
.map((object) => $monkeyPatchObject(object, { $toString: Ontology.$toString }));
|
|
1409
|
-
function createUnsafe(parameters) {
|
|
1410
|
-
return Ontology.create(parameters).unsafeCoerce();
|
|
1411
|
-
}
|
|
1412
|
-
Ontology.createUnsafe = createUnsafe;
|
|
1413
1134
|
Ontology._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
1414
1135
|
? $ensureRdfResourceType(resource, [Ontology.schema.fromRdfType], {
|
|
1415
1136
|
graph: options.graph,
|
|
@@ -1436,6 +1157,18 @@ export var Ontology;
|
|
|
1436
1157
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1437
1158
|
}),
|
|
1438
1159
|
}).chain((properties) => Ontology.create(properties)));
|
|
1160
|
+
Ontology.$toString = (_ontology) => `Ontology(${JSON.stringify(Ontology.toStringRecord(_ontology))})`;
|
|
1161
|
+
Ontology.create = (parameters) => $sequenceRecord({
|
|
1162
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1163
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1164
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1165
|
+
})
|
|
1166
|
+
.map((properties) => ({ ...properties, $type: "Ontology" }))
|
|
1167
|
+
.map((object) => $monkeyPatchObject(object, { $toString: Ontology.$toString }));
|
|
1168
|
+
function createUnsafe(parameters) {
|
|
1169
|
+
return Ontology.create(parameters).unsafeCoerce();
|
|
1170
|
+
}
|
|
1171
|
+
Ontology.createUnsafe = createUnsafe;
|
|
1439
1172
|
Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
|
|
1440
1173
|
Ontology.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
1441
1174
|
.toResource()
|
|
@@ -1475,20 +1208,6 @@ export var Ontology;
|
|
|
1475
1208
|
dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
|
|
1476
1209
|
],
|
|
1477
1210
|
};
|
|
1478
|
-
Ontology._toRdfResource = (parameters) => {
|
|
1479
|
-
if (!parameters.ignoreRdfType) {
|
|
1480
|
-
parameters.resource.add($RdfVocabularies.rdf.type, Ontology.schema.toRdfTypes, parameters.graph);
|
|
1481
|
-
}
|
|
1482
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1483
|
-
.toList()
|
|
1484
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1485
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1486
|
-
.toList()
|
|
1487
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1488
|
-
return parameters.resource;
|
|
1489
|
-
};
|
|
1490
|
-
Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
|
|
1491
|
-
Ontology.$toString = (_ontology) => `Ontology(${JSON.stringify(Ontology.toStringRecord(_ontology))})`;
|
|
1492
1211
|
Ontology.toStringRecord = (_ontology) => $compactRecord({
|
|
1493
1212
|
$identifier: _ontology.$identifier().toString(),
|
|
1494
1213
|
label: _ontology.label.map((item) => item.toString()).extract(),
|
|
@@ -1496,17 +1215,6 @@ export var Ontology;
|
|
|
1496
1215
|
})(Ontology || (Ontology = {}));
|
|
1497
1216
|
export var PropertyGroup;
|
|
1498
1217
|
(function (PropertyGroup) {
|
|
1499
|
-
PropertyGroup.create = (parameters) => $sequenceRecord({
|
|
1500
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1501
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1502
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1503
|
-
})
|
|
1504
|
-
.map((properties) => ({ ...properties, $type: "PropertyGroup" }))
|
|
1505
|
-
.map((object) => $monkeyPatchObject(object, { $toString: PropertyGroup.$toString }));
|
|
1506
|
-
function createUnsafe(parameters) {
|
|
1507
|
-
return PropertyGroup.create(parameters).unsafeCoerce();
|
|
1508
|
-
}
|
|
1509
|
-
PropertyGroup.createUnsafe = createUnsafe;
|
|
1510
1218
|
PropertyGroup._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
1511
1219
|
? $ensureRdfResourceType(resource, [PropertyGroup.schema.fromRdfType], {
|
|
1512
1220
|
graph: options.graph,
|
|
@@ -1533,6 +1241,18 @@ export var PropertyGroup;
|
|
|
1533
1241
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1534
1242
|
}),
|
|
1535
1243
|
}).chain((properties) => PropertyGroup.create(properties)));
|
|
1244
|
+
PropertyGroup.$toString = (_propertyGroup) => `PropertyGroup(${JSON.stringify(PropertyGroup.toStringRecord(_propertyGroup))})`;
|
|
1245
|
+
PropertyGroup.create = (parameters) => $sequenceRecord({
|
|
1246
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1247
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1248
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1249
|
+
})
|
|
1250
|
+
.map((properties) => ({ ...properties, $type: "PropertyGroup" }))
|
|
1251
|
+
.map((object) => $monkeyPatchObject(object, { $toString: PropertyGroup.$toString }));
|
|
1252
|
+
function createUnsafe(parameters) {
|
|
1253
|
+
return PropertyGroup.create(parameters).unsafeCoerce();
|
|
1254
|
+
}
|
|
1255
|
+
PropertyGroup.createUnsafe = createUnsafe;
|
|
1536
1256
|
PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
|
|
1537
1257
|
PropertyGroup.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
1538
1258
|
.toResource()
|
|
@@ -1572,20 +1292,6 @@ export var PropertyGroup;
|
|
|
1572
1292
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"),
|
|
1573
1293
|
],
|
|
1574
1294
|
};
|
|
1575
|
-
PropertyGroup._toRdfResource = (parameters) => {
|
|
1576
|
-
if (!parameters.ignoreRdfType) {
|
|
1577
|
-
parameters.resource.add($RdfVocabularies.rdf.type, PropertyGroup.schema.toRdfTypes, parameters.graph);
|
|
1578
|
-
}
|
|
1579
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1580
|
-
.toList()
|
|
1581
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1582
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1583
|
-
.toList()
|
|
1584
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1585
|
-
return parameters.resource;
|
|
1586
|
-
};
|
|
1587
|
-
PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
|
|
1588
|
-
PropertyGroup.$toString = (_propertyGroup) => `PropertyGroup(${JSON.stringify(PropertyGroup.toStringRecord(_propertyGroup))})`;
|
|
1589
1295
|
PropertyGroup.toStringRecord = (_propertyGroup) => $compactRecord({
|
|
1590
1296
|
$identifier: _propertyGroup.$identifier().toString(),
|
|
1591
1297
|
label: _propertyGroup.label.map((item) => item.toString()).extract(),
|
|
@@ -1593,66 +1299,6 @@ export var PropertyGroup;
|
|
|
1593
1299
|
})(PropertyGroup || (PropertyGroup = {}));
|
|
1594
1300
|
export var PropertyShape;
|
|
1595
1301
|
(function (PropertyShape) {
|
|
1596
|
-
PropertyShape.create = (parameters) => $sequenceRecord({
|
|
1597
|
-
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
1598
|
-
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
1599
|
-
classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
1600
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1601
|
-
datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
1602
|
-
deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
1603
|
-
defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
|
|
1604
|
-
description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
|
|
1605
|
-
disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
|
|
1606
|
-
display: $convertWithDefaultValue($identityConversionFunction, false)(parameters.display),
|
|
1607
|
-
equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
|
|
1608
|
-
flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
1609
|
-
groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
|
|
1610
|
-
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
1611
|
-
ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters.ignore),
|
|
1612
|
-
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
1613
|
-
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
1614
|
-
label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1615
|
-
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
1616
|
-
lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
|
|
1617
|
-
lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
|
|
1618
|
-
maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
|
|
1619
|
-
maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
1620
|
-
maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
1621
|
-
maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
1622
|
-
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
1623
|
-
minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
|
|
1624
|
-
minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
1625
|
-
minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
1626
|
-
minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
1627
|
-
mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
|
|
1628
|
-
name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
|
|
1629
|
-
node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
1630
|
-
nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
1631
|
-
not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
1632
|
-
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
1633
|
-
order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
|
|
1634
|
-
path: Either.of(parameters.path),
|
|
1635
|
-
pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
1636
|
-
qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
|
|
1637
|
-
qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
|
|
1638
|
-
qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
|
|
1639
|
-
qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
|
|
1640
|
-
resolve: $convertToMaybe($convertToIdentifier)(parameters.resolve).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.resolve.type, value)),
|
|
1641
|
-
severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
1642
|
-
shaclmateName: $convertToMaybe($identityConversionFunction)(parameters.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
|
|
1643
|
-
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
1644
|
-
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
1645
|
-
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
1646
|
-
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
1647
|
-
uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
|
|
1648
|
-
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
1649
|
-
})
|
|
1650
|
-
.map((properties) => ({ ...properties, $type: "PropertyShape" }))
|
|
1651
|
-
.map((object) => $monkeyPatchObject(object, { $toString: PropertyShape.$toString }));
|
|
1652
|
-
function createUnsafe(parameters) {
|
|
1653
|
-
return PropertyShape.create(parameters).unsafeCoerce();
|
|
1654
|
-
}
|
|
1655
|
-
PropertyShape.createUnsafe = createUnsafe;
|
|
1656
1302
|
PropertyShape._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
1657
1303
|
? $ensureRdfResourceType(resource, [PropertyShape.schema.fromRdfType], {
|
|
1658
1304
|
graph: options.graph,
|
|
@@ -2022,6 +1668,67 @@ export var PropertyShape;
|
|
|
2022
1668
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
2023
1669
|
}),
|
|
2024
1670
|
}).chain((properties) => PropertyShape.create(properties)));
|
|
1671
|
+
PropertyShape.$toString = (_propertyShape) => `PropertyShape(${JSON.stringify(PropertyShape.toStringRecord(_propertyShape))})`;
|
|
1672
|
+
PropertyShape.create = (parameters) => $sequenceRecord({
|
|
1673
|
+
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
1674
|
+
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
1675
|
+
classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
1676
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1677
|
+
datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
1678
|
+
deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
1679
|
+
defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
|
|
1680
|
+
description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
|
|
1681
|
+
disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
|
|
1682
|
+
display: $convertWithDefaultValue($identityConversionFunction, false)(parameters.display),
|
|
1683
|
+
equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
|
|
1684
|
+
flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
1685
|
+
groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
|
|
1686
|
+
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
1687
|
+
ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters.ignore),
|
|
1688
|
+
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
1689
|
+
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
1690
|
+
label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1691
|
+
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
1692
|
+
lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
|
|
1693
|
+
lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
|
|
1694
|
+
maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
|
|
1695
|
+
maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
1696
|
+
maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
1697
|
+
maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
1698
|
+
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
1699
|
+
minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
|
|
1700
|
+
minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
1701
|
+
minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
1702
|
+
minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
1703
|
+
mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
|
|
1704
|
+
name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
|
|
1705
|
+
node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
1706
|
+
nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
1707
|
+
not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
1708
|
+
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
1709
|
+
order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
|
|
1710
|
+
path: Either.of(parameters.path),
|
|
1711
|
+
pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
1712
|
+
qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
|
|
1713
|
+
qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
|
|
1714
|
+
qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
|
|
1715
|
+
qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
|
|
1716
|
+
resolve: $convertToMaybe($convertToIdentifier)(parameters.resolve).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.resolve.type, value)),
|
|
1717
|
+
severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
1718
|
+
shaclmateName: $convertToMaybe($identityConversionFunction)(parameters.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
|
|
1719
|
+
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
1720
|
+
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
1721
|
+
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
1722
|
+
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
1723
|
+
uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
|
|
1724
|
+
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
1725
|
+
})
|
|
1726
|
+
.map((properties) => ({ ...properties, $type: "PropertyShape" }))
|
|
1727
|
+
.map((object) => $monkeyPatchObject(object, { $toString: PropertyShape.$toString }));
|
|
1728
|
+
function createUnsafe(parameters) {
|
|
1729
|
+
return PropertyShape.create(parameters).unsafeCoerce();
|
|
1730
|
+
}
|
|
1731
|
+
PropertyShape.createUnsafe = createUnsafe;
|
|
2025
1732
|
PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
|
|
2026
1733
|
PropertyShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
2027
1734
|
.toResource()
|
|
@@ -2396,14 +2103,7 @@ export var PropertyShape;
|
|
|
2396
2103
|
return {
|
|
2397
2104
|
kind: "Option",
|
|
2398
2105
|
get itemType() {
|
|
2399
|
-
return
|
|
2400
|
-
kind: "Iri",
|
|
2401
|
-
in: [
|
|
2402
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
2403
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
2404
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
2405
|
-
],
|
|
2406
|
-
};
|
|
2106
|
+
return Severity.schema;
|
|
2407
2107
|
},
|
|
2408
2108
|
};
|
|
2409
2109
|
},
|
|
@@ -2463,243 +2163,6 @@ export var PropertyShape;
|
|
|
2463
2163
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"),
|
|
2464
2164
|
],
|
|
2465
2165
|
};
|
|
2466
|
-
PropertyShape._toRdfResource = (parameters) => {
|
|
2467
|
-
if (!parameters.ignoreRdfType) {
|
|
2468
|
-
parameters.resource.add($RdfVocabularies.rdf.type, PropertyShape.schema.toRdfTypes, parameters.graph);
|
|
2469
|
-
}
|
|
2470
|
-
parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
|
|
2471
|
-
value.length > 0
|
|
2472
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2473
|
-
if (itemIndex === 0) {
|
|
2474
|
-
currentSubListResource = listResource;
|
|
2475
|
-
}
|
|
2476
|
-
else {
|
|
2477
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2478
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2479
|
-
currentSubListResource = newSubListResource;
|
|
2480
|
-
}
|
|
2481
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2482
|
-
if (itemIndex + 1 === list.length) {
|
|
2483
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2484
|
-
}
|
|
2485
|
-
return { currentSubListResource, listResource };
|
|
2486
|
-
}, {
|
|
2487
|
-
currentSubListResource: null,
|
|
2488
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2489
|
-
}).listResource.identifier
|
|
2490
|
-
: $RdfVocabularies.rdf.nil,
|
|
2491
|
-
]), parameters.graph);
|
|
2492
|
-
parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
2493
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
2494
|
-
.toList()
|
|
2495
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2496
|
-
parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
2497
|
-
parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
|
|
2498
|
-
.toList()
|
|
2499
|
-
.flatMap((value) => [
|
|
2500
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2501
|
-
]), parameters.graph);
|
|
2502
|
-
parameters.resource.add(PropertyShape.schema.properties.defaultValue.path, parameters.object.defaultValue.toList(), parameters.graph);
|
|
2503
|
-
parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
|
|
2504
|
-
.toList()
|
|
2505
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2506
|
-
parameters.resource.add(PropertyShape.schema.properties.disjoint.path, parameters.object.disjoint.flatMap((item) => [item]), parameters.graph);
|
|
2507
|
-
parameters.resource.add(PropertyShape.schema.properties.display.path, $strictEquals(parameters.object.display, false).isLeft()
|
|
2508
|
-
? [
|
|
2509
|
-
$literalFactory.boolean(parameters.object.display, $RdfVocabularies.xsd.boolean),
|
|
2510
|
-
]
|
|
2511
|
-
: [], parameters.graph);
|
|
2512
|
-
parameters.resource.add(PropertyShape.schema.properties.equals.path, parameters.object.equals.flatMap((item) => [item]), parameters.graph);
|
|
2513
|
-
parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
|
|
2514
|
-
.toList()
|
|
2515
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2516
|
-
parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
|
|
2517
|
-
parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
2518
|
-
parameters.resource.add(NodeShape.schema.properties.ignore.path, $strictEquals(parameters.object.ignore, false).isLeft()
|
|
2519
|
-
? [
|
|
2520
|
-
$literalFactory.boolean(parameters.object.ignore, $RdfVocabularies.xsd.boolean),
|
|
2521
|
-
]
|
|
2522
|
-
: [], parameters.graph);
|
|
2523
|
-
parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
|
|
2524
|
-
value.length > 0
|
|
2525
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2526
|
-
if (itemIndex === 0) {
|
|
2527
|
-
currentSubListResource = listResource;
|
|
2528
|
-
}
|
|
2529
|
-
else {
|
|
2530
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2531
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2532
|
-
currentSubListResource = newSubListResource;
|
|
2533
|
-
}
|
|
2534
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2535
|
-
if (itemIndex + 1 === list.length) {
|
|
2536
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2537
|
-
}
|
|
2538
|
-
return { currentSubListResource, listResource };
|
|
2539
|
-
}, {
|
|
2540
|
-
currentSubListResource: null,
|
|
2541
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2542
|
-
}).listResource.identifier
|
|
2543
|
-
: $RdfVocabularies.rdf.nil,
|
|
2544
|
-
]), parameters.graph);
|
|
2545
|
-
parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
2546
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
2547
|
-
.toList()
|
|
2548
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2549
|
-
parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
2550
|
-
value.length > 0
|
|
2551
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2552
|
-
if (itemIndex === 0) {
|
|
2553
|
-
currentSubListResource = listResource;
|
|
2554
|
-
}
|
|
2555
|
-
else {
|
|
2556
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2557
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2558
|
-
currentSubListResource = newSubListResource;
|
|
2559
|
-
}
|
|
2560
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
2561
|
-
if (itemIndex + 1 === list.length) {
|
|
2562
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2563
|
-
}
|
|
2564
|
-
return { currentSubListResource, listResource };
|
|
2565
|
-
}, {
|
|
2566
|
-
currentSubListResource: null,
|
|
2567
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2568
|
-
}).listResource.identifier
|
|
2569
|
-
: $RdfVocabularies.rdf.nil,
|
|
2570
|
-
]), parameters.graph);
|
|
2571
|
-
parameters.resource.add(PropertyShape.schema.properties.lessThan.path, parameters.object.lessThan.flatMap((item) => [item]), parameters.graph);
|
|
2572
|
-
parameters.resource.add(PropertyShape.schema.properties.lessThanOrEquals.path, parameters.object.lessThanOrEquals.flatMap((item) => [item]), parameters.graph);
|
|
2573
|
-
parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
|
|
2574
|
-
.toList()
|
|
2575
|
-
.flatMap((value) => [
|
|
2576
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2577
|
-
]), parameters.graph);
|
|
2578
|
-
parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
|
|
2579
|
-
parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
|
|
2580
|
-
parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
|
|
2581
|
-
.toList()
|
|
2582
|
-
.flatMap((value) => [
|
|
2583
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2584
|
-
]), parameters.graph);
|
|
2585
|
-
parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
|
|
2586
|
-
.toList()
|
|
2587
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2588
|
-
parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
|
|
2589
|
-
.toList()
|
|
2590
|
-
.flatMap((value) => [
|
|
2591
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2592
|
-
]), parameters.graph);
|
|
2593
|
-
parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
|
|
2594
|
-
parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
|
|
2595
|
-
parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
|
|
2596
|
-
.toList()
|
|
2597
|
-
.flatMap((value) => [
|
|
2598
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2599
|
-
]), parameters.graph);
|
|
2600
|
-
parameters.resource.add(NodeShape.schema.properties.mutable.path, parameters.object.mutable
|
|
2601
|
-
.toList()
|
|
2602
|
-
.flatMap((value) => [
|
|
2603
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2604
|
-
]), parameters.graph);
|
|
2605
|
-
parameters.resource.add(PropertyShape.schema.properties.name.path, parameters.object.name
|
|
2606
|
-
.toList()
|
|
2607
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2608
|
-
parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
|
|
2609
|
-
parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
2610
|
-
parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
2611
|
-
parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
2612
|
-
value.length > 0
|
|
2613
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2614
|
-
if (itemIndex === 0) {
|
|
2615
|
-
currentSubListResource = listResource;
|
|
2616
|
-
}
|
|
2617
|
-
else {
|
|
2618
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2619
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2620
|
-
currentSubListResource = newSubListResource;
|
|
2621
|
-
}
|
|
2622
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2623
|
-
if (itemIndex + 1 === list.length) {
|
|
2624
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2625
|
-
}
|
|
2626
|
-
return { currentSubListResource, listResource };
|
|
2627
|
-
}, {
|
|
2628
|
-
currentSubListResource: null,
|
|
2629
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2630
|
-
}).listResource.identifier
|
|
2631
|
-
: $RdfVocabularies.rdf.nil,
|
|
2632
|
-
]), parameters.graph);
|
|
2633
|
-
parameters.resource.add(PropertyShape.schema.properties.order.path, parameters.object.order
|
|
2634
|
-
.toList()
|
|
2635
|
-
.flatMap((value) => [
|
|
2636
|
-
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
2637
|
-
]), parameters.graph);
|
|
2638
|
-
parameters.resource.add(PropertyShape.schema.properties.path.path, [
|
|
2639
|
-
$PropertyPath.toRdfResource(parameters.object.path, {
|
|
2640
|
-
graph: parameters.graph,
|
|
2641
|
-
resourceSet: parameters.resourceSet,
|
|
2642
|
-
}).identifier,
|
|
2643
|
-
], parameters.graph);
|
|
2644
|
-
parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
|
|
2645
|
-
.toList()
|
|
2646
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2647
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedMaxCount.path, parameters.object.qualifiedMaxCount
|
|
2648
|
-
.toList()
|
|
2649
|
-
.flatMap((value) => [
|
|
2650
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2651
|
-
]), parameters.graph);
|
|
2652
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedMinCount.path, parameters.object.qualifiedMinCount
|
|
2653
|
-
.toList()
|
|
2654
|
-
.flatMap((value) => [
|
|
2655
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2656
|
-
]), parameters.graph);
|
|
2657
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShape.path, parameters.object.qualifiedValueShape.toList(), parameters.graph);
|
|
2658
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.path, parameters.object.qualifiedValueShapesDisjoint
|
|
2659
|
-
.toList()
|
|
2660
|
-
.flatMap((value) => [
|
|
2661
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2662
|
-
]), parameters.graph);
|
|
2663
|
-
parameters.resource.add(PropertyShape.schema.properties.resolve.path, parameters.object.resolve.toList(), parameters.graph);
|
|
2664
|
-
parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
|
|
2665
|
-
parameters.resource.add(NodeShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
|
|
2666
|
-
.toList()
|
|
2667
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2668
|
-
parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
|
|
2669
|
-
parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
|
|
2670
|
-
parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
2671
|
-
parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
2672
|
-
parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
|
|
2673
|
-
.toList()
|
|
2674
|
-
.flatMap((value) => [
|
|
2675
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2676
|
-
]), parameters.graph);
|
|
2677
|
-
parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
|
|
2678
|
-
value.length > 0
|
|
2679
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2680
|
-
if (itemIndex === 0) {
|
|
2681
|
-
currentSubListResource = listResource;
|
|
2682
|
-
}
|
|
2683
|
-
else {
|
|
2684
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2685
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2686
|
-
currentSubListResource = newSubListResource;
|
|
2687
|
-
}
|
|
2688
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2689
|
-
if (itemIndex + 1 === list.length) {
|
|
2690
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2691
|
-
}
|
|
2692
|
-
return { currentSubListResource, listResource };
|
|
2693
|
-
}, {
|
|
2694
|
-
currentSubListResource: null,
|
|
2695
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2696
|
-
}).listResource.identifier
|
|
2697
|
-
: $RdfVocabularies.rdf.nil,
|
|
2698
|
-
]), parameters.graph);
|
|
2699
|
-
return parameters.resource;
|
|
2700
|
-
};
|
|
2701
|
-
PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
|
|
2702
|
-
PropertyShape.$toString = (_propertyShape) => `PropertyShape(${JSON.stringify(PropertyShape.toStringRecord(_propertyShape))})`;
|
|
2703
2166
|
PropertyShape.toStringRecord = (_propertyShape) => $compactRecord({
|
|
2704
2167
|
$identifier: _propertyShape.$identifier().toString(),
|
|
2705
2168
|
label: _propertyShape.label.map((item) => item.toString()).extract(),
|
|
@@ -2710,23 +2173,21 @@ export var PropertyShape;
|
|
|
2710
2173
|
.extract(),
|
|
2711
2174
|
});
|
|
2712
2175
|
})(PropertyShape || (PropertyShape = {}));
|
|
2176
|
+
export var Severity;
|
|
2177
|
+
(function (Severity) {
|
|
2178
|
+
const inValues = [
|
|
2179
|
+
"http://www.w3.org/ns/shacl#Info",
|
|
2180
|
+
"http://www.w3.org/ns/shacl#Warning",
|
|
2181
|
+
"http://www.w3.org/ns/shacl#Violation",
|
|
2182
|
+
];
|
|
2183
|
+
Severity.schema = {
|
|
2184
|
+
kind: "Iri",
|
|
2185
|
+
in: inValues.map((inValue) => dataFactory.namedNode(inValue)),
|
|
2186
|
+
inValues,
|
|
2187
|
+
};
|
|
2188
|
+
})(Severity || (Severity = {}));
|
|
2713
2189
|
export var ValidationReport;
|
|
2714
2190
|
(function (ValidationReport) {
|
|
2715
|
-
ValidationReport.create = (parameters) => $sequenceRecord({
|
|
2716
|
-
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
2717
|
-
conforms: Either.of(parameters.conforms),
|
|
2718
|
-
results: $convertToScalarSet($identityConversionFunction, true)(parameters.results).chain((value) => $validateArray($identityValidationFunction, true)(ValidationReport.schema.properties.results.type, value)),
|
|
2719
|
-
shapesGraphWellFormed: $convertToMaybe($identityConversionFunction)(parameters.shapesGraphWellFormed).chain((value) => $validateMaybe($identityValidationFunction)(ValidationReport.schema.properties.shapesGraphWellFormed.type, value)),
|
|
2720
|
-
})
|
|
2721
|
-
.map((properties) => ({
|
|
2722
|
-
...properties,
|
|
2723
|
-
$type: "ValidationReport",
|
|
2724
|
-
}))
|
|
2725
|
-
.map((object) => $monkeyPatchObject(object, { $toString: ValidationReport.$toString }));
|
|
2726
|
-
function createUnsafe(parameters) {
|
|
2727
|
-
return ValidationReport.create(parameters).unsafeCoerce();
|
|
2728
|
-
}
|
|
2729
|
-
ValidationReport.createUnsafe = createUnsafe;
|
|
2730
2191
|
ValidationReport._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
2731
2192
|
? $ensureRdfResourceType(resource, [ValidationReport.schema.fromRdfType], { graph: options.graph })
|
|
2732
2193
|
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
@@ -2758,6 +2219,22 @@ export var ValidationReport;
|
|
|
2758
2219
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
2759
2220
|
}),
|
|
2760
2221
|
}).chain((properties) => ValidationReport.create(properties)));
|
|
2222
|
+
ValidationReport.$toString = (_validationReport) => `ValidationReport(${JSON.stringify(ValidationReport.toStringRecord(_validationReport))})`;
|
|
2223
|
+
ValidationReport.create = (parameters) => $sequenceRecord({
|
|
2224
|
+
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
2225
|
+
conforms: Either.of(parameters.conforms),
|
|
2226
|
+
results: $convertToScalarSet($identityConversionFunction, true)(parameters.results).chain((value) => $validateArray($identityValidationFunction, true)(ValidationReport.schema.properties.results.type, value)),
|
|
2227
|
+
shapesGraphWellFormed: $convertToMaybe($identityConversionFunction)(parameters.shapesGraphWellFormed).chain((value) => $validateMaybe($identityValidationFunction)(ValidationReport.schema.properties.shapesGraphWellFormed.type, value)),
|
|
2228
|
+
})
|
|
2229
|
+
.map((properties) => ({
|
|
2230
|
+
...properties,
|
|
2231
|
+
$type: "ValidationReport",
|
|
2232
|
+
}))
|
|
2233
|
+
.map((object) => $monkeyPatchObject(object, { $toString: ValidationReport.$toString }));
|
|
2234
|
+
function createUnsafe(parameters) {
|
|
2235
|
+
return ValidationReport.create(parameters).unsafeCoerce();
|
|
2236
|
+
}
|
|
2237
|
+
ValidationReport.createUnsafe = createUnsafe;
|
|
2761
2238
|
ValidationReport.fromRdfResource = $wrap_FromRdfResourceFunction(ValidationReport._fromRdfResource);
|
|
2762
2239
|
ValidationReport.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
2763
2240
|
.toResource()
|
|
@@ -2806,52 +2283,10 @@ export var ValidationReport;
|
|
|
2806
2283
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#ValidationReport"),
|
|
2807
2284
|
],
|
|
2808
2285
|
};
|
|
2809
|
-
ValidationReport._toRdfResource = (parameters) => {
|
|
2810
|
-
if (!parameters.ignoreRdfType) {
|
|
2811
|
-
parameters.resource.add($RdfVocabularies.rdf.type, ValidationReport.schema.toRdfTypes, parameters.graph);
|
|
2812
|
-
}
|
|
2813
|
-
parameters.resource.add(ValidationReport.schema.properties.conforms.path, [
|
|
2814
|
-
$literalFactory.boolean(parameters.object.conforms, $RdfVocabularies.xsd.boolean),
|
|
2815
|
-
], parameters.graph);
|
|
2816
|
-
parameters.resource.add(ValidationReport.schema.properties.results.path, parameters.object.results.flatMap((item) => [
|
|
2817
|
-
ValidationResult.toRdfResource(item, {
|
|
2818
|
-
graph: parameters.graph,
|
|
2819
|
-
resourceSet: parameters.resourceSet,
|
|
2820
|
-
}).identifier,
|
|
2821
|
-
]), parameters.graph);
|
|
2822
|
-
parameters.resource.add(ValidationReport.schema.properties.shapesGraphWellFormed.path, parameters.object.shapesGraphWellFormed
|
|
2823
|
-
.toList()
|
|
2824
|
-
.flatMap((value) => [
|
|
2825
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2826
|
-
]), parameters.graph);
|
|
2827
|
-
return parameters.resource;
|
|
2828
|
-
};
|
|
2829
|
-
ValidationReport.toRdfResource = $wrap_ToRdfResourceFunction(ValidationReport._toRdfResource);
|
|
2830
|
-
ValidationReport.$toString = (_validationReport) => `ValidationReport(${JSON.stringify(ValidationReport.toStringRecord(_validationReport))})`;
|
|
2831
2286
|
ValidationReport.toStringRecord = (_validationReport) => $compactRecord({ $identifier: _validationReport.$identifier().toString() });
|
|
2832
2287
|
})(ValidationReport || (ValidationReport = {}));
|
|
2833
2288
|
export var ValidationResult;
|
|
2834
2289
|
(function (ValidationResult) {
|
|
2835
|
-
ValidationResult.create = (parameters) => $sequenceRecord({
|
|
2836
|
-
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
2837
|
-
details: $convertToScalarSet($identityConversionFunction, true)(parameters.details).chain((value) => $validateArray($identityValidationFunction, true)(ValidationResult.schema.properties.details.type, value)),
|
|
2838
|
-
focusNode: Either.of(parameters.focusNode),
|
|
2839
|
-
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.message.type, value)),
|
|
2840
|
-
path: $convertToMaybe($identityConversionFunction)(parameters.path).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.path.type, value)),
|
|
2841
|
-
severity: $convertToIri(parameters.severity),
|
|
2842
|
-
sourceConstraintComponent: $convertToIri(parameters.sourceConstraintComponent),
|
|
2843
|
-
sourceShape: $convertToMaybe($convertToIdentifier)(parameters.sourceShape).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.sourceShape.type, value)),
|
|
2844
|
-
value: $convertToMaybe($identityConversionFunction)(parameters.value).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.value.type, value)),
|
|
2845
|
-
})
|
|
2846
|
-
.map((properties) => ({
|
|
2847
|
-
...properties,
|
|
2848
|
-
$type: "ValidationResult",
|
|
2849
|
-
}))
|
|
2850
|
-
.map((object) => $monkeyPatchObject(object, { $toString: ValidationResult.$toString }));
|
|
2851
|
-
function createUnsafe(parameters) {
|
|
2852
|
-
return ValidationResult.create(parameters).unsafeCoerce();
|
|
2853
|
-
}
|
|
2854
|
-
ValidationResult.createUnsafe = createUnsafe;
|
|
2855
2290
|
ValidationResult._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
2856
2291
|
? $ensureRdfResourceType(resource, [ValidationResult.schema.fromRdfType], { graph: options.graph })
|
|
2857
2292
|
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
@@ -2918,6 +2353,27 @@ export var ValidationResult;
|
|
|
2918
2353
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($termFromRdfResourceValues)),
|
|
2919
2354
|
}),
|
|
2920
2355
|
}).chain((properties) => ValidationResult.create(properties)));
|
|
2356
|
+
ValidationResult.$toString = (_validationResult) => `ValidationResult(${JSON.stringify(ValidationResult.toStringRecord(_validationResult))})`;
|
|
2357
|
+
ValidationResult.create = (parameters) => $sequenceRecord({
|
|
2358
|
+
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
2359
|
+
details: $convertToScalarSet($identityConversionFunction, true)(parameters.details).chain((value) => $validateArray($identityValidationFunction, true)(ValidationResult.schema.properties.details.type, value)),
|
|
2360
|
+
focusNode: Either.of(parameters.focusNode),
|
|
2361
|
+
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.message.type, value)),
|
|
2362
|
+
path: $convertToMaybe($identityConversionFunction)(parameters.path).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.path.type, value)),
|
|
2363
|
+
severity: $convertToIri(parameters.severity),
|
|
2364
|
+
sourceConstraintComponent: $convertToIri(parameters.sourceConstraintComponent),
|
|
2365
|
+
sourceShape: $convertToMaybe($convertToIdentifier)(parameters.sourceShape).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.sourceShape.type, value)),
|
|
2366
|
+
value: $convertToMaybe($identityConversionFunction)(parameters.value).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.value.type, value)),
|
|
2367
|
+
})
|
|
2368
|
+
.map((properties) => ({
|
|
2369
|
+
...properties,
|
|
2370
|
+
$type: "ValidationResult",
|
|
2371
|
+
}))
|
|
2372
|
+
.map((object) => $monkeyPatchObject(object, { $toString: ValidationResult.$toString }));
|
|
2373
|
+
function createUnsafe(parameters) {
|
|
2374
|
+
return ValidationResult.create(parameters).unsafeCoerce();
|
|
2375
|
+
}
|
|
2376
|
+
ValidationResult.createUnsafe = createUnsafe;
|
|
2921
2377
|
ValidationResult.fromRdfResource = $wrap_FromRdfResourceFunction(ValidationResult._fromRdfResource);
|
|
2922
2378
|
ValidationResult.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
2923
2379
|
.toResource()
|
|
@@ -2979,14 +2435,7 @@ export var ValidationResult;
|
|
|
2979
2435
|
kind: "Shacl",
|
|
2980
2436
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#resultSeverity"),
|
|
2981
2437
|
get type() {
|
|
2982
|
-
return
|
|
2983
|
-
kind: "Iri",
|
|
2984
|
-
in: [
|
|
2985
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
2986
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
2987
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
2988
|
-
],
|
|
2989
|
-
};
|
|
2438
|
+
return Severity.schema;
|
|
2990
2439
|
},
|
|
2991
2440
|
},
|
|
2992
2441
|
sourceConstraintComponent: {
|
|
@@ -3018,29 +2467,6 @@ export var ValidationResult;
|
|
|
3018
2467
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#ValidationResult"),
|
|
3019
2468
|
],
|
|
3020
2469
|
};
|
|
3021
|
-
ValidationResult._toRdfResource = (parameters) => {
|
|
3022
|
-
if (!parameters.ignoreRdfType) {
|
|
3023
|
-
parameters.resource.add($RdfVocabularies.rdf.type, ValidationResult.schema.toRdfTypes, parameters.graph);
|
|
3024
|
-
}
|
|
3025
|
-
parameters.resource.add(ValidationResult.schema.properties.details.path, parameters.object.details.flatMap((item) => [item]), parameters.graph);
|
|
3026
|
-
parameters.resource.add(ValidationResult.schema.properties.focusNode.path, [parameters.object.focusNode], parameters.graph);
|
|
3027
|
-
parameters.resource.add(ValidationResult.schema.properties.message.path, parameters.object.message
|
|
3028
|
-
.toList()
|
|
3029
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
3030
|
-
parameters.resource.add(ValidationResult.schema.properties.path.path, parameters.object.path.toList().flatMap((value) => [
|
|
3031
|
-
$PropertyPath.toRdfResource(value, {
|
|
3032
|
-
graph: parameters.graph,
|
|
3033
|
-
resourceSet: parameters.resourceSet,
|
|
3034
|
-
}).identifier,
|
|
3035
|
-
]), parameters.graph);
|
|
3036
|
-
parameters.resource.add(ValidationResult.schema.properties.severity.path, [parameters.object.severity], parameters.graph);
|
|
3037
|
-
parameters.resource.add(ValidationResult.schema.properties.sourceConstraintComponent.path, [parameters.object.sourceConstraintComponent], parameters.graph);
|
|
3038
|
-
parameters.resource.add(ValidationResult.schema.properties.sourceShape.path, parameters.object.sourceShape.toList(), parameters.graph);
|
|
3039
|
-
parameters.resource.add(ValidationResult.schema.properties.value.path, parameters.object.value.toList(), parameters.graph);
|
|
3040
|
-
return parameters.resource;
|
|
3041
|
-
};
|
|
3042
|
-
ValidationResult.toRdfResource = $wrap_ToRdfResourceFunction(ValidationResult._toRdfResource);
|
|
3043
|
-
ValidationResult.$toString = (_validationResult) => `ValidationResult(${JSON.stringify(ValidationResult.toStringRecord(_validationResult))})`;
|
|
3044
2470
|
ValidationResult.toStringRecord = (_validationResult) => $compactRecord({ $identifier: _validationResult.$identifier().toString() });
|
|
3045
2471
|
})(ValidationResult || (ValidationResult = {}));
|
|
3046
2472
|
export var Shape;
|
|
@@ -3319,14 +2745,7 @@ export var Shape;
|
|
|
3319
2745
|
return {
|
|
3320
2746
|
kind: "Option",
|
|
3321
2747
|
get itemType() {
|
|
3322
|
-
return
|
|
3323
|
-
kind: "Iri",
|
|
3324
|
-
in: [
|
|
3325
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
3326
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
3327
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
3328
|
-
],
|
|
3329
|
-
};
|
|
2748
|
+
return Severity.schema;
|
|
3330
2749
|
},
|
|
3331
2750
|
};
|
|
3332
2751
|
},
|
|
@@ -3375,56 +2794,9 @@ export var Shape;
|
|
|
3375
2794
|
},
|
|
3376
2795
|
},
|
|
3377
2796
|
};
|
|
3378
|
-
Shape.toRdfResource = (object, options) => {
|
|
3379
|
-
if (NodeShape.isNodeShape(object)) {
|
|
3380
|
-
return NodeShape.toRdfResource(object, options);
|
|
3381
|
-
}
|
|
3382
|
-
if (PropertyShape.isPropertyShape(object)) {
|
|
3383
|
-
return PropertyShape.toRdfResource(object, options);
|
|
3384
|
-
}
|
|
3385
|
-
throw new Error("unrecognized type");
|
|
3386
|
-
};
|
|
3387
|
-
Shape.toRdfResourceValues = ((value, _options) => {
|
|
3388
|
-
if (NodeShape.isNodeShape(value)) {
|
|
3389
|
-
return [
|
|
3390
|
-
NodeShape.toRdfResource(value, {
|
|
3391
|
-
graph: _options.graph,
|
|
3392
|
-
resourceSet: _options.resourceSet,
|
|
3393
|
-
}).identifier,
|
|
3394
|
-
];
|
|
3395
|
-
}
|
|
3396
|
-
if (PropertyShape.isPropertyShape(value)) {
|
|
3397
|
-
return [
|
|
3398
|
-
PropertyShape.toRdfResource(value, {
|
|
3399
|
-
graph: _options.graph,
|
|
3400
|
-
resourceSet: _options.resourceSet,
|
|
3401
|
-
}).identifier,
|
|
3402
|
-
];
|
|
3403
|
-
}
|
|
3404
|
-
throw new Error("unable to serialize to RDF");
|
|
3405
|
-
});
|
|
3406
2797
|
})(Shape || (Shape = {}));
|
|
3407
2798
|
export var $Object;
|
|
3408
2799
|
(function ($Object) {
|
|
3409
|
-
$Object.toRdfResource = (object, options) => {
|
|
3410
|
-
switch (object.$type) {
|
|
3411
|
-
case "NodeShape":
|
|
3412
|
-
return NodeShape.toRdfResource(object, options);
|
|
3413
|
-
case "Ontology":
|
|
3414
|
-
return Ontology.toRdfResource(object, options);
|
|
3415
|
-
case "PropertyGroup":
|
|
3416
|
-
return PropertyGroup.toRdfResource(object, options);
|
|
3417
|
-
case "PropertyShape":
|
|
3418
|
-
return PropertyShape.toRdfResource(object, options);
|
|
3419
|
-
case "ValidationReport":
|
|
3420
|
-
return ValidationReport.toRdfResource(object, options);
|
|
3421
|
-
case "ValidationResult":
|
|
3422
|
-
return ValidationResult.toRdfResource(object, options);
|
|
3423
|
-
default:
|
|
3424
|
-
object;
|
|
3425
|
-
throw new Error("should never reach this point");
|
|
3426
|
-
}
|
|
3427
|
-
};
|
|
3428
2800
|
function $toString(object) {
|
|
3429
2801
|
switch (object.$type) {
|
|
3430
2802
|
case "NodeShape":
|