@shaclmate/shacl-ast 4.0.40 → 4.0.41

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/generated.js CHANGED
@@ -15,11 +15,6 @@ function $compactRecord(record) {
15
15
  return definedProperties;
16
16
  }, {});
17
17
  }
18
- function $convertToArray(convertToItem, _readonly) {
19
- return (value) => (typeof value === "undefined"
20
- ? Either.of([])
21
- : Either.sequence(value.map(convertToItem)));
22
- }
23
18
  function $convertToIdentifier(value) {
24
19
  switch (typeof value) {
25
20
  case "object":
@@ -56,6 +51,9 @@ function $convertToIri(value) {
56
51
  return Either.of(dataFactory.namedNode(value));
57
52
  }
58
53
  }
54
+ function $convertToList(convertToItem, _readonly) {
55
+ return (value) => Either.sequence(value.map(convertToItem));
56
+ }
59
57
  function $convertToLiteral(value) {
60
58
  if (typeof value === "object") {
61
59
  if (value instanceof Date) {
@@ -80,6 +78,19 @@ function $convertToMaybe(convertToItem) {
80
78
  return convertToItem(value).map(Maybe.of);
81
79
  };
82
80
  }
81
+ function $convertToScalarSet(convertToItem, _readonly) {
82
+ return (value) => {
83
+ if (typeof value === "undefined") {
84
+ return Either.of([]);
85
+ }
86
+ if (Array.isArray(value)) {
87
+ return Either.sequence(value.map(convertToItem));
88
+ }
89
+ return convertToItem(value).map((value) => [
90
+ value,
91
+ ]);
92
+ };
93
+ }
83
94
  function $ensureRdfResourceType(resource, types, options) {
84
95
  return resource
85
96
  .value($RdfVocabularies.rdf.type, options)
@@ -254,24 +265,29 @@ export var PropertyShape;
254
265
  function create(parameters) {
255
266
  return $sequenceRecord({
256
267
  $identifier: $convertToIdentifierProperty(parameters.$identifier),
257
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
258
- classes: $convertToArray(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
268
+ and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
269
+ classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
259
270
  comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
260
271
  datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
261
272
  deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
262
273
  defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
263
274
  description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
264
- flags: $convertToArray($identityConversionFunction, true)(parameters.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type, value)),
265
- groups: $convertToArray($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
266
- hasValues: $convertToArray($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
267
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
275
+ disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
276
+ equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
277
+ flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.flags.type, value)),
278
+ groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
279
+ hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
280
+ in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
268
281
  isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
269
282
  label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
270
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
283
+ languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
284
+ lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
285
+ lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
271
286
  maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
272
287
  maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
273
288
  maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
274
289
  maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
290
+ message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.message.type, value)),
275
291
  minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
276
292
  minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
277
293
  minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
@@ -279,13 +295,22 @@ export var PropertyShape;
279
295
  name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
280
296
  node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
281
297
  nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
282
- not: $convertToArray($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
283
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
298
+ not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
299
+ or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
284
300
  order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
285
301
  path: Either.of(parameters.path),
286
- patterns: $convertToArray($identityConversionFunction, true)(parameters.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type, value)),
302
+ pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.pattern.type, value)),
303
+ qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
304
+ qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
305
+ qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
306
+ qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
307
+ severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.severity.type, value)),
308
+ targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetClasses.type, value)),
309
+ targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetNodes.type, value)),
310
+ targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetObjectsOf.type, value)),
311
+ targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetSubjectsOf.type, value)),
287
312
  uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
288
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
313
+ xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
289
314
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyShape" }, { $toString }));
290
315
  }
291
316
  PropertyShape.create = create;
@@ -430,20 +455,47 @@ export var PropertyShape;
430
455
  value: Maybe.empty(),
431
456
  })),
432
457
  }),
433
- flags: $shaclPropertyFromRdf({
458
+ disjoint: $shaclPropertyFromRdf({
434
459
  graph: _$options.graph,
435
460
  resource: $resource,
436
- propertySchema: PropertyShape.schema.properties.flags,
461
+ propertySchema: PropertyShape.schema.properties.disjoint,
437
462
  typeFromRdf: (resourceValues) => resourceValues
438
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
439
- .chain((values) => values.chainMap((value) => value.toString()))
463
+ .chain((values) => values.chainMap((value) => value.toIri()))
464
+ .map((values) => values.toArray())
465
+ .map((valuesArray) => Resource.Values.fromValue({
466
+ focusResource: $resource,
467
+ propertyPath: PropertyShape.schema.properties.disjoint.path,
468
+ value: valuesArray,
469
+ })),
470
+ }),
471
+ equals: $shaclPropertyFromRdf({
472
+ graph: _$options.graph,
473
+ resource: $resource,
474
+ propertySchema: PropertyShape.schema.properties.equals,
475
+ typeFromRdf: (resourceValues) => resourceValues
476
+ .chain((values) => values.chainMap((value) => value.toIri()))
440
477
  .map((values) => values.toArray())
441
478
  .map((valuesArray) => Resource.Values.fromValue({
442
479
  focusResource: $resource,
443
- propertyPath: PropertyShape.schema.properties.flags.path,
480
+ propertyPath: PropertyShape.schema.properties.equals.path,
444
481
  value: valuesArray,
445
482
  })),
446
483
  }),
484
+ flags: $shaclPropertyFromRdf({
485
+ graph: _$options.graph,
486
+ resource: $resource,
487
+ propertySchema: PropertyShape.schema.properties.flags,
488
+ typeFromRdf: (resourceValues) => resourceValues
489
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
490
+ .chain((values) => values.chainMap((value) => value.toString()))
491
+ .map((values) => values.length > 0
492
+ ? values.map((value) => Maybe.of(value))
493
+ : Resource.Values.fromValue({
494
+ focusResource: $resource,
495
+ propertyPath: PropertyShape.schema.properties.flags.path,
496
+ value: Maybe.empty(),
497
+ })),
498
+ }),
447
499
  groups: $shaclPropertyFromRdf({
448
500
  graph: _$options.graph,
449
501
  resource: $resource,
@@ -567,6 +619,32 @@ export var PropertyShape;
567
619
  value: Maybe.empty(),
568
620
  })),
569
621
  }),
