@shaclmate/shacl-ast 4.0.72 → 4.0.74
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/AbstractShapesGraph.d.ts +7 -43
- package/dist/AbstractShapesGraph.js +207 -283
- package/dist/ShapesGraph.d.ts +8 -16
- package/dist/ShapesGraph.js +5 -36
- package/dist/shacl-ast.shaclmate.d.ts +41 -70
- package/dist/shacl-ast.shaclmate.js +180 -742
- package/package.json +4 -5
|
@@ -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) {
|
|
@@ -187,7 +186,6 @@ export var $PropertyPath;
|
|
|
187
186
|
.toResource()
|
|
188
187
|
.chain((resource) => $PropertyPath.fromRdfResource(resource, options)));
|
|
189
188
|
$PropertyPath.schema = {};
|
|
190
|
-
$PropertyPath.toRdfResource = RdfxResourcePropertyPath.toResource;
|
|
191
189
|
$PropertyPath.$toString = RdfxResourcePropertyPath.toString;
|
|
192
190
|
})($PropertyPath || ($PropertyPath = {}));
|
|
193
191
|
function $rdfResourceIdentifierValues(resource) {
|
|
@@ -216,6 +214,7 @@ var $RdfVocabularies;
|
|
|
216
214
|
byte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#byte"),
|
|
217
215
|
date: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#date"),
|
|
218
216
|
dateTime: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),
|
|
217
|
+
dateTimeStamp: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTimeStamp"),
|
|
219
218
|
decimal: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),
|
|
220
219
|
double: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#double"),
|
|
221
220
|
float: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float"),
|
|
@@ -368,71 +367,8 @@ function $wrap_FromRdfResourceFunction(_fromRdfResourceFunction) {
|
|
|
368
367
|
});
|
|
369
368
|
};
|
|
370
369
|
}
|
|
371
|
-
function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
|
|
372
|
-
return (object, options) => {
|
|
373
|
-
let { graph, ignoreRdfType = false, resourceSet } = options ?? {};
|
|
374
|
-
if (!resourceSet) {
|
|
375
|
-
resourceSet = new ResourceSet({
|
|
376
|
-
dataFactory: dataFactory,
|
|
377
|
-
dataset: datasetFactory.dataset(),
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
const resource = resourceSet.resource(object.$identifier());
|
|
381
|
-
_toRdfResourceFunction({
|
|
382
|
-
graph,
|
|
383
|
-
ignoreRdfType,
|
|
384
|
-
object,
|
|
385
|
-
resource,
|
|
386
|
-
resourceSet,
|
|
387
|
-
});
|
|
388
|
-
return resource;
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
370
|
export var NodeShape;
|
|
392
371
|
(function (NodeShape) {
|
|
393
|
-
NodeShape.create = (parameters) => $sequenceRecord({
|
|
394
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
395
|
-
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
396
|
-
classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
397
|
-
closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
|
|
398
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
399
|
-
datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
400
|
-
deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
401
|
-
flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
402
|
-
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
403
|
-
ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
|
|
404
|
-
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
405
|
-
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
406
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
407
|
-
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
408
|
-
maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
409
|
-
maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
410
|
-
maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
411
|
-
message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
412
|
-
minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
413
|
-
minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
414
|
-
minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
415
|
-
node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
416
|
-
nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
417
|
-
not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
418
|
-
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
419
|
-
pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
420
|
-
properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
|
|
421
|
-
severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
422
|
-
subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
|
|
423
|
-
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
424
|
-
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
425
|
-
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
426
|
-
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
427
|
-
types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
|
|
428
|
-
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
429
|
-
})
|
|
430
|
-
.map((properties) => ({ ...properties, $type: "NodeShape" }))
|
|
431
|
-
.map((object) => $monkeyPatchObject(object, { $toString: NodeShape.$toString }));
|
|
432
|
-
function createUnsafe(parameters) {
|
|
433
|
-
return NodeShape.create(parameters).unsafeCoerce();
|
|
434
|
-
}
|
|
435
|
-
NodeShape.createUnsafe = createUnsafe;
|
|
436
372
|
NodeShape._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
437
373
|
? $ensureRdfResourceType(resource, [NodeShape.schema.fromRdfType], {
|
|
438
374
|
graph: options.graph,
|
|
@@ -683,6 +619,50 @@ export var NodeShape;
|
|
|
683
619
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
684
620
|
}),
|
|
685
621
|
}).chain((properties) => NodeShape.create(properties)));
|
|
622
|
+
NodeShape.$toString = (_nodeShape) => `NodeShape(${JSON.stringify(NodeShape.toStringRecord(_nodeShape))})`;
|
|
623
|
+
NodeShape.create = (parameters) => $sequenceRecord({
|
|
624
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
625
|
+
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
626
|
+
classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
627
|
+
closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
|
|
628
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
629
|
+
datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
630
|
+
deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
631
|
+
flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
632
|
+
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
633
|
+
ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
|
|
634
|
+
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
635
|
+
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
636
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
637
|
+
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
638
|
+
maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
639
|
+
maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
640
|
+
maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
641
|
+
message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
642
|
+
minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
643
|
+
minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
644
|
+
minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
645
|
+
node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
646
|
+
nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
647
|
+
not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
648
|
+
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
649
|
+
pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
650
|
+
properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
|
|
651
|
+
severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
652
|
+
subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
|
|
653
|
+
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
654
|
+
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
655
|
+
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
656
|
+
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
657
|
+
types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
|
|
658
|
+
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
659
|
+
})
|
|
660
|
+
.map((properties) => ({ ...properties, $type: "NodeShape" }))
|
|
661
|
+
.map((object) => $monkeyPatchObject(object, { $toString: NodeShape.$toString }));
|
|
662
|
+
function createUnsafe(parameters) {
|
|
663
|
+
return NodeShape.create(parameters).unsafeCoerce();
|
|
664
|
+
}
|
|
665
|
+
NodeShape.createUnsafe = createUnsafe;
|
|
686
666
|
NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
|
|
687
667
|
NodeShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
688
668
|
.toResource()
|
|
@@ -938,14 +918,7 @@ export var NodeShape;
|
|
|
938
918
|
return {
|
|
939
919
|
kind: "Option",
|
|
940
920
|
get itemType() {
|
|
941
|
-
return
|
|
942
|
-
kind: "Iri",
|
|
943
|
-
in: [
|
|
944
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
945
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
946
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
947
|
-
],
|
|
948
|
-
};
|
|
921
|
+
return Severity.schema;
|
|
949
922
|
},
|
|
950
923
|
};
|
|
951
924
|
},
|
|
@@ -997,200 +970,6 @@ export var NodeShape;
|
|
|
997
970
|
},
|
|
998
971
|
toRdfTypes: [dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape")],
|
|
999
972
|
};
|
|
1000
|
-
NodeShape._toRdfResource = (parameters) => {
|
|
1001
|
-
if (!parameters.ignoreRdfType) {
|
|
1002
|
-
parameters.resource.add($RdfVocabularies.rdf.type, NodeShape.schema.toRdfTypes, parameters.graph);
|
|
1003
|
-
}
|
|
1004
|
-
parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
|
|
1005
|
-
value.length > 0
|
|
1006
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1007
|
-
if (itemIndex === 0) {
|
|
1008
|
-
currentSubListResource = listResource;
|
|
1009
|
-
}
|
|
1010
|
-
else {
|
|
1011
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1012
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1013
|
-
currentSubListResource = newSubListResource;
|
|
1014
|
-
}
|
|
1015
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1016
|
-
if (itemIndex + 1 === list.length) {
|
|
1017
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1018
|
-
}
|
|
1019
|
-
return { currentSubListResource, listResource };
|
|
1020
|
-
}, {
|
|
1021
|
-
currentSubListResource: null,
|
|
1022
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1023
|
-
}).listResource.identifier
|
|
1024
|
-
: $RdfVocabularies.rdf.nil,
|
|
1025
|
-
]), parameters.graph);
|
|
1026
|
-
parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
1027
|
-
parameters.resource.add(NodeShape.schema.properties.closed.path, parameters.object.closed
|
|
1028
|
-
.toList()
|
|
1029
|
-
.flatMap((value) => [
|
|
1030
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1031
|
-
]), parameters.graph);
|
|
1032
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1033
|
-
.toList()
|
|
1034
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1035
|
-
parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
1036
|
-
parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
|
|
1037
|
-
.toList()
|
|
1038
|
-
.flatMap((value) => [
|
|
1039
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1040
|
-
]), parameters.graph);
|
|
1041
|
-
parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
|
|
1042
|
-
.toList()
|
|
1043
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1044
|
-
parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
1045
|
-
parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
|
|
1046
|
-
value.length > 0
|
|
1047
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1048
|
-
if (itemIndex === 0) {
|
|
1049
|
-
currentSubListResource = listResource;
|
|
1050
|
-
}
|
|
1051
|
-
else {
|
|
1052
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1053
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1054
|
-
currentSubListResource = newSubListResource;
|
|
1055
|
-
}
|
|
1056
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1057
|
-
if (itemIndex + 1 === list.length) {
|
|
1058
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1059
|
-
}
|
|
1060
|
-
return { currentSubListResource, listResource };
|
|
1061
|
-
}, {
|
|
1062
|
-
currentSubListResource: null,
|
|
1063
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1064
|
-
}).listResource.identifier
|
|
1065
|
-
: $RdfVocabularies.rdf.nil,
|
|
1066
|
-
]), parameters.graph);
|
|
1067
|
-
parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
|
|
1068
|
-
value.length > 0
|
|
1069
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1070
|
-
if (itemIndex === 0) {
|
|
1071
|
-
currentSubListResource = listResource;
|
|
1072
|
-
}
|
|
1073
|
-
else {
|
|
1074
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1075
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1076
|
-
currentSubListResource = newSubListResource;
|
|
1077
|
-
}
|
|
1078
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1079
|
-
if (itemIndex + 1 === list.length) {
|
|
1080
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1081
|
-
}
|
|
1082
|
-
return { currentSubListResource, listResource };
|
|
1083
|
-
}, {
|
|
1084
|
-
currentSubListResource: null,
|
|
1085
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1086
|
-
}).listResource.identifier
|
|
1087
|
-
: $RdfVocabularies.rdf.nil,
|
|
1088
|
-
]), parameters.graph);
|
|
1089
|
-
parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
1090
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1091
|
-
.toList()
|
|
1092
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1093
|
-
parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
1094
|
-
value.length > 0
|
|
1095
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1096
|
-
if (itemIndex === 0) {
|
|
1097
|
-
currentSubListResource = listResource;
|
|
1098
|
-
}
|
|
1099
|
-
else {
|
|
1100
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1101
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1102
|
-
currentSubListResource = newSubListResource;
|
|
1103
|
-
}
|
|
1104
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
1105
|
-
if (itemIndex + 1 === list.length) {
|
|
1106
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1107
|
-
}
|
|
1108
|
-
return { currentSubListResource, listResource };
|
|
1109
|
-
}, {
|
|
1110
|
-
currentSubListResource: null,
|
|
1111
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1112
|
-
}).listResource.identifier
|
|
1113
|
-
: $RdfVocabularies.rdf.nil,
|
|
1114
|
-
]), parameters.graph);
|
|
1115
|
-
parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
|
|
1116
|
-
parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
|
|
1117
|
-
parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
|
|
1118
|
-
.toList()
|
|
1119
|
-
.flatMap((value) => [
|
|
1120
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
1121
|
-
]), parameters.graph);
|
|
1122
|
-
parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
|
|
1123
|
-
.toList()
|
|
1124
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1125
|
-
parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
|
|
1126
|
-
parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
|
|
1127
|
-
parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
|
|
1128
|
-
.toList()
|
|
1129
|
-
.flatMap((value) => [
|
|
1130
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
1131
|
-
]), parameters.graph);
|
|
1132
|
-
parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
|
|
1133
|
-
parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
1134
|
-
parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
1135
|
-
parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
1136
|
-
value.length > 0
|
|
1137
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1138
|
-
if (itemIndex === 0) {
|
|
1139
|
-
currentSubListResource = listResource;
|
|
1140
|
-
}
|
|
1141
|
-
else {
|
|
1142
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1143
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1144
|
-
currentSubListResource = newSubListResource;
|
|
1145
|
-
}
|
|
1146
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1147
|
-
if (itemIndex + 1 === list.length) {
|
|
1148
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1149
|
-
}
|
|
1150
|
-
return { currentSubListResource, listResource };
|
|
1151
|
-
}, {
|
|
1152
|
-
currentSubListResource: null,
|
|
1153
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1154
|
-
}).listResource.identifier
|
|
1155
|
-
: $RdfVocabularies.rdf.nil,
|
|
1156
|
-
]), parameters.graph);
|
|
1157
|
-
parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
|
|
1158
|
-
.toList()
|
|
1159
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1160
|
-
parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
|
|
1161
|
-
parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
|
|
1162
|
-
parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
|
|
1163
|
-
parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
|
|
1164
|
-
parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
|
|
1165
|
-
parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
1166
|
-
parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
1167
|
-
parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
|
|
1168
|
-
parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
|
|
1169
|
-
value.length > 0
|
|
1170
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1171
|
-
if (itemIndex === 0) {
|
|
1172
|
-
currentSubListResource = listResource;
|
|
1173
|
-
}
|
|
1174
|
-
else {
|
|
1175
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1176
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1177
|
-
currentSubListResource = newSubListResource;
|
|
1178
|
-
}
|
|
1179
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1180
|
-
if (itemIndex + 1 === list.length) {
|
|
1181
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1182
|
-
}
|
|
1183
|
-
return { currentSubListResource, listResource };
|
|
1184
|
-
}, {
|
|
1185
|
-
currentSubListResource: null,
|
|
1186
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1187
|
-
}).listResource.identifier
|
|
1188
|
-
: $RdfVocabularies.rdf.nil,
|
|
1189
|
-
]), parameters.graph);
|
|
1190
|
-
return parameters.resource;
|
|
1191
|
-
};
|
|
1192
|
-
NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
|
|
1193
|
-
NodeShape.$toString = (_nodeShape) => `NodeShape(${JSON.stringify(NodeShape.toStringRecord(_nodeShape))})`;
|
|
1194
973
|
NodeShape.toStringRecord = (_nodeShape) => $compactRecord({
|
|
1195
974
|
$identifier: _nodeShape.$identifier().toString(),
|
|
1196
975
|
label: _nodeShape.label.map((item) => item.toString()).extract(),
|
|
@@ -1198,17 +977,6 @@ export var NodeShape;
|
|
|
1198
977
|
})(NodeShape || (NodeShape = {}));
|
|
1199
978
|
export var Ontology;
|
|
1200
979
|
(function (Ontology) {
|
|
1201
|
-
Ontology.create = (parameters) => $sequenceRecord({
|
|
1202
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1203
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1204
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1205
|
-
})
|
|
1206
|
-
.map((properties) => ({ ...properties, $type: "Ontology" }))
|
|
1207
|
-
.map((object) => $monkeyPatchObject(object, { $toString: Ontology.$toString }));
|
|
1208
|
-
function createUnsafe(parameters) {
|
|
1209
|
-
return Ontology.create(parameters).unsafeCoerce();
|
|
1210
|
-
}
|
|
1211
|
-
Ontology.createUnsafe = createUnsafe;
|
|
1212
980
|
Ontology._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
1213
981
|
? $ensureRdfResourceType(resource, [Ontology.schema.fromRdfType], {
|
|
1214
982
|
graph: options.graph,
|
|
@@ -1235,6 +1003,18 @@ export var Ontology;
|
|
|
1235
1003
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1236
1004
|
}),
|
|
1237
1005
|
}).chain((properties) => Ontology.create(properties)));
|
|
1006
|
+
Ontology.$toString = (_ontology) => `Ontology(${JSON.stringify(Ontology.toStringRecord(_ontology))})`;
|
|
1007
|
+
Ontology.create = (parameters) => $sequenceRecord({
|
|
1008
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1009
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1010
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1011
|
+
})
|
|
1012
|
+
.map((properties) => ({ ...properties, $type: "Ontology" }))
|
|
1013
|
+
.map((object) => $monkeyPatchObject(object, { $toString: Ontology.$toString }));
|
|
1014
|
+
function createUnsafe(parameters) {
|
|
1015
|
+
return Ontology.create(parameters).unsafeCoerce();
|
|
1016
|
+
}
|
|
1017
|
+
Ontology.createUnsafe = createUnsafe;
|
|
1238
1018
|
Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
|
|
1239
1019
|
Ontology.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
1240
1020
|
.toResource()
|
|
@@ -1274,20 +1054,6 @@ export var Ontology;
|
|
|
1274
1054
|
dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
|
|
1275
1055
|
],
|
|
1276
1056
|
};
|
|
1277
|
-
Ontology._toRdfResource = (parameters) => {
|
|
1278
|
-
if (!parameters.ignoreRdfType) {
|
|
1279
|
-
parameters.resource.add($RdfVocabularies.rdf.type, Ontology.schema.toRdfTypes, parameters.graph);
|
|
1280
|
-
}
|
|
1281
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1282
|
-
.toList()
|
|
1283
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1284
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1285
|
-
.toList()
|
|
1286
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1287
|
-
return parameters.resource;
|
|
1288
|
-
};
|
|
1289
|
-
Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
|
|
1290
|
-
Ontology.$toString = (_ontology) => `Ontology(${JSON.stringify(Ontology.toStringRecord(_ontology))})`;
|
|
1291
1057
|
Ontology.toStringRecord = (_ontology) => $compactRecord({
|
|
1292
1058
|
$identifier: _ontology.$identifier().toString(),
|
|
1293
1059
|
label: _ontology.label.map((item) => item.toString()).extract(),
|
|
@@ -1295,17 +1061,6 @@ export var Ontology;
|
|
|
1295
1061
|
})(Ontology || (Ontology = {}));
|
|
1296
1062
|
export var PropertyGroup;
|
|
1297
1063
|
(function (PropertyGroup) {
|
|
1298
|
-
PropertyGroup.create = (parameters) => $sequenceRecord({
|
|
1299
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1300
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1301
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1302
|
-
})
|
|
1303
|
-
.map((properties) => ({ ...properties, $type: "PropertyGroup" }))
|
|
1304
|
-
.map((object) => $monkeyPatchObject(object, { $toString: PropertyGroup.$toString }));
|
|
1305
|
-
function createUnsafe(parameters) {
|
|
1306
|
-
return PropertyGroup.create(parameters).unsafeCoerce();
|
|
1307
|
-
}
|
|
1308
|
-
PropertyGroup.createUnsafe = createUnsafe;
|
|
1309
1064
|
PropertyGroup._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
1310
1065
|
? $ensureRdfResourceType(resource, [PropertyGroup.schema.fromRdfType], {
|
|
1311
1066
|
graph: options.graph,
|
|
@@ -1332,6 +1087,18 @@ export var PropertyGroup;
|
|
|
1332
1087
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1333
1088
|
}),
|
|
1334
1089
|
}).chain((properties) => PropertyGroup.create(properties)));
|
|
1090
|
+
PropertyGroup.$toString = (_propertyGroup) => `PropertyGroup(${JSON.stringify(PropertyGroup.toStringRecord(_propertyGroup))})`;
|
|
1091
|
+
PropertyGroup.create = (parameters) => $sequenceRecord({
|
|
1092
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1093
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1094
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1095
|
+
})
|
|
1096
|
+
.map((properties) => ({ ...properties, $type: "PropertyGroup" }))
|
|
1097
|
+
.map((object) => $monkeyPatchObject(object, { $toString: PropertyGroup.$toString }));
|
|
1098
|
+
function createUnsafe(parameters) {
|
|
1099
|
+
return PropertyGroup.create(parameters).unsafeCoerce();
|
|
1100
|
+
}
|
|
1101
|
+
PropertyGroup.createUnsafe = createUnsafe;
|
|
1335
1102
|
PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
|
|
1336
1103
|
PropertyGroup.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
1337
1104
|
.toResource()
|
|
@@ -1371,20 +1138,6 @@ export var PropertyGroup;
|
|
|
1371
1138
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"),
|
|
1372
1139
|
],
|
|
1373
1140
|
};
|
|
1374
|
-
PropertyGroup._toRdfResource = (parameters) => {
|
|
1375
|
-
if (!parameters.ignoreRdfType) {
|
|
1376
|
-
parameters.resource.add($RdfVocabularies.rdf.type, PropertyGroup.schema.toRdfTypes, parameters.graph);
|
|
1377
|
-
}
|
|
1378
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1379
|
-
.toList()
|
|
1380
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1381
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1382
|
-
.toList()
|
|
1383
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1384
|
-
return parameters.resource;
|
|
1385
|
-
};
|
|
1386
|
-
PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
|
|
1387
|
-
PropertyGroup.$toString = (_propertyGroup) => `PropertyGroup(${JSON.stringify(PropertyGroup.toStringRecord(_propertyGroup))})`;
|
|
1388
1141
|
PropertyGroup.toStringRecord = (_propertyGroup) => $compactRecord({
|
|
1389
1142
|
$identifier: _propertyGroup.$identifier().toString(),
|
|
1390
1143
|
label: _propertyGroup.label.map((item) => item.toString()).extract(),
|
|
@@ -1392,61 +1145,6 @@ export var PropertyGroup;
|
|
|
1392
1145
|
})(PropertyGroup || (PropertyGroup = {}));
|
|
1393
1146
|
export var PropertyShape;
|
|
1394
1147
|
(function (PropertyShape) {
|
|
1395
|
-
PropertyShape.create = (parameters) => $sequenceRecord({
|
|
1396
|
-
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
1397
|
-
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
1398
|
-
classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
1399
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1400
|
-
datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
1401
|
-
deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
1402
|
-
defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
|
|
1403
|
-
description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
|
|
1404
|
-
disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
|
|
1405
|
-
equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
|
|
1406
|
-
flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
1407
|
-
groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
|
|
1408
|
-
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
1409
|
-
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
1410
|
-
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
1411
|
-
label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1412
|
-
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
1413
|
-
lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
|
|
1414
|
-
lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
|
|
1415
|
-
maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
|
|
1416
|
-
maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
1417
|
-
maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
1418
|
-
maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
1419
|
-
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
1420
|
-
minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
|
|
1421
|
-
minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
1422
|
-
minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
1423
|
-
minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
1424
|
-
name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
|
|
1425
|
-
node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
1426
|
-
nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
1427
|
-
not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
1428
|
-
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
1429
|
-
order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
|
|
1430
|
-
path: Either.of(parameters.path),
|
|
1431
|
-
pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
1432
|
-
qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
|
|
1433
|
-
qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
|
|
1434
|
-
qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
|
|
1435
|
-
qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
|
|
1436
|
-
severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
1437
|
-
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
1438
|
-
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
1439
|
-
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
1440
|
-
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
1441
|
-
uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
|
|
1442
|
-
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
1443
|
-
})
|
|
1444
|
-
.map((properties) => ({ ...properties, $type: "PropertyShape" }))
|
|
1445
|
-
.map((object) => $monkeyPatchObject(object, { $toString: PropertyShape.$toString }));
|
|
1446
|
-
function createUnsafe(parameters) {
|
|
1447
|
-
return PropertyShape.create(parameters).unsafeCoerce();
|
|
1448
|
-
}
|
|
1449
|
-
PropertyShape.createUnsafe = createUnsafe;
|
|
1450
1148
|
PropertyShape._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
1451
1149
|
? $ensureRdfResourceType(resource, [PropertyShape.schema.fromRdfType], {
|
|
1452
1150
|
graph: options.graph,
|
|
@@ -1781,6 +1479,62 @@ export var PropertyShape;
|
|
|
1781
1479
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
1782
1480
|
}),
|
|
1783
1481
|
}).chain((properties) => PropertyShape.create(properties)));
|
|
1482
|
+
PropertyShape.$toString = (_propertyShape) => `PropertyShape(${JSON.stringify(PropertyShape.toStringRecord(_propertyShape))})`;
|
|
1483
|
+
PropertyShape.create = (parameters) => $sequenceRecord({
|
|
1484
|
+
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
1485
|
+
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
1486
|
+
classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
1487
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1488
|
+
datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
1489
|
+
deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
1490
|
+
defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
|
|
1491
|
+
description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
|
|
1492
|
+
disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
|
|
1493
|
+
equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
|
|
1494
|
+
flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
1495
|
+
groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
|
|
1496
|
+
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
1497
|
+
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
1498
|
+
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
1499
|
+
label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1500
|
+
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
1501
|
+
lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
|
|
1502
|
+
lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
|
|
1503
|
+
maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
|
|
1504
|
+
maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
1505
|
+
maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
1506
|
+
maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
1507
|
+
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
1508
|
+
minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
|
|
1509
|
+
minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
1510
|
+
minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
1511
|
+
minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
1512
|
+
name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
|
|
1513
|
+
node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
1514
|
+
nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
1515
|
+
not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
1516
|
+
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
1517
|
+
order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
|
|
1518
|
+
path: Either.of(parameters.path),
|
|
1519
|
+
pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
1520
|
+
qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
|
|
1521
|
+
qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
|
|
1522
|
+
qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
|
|
1523
|
+
qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
|
|
1524
|
+
severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
1525
|
+
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
1526
|
+
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
1527
|
+
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
1528
|
+
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
1529
|
+
uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
|
|
1530
|
+
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
1531
|
+
})
|
|
1532
|
+
.map((properties) => ({ ...properties, $type: "PropertyShape" }))
|
|
1533
|
+
.map((object) => $monkeyPatchObject(object, { $toString: PropertyShape.$toString }));
|
|
1534
|
+
function createUnsafe(parameters) {
|
|
1535
|
+
return PropertyShape.create(parameters).unsafeCoerce();
|
|
1536
|
+
}
|
|
1537
|
+
PropertyShape.createUnsafe = createUnsafe;
|
|
1784
1538
|
PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
|
|
1785
1539
|
PropertyShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
1786
1540
|
.toResource()
|
|
@@ -2121,14 +1875,7 @@ export var PropertyShape;
|
|
|
2121
1875
|
return {
|
|
2122
1876
|
kind: "Option",
|
|
2123
1877
|
get itemType() {
|
|
2124
|
-
return
|
|
2125
|
-
kind: "Iri",
|
|
2126
|
-
in: [
|
|
2127
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
2128
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
2129
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
2130
|
-
],
|
|
2131
|
-
};
|
|
1878
|
+
return Severity.schema;
|
|
2132
1879
|
},
|
|
2133
1880
|
};
|
|
2134
1881
|
},
|
|
@@ -2180,224 +1927,6 @@ export var PropertyShape;
|
|
|
2180
1927
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"),
|
|
2181
1928
|
],
|
|
2182
1929
|
};
|
|
2183
|
-
PropertyShape._toRdfResource = (parameters) => {
|
|
2184
|
-
if (!parameters.ignoreRdfType) {
|
|
2185
|
-
parameters.resource.add($RdfVocabularies.rdf.type, PropertyShape.schema.toRdfTypes, parameters.graph);
|
|
2186
|
-
}
|
|
2187
|
-
parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
|
|
2188
|
-
value.length > 0
|
|
2189
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2190
|
-
if (itemIndex === 0) {
|
|
2191
|
-
currentSubListResource = listResource;
|
|
2192
|
-
}
|
|
2193
|
-
else {
|
|
2194
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2195
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2196
|
-
currentSubListResource = newSubListResource;
|
|
2197
|
-
}
|
|
2198
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2199
|
-
if (itemIndex + 1 === list.length) {
|
|
2200
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2201
|
-
}
|
|
2202
|
-
return { currentSubListResource, listResource };
|
|
2203
|
-
}, {
|
|
2204
|
-
currentSubListResource: null,
|
|
2205
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2206
|
-
}).listResource.identifier
|
|
2207
|
-
: $RdfVocabularies.rdf.nil,
|
|
2208
|
-
]), parameters.graph);
|
|
2209
|
-
parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
2210
|
-
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
2211
|
-
.toList()
|
|
2212
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2213
|
-
parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
2214
|
-
parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
|
|
2215
|
-
.toList()
|
|
2216
|
-
.flatMap((value) => [
|
|
2217
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2218
|
-
]), parameters.graph);
|
|
2219
|
-
parameters.resource.add(PropertyShape.schema.properties.defaultValue.path, parameters.object.defaultValue.toList(), parameters.graph);
|
|
2220
|
-
parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
|
|
2221
|
-
.toList()
|
|
2222
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2223
|
-
parameters.resource.add(PropertyShape.schema.properties.disjoint.path, parameters.object.disjoint.flatMap((item) => [item]), parameters.graph);
|
|
2224
|
-
parameters.resource.add(PropertyShape.schema.properties.equals.path, parameters.object.equals.flatMap((item) => [item]), parameters.graph);
|
|
2225
|
-
parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
|
|
2226
|
-
.toList()
|
|
2227
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2228
|
-
parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
|
|
2229
|
-
parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
2230
|
-
parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
|
|
2231
|
-
value.length > 0
|
|
2232
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2233
|
-
if (itemIndex === 0) {
|
|
2234
|
-
currentSubListResource = listResource;
|
|
2235
|
-
}
|
|
2236
|
-
else {
|
|
2237
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2238
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2239
|
-
currentSubListResource = newSubListResource;
|
|
2240
|
-
}
|
|
2241
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2242
|
-
if (itemIndex + 1 === list.length) {
|
|
2243
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2244
|
-
}
|
|
2245
|
-
return { currentSubListResource, listResource };
|
|
2246
|
-
}, {
|
|
2247
|
-
currentSubListResource: null,
|
|
2248
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2249
|
-
}).listResource.identifier
|
|
2250
|
-
: $RdfVocabularies.rdf.nil,
|
|
2251
|
-
]), parameters.graph);
|
|
2252
|
-
parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
2253
|
-
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
2254
|
-
.toList()
|
|
2255
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2256
|
-
parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
2257
|
-
value.length > 0
|
|
2258
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2259
|
-
if (itemIndex === 0) {
|
|
2260
|
-
currentSubListResource = listResource;
|
|
2261
|
-
}
|
|
2262
|
-
else {
|
|
2263
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2264
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2265
|
-
currentSubListResource = newSubListResource;
|
|
2266
|
-
}
|
|
2267
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
2268
|
-
if (itemIndex + 1 === list.length) {
|
|
2269
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2270
|
-
}
|
|
2271
|
-
return { currentSubListResource, listResource };
|
|
2272
|
-
}, {
|
|
2273
|
-
currentSubListResource: null,
|
|
2274
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2275
|
-
}).listResource.identifier
|
|
2276
|
-
: $RdfVocabularies.rdf.nil,
|
|
2277
|
-
]), parameters.graph);
|
|
2278
|
-
parameters.resource.add(PropertyShape.schema.properties.lessThan.path, parameters.object.lessThan.flatMap((item) => [item]), parameters.graph);
|
|
2279
|
-
parameters.resource.add(PropertyShape.schema.properties.lessThanOrEquals.path, parameters.object.lessThanOrEquals.flatMap((item) => [item]), parameters.graph);
|
|
2280
|
-
parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
|
|
2281
|
-
.toList()
|
|
2282
|
-
.flatMap((value) => [
|
|
2283
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2284
|
-
]), parameters.graph);
|
|
2285
|
-
parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
|
|
2286
|
-
parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
|
|
2287
|
-
parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
|
|
2288
|
-
.toList()
|
|
2289
|
-
.flatMap((value) => [
|
|
2290
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2291
|
-
]), parameters.graph);
|
|
2292
|
-
parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
|
|
2293
|
-
.toList()
|
|
2294
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2295
|
-
parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
|
|
2296
|
-
.toList()
|
|
2297
|
-
.flatMap((value) => [
|
|
2298
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2299
|
-
]), parameters.graph);
|
|
2300
|
-
parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
|
|
2301
|
-
parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
|
|
2302
|
-
parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
|
|
2303
|
-
.toList()
|
|
2304
|
-
.flatMap((value) => [
|
|
2305
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2306
|
-
]), parameters.graph);
|
|
2307
|
-
parameters.resource.add(PropertyShape.schema.properties.name.path, parameters.object.name
|
|
2308
|
-
.toList()
|
|
2309
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2310
|
-
parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
|
|
2311
|
-
parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
2312
|
-
parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
2313
|
-
parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
2314
|
-
value.length > 0
|
|
2315
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2316
|
-
if (itemIndex === 0) {
|
|
2317
|
-
currentSubListResource = listResource;
|
|
2318
|
-
}
|
|
2319
|
-
else {
|
|
2320
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2321
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2322
|
-
currentSubListResource = newSubListResource;
|
|
2323
|
-
}
|
|
2324
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2325
|
-
if (itemIndex + 1 === list.length) {
|
|
2326
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2327
|
-
}
|
|
2328
|
-
return { currentSubListResource, listResource };
|
|
2329
|
-
}, {
|
|
2330
|
-
currentSubListResource: null,
|
|
2331
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2332
|
-
}).listResource.identifier
|
|
2333
|
-
: $RdfVocabularies.rdf.nil,
|
|
2334
|
-
]), parameters.graph);
|
|
2335
|
-
parameters.resource.add(PropertyShape.schema.properties.order.path, parameters.object.order
|
|
2336
|
-
.toList()
|
|
2337
|
-
.flatMap((value) => [
|
|
2338
|
-
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
2339
|
-
]), parameters.graph);
|
|
2340
|
-
parameters.resource.add(PropertyShape.schema.properties.path.path, [
|
|
2341
|
-
$PropertyPath.toRdfResource(parameters.object.path, {
|
|
2342
|
-
graph: parameters.graph,
|
|
2343
|
-
resourceSet: parameters.resourceSet,
|
|
2344
|
-
}).identifier,
|
|
2345
|
-
], parameters.graph);
|
|
2346
|
-
parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
|
|
2347
|
-
.toList()
|
|
2348
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2349
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedMaxCount.path, parameters.object.qualifiedMaxCount
|
|
2350
|
-
.toList()
|
|
2351
|
-
.flatMap((value) => [
|
|
2352
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2353
|
-
]), parameters.graph);
|
|
2354
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedMinCount.path, parameters.object.qualifiedMinCount
|
|
2355
|
-
.toList()
|
|
2356
|
-
.flatMap((value) => [
|
|
2357
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2358
|
-
]), parameters.graph);
|
|
2359
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShape.path, parameters.object.qualifiedValueShape.toList(), parameters.graph);
|
|
2360
|
-
parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.path, parameters.object.qualifiedValueShapesDisjoint
|
|
2361
|
-
.toList()
|
|
2362
|
-
.flatMap((value) => [
|
|
2363
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2364
|
-
]), parameters.graph);
|
|
2365
|
-
parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
|
|
2366
|
-
parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
|
|
2367
|
-
parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
|
|
2368
|
-
parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
2369
|
-
parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
2370
|
-
parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
|
|
2371
|
-
.toList()
|
|
2372
|
-
.flatMap((value) => [
|
|
2373
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2374
|
-
]), parameters.graph);
|
|
2375
|
-
parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
|
|
2376
|
-
value.length > 0
|
|
2377
|
-
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2378
|
-
if (itemIndex === 0) {
|
|
2379
|
-
currentSubListResource = listResource;
|
|
2380
|
-
}
|
|
2381
|
-
else {
|
|
2382
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2383
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2384
|
-
currentSubListResource = newSubListResource;
|
|
2385
|
-
}
|
|
2386
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2387
|
-
if (itemIndex + 1 === list.length) {
|
|
2388
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2389
|
-
}
|
|
2390
|
-
return { currentSubListResource, listResource };
|
|
2391
|
-
}, {
|
|
2392
|
-
currentSubListResource: null,
|
|
2393
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2394
|
-
}).listResource.identifier
|
|
2395
|
-
: $RdfVocabularies.rdf.nil,
|
|
2396
|
-
]), parameters.graph);
|
|
2397
|
-
return parameters.resource;
|
|
2398
|
-
};
|
|
2399
|
-
PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
|
|
2400
|
-
PropertyShape.$toString = (_propertyShape) => `PropertyShape(${JSON.stringify(PropertyShape.toStringRecord(_propertyShape))})`;
|
|
2401
1930
|
PropertyShape.toStringRecord = (_propertyShape) => $compactRecord({
|
|
2402
1931
|
$identifier: _propertyShape.$identifier().toString(),
|
|
2403
1932
|
label: _propertyShape.label.map((item) => item.toString()).extract(),
|
|
@@ -2405,23 +1934,21 @@ export var PropertyShape;
|
|
|
2405
1934
|
path: $PropertyPath.$toString(_propertyShape.path),
|
|
2406
1935
|
});
|
|
2407
1936
|
})(PropertyShape || (PropertyShape = {}));
|
|
1937
|
+
export var Severity;
|
|
1938
|
+
(function (Severity) {
|
|
1939
|
+
const inValues = [
|
|
1940
|
+
"http://www.w3.org/ns/shacl#Info",
|
|
1941
|
+
"http://www.w3.org/ns/shacl#Warning",
|
|
1942
|
+
"http://www.w3.org/ns/shacl#Violation",
|
|
1943
|
+
];
|
|
1944
|
+
Severity.schema = {
|
|
1945
|
+
kind: "Iri",
|
|
1946
|
+
in: inValues.map((inValue) => dataFactory.namedNode(inValue)),
|
|
1947
|
+
inValues,
|
|
1948
|
+
};
|
|
1949
|
+
})(Severity || (Severity = {}));
|
|
2408
1950
|
export var ValidationReport;
|
|
2409
1951
|
(function (ValidationReport) {
|
|
2410
|
-
ValidationReport.create = (parameters) => $sequenceRecord({
|
|
2411
|
-
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
2412
|
-
conforms: Either.of(parameters.conforms),
|
|
2413
|
-
results: $convertToScalarSet($identityConversionFunction, true)(parameters.results).chain((value) => $validateArray($identityValidationFunction, true)(ValidationReport.schema.properties.results.type, value)),
|
|
2414
|
-
shapesGraphWellFormed: $convertToMaybe($identityConversionFunction)(parameters.shapesGraphWellFormed).chain((value) => $validateMaybe($identityValidationFunction)(ValidationReport.schema.properties.shapesGraphWellFormed.type, value)),
|
|
2415
|
-
})
|
|
2416
|
-
.map((properties) => ({
|
|
2417
|
-
...properties,
|
|
2418
|
-
$type: "ValidationReport",
|
|
2419
|
-
}))
|
|
2420
|
-
.map((object) => $monkeyPatchObject(object, { $toString: ValidationReport.$toString }));
|
|
2421
|
-
function createUnsafe(parameters) {
|
|
2422
|
-
return ValidationReport.create(parameters).unsafeCoerce();
|
|
2423
|
-
}
|
|
2424
|
-
ValidationReport.createUnsafe = createUnsafe;
|
|
2425
1952
|
ValidationReport._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
2426
1953
|
? $ensureRdfResourceType(resource, [ValidationReport.schema.fromRdfType], { graph: options.graph })
|
|
2427
1954
|
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
@@ -2453,6 +1980,22 @@ export var ValidationReport;
|
|
|
2453
1980
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
2454
1981
|
}),
|
|
2455
1982
|
}).chain((properties) => ValidationReport.create(properties)));
|
|
1983
|
+
ValidationReport.$toString = (_validationReport) => `ValidationReport(${JSON.stringify(ValidationReport.toStringRecord(_validationReport))})`;
|
|
1984
|
+
ValidationReport.create = (parameters) => $sequenceRecord({
|
|
1985
|
+
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
1986
|
+
conforms: Either.of(parameters.conforms),
|
|
1987
|
+
results: $convertToScalarSet($identityConversionFunction, true)(parameters.results).chain((value) => $validateArray($identityValidationFunction, true)(ValidationReport.schema.properties.results.type, value)),
|
|
1988
|
+
shapesGraphWellFormed: $convertToMaybe($identityConversionFunction)(parameters.shapesGraphWellFormed).chain((value) => $validateMaybe($identityValidationFunction)(ValidationReport.schema.properties.shapesGraphWellFormed.type, value)),
|
|
1989
|
+
})
|
|
1990
|
+
.map((properties) => ({
|
|
1991
|
+
...properties,
|
|
1992
|
+
$type: "ValidationReport",
|
|
1993
|
+
}))
|
|
1994
|
+
.map((object) => $monkeyPatchObject(object, { $toString: ValidationReport.$toString }));
|
|
1995
|
+
function createUnsafe(parameters) {
|
|
1996
|
+
return ValidationReport.create(parameters).unsafeCoerce();
|
|
1997
|
+
}
|
|
1998
|
+
ValidationReport.createUnsafe = createUnsafe;
|
|
2456
1999
|
ValidationReport.fromRdfResource = $wrap_FromRdfResourceFunction(ValidationReport._fromRdfResource);
|
|
2457
2000
|
ValidationReport.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
2458
2001
|
.toResource()
|
|
@@ -2501,52 +2044,10 @@ export var ValidationReport;
|
|
|
2501
2044
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#ValidationReport"),
|
|
2502
2045
|
],
|
|
2503
2046
|
};
|
|
2504
|
-
ValidationReport._toRdfResource = (parameters) => {
|
|
2505
|
-
if (!parameters.ignoreRdfType) {
|
|
2506
|
-
parameters.resource.add($RdfVocabularies.rdf.type, ValidationReport.schema.toRdfTypes, parameters.graph);
|
|
2507
|
-
}
|
|
2508
|
-
parameters.resource.add(ValidationReport.schema.properties.conforms.path, [
|
|
2509
|
-
$literalFactory.boolean(parameters.object.conforms, $RdfVocabularies.xsd.boolean),
|
|
2510
|
-
], parameters.graph);
|
|
2511
|
-
parameters.resource.add(ValidationReport.schema.properties.results.path, parameters.object.results.flatMap((item) => [
|
|
2512
|
-
ValidationResult.toRdfResource(item, {
|
|
2513
|
-
graph: parameters.graph,
|
|
2514
|
-
resourceSet: parameters.resourceSet,
|
|
2515
|
-
}).identifier,
|
|
2516
|
-
]), parameters.graph);
|
|
2517
|
-
parameters.resource.add(ValidationReport.schema.properties.shapesGraphWellFormed.path, parameters.object.shapesGraphWellFormed
|
|
2518
|
-
.toList()
|
|
2519
|
-
.flatMap((value) => [
|
|
2520
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2521
|
-
]), parameters.graph);
|
|
2522
|
-
return parameters.resource;
|
|
2523
|
-
};
|
|
2524
|
-
ValidationReport.toRdfResource = $wrap_ToRdfResourceFunction(ValidationReport._toRdfResource);
|
|
2525
|
-
ValidationReport.$toString = (_validationReport) => `ValidationReport(${JSON.stringify(ValidationReport.toStringRecord(_validationReport))})`;
|
|
2526
2047
|
ValidationReport.toStringRecord = (_validationReport) => $compactRecord({ $identifier: _validationReport.$identifier().toString() });
|
|
2527
2048
|
})(ValidationReport || (ValidationReport = {}));
|
|
2528
2049
|
export var ValidationResult;
|
|
2529
2050
|
(function (ValidationResult) {
|
|
2530
|
-
ValidationResult.create = (parameters) => $sequenceRecord({
|
|
2531
|
-
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
2532
|
-
details: $convertToScalarSet($identityConversionFunction, true)(parameters.details).chain((value) => $validateArray($identityValidationFunction, true)(ValidationResult.schema.properties.details.type, value)),
|
|
2533
|
-
focusNode: Either.of(parameters.focusNode),
|
|
2534
|
-
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.message.type, value)),
|
|
2535
|
-
path: $convertToMaybe($identityConversionFunction)(parameters.path).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.path.type, value)),
|
|
2536
|
-
severity: $convertToIri(parameters.severity),
|
|
2537
|
-
sourceConstraintComponent: $convertToIri(parameters.sourceConstraintComponent),
|
|
2538
|
-
sourceShape: $convertToMaybe($convertToIdentifier)(parameters.sourceShape).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.sourceShape.type, value)),
|
|
2539
|
-
value: $convertToMaybe($identityConversionFunction)(parameters.value).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.value.type, value)),
|
|
2540
|
-
})
|
|
2541
|
-
.map((properties) => ({
|
|
2542
|
-
...properties,
|
|
2543
|
-
$type: "ValidationResult",
|
|
2544
|
-
}))
|
|
2545
|
-
.map((object) => $monkeyPatchObject(object, { $toString: ValidationResult.$toString }));
|
|
2546
|
-
function createUnsafe(parameters) {
|
|
2547
|
-
return ValidationResult.create(parameters).unsafeCoerce();
|
|
2548
|
-
}
|
|
2549
|
-
ValidationResult.createUnsafe = createUnsafe;
|
|
2550
2051
|
ValidationResult._fromRdfResource = (resource, options) => (!options.ignoreRdfType
|
|
2551
2052
|
? $ensureRdfResourceType(resource, [ValidationResult.schema.fromRdfType], { graph: options.graph })
|
|
2552
2053
|
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
@@ -2613,6 +2114,27 @@ export var ValidationResult;
|
|
|
2613
2114
|
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($termFromRdfResourceValues)),
|
|
2614
2115
|
}),
|
|
2615
2116
|
}).chain((properties) => ValidationResult.create(properties)));
|
|
2117
|
+
ValidationResult.$toString = (_validationResult) => `ValidationResult(${JSON.stringify(ValidationResult.toStringRecord(_validationResult))})`;
|
|
2118
|
+
ValidationResult.create = (parameters) => $sequenceRecord({
|
|
2119
|
+
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
2120
|
+
details: $convertToScalarSet($identityConversionFunction, true)(parameters.details).chain((value) => $validateArray($identityValidationFunction, true)(ValidationResult.schema.properties.details.type, value)),
|
|
2121
|
+
focusNode: Either.of(parameters.focusNode),
|
|
2122
|
+
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.message.type, value)),
|
|
2123
|
+
path: $convertToMaybe($identityConversionFunction)(parameters.path).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.path.type, value)),
|
|
2124
|
+
severity: $convertToIri(parameters.severity),
|
|
2125
|
+
sourceConstraintComponent: $convertToIri(parameters.sourceConstraintComponent),
|
|
2126
|
+
sourceShape: $convertToMaybe($convertToIdentifier)(parameters.sourceShape).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.sourceShape.type, value)),
|
|
2127
|
+
value: $convertToMaybe($identityConversionFunction)(parameters.value).chain((value) => $validateMaybe($identityValidationFunction)(ValidationResult.schema.properties.value.type, value)),
|
|
2128
|
+
})
|
|
2129
|
+
.map((properties) => ({
|
|
2130
|
+
...properties,
|
|
2131
|
+
$type: "ValidationResult",
|
|
2132
|
+
}))
|
|
2133
|
+
.map((object) => $monkeyPatchObject(object, { $toString: ValidationResult.$toString }));
|
|
2134
|
+
function createUnsafe(parameters) {
|
|
2135
|
+
return ValidationResult.create(parameters).unsafeCoerce();
|
|
2136
|
+
}
|
|
2137
|
+
ValidationResult.createUnsafe = createUnsafe;
|
|
2616
2138
|
ValidationResult.fromRdfResource = $wrap_FromRdfResourceFunction(ValidationResult._fromRdfResource);
|
|
2617
2139
|
ValidationResult.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
2618
2140
|
.toResource()
|
|
@@ -2674,14 +2196,7 @@ export var ValidationResult;
|
|
|
2674
2196
|
kind: "Shacl",
|
|
2675
2197
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#resultSeverity"),
|
|
2676
2198
|
get type() {
|
|
2677
|
-
return
|
|
2678
|
-
kind: "Iri",
|
|
2679
|
-
in: [
|
|
2680
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
2681
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
2682
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
2683
|
-
],
|
|
2684
|
-
};
|
|
2199
|
+
return Severity.schema;
|
|
2685
2200
|
},
|
|
2686
2201
|
},
|
|
2687
2202
|
sourceConstraintComponent: {
|
|
@@ -2713,29 +2228,6 @@ export var ValidationResult;
|
|
|
2713
2228
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#ValidationResult"),
|
|
2714
2229
|
],
|
|
2715
2230
|
};
|
|
2716
|
-
ValidationResult._toRdfResource = (parameters) => {
|
|
2717
|
-
if (!parameters.ignoreRdfType) {
|
|
2718
|
-
parameters.resource.add($RdfVocabularies.rdf.type, ValidationResult.schema.toRdfTypes, parameters.graph);
|
|
2719
|
-
}
|
|
2720
|
-
parameters.resource.add(ValidationResult.schema.properties.details.path, parameters.object.details.flatMap((item) => [item]), parameters.graph);
|
|
2721
|
-
parameters.resource.add(ValidationResult.schema.properties.focusNode.path, [parameters.object.focusNode], parameters.graph);
|
|
2722
|
-
parameters.resource.add(ValidationResult.schema.properties.message.path, parameters.object.message
|
|
2723
|
-
.toList()
|
|
2724
|
-
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2725
|
-
parameters.resource.add(ValidationResult.schema.properties.path.path, parameters.object.path.toList().flatMap((value) => [
|
|
2726
|
-
$PropertyPath.toRdfResource(value, {
|
|
2727
|
-
graph: parameters.graph,
|
|
2728
|
-
resourceSet: parameters.resourceSet,
|
|
2729
|
-
}).identifier,
|
|
2730
|
-
]), parameters.graph);
|
|
2731
|
-
parameters.resource.add(ValidationResult.schema.properties.severity.path, [parameters.object.severity], parameters.graph);
|
|
2732
|
-
parameters.resource.add(ValidationResult.schema.properties.sourceConstraintComponent.path, [parameters.object.sourceConstraintComponent], parameters.graph);
|
|
2733
|
-
parameters.resource.add(ValidationResult.schema.properties.sourceShape.path, parameters.object.sourceShape.toList(), parameters.graph);
|
|
2734
|
-
parameters.resource.add(ValidationResult.schema.properties.value.path, parameters.object.value.toList(), parameters.graph);
|
|
2735
|
-
return parameters.resource;
|
|
2736
|
-
};
|
|
2737
|
-
ValidationResult.toRdfResource = $wrap_ToRdfResourceFunction(ValidationResult._toRdfResource);
|
|
2738
|
-
ValidationResult.$toString = (_validationResult) => `ValidationResult(${JSON.stringify(ValidationResult.toStringRecord(_validationResult))})`;
|
|
2739
2231
|
ValidationResult.toStringRecord = (_validationResult) => $compactRecord({ $identifier: _validationResult.$identifier().toString() });
|
|
2740
2232
|
})(ValidationResult || (ValidationResult = {}));
|
|
2741
2233
|
export var Shape;
|
|
@@ -2997,14 +2489,7 @@ export var Shape;
|
|
|
2997
2489
|
return {
|
|
2998
2490
|
kind: "Option",
|
|
2999
2491
|
get itemType() {
|
|
3000
|
-
return
|
|
3001
|
-
kind: "Iri",
|
|
3002
|
-
in: [
|
|
3003
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
3004
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
3005
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
3006
|
-
],
|
|
3007
|
-
};
|
|
2492
|
+
return Severity.schema;
|
|
3008
2493
|
},
|
|
3009
2494
|
};
|
|
3010
2495
|
},
|
|
@@ -3045,56 +2530,9 @@ export var Shape;
|
|
|
3045
2530
|
},
|
|
3046
2531
|
},
|
|
3047
2532
|
};
|
|
3048
|
-
Shape.toRdfResource = (object, options) => {
|
|
3049
|
-
if (NodeShape.isNodeShape(object)) {
|
|
3050
|
-
return NodeShape.toRdfResource(object, options);
|
|
3051
|
-
}
|
|
3052
|
-
if (PropertyShape.isPropertyShape(object)) {
|
|
3053
|
-
return PropertyShape.toRdfResource(object, options);
|
|
3054
|
-
}
|
|
3055
|
-
throw new Error("unrecognized type");
|
|
3056
|
-
};
|
|
3057
|
-
Shape.toRdfResourceValues = ((value, _options) => {
|
|
3058
|
-
if (NodeShape.isNodeShape(value)) {
|
|
3059
|
-
return [
|
|
3060
|
-
NodeShape.toRdfResource(value, {
|
|
3061
|
-
graph: _options.graph,
|
|
3062
|
-
resourceSet: _options.resourceSet,
|
|
3063
|
-
}).identifier,
|
|
3064
|
-
];
|
|
3065
|
-
}
|
|
3066
|
-
if (PropertyShape.isPropertyShape(value)) {
|
|
3067
|
-
return [
|
|
3068
|
-
PropertyShape.toRdfResource(value, {
|
|
3069
|
-
graph: _options.graph,
|
|
3070
|
-
resourceSet: _options.resourceSet,
|
|
3071
|
-
}).identifier,
|
|
3072
|
-
];
|
|
3073
|
-
}
|
|
3074
|
-
throw new Error("unable to serialize to RDF");
|
|
3075
|
-
});
|
|
3076
2533
|
})(Shape || (Shape = {}));
|
|
3077
2534
|
export var $Object;
|
|
3078
2535
|
(function ($Object) {
|
|
3079
|
-
$Object.toRdfResource = (object, options) => {
|
|
3080
|
-
switch (object.$type) {
|
|
3081
|
-
case "NodeShape":
|
|
3082
|
-
return NodeShape.toRdfResource(object, options);
|
|
3083
|
-
case "Ontology":
|
|
3084
|
-
return Ontology.toRdfResource(object, options);
|
|
3085
|
-
case "PropertyGroup":
|
|
3086
|
-
return PropertyGroup.toRdfResource(object, options);
|
|
3087
|
-
case "PropertyShape":
|
|
3088
|
-
return PropertyShape.toRdfResource(object, options);
|
|
3089
|
-
case "ValidationReport":
|
|
3090
|
-
return ValidationReport.toRdfResource(object, options);
|
|
3091
|
-
case "ValidationResult":
|
|
3092
|
-
return ValidationResult.toRdfResource(object, options);
|
|
3093
|
-
default:
|
|
3094
|
-
object;
|
|
3095
|
-
throw new Error("should never reach this point");
|
|
3096
|
-
}
|
|
3097
|
-
};
|
|
3098
2536
|
function $toString(object) {
|
|
3099
2537
|
switch (object.$type) {
|
|
3100
2538
|
case "NodeShape":
|