622
+ lessThan: $shaclPropertyFromRdf({
623
+ graph: _$options.graph,
624
+ resource: $resource,
625
+ propertySchema: PropertyShape.schema.properties.lessThan,
626
+ typeFromRdf: (resourceValues) => resourceValues
627
+ .chain((values) => values.chainMap((value) => value.toIri()))
628
+ .map((values) => values.toArray())
629
+ .map((valuesArray) => Resource.Values.fromValue({
630
+ focusResource: $resource,
631
+ propertyPath: PropertyShape.schema.properties.lessThan.path,
632
+ value: valuesArray,
633
+ })),
634
+ }),
635
+ lessThanOrEquals: $shaclPropertyFromRdf({
636
+ graph: _$options.graph,
637
+ resource: $resource,
638
+ propertySchema: PropertyShape.schema.properties.lessThanOrEquals,
639
+ typeFromRdf: (resourceValues) => resourceValues
640
+ .chain((values) => values.chainMap((value) => value.toIri()))
641
+ .map((values) => values.toArray())
642
+ .map((valuesArray) => Resource.Values.fromValue({
643
+ focusResource: $resource,
644
+ propertyPath: PropertyShape.schema.properties.lessThanOrEquals.path,
645
+ value: valuesArray,
646
+ })),
647
+ }),
570
648
  maxCount: $shaclPropertyFromRdf({
571
649
  graph: _$options.graph,
572
650
  resource: $resource,
@@ -625,6 +703,21 @@ export var PropertyShape;
625
703
  value: Maybe.empty(),
626
704
  })),
627
705
  }),
706
+ message: $shaclPropertyFromRdf({
707
+ graph: _$options.graph,
708
+ resource: $resource,
709
+ propertySchema: PropertyShape.schema.properties.message,
710
+ typeFromRdf: (resourceValues) => resourceValues
711
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
712
+ .chain((values) => values.chainMap((value) => value.toString()))
713
+ .map((values) => values.length > 0
714
+ ? values.map((value) => Maybe.of(value))
715
+ : Resource.Values.fromValue({
716
+ focusResource: $resource,
717
+ propertyPath: PropertyShape.schema.properties.message.path,
718
+ value: Maybe.empty(),
719
+ })),
720
+ }),
628
721
  minCount: $shaclPropertyFromRdf({
629
722
  graph: _$options.graph,
630
723
  resource: $resource,
@@ -793,17 +886,159 @@ export var PropertyShape;
793
886
  propertyPath: PropertyShape.schema.properties.path.path,
794
887
  }),
795
888
  }),
796
- patterns: $shaclPropertyFromRdf({
889
+ pattern: $shaclPropertyFromRdf({
797
890
  graph: _$options.graph,
798
891
  resource: $resource,
799
- propertySchema: PropertyShape.schema.properties.patterns,
892
+ propertySchema: PropertyShape.schema.properties.pattern,
800
893
  typeFromRdf: (resourceValues) => resourceValues
801
894
  .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
802
895
  .chain((values) => values.chainMap((value) => value.toString()))
896
+ .map((values) => values.length > 0
897
+ ? values.map((value) => Maybe.of(value))
898
+ : Resource.Values.fromValue({
899
+ focusResource: $resource,
900
+ propertyPath: PropertyShape.schema.properties.pattern.path,
901
+ value: Maybe.empty(),
902
+ })),
903
+ }),
904
+ qualifiedMaxCount: $shaclPropertyFromRdf({
905
+ graph: _$options.graph,
906
+ resource: $resource,
907
+ propertySchema: PropertyShape.schema.properties.qualifiedMaxCount,
908
+ typeFromRdf: (resourceValues) => resourceValues
909
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
910
+ .map((values) => values.length > 0
911
+ ? values.map((value) => Maybe.of(value))
912
+ : Resource.Values.fromValue({
913
+ focusResource: $resource,
914
+ propertyPath: PropertyShape.schema.properties.qualifiedMaxCount.path,
915
+ value: Maybe.empty(),
916
+ })),
917
+ }),
918
+ qualifiedMinCount: $shaclPropertyFromRdf({
919
+ graph: _$options.graph,
920
+ resource: $resource,
921
+ propertySchema: PropertyShape.schema.properties.qualifiedMinCount,
922
+ typeFromRdf: (resourceValues) => resourceValues
923
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
924
+ .map((values) => values.length > 0
925
+ ? values.map((value) => Maybe.of(value))
926
+ : Resource.Values.fromValue({
927
+ focusResource: $resource,
928
+ propertyPath: PropertyShape.schema.properties.qualifiedMinCount.path,
929
+ value: Maybe.empty(),
930
+ })),
931
+ }),
932
+ qualifiedValueShape: $shaclPropertyFromRdf({
933
+ graph: _$options.graph,
934
+ resource: $resource,
935
+ propertySchema: PropertyShape.schema.properties.qualifiedValueShape,
936
+ typeFromRdf: (resourceValues) => resourceValues
937
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
938
+ .map((values) => values.length > 0
939
+ ? values.map((value) => Maybe.of(value))
940
+ : Resource.Values.fromValue({
941
+ focusResource: $resource,
942
+ propertyPath: PropertyShape.schema.properties.qualifiedValueShape
943
+ .path,
944
+ value: Maybe.empty(),
945
+ })),
946
+ }),
947
+ qualifiedValueShapesDisjoint: $shaclPropertyFromRdf({
948
+ graph: _$options.graph,
949
+ resource: $resource,
950
+ propertySchema: PropertyShape.schema.properties.qualifiedValueShapesDisjoint,
951
+ typeFromRdf: (resourceValues) => resourceValues
952
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
953
+ .map((values) => values.length > 0
954
+ ? values.map((value) => Maybe.of(value))
955
+ : Resource.Values.fromValue({
956
+ focusResource: $resource,
957
+ propertyPath: PropertyShape.schema.properties
958
+ .qualifiedValueShapesDisjoint.path,
959
+ value: Maybe.empty(),
960
+ })),
961
+ }),
962
+ severity: $shaclPropertyFromRdf({
963
+ graph: _$options.graph,
964
+ resource: $resource,
965
+ propertySchema: PropertyShape.schema.properties.severity,
966
+ typeFromRdf: (resourceValues) => resourceValues
967
+ .chain((values) => values.chainMap((value) => value.toIri([
968
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
969
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
970
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
971
+ ])))
972
+ .map((values) => values.length > 0
973
+ ? values.map((value) => Maybe.of(value))
974
+ : Resource.Values.fromValue({
975
+ focusResource: $resource,
976
+ propertyPath: PropertyShape.schema.properties.severity.path,
977
+ value: Maybe.empty(),
978
+ })),
979
+ }),
980
+ targetClasses: $shaclPropertyFromRdf({
981
+ graph: _$options.graph,
982
+ resource: $resource,
983
+ propertySchema: PropertyShape.schema.properties.targetClasses,
984
+ typeFromRdf: (resourceValues) => resourceValues
985
+ .chain((values) => values.chainMap((value) => value.toIri()))
986
+ .map((values) => values.toArray())
987
+ .map((valuesArray) => Resource.Values.fromValue({
988
+ focusResource: $resource,
989
+ propertyPath: PropertyShape.schema.properties.targetClasses.path,
990
+ value: valuesArray,
991
+ })),
992
+ }),
993
+ targetNodes: $shaclPropertyFromRdf({
994
+ graph: _$options.graph,
995
+ resource: $resource,
996
+ propertySchema: PropertyShape.schema.properties.targetNodes,
997
+ typeFromRdf: (resourceValues) => resourceValues
998
+ .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
999
+ switch (term.termType) {
1000
+ case "NamedNode":
1001
+ case "Literal":
1002
+ return Either.of(term);
1003
+ default:
1004
+ return Left(new Resource.MistypedTermValueError({
1005
+ actualValue: term,
1006
+ expectedValueType: "(NamedNode | Literal)",
1007
+ focusResource: $resource,
1008
+ propertyPath: PropertyShape.schema.properties.targetNodes.path,
1009
+ }));
1010
+ }
1011
+ })))
1012
+ .map((values) => values.toArray())
1013
+ .map((valuesArray) => Resource.Values.fromValue({
1014
+ focusResource: $resource,
1015
+ propertyPath: PropertyShape.schema.properties.targetNodes.path,
1016
+ value: valuesArray,
1017
+ })),
1018
+ }),
1019
+ targetObjectsOf: $shaclPropertyFromRdf({
1020
+ graph: _$options.graph,
1021
+ resource: $resource,
1022
+ propertySchema: PropertyShape.schema.properties.targetObjectsOf,
1023
+ typeFromRdf: (resourceValues) => resourceValues
1024
+ .chain((values) => values.chainMap((value) => value.toIri()))
1025
+ .map((values) => values.toArray())
1026
+ .map((valuesArray) => Resource.Values.fromValue({
1027
+ focusResource: $resource,
1028
+ propertyPath: PropertyShape.schema.properties.targetObjectsOf.path,
1029
+ value: valuesArray,
1030
+ })),
1031
+ }),
1032
+ targetSubjectsOf: $shaclPropertyFromRdf({
1033
+ graph: _$options.graph,
1034
+ resource: $resource,
1035
+ propertySchema: PropertyShape.schema.properties.targetSubjectsOf,
1036
+ typeFromRdf: (resourceValues) => resourceValues
1037
+ .chain((values) => values.chainMap((value) => value.toIri()))
803
1038
  .map((values) => values.toArray())
804
1039
  .map((valuesArray) => Resource.Values.fromValue({
805
1040
  focusResource: $resource,
806
- propertyPath: PropertyShape.schema.properties.patterns.path,
1041
+ propertyPath: PropertyShape.schema.properties.targetSubjectsOf.path,
807
1042
  value: valuesArray,
808
1043
  })),
809
1044
  }),
@@ -913,10 +1148,23 @@ export var PropertyShape;
913
1148
  itemType: { kind: "String" },
914
1149
  },
915
1150
  },
1151
+ disjoint: {
1152
+ kind: "Shacl",
1153
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#disjoint"),
1154
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1155
+ },
1156
+ equals: {
1157
+ kind: "Shacl",
1158
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#equals"),
1159
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1160
+ },
916
1161
  flags: {
917
1162
  kind: "Shacl",
918
1163
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
919
- type: { kind: "Set", itemType: { kind: "String" } },
1164
+ type: {
1165
+ kind: "Option",
1166
+ itemType: { kind: "String" },
1167
+ },
920
1168
  },
921
1169
  groups: {
922
1170
  kind: "Shacl",
@@ -969,6 +1217,16 @@ export var PropertyShape;
969
1217
  },
970
1218
  },
971
1219
  },
1220
+ lessThan: {
1221
+ kind: "Shacl",
1222
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThan"),
1223
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1224
+ },
1225
+ lessThanOrEquals: {
1226
+ kind: "Shacl",
1227
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThanOrEquals"),
1228
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1229
+ },
972
1230
  maxCount: {
973
1231
  kind: "Shacl",
974
1232
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
@@ -1001,6 +1259,14 @@ export var PropertyShape;
1001
1259
  itemType: { kind: "BigInt" },
1002
1260
  },
1003
1261
  },
1262
+ message: {
1263
+ kind: "Shacl",
1264
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
1265
+ type: {
1266
+ kind: "Option",
1267
+ itemType: { kind: "String" },
1268
+ },
1269
+ },
1004
1270
  minCount: {
1005
1271
  kind: "Shacl",
1006
1272
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
@@ -1098,10 +1364,80 @@ export var PropertyShape;
1098
1364
  return $PropertyPath.schema;
1099
1365
  },
1100
1366
  },
1101
- patterns: {
1367
+ pattern: {
1102
1368
  kind: "Shacl",
1103
1369
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
1104
- type: { kind: "Set", itemType: { kind: "String" } },
1370
+ type: {
1371
+ kind: "Option",
1372
+ itemType: { kind: "String" },
1373
+ },
1374
+ },
1375
+ qualifiedMaxCount: {
1376
+ kind: "Shacl",
1377
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMaxCount"),
1378
+ type: {
1379
+ kind: "Option",
1380
+ itemType: { kind: "BigInt" },
1381
+ },
1382
+ },
1383
+ qualifiedMinCount: {
1384
+ kind: "Shacl",
1385
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMinCount"),
1386
+ type: {
1387
+ kind: "Option",
1388
+ itemType: { kind: "BigInt" },
1389
+ },
1390
+ },
1391
+ qualifiedValueShape: {
1392
+ kind: "Shacl",
1393
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShape"),
1394
+ type: {
1395
+ kind: "Option",
1396
+ itemType: { kind: "Identifier" },
1397
+ },
1398
+ },
1399
+ qualifiedValueShapesDisjoint: {
1400
+ kind: "Shacl",
1401
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShapesDisjoint"),
1402
+ type: {
1403
+ kind: "Option",
1404
+ itemType: { kind: "Boolean" },
1405
+ },
1406
+ },
1407
+ severity: {
1408
+ kind: "Shacl",
1409
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
1410
+ type: {
1411
+ kind: "Option",
1412
+ itemType: {
1413
+ kind: "Iri",
1414
+ in: [
1415
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
1416
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
1417
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
1418
+ ],
1419
+ },
1420
+ },
1421
+ },
1422
+ targetClasses: {
1423
+ kind: "Shacl",
1424
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
1425
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1426
+ },
1427
+ targetNodes: {
1428
+ kind: "Shacl",
1429
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
1430
+ type: { kind: "Set", itemType: { kind: "Term" } },
1431
+ },
1432
+ targetObjectsOf: {
1433
+ kind: "Shacl",
1434
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
1435
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1436
+ },
1437
+ targetSubjectsOf: {
1438
+ kind: "Shacl",
1439
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
1440
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1105
1441
  },
1106
1442
  uniqueLang: {
1107
1443
  kind: "Shacl",
@@ -1164,7 +1500,11 @@ export var PropertyShape;
1164
1500
  parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
1165
1501
  .toList()
1166
1502
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1167
- parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
1503
+ parameters.resource.add(PropertyShape.schema.properties.disjoint.path, parameters.object.disjoint.flatMap((item) => [item]), parameters.graph);
1504
+ parameters.resource.add(PropertyShape.schema.properties.equals.path, parameters.object.equals.flatMap((item) => [item]), parameters.graph);
1505
+ parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags
1506
+ .toList()
1507
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1168
1508
  parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
1169
1509
  parameters.resource.add(PropertyShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
1170
1510
  parameters.resource.add(PropertyShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
@@ -1215,6 +1555,8 @@ export var PropertyShape;
1215
1555
  }).listResource.identifier
1216
1556
  : $RdfVocabularies.rdf.nil,
1217
1557
  ]), parameters.graph);
1558
+ parameters.resource.add(PropertyShape.schema.properties.lessThan.path, parameters.object.lessThan.flatMap((item) => [item]), parameters.graph);
1559
+ parameters.resource.add(PropertyShape.schema.properties.lessThanOrEquals.path, parameters.object.lessThanOrEquals.flatMap((item) => [item]), parameters.graph);
1218
1560
  parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
1219
1561
  .toList()
1220
1562
  .flatMap((value) => [
@@ -1227,6 +1569,9 @@ export var PropertyShape;
1227
1569
  .flatMap((value) => [
1228
1570
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1229
1571
  ]), parameters.graph);
1572
+ parameters.resource.add(PropertyShape.schema.properties.message.path, parameters.object.message
1573
+ .toList()
1574
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1230
1575
  parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
1231
1576
  .toList()
1232
1577
  .flatMap((value) => [
@@ -1278,9 +1623,30 @@ export var PropertyShape;
1278
1623
  resourceSet: parameters.resourceSet,
1279
1624
  }).identifier,
1280
1625
  ], parameters.graph);
1281
- parameters.resource.add(PropertyShape.schema.properties.patterns.path, parameters.object.patterns.flatMap((item) => [
1282
- $literalFactory.string(item),
1626
+ parameters.resource.add(PropertyShape.schema.properties.pattern.path, parameters.object.pattern
1627
+ .toList()
1628
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1629
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedMaxCount.path, parameters.object.qualifiedMaxCount
1630
+ .toList()
1631
+ .flatMap((value) => [
1632
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1283
1633
  ]), parameters.graph);
1634
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedMinCount.path, parameters.object.qualifiedMinCount
1635
+ .toList()
1636
+ .flatMap((value) => [
1637
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1638
+ ]), parameters.graph);
1639
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShape.path, parameters.object.qualifiedValueShape.toList(), parameters.graph);
1640
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.path, parameters.object.qualifiedValueShapesDisjoint
1641
+ .toList()
1642
+ .flatMap((value) => [
1643
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1644
+ ]), parameters.graph);
1645
+ parameters.resource.add(PropertyShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
1646
+ parameters.resource.add(PropertyShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
1647
+ parameters.resource.add(PropertyShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
1648
+ parameters.resource.add(PropertyShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
1649
+ parameters.resource.add(PropertyShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
1284
1650
  parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
1285
1651
  .toList()
1286
1652
  .flatMap((value) => [
@@ -1586,36 +1952,40 @@ export var NodeShape;
1586
1952
  function create(parameters) {
1587
1953
  return $sequenceRecord({
1588
1954
  $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1589
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
1590
- classes: $convertToArray(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
1955
+ and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
1956
+ classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
1591
1957
  closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
1592
1958
  comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1593
1959
  datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
1594
1960
  deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
1595
- flags: $convertToArray($identityConversionFunction, true)(parameters?.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type, value)),
1596
- hasValues: $convertToArray($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
1597
- ignoredProperties: $convertToMaybe($convertToArray(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
1598
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
1961
+ flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.flags.type, value)),
1962
+ hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
1963
+ ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
1964
+ in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
1599
1965
  isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
1600
1966
  label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1601
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
1602
- maxCount: $convertToMaybe($identityConversionFunction)(parameters?.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
1967
+ languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
1603
1968
  maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
1604
1969
  maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
1605
1970
  maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
1606
- minCount: $convertToMaybe($identityConversionFunction)(parameters?.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
1971
+ message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.message.type, value)),
1607
1972
  minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
1608
1973
  minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
1609
1974
  minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
1610
1975
  node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
1611
1976
  nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
1612
- not: $convertToArray($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
1613
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
1614
- patterns: $convertToArray($identityConversionFunction, true)(parameters?.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type, value)),
1615
- properties: $convertToArray($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
1616
- subClassOf: $convertToArray(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
1617
- types: $convertToArray(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
1618
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
1977
+ not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
1978
+ or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
1979
+ pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.pattern.type, value)),
1980
+ properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
1981
+ severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.severity.type, value)),
1982
+ subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
1983
+ targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetClasses.type, value)),
1984
+ targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetNodes.type, value)),
1985
+ targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetObjectsOf.type, value)),
1986
+ targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetSubjectsOf.type, value)),
1987
+ types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
1988
+ xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
1619
1989
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "NodeShape" }, { $toString }));
1620
1990
  }
1621
1991
  NodeShape.create = create;
@@ -1739,12 +2109,13 @@ export var NodeShape;
1739
2109
  typeFromRdf: (resourceValues) => resourceValues
1740
2110
  .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1741
2111
  .chain((values) => values.chainMap((value) => value.toString()))
1742
- .map((values) => values.toArray())
1743
- .map((valuesArray) => Resource.Values.fromValue({
1744
- focusResource: $resource,
1745
- propertyPath: PropertyShape.schema.properties.flags.path,
1746
- value: valuesArray,
1747
- })),
2112
+ .map((values) => values.length > 0
2113
+ ? values.map((value) => Maybe.of(value))
2114
+ : Resource.Values.fromValue({
2115
+ focusResource: $resource,
2116
+ propertyPath: PropertyShape.schema.properties.flags.path,
2117
+ value: Maybe.empty(),
2118
+ })),
1748
2119
  }),
1749
2120
  hasValues: $shaclPropertyFromRdf({
1750
2121
  graph: _$options.graph,
@@ -1876,20 +2247,6 @@ export var NodeShape;
1876
2247
  value: Maybe.empty(),
1877
2248
  })),
1878
2249
  }),
1879
- maxCount: $shaclPropertyFromRdf({
1880
- graph: _$options.graph,
1881
- resource: $resource,
1882
- propertySchema: NodeShape.schema.properties.maxCount,
1883
- typeFromRdf: (resourceValues) => resourceValues
1884
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1885
- .map((values) => values.length > 0
1886
- ? values.map((value) => Maybe.of(value))
1887
- : Resource.Values.fromValue({
1888
- focusResource: $resource,
1889
- propertyPath: PropertyShape.schema.properties.maxCount.path,
1890
- value: Maybe.empty(),
1891
- })),
1892
- }),
1893
2250
  maxExclusive: $shaclPropertyFromRdf({
1894
2251
  graph: _$options.graph,
1895
2252
  resource: $resource,
@@ -1934,17 +2291,18 @@ export var NodeShape;
1934
2291
  value: Maybe.empty(),
1935
2292
  })),
1936
2293
  }),
1937
- minCount: $shaclPropertyFromRdf({
2294
+ message: $shaclPropertyFromRdf({
1938
2295
  graph: _$options.graph,
1939
2296
  resource: $resource,
1940
- propertySchema: NodeShape.schema.properties.minCount,
2297
+ propertySchema: NodeShape.schema.properties.message,
1941
2298
  typeFromRdf: (resourceValues) => resourceValues
1942
- .chain((values) => values.chainMap((value) => value.toBigInt()))
2299
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2300
+ .chain((values) => values.chainMap((value) => value.toString()))
1943
2301
  .map((values) => values.length > 0
1944
2302
  ? values.map((value) => Maybe.of(value))
1945
2303
  : Resource.Values.fromValue({
1946
2304
  focusResource: $resource,
1947
- propertyPath: PropertyShape.schema.properties.minCount.path,
2305
+ propertyPath: PropertyShape.schema.properties.message.path,
1948
2306
  value: Maybe.empty(),
1949
2307
  })),
1950
2308
  }),
@@ -2060,19 +2418,20 @@ export var NodeShape;
2060
2418
  value: Maybe.empty(),
2061
2419
  })),
2062
2420
  }),
2063
- patterns: $shaclPropertyFromRdf({
2421
+ pattern: $shaclPropertyFromRdf({
2064
2422
  graph: _$options.graph,
2065
2423
  resource: $resource,
2066
- propertySchema: NodeShape.schema.properties.patterns,
2424
+ propertySchema: NodeShape.schema.properties.pattern,
2067
2425
  typeFromRdf: (resourceValues) => resourceValues
2068
2426
  .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2069
2427
  .chain((values) => values.chainMap((value) => value.toString()))
2070
- .map((values) => values.toArray())
2071
- .map((valuesArray) => Resource.Values.fromValue({
2072
- focusResource: $resource,
2073
- propertyPath: PropertyShape.schema.properties.patterns.path,
2074
- value: valuesArray,
2075
- })),
2428
+ .map((values) => values.length > 0
2429
+ ? values.map((value) => Maybe.of(value))
2430
+ : Resource.Values.fromValue({
2431
+ focusResource: $resource,
2432
+ propertyPath: PropertyShape.schema.properties.pattern.path,
2433
+ value: Maybe.empty(),
2434
+ })),
2076
2435
  }),
2077
2436
  properties: $shaclPropertyFromRdf({
2078
2437
  graph: _$options.graph,
@@ -2087,6 +2446,24 @@ export var NodeShape;
2087
2446
  value: valuesArray,
2088
2447
  })),
2089
2448
  }),
2449
+ severity: $shaclPropertyFromRdf({
2450
+ graph: _$options.graph,
2451
+ resource: $resource,
2452
+ propertySchema: NodeShape.schema.properties.severity,
2453
+ typeFromRdf: (resourceValues) => resourceValues
2454
+ .chain((values) => values.chainMap((value) => value.toIri([
2455
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
2456
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
2457
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
2458
+ ])))
2459
+ .map((values) => values.length > 0
2460
+ ? values.map((value) => Maybe.of(value))
2461
+ : Resource.Values.fromValue({
2462
+ focusResource: $resource,
2463
+ propertyPath: PropertyShape.schema.properties.severity.path,
2464
+ value: Maybe.empty(),
2465
+ })),
2466
+ }),
2090
2467
  subClassOf: $shaclPropertyFromRdf({
2091
2468
  graph: _$options.graph,
2092
2469
  resource: $resource,
@@ -2100,6 +2477,71 @@ export var NodeShape;
2100
2477
  value: valuesArray,
2101
2478
  })),
2102
2479
  }),
2480
+ targetClasses: $shaclPropertyFromRdf({
2481
+ graph: _$options.graph,
2482
+ resource: $resource,
2483
+ propertySchema: NodeShape.schema.properties.targetClasses,
2484
+ typeFromRdf: (resourceValues) => resourceValues
2485
+ .chain((values) => values.chainMap((value) => value.toIri()))
2486
+ .map((values) => values.toArray())
2487
+ .map((valuesArray) => Resource.Values.fromValue({
2488
+ focusResource: $resource,
2489
+ propertyPath: PropertyShape.schema.properties.targetClasses.path,
2490
+ value: valuesArray,
2491
+ })),
2492
+ }),
2493
+ targetNodes: $shaclPropertyFromRdf({
2494
+ graph: _$options.graph,
2495
+ resource: $resource,
2496
+ propertySchema: NodeShape.schema.properties.targetNodes,
2497
+ typeFromRdf: (resourceValues) => resourceValues
2498
+ .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
2499
+ switch (term.termType) {
2500
+ case "NamedNode":
2501
+ case "Literal":
2502
+ return Either.of(term);
2503
+ default:
2504
+ return Left(new Resource.MistypedTermValueError({
2505
+ actualValue: term,
2506
+ expectedValueType: "(NamedNode | Literal)",
2507
+ focusResource: $resource,
2508
+ propertyPath: PropertyShape.schema.properties.targetNodes.path,
2509
+ }));
2510
+ }
2511
+ })))
2512
+ .map((values) => values.toArray())
2513
+ .map((valuesArray) => Resource.Values.fromValue({
2514
+ focusResource: $resource,
2515
+ propertyPath: PropertyShape.schema.properties.targetNodes.path,
2516
+ value: valuesArray,
2517
+ })),
2518
+ }),
2519
+ targetObjectsOf: $shaclPropertyFromRdf({
2520
+ graph: _$options.graph,
2521
+ resource: $resource,
2522
+ propertySchema: NodeShape.schema.properties.targetObjectsOf,
2523
+ typeFromRdf: (resourceValues) => resourceValues
2524
+ .chain((values) => values.chainMap((value) => value.toIri()))
2525
+ .map((values) => values.toArray())
2526
+ .map((valuesArray) => Resource.Values.fromValue({
2527
+ focusResource: $resource,
2528
+ propertyPath: PropertyShape.schema.properties.targetObjectsOf.path,
2529
+ value: valuesArray,
2530
+ })),
2531
+ }),
2532
+ targetSubjectsOf: $shaclPropertyFromRdf({
2533
+ graph: _$options.graph,
2534
+ resource: $resource,
2535
+ propertySchema: NodeShape.schema.properties.targetSubjectsOf,
2536
+ typeFromRdf: (resourceValues) => resourceValues
2537
+ .chain((values) => values.chainMap((value) => value.toIri()))
2538
+ .map((values) => values.toArray())
2539
+ .map((valuesArray) => Resource.Values.fromValue({
2540
+ focusResource: $resource,
2541
+ propertyPath: PropertyShape.schema.properties.targetSubjectsOf.path,
2542
+ value: valuesArray,
2543
+ })),
2544
+ }),
2103
2545
  types: $shaclPropertyFromRdf({
2104
2546
  graph: _$options.graph,
2105
2547
  resource: $resource,
@@ -2203,7 +2645,10 @@ export var NodeShape;
2203
2645
  flags: {
2204
2646
  kind: "Shacl",
2205
2647
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2206
- type: { kind: "Set", itemType: { kind: "String" } },
2648
+ type: {
2649
+ kind: "Option",
2650
+ itemType: { kind: "String" },
2651
+ },
2207
2652
  },
2208
2653
  hasValues: {
2209
2654
  kind: "Shacl",
@@ -2259,14 +2704,6 @@ export var NodeShape;
2259
2704
  },
2260
2705
  },
2261
2706
  },
2262
- maxCount: {
2263
- kind: "Shacl",
2264
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
2265
- type: {
2266
- kind: "Option",
2267
- itemType: { kind: "BigInt" },
2268
- },
2269
- },
2270
2707
  maxExclusive: {
2271
2708
  kind: "Shacl",
2272
2709
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
@@ -2291,12 +2728,12 @@ export var NodeShape;
2291
2728
  itemType: { kind: "BigInt" },
2292
2729
  },
2293
2730
  },
2294
- minCount: {
2731
+ message: {
2295
2732
  kind: "Shacl",
2296
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
2733
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
2297
2734
  type: {
2298
2735
  kind: "Option",
2299
- itemType: { kind: "BigInt" },
2736
+ itemType: { kind: "String" },
2300
2737
  },
2301
2738
  },
2302
2739
  minExclusive: {
@@ -2368,10 +2805,13 @@ export var NodeShape;
2368
2805
  },
2369
2806
  },
2370
2807
  },
2371
- patterns: {
2808
+ pattern: {
2372
2809
  kind: "Shacl",
2373
2810
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
2374
- type: { kind: "Set", itemType: { kind: "String" } },
2811
+ type: {
2812
+ kind: "Option",
2813
+ itemType: { kind: "String" },
2814
+ },
2375
2815
  },
2376
2816
  properties: {
2377
2817
  kind: "Shacl",
@@ -2381,11 +2821,46 @@ export var NodeShape;
2381
2821
  itemType: { kind: "Identifier" },
2382
2822
  },
2383
2823
  },
2824
+ severity: {
2825
+ kind: "Shacl",
2826
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
2827
+ type: {
2828
+ kind: "Option",
2829
+ itemType: {
2830
+ kind: "Iri",
2831
+ in: [
2832
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
2833
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
2834
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
2835
+ ],
2836
+ },
2837
+ },
2838
+ },
2384
2839
  subClassOf: {
2385
2840
  kind: "Shacl",
2386
2841
  path: $RdfVocabularies.rdfs.subClassOf,
2387
2842
  type: { kind: "Set", itemType: { kind: "Iri" } },
2388
2843
  },
2844
+ targetClasses: {
2845
+ kind: "Shacl",
2846
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
2847
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2848
+ },
2849
+ targetNodes: {
2850
+ kind: "Shacl",
2851
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
2852
+ type: { kind: "Set", itemType: { kind: "Term" } },
2853
+ },
2854
+ targetObjectsOf: {
2855
+ kind: "Shacl",
2856
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
2857
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2858
+ },
2859
+ targetSubjectsOf: {
2860
+ kind: "Shacl",
2861
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
2862
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2863
+ },
2389
2864
  types: {
2390
2865
  kind: "Shacl",
2391
2866
  path: $RdfVocabularies.rdf.type,
@@ -2445,7 +2920,9 @@ export var NodeShape;
2445
2920
  .flatMap((value) => [
2446
2921
  $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
2447
2922
  ]), parameters.graph);
2448
- parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
2923
+ parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags
2924
+ .toList()
2925
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2449
2926
  parameters.resource.add(PropertyShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
2450
2927
  parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
2451
2928
  value.length > 0
@@ -2517,11 +2994,6 @@ export var NodeShape;
2517
2994
  }).listResource.identifier
2518
2995
  : $RdfVocabularies.rdf.nil,
2519
2996
  ]), parameters.graph);
2520
- parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
2521
- .toList()
2522
- .flatMap((value) => [
2523
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2524
- ]), parameters.graph);
2525
2997
  parameters.resource.add(PropertyShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
2526
2998
  parameters.resource.add(PropertyShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
2527
2999
  parameters.resource.add(PropertyShape.schema.properties.maxLength.path, parameters.object.maxLength
@@ -2529,11 +3001,9 @@ export var NodeShape;
2529
3001
  .flatMap((value) => [
2530
3002
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2531
3003
  ]), parameters.graph);
2532
- parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
3004
+ parameters.resource.add(PropertyShape.schema.properties.message.path, parameters.object.message
2533
3005
  .toList()
2534
- .flatMap((value) => [
2535
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2536
- ]), parameters.graph);
3006
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2537
3007
  parameters.resource.add(PropertyShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
2538
3008
  parameters.resource.add(PropertyShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
2539
3009
  parameters.resource.add(PropertyShape.schema.properties.minLength.path, parameters.object.minLength
@@ -2566,11 +3036,16 @@ export var NodeShape;
2566
3036
  }).listResource.identifier
2567
3037
  : $RdfVocabularies.rdf.nil,
2568
3038
  ]), parameters.graph);
2569
- parameters.resource.add(PropertyShape.schema.properties.patterns.path, parameters.object.patterns.flatMap((item) => [
2570
- $literalFactory.string(item),
2571
- ]), parameters.graph);
3039
+ parameters.resource.add(PropertyShape.schema.properties.pattern.path, parameters.object.pattern
3040
+ .toList()
3041
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2572
3042
  parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
3043
+ parameters.resource.add(PropertyShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
2573
3044
  parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
3045
+ parameters.resource.add(PropertyShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
3046
+ parameters.resource.add(PropertyShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
3047
+ parameters.resource.add(PropertyShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
3048
+ parameters.resource.add(PropertyShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
2574
3049
  parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
2575
3050
  parameters.resource.add(PropertyShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
2576
3051
  value.length > 0
@@ -2706,7 +3181,10 @@ export var Shape;
2706
3181
  flags: {
2707
3182
  kind: "Shacl",
2708
3183
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2709
- type: { kind: "Set", itemType: { kind: "String" } },
3184
+ type: {
3185
+ kind: "Option",
3186
+ itemType: { kind: "String" },
3187
+ },
2710
3188
  },
2711
3189
  hasValues: {
2712
3190
  kind: "Shacl",
@@ -2751,14 +3229,6 @@ export var Shape;
2751
3229
  },
2752
3230
  },
2753
3231
  },
2754
- maxCount: {
2755
- kind: "Shacl",
2756
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
2757
- type: {
2758
- kind: "Option",
2759
- itemType: { kind: "BigInt" },
2760
- },
2761
- },
2762
3232
  maxExclusive: {
2763
3233
  kind: "Shacl",
2764
3234
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
@@ -2783,12 +3253,12 @@ export var Shape;
2783
3253
  itemType: { kind: "BigInt" },
2784
3254
  },
2785
3255
  },
2786
- minCount: {
3256
+ message: {
2787
3257
  kind: "Shacl",
2788
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
3258
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
2789
3259
  type: {
2790
3260
  kind: "Option",
2791
- itemType: { kind: "BigInt" },
3261
+ itemType: { kind: "String" },
2792
3262
  },
2793
3263
  },
2794
3264
  minExclusive: {
@@ -2860,10 +3330,48 @@ export var Shape;
2860
3330
  },
2861
3331
  },
2862
3332
  },
2863
- patterns: {
3333
+ pattern: {
2864
3334
  kind: "Shacl",
2865
3335
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
2866
- type: { kind: "Set", itemType: { kind: "String" } },
3336
+ type: {
3337
+ kind: "Option",
3338
+ itemType: { kind: "String" },
3339
+ },
3340
+ },
3341
+ severity: {
3342
+ kind: "Shacl",
3343
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
3344
+ type: {
3345
+ kind: "Option",
3346
+ itemType: {
3347
+ kind: "Iri",
3348
+ in: [
3349
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
3350
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
3351
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
3352
+ ],
3353
+ },
3354
+ },
3355
+ },
3356
+ targetClasses: {
3357
+ kind: "Shacl",
3358
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
3359
+ type: { kind: "Set", itemType: { kind: "Iri" } },
3360
+ },
3361
+ targetNodes: {
3362
+ kind: "Shacl",
3363
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
3364
+ type: { kind: "Set", itemType: { kind: "Term" } },
3365
+ },
3366
+ targetObjectsOf: {
3367
+ kind: "Shacl",
3368
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
3369
+ type: { kind: "Set", itemType: { kind: "Iri" } },
3370
+ },
3371
+ targetSubjectsOf: {
3372
+ kind: "Shacl",
3373
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
3374
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2867
3375
  },
2868
3376
  xone: {
2869
3377
  kind: "Shacl",