@shaclmate/shacl-ast 4.0.38 → 4.0.39

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
@@ -80,6 +80,20 @@ function $convertToMaybe(convertToItem) {
80
80
  return convertToItem(value).map(Maybe.of);
81
81
  };
82
82
  }
83
+ function $ensureRdfResourceType(resource, types, options) {
84
+ return resource
85
+ .value($RdfVocabularies.rdf.type, options)
86
+ .chain((actualRdfTypeValue) => actualRdfTypeValue.toIri())
87
+ .chain((actualRdfType) => {
88
+ // Check the expected type and its known subtypes
89
+ for (const type of types) {
90
+ if (resource.isInstanceOf(type, options)) {
91
+ return Right(undefined);
92
+ }
93
+ }
94
+ return Left(new Error(`${resource.identifier} has unexpected RDF type (actual: ${actualRdfType}, expected one of ${types})`));
95
+ });
96
+ }
83
97
  function $fromRdfPreferredLanguages(values, preferredLanguages) {
84
98
  if (!preferredLanguages || preferredLanguages.length === 0) {
85
99
  return Right(values);
@@ -196,12 +210,12 @@ function $validateArray(validateItem, _readonly) {
196
210
  if (schema.minCount !== undefined && valueArray.length < schema.minCount) {
197
211
  return Left(new Error(`value array has length (${valueArray.length}) less than minCount (${schema.minCount})`));
198
212
  }
199
- return Either.sequence(valueArray.map((value) => validateItem(schema.item(), value)));
213
+ return Either.sequence(valueArray.map((value) => validateItem(schema.itemType, value)));
200
214
  };
201
215
  }
202
216
  function $validateMaybe(validateItem) {
203
217
  return (schema, valueMaybe) => valueMaybe
204
- .map((value) => validateItem(schema.item(), value).map(() => valueMaybe))
218
+ .map((value) => validateItem(schema.itemType, value).map(() => valueMaybe))
205
219
  .orDefault(Either.of(valueMaybe));
206
220
  }
207
221
  function $wrap_FromRdfResourceFunction(_fromRdfResourceFunction) {
@@ -240,38 +254,38 @@ export var PropertyShape;
240
254
  function create(parameters) {
241
255
  return $sequenceRecord({
242
256
  $identifier: $convertToIdentifierProperty(parameters.$identifier),
243
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type(), value)),
244
- classes: $convertToArray(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type(), value)),
245
- comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
246
- datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type(), value)),
247
- deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type(), value)),
248
- defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type(), value)),
249
- description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type(), value)),
250
- flags: $convertToArray($identityConversionFunction, true)(parameters.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type(), value)),
251
- groups: $convertToArray($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type(), value)),
252
- hasValues: $convertToArray($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type(), value)),
253
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type(), value)),
254
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type(), value)),
255
- label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
256
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type(), value)),
257
- maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type(), value)),
258
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type(), value)),
259
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type(), value)),
260
- maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type(), value)),
261
- minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type(), value)),
262
- minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type(), value)),
263
- minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type(), value)),
264
- minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type(), value)),
265
- name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type(), value)),
266
- node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type(), value)),
267
- nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type(), value)),
268
- not: $convertToArray($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type(), value)),
269
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type(), value)),
270
- order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type(), value)),
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)),
259
+ comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
260
+ datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
261
+ deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
262
+ defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
263
+ 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)),
268
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
269
+ 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)),
271
+ maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
272
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
273
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
274
+ maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
275
+ minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
276
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
277
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
278
+ minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
279
+ name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
280
+ node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
281
+ 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)),
284
+ order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
271
285
  path: Either.of(parameters.path),
272
- patterns: $convertToArray($identityConversionFunction, true)(parameters.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type(), value)),
273
- uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type(), value)),
274
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type(), value)),
286
+ patterns: $convertToArray($identityConversionFunction, true)(parameters.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type, value)),
287
+ 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)),
275
289
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyShape" }, { $toString }));
276
290
  }
277
291
  PropertyShape.create = create;
@@ -286,22 +300,8 @@ export var PropertyShape;
286
300
  })(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
287
301
  PropertyShape._fromRdfResource = ($resource, _$options) => {
288
302
  return (!_$options.ignoreRdfType
289
- ? $resource
290
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
291
- .chain((actualRdfType) => actualRdfType.toIri())
292
- .chain((actualRdfType) => {
293
- // Check the expected type and its known subtypes
294
- switch (actualRdfType.value) {
295
- case "http://www.w3.org/ns/shacl#PropertyShape":
296
- return Right(true);
297
- }
298
- // Check arbitrary rdfs:subClassOf's of the expected type
299
- if ($resource.isInstanceOf(PropertyShape.fromRdfType, {
300
- graph: _$options.graph,
301
- })) {
302
- return Right(true);
303
- }
304
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyShape)`));
303
+ ? $ensureRdfResourceType($resource, [PropertyShape.fromRdfType], {
304
+ graph: _$options.graph,
305
305
  })
306
306
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
307
307
  $identifier: Right(new Resource.Value({
@@ -861,221 +861,200 @@ export var PropertyShape;
861
861
  properties: {
862
862
  $identifier: {
863
863
  kind: "Identifier",
864
- type: () => ({ kind: "Identifier" }),
865
- },
866
- $type: {
867
- kind: "Discriminant",
868
- type: () => ({
869
- kind: "TypeDiscriminant",
870
- ownValues: ["PropertyShape"],
871
- }),
864
+ type: { kind: "Identifier" },
872
865
  },
873
866
  and: {
874
867
  kind: "Shacl",
875
- type: () => ({
876
- kind: "Maybe",
877
- item: () => ({
878
- kind: "List",
879
- item: () => ({ kind: "Identifier" }),
880
- }),
881
- }),
882
868
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
869
+ type: {
870
+ kind: "Option",
871
+ itemType: {
872
+ kind: "List",
873
+ itemType: { kind: "Identifier" },
874
+ },
875
+ },
883
876
  },
884
877
  classes: {
885
878
  kind: "Shacl",
886
- type: () => ({
887
- kind: "Set",
888
- item: () => ({ kind: "Iri" }),
889
- }),
890
879
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
880
+ type: { kind: "Set", itemType: { kind: "Iri" } },
891
881
  },
892
882
  comment: {
893
883
  kind: "Shacl",
894
- type: () => ({
895
- kind: "Maybe",
896
- item: () => ({ kind: "String" }),
897
- }),
898
884
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
885
+ type: {
886
+ kind: "Option",
887
+ itemType: { kind: "String" },
888
+ },
899
889
  },
900
890
  datatype: {
901
891
  kind: "Shacl",
902
- type: () => ({
903
- kind: "Maybe",
904
- item: () => ({ kind: "Iri" }),
905
- }),
906
892
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
893
+ type: { kind: "Option", itemType: { kind: "Iri" } },
907
894
  },
908
895
  deactivated: {
909
896
  kind: "Shacl",
910
- type: () => ({
911
- kind: "Maybe",
912
- item: () => ({ kind: "Boolean" }),
913
- }),
914
897
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
898
+ type: {
899
+ kind: "Option",
900
+ itemType: { kind: "Boolean" },
901
+ },
915
902
  },
916
903
  defaultValue: {
917
904
  kind: "Shacl",
918
- type: () => ({
919
- kind: "Maybe",
920
- item: () => ({ kind: "Term" }),
921
- }),
922
905
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
906
+ type: { kind: "Option", itemType: { kind: "Term" } },
923
907
  },
924
908
  description: {
925
909
  kind: "Shacl",
926
- type: () => ({
927
- kind: "Maybe",
928
- item: () => ({ kind: "String" }),
929
- }),
930
910
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
911
+ type: {
912
+ kind: "Option",
913
+ itemType: { kind: "String" },
914
+ },
931
915
  },
932
916
  flags: {
933
917
  kind: "Shacl",
934
- type: () => ({
935
- kind: "Set",
936
- item: () => ({ kind: "String" }),
937
- }),
938
918
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
919
+ type: { kind: "Set", itemType: { kind: "String" } },
939
920
  },
940
921
  groups: {
941
922
  kind: "Shacl",
942
- type: () => ({
943
- kind: "Set",
944
- item: () => ({ kind: "Identifier" }),
945
- }),
946
923
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
924
+ type: {
925
+ kind: "Set",
926
+ itemType: { kind: "Identifier" },
927
+ },
947
928
  },
948
929
  hasValues: {
949
930
  kind: "Shacl",
950
- type: () => ({
951
- kind: "Set",
952
- item: () => ({ kind: "Term" }),
953
- }),
954
931
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
932
+ type: { kind: "Set", itemType: { kind: "Term" } },
955
933
  },
956
934
  in_: {
957
935
  kind: "Shacl",
958
- type: () => ({
959
- kind: "Maybe",
960
- item: () => ({
961
- kind: "List",
962
- item: () => ({ kind: "Term" }),
963
- }),
964
- }),
965
936
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
937
+ type: {
938
+ kind: "Option",
939
+ itemType: {
940
+ kind: "List",
941
+ itemType: { kind: "Term" },
942
+ },
943
+ },
966
944
  },
967
945
  isDefinedBy: {
968
946
  kind: "Shacl",
969
- type: () => ({
970
- kind: "Maybe",
971
- item: () => ({ kind: "Identifier" }),
972
- }),
973
947
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
948
+ type: {
949
+ kind: "Option",
950
+ itemType: { kind: "Identifier" },
951
+ },
974
952
  },
975
953
  label: {
976
954
  kind: "Shacl",
977
- type: () => ({
978
- kind: "Maybe",
979
- item: () => ({ kind: "String" }),
980
- }),
981
955
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
956
+ type: {
957
+ kind: "Option",
958
+ itemType: { kind: "String" },
959
+ },
982
960
  },
983
961
  languageIn: {
984
962
  kind: "Shacl",
985
- type: () => ({
986
- kind: "Maybe",
987
- item: () => ({
988
- kind: "List",
989
- item: () => ({ kind: "String" }),
990
- }),
991
- }),
992
963
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
964
+ type: {
965
+ kind: "Option",
966
+ itemType: {
967
+ kind: "List",
968
+ itemType: { kind: "String" },
969
+ },
970
+ },
993
971
  },
994
972
  maxCount: {
995
973
  kind: "Shacl",
996
- type: () => ({
997
- kind: "Maybe",
998
- item: () => ({ kind: "BigInt" }),
999
- }),
1000
974
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
975
+ type: {
976
+ kind: "Option",
977
+ itemType: { kind: "BigInt" },
978
+ },
1001
979
  },
1002
980
  maxExclusive: {
1003
981
  kind: "Shacl",
1004
- type: () => ({
1005
- kind: "Maybe",
1006
- item: () => ({ kind: "Literal" }),
1007
- }),
1008
982
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
983
+ type: {
984
+ kind: "Option",
985
+ itemType: { kind: "Literal" },
986
+ },
1009
987
  },
1010
988
  maxInclusive: {
1011
989
  kind: "Shacl",
1012
- type: () => ({
1013
- kind: "Maybe",
1014
- item: () => ({ kind: "Literal" }),
1015
- }),
1016
990
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
991
+ type: {
992
+ kind: "Option",
993
+ itemType: { kind: "Literal" },
994
+ },
1017
995
  },
1018
996
  maxLength: {
1019
997
  kind: "Shacl",
1020
- type: () => ({
1021
- kind: "Maybe",
1022
- item: () => ({ kind: "BigInt" }),
1023
- }),
1024
998
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
999
+ type: {
1000
+ kind: "Option",
1001
+ itemType: { kind: "BigInt" },
1002
+ },
1025
1003
  },
1026
1004
  minCount: {
1027
1005
  kind: "Shacl",
1028
- type: () => ({
1029
- kind: "Maybe",
1030
- item: () => ({ kind: "BigInt" }),
1031
- }),
1032
1006
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
1007
+ type: {
1008
+ kind: "Option",
1009
+ itemType: { kind: "BigInt" },
1010
+ },
1033
1011
  },
1034
1012
  minExclusive: {
1035
1013
  kind: "Shacl",
1036
- type: () => ({
1037
- kind: "Maybe",
1038
- item: () => ({ kind: "Literal" }),
1039
- }),
1040
1014
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
1015
+ type: {
1016
+ kind: "Option",
1017
+ itemType: { kind: "Literal" },
1018
+ },
1041
1019
  },
1042
1020
  minInclusive: {
1043
1021
  kind: "Shacl",
1044
- type: () => ({
1045
- kind: "Maybe",
1046
- item: () => ({ kind: "Literal" }),
1047
- }),
1048
1022
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
1023
+ type: {
1024
+ kind: "Option",
1025
+ itemType: { kind: "Literal" },
1026
+ },
1049
1027
  },
1050
1028
  minLength: {
1051
1029
  kind: "Shacl",
1052
- type: () => ({
1053
- kind: "Maybe",
1054
- item: () => ({ kind: "BigInt" }),
1055
- }),
1056
1030
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
1031
+ type: {
1032
+ kind: "Option",
1033
+ itemType: { kind: "BigInt" },
1034
+ },
1057
1035
  },
1058
1036
  name: {
1059
1037
  kind: "Shacl",
1060
- type: () => ({
1061
- kind: "Maybe",
1062
- item: () => ({ kind: "String" }),
1063
- }),
1064
1038
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
1039
+ type: {
1040
+ kind: "Option",
1041
+ itemType: { kind: "String" },
1042
+ },
1065
1043
  },
1066
1044
  node: {
1067
1045
  kind: "Shacl",
1068
- type: () => ({
1069
- kind: "Maybe",
1070
- item: () => ({ kind: "Identifier" }),
1071
- }),
1072
1046
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
1047
+ type: {
1048
+ kind: "Option",
1049
+ itemType: { kind: "Identifier" },
1050
+ },
1073
1051
  },
1074
1052
  nodeKind: {
1075
1053
  kind: "Shacl",
1076
- type: () => ({
1077
- kind: "Maybe",
1078
- item: () => ({
1054
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
1055
+ type: {
1056
+ kind: "Option",
1057
+ itemType: {
1079
1058
  kind: "Iri",
1080
1059
  in: [
1081
1060
  dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
@@ -1085,68 +1064,63 @@ export var PropertyShape;
1085
1064
  dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
1086
1065
  dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
1087
1066
  ],
1088
- }),
1089
- }),
1090
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
1067
+ },
1068
+ },
1091
1069
  },
1092
1070
  not: {
1093
1071
  kind: "Shacl",
1094
- type: () => ({
1095
- kind: "Set",
1096
- item: () => ({ kind: "Identifier" }),
1097
- }),
1098
1072
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
1073
+ type: {
1074
+ kind: "Set",
1075
+ itemType: { kind: "Identifier" },
1076
+ },
1099
1077
  },
1100
1078
  or: {
1101
1079
  kind: "Shacl",
1102
- type: () => ({
1103
- kind: "Maybe",
1104
- item: () => ({
1105
- kind: "List",
1106
- item: () => ({ kind: "Identifier" }),
1107
- }),
1108
- }),
1109
1080
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
1081
+ type: {
1082
+ kind: "Option",
1083
+ itemType: {
1084
+ kind: "List",
1085
+ itemType: { kind: "Identifier" },
1086
+ },
1087
+ },
1110
1088
  },
1111
1089
  order: {
1112
1090
  kind: "Shacl",
1113
- type: () => ({
1114
- kind: "Maybe",
1115
- item: () => ({ kind: "Float" }),
1116
- }),
1117
1091
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
1092
+ type: { kind: "Option", itemType: { kind: "Float" } },
1118
1093
  },
1119
1094
  path: {
1120
1095
  kind: "Shacl",
1121
- type: () => $PropertyPath.schema,
1122
1096
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
1097
+ get type() {
1098
+ return $PropertyPath.schema;
1099
+ },
1123
1100
  },
1124
1101
  patterns: {
1125
1102
  kind: "Shacl",
1126
- type: () => ({
1127
- kind: "Set",
1128
- item: () => ({ kind: "String" }),
1129
- }),
1130
1103
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
1104
+ type: { kind: "Set", itemType: { kind: "String" } },
1131
1105
  },
1132
1106
  uniqueLang: {
1133
1107
  kind: "Shacl",
1134
- type: () => ({
1135
- kind: "Maybe",
1136
- item: () => ({ kind: "Boolean" }),
1137
- }),
1138
1108
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
1109
+ type: {
1110
+ kind: "Option",
1111
+ itemType: { kind: "Boolean" },
1112
+ },
1139
1113
  },
1140
1114
  xone: {
1141
1115
  kind: "Shacl",
1142
- type: () => ({
1143
- kind: "Maybe",
1144
- item: () => ({
1145
- kind: "List",
1146
- item: () => ({ kind: "Identifier" }),
1147
- }),
1148
- }),
1149
1116
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
1117
+ type: {
1118
+ kind: "Option",
1119
+ itemType: {
1120
+ kind: "List",
1121
+ itemType: { kind: "Identifier" },
1122
+ },
1123
+ },
1150
1124
  },
1151
1125
  },
1152
1126
  };
@@ -1356,8 +1330,8 @@ export var PropertyGroup;
1356
1330
  function create(parameters) {
1357
1331
  return $sequenceRecord({
1358
1332
  $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1359
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
1360
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
1333
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1334
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1361
1335
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyGroup" }, { $toString }));
1362
1336
  }
1363
1337
  PropertyGroup.create = create;
@@ -1372,22 +1346,8 @@ export var PropertyGroup;
1372
1346
  })(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
1373
1347
  PropertyGroup._fromRdfResource = ($resource, _$options) => {
1374
1348
  return (!_$options.ignoreRdfType
1375
- ? $resource
1376
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
1377
- .chain((actualRdfType) => actualRdfType.toIri())
1378
- .chain((actualRdfType) => {
1379
- // Check the expected type and its known subtypes
1380
- switch (actualRdfType.value) {
1381
- case "http://www.w3.org/ns/shacl#PropertyGroup":
1382
- return Right(true);
1383
- }
1384
- // Check arbitrary rdfs:subClassOf's of the expected type
1385
- if ($resource.isInstanceOf(PropertyGroup.fromRdfType, {
1386
- graph: _$options.graph,
1387
- })) {
1388
- return Right(true);
1389
- }
1390
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyGroup)`));
1349
+ ? $ensureRdfResourceType($resource, [PropertyGroup.fromRdfType], {
1350
+ graph: _$options.graph,
1391
1351
  })
1392
1352
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1393
1353
  $identifier: Right(new Resource.Value({
@@ -1448,30 +1408,23 @@ export var PropertyGroup;
1448
1408
  properties: {
1449
1409
  $identifier: {
1450
1410
  kind: "Identifier",
1451
- type: () => ({ kind: "Identifier" }),
1452
- },
1453
- $type: {
1454
- kind: "Discriminant",
1455
- type: () => ({
1456
- kind: "TypeDiscriminant",
1457
- ownValues: ["PropertyGroup"],
1458
- }),
1411
+ type: { kind: "Identifier" },
1459
1412
  },
1460
1413
  comment: {
1461
1414
  kind: "Shacl",
1462
- type: () => ({
1463
- kind: "Maybe",
1464
- item: () => ({ kind: "String" }),
1465
- }),
1466
1415
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
1416
+ type: {
1417
+ kind: "Option",
1418
+ itemType: { kind: "String" },
1419
+ },
1467
1420
  },
1468
1421
  label: {
1469
1422
  kind: "Shacl",
1470
- type: () => ({
1471
- kind: "Maybe",
1472
- item: () => ({ kind: "String" }),
1473
- }),
1474
1423
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
1424
+ type: {
1425
+ kind: "Option",
1426
+ itemType: { kind: "String" },
1427
+ },
1475
1428
  },
1476
1429
  },
1477
1430
  };
@@ -1505,8 +1458,8 @@ export var Ontology;
1505
1458
  function create(parameters) {
1506
1459
  return $sequenceRecord({
1507
1460
  $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1508
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
1509
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
1461
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1462
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1510
1463
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "Ontology" }, { $toString }));
1511
1464
  }
1512
1465
  Ontology.create = create;
@@ -1521,22 +1474,8 @@ export var Ontology;
1521
1474
  })(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
1522
1475
  Ontology._fromRdfResource = ($resource, _$options) => {
1523
1476
  return (!_$options.ignoreRdfType
1524
- ? $resource
1525
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
1526
- .chain((actualRdfType) => actualRdfType.toIri())
1527
- .chain((actualRdfType) => {
1528
- // Check the expected type and its known subtypes
1529
- switch (actualRdfType.value) {
1530
- case "http://www.w3.org/2002/07/owl#Ontology":
1531
- return Right(true);
1532
- }
1533
- // Check arbitrary rdfs:subClassOf's of the expected type
1534
- if ($resource.isInstanceOf(Ontology.fromRdfType, {
1535
- graph: _$options.graph,
1536
- })) {
1537
- return Right(true);
1538
- }
1539
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/2002/07/owl#Ontology)`));
1477
+ ? $ensureRdfResourceType($resource, [Ontology.fromRdfType], {
1478
+ graph: _$options.graph,
1540
1479
  })
1541
1480
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1542
1481
  $identifier: Right(new Resource.Value({
@@ -1597,30 +1536,23 @@ export var Ontology;
1597
1536
  properties: {
1598
1537
  $identifier: {
1599
1538
  kind: "Identifier",
1600
- type: () => ({ kind: "Identifier" }),
1601
- },
1602
- $type: {
1603
- kind: "Discriminant",
1604
- type: () => ({
1605
- kind: "TypeDiscriminant",
1606
- ownValues: ["Ontology"],
1607
- }),
1539
+ type: { kind: "Identifier" },
1608
1540
  },
1609
1541
  comment: {
1610
1542
  kind: "Shacl",
1611
- type: () => ({
1612
- kind: "Maybe",
1613
- item: () => ({ kind: "String" }),
1614
- }),
1615
1543
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
1544
+ type: {
1545
+ kind: "Option",
1546
+ itemType: { kind: "String" },
1547
+ },
1616
1548
  },
1617
1549
  label: {
1618
1550
  kind: "Shacl",
1619
- type: () => ({
1620
- kind: "Maybe",
1621
- item: () => ({ kind: "String" }),
1622
- }),
1623
1551
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
1552
+ type: {
1553
+ kind: "Option",
1554
+ itemType: { kind: "String" },
1555
+ },
1624
1556
  },
1625
1557
  },
1626
1558
  };
@@ -1654,36 +1586,36 @@ export var NodeShape;
1654
1586
  function create(parameters) {
1655
1587
  return $sequenceRecord({
1656
1588
  $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1657
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type(), value)),
1658
- classes: $convertToArray(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type(), value)),
1659
- closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type(), value)),
1660
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
1661
- datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type(), value)),
1662
- deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type(), value)),
1663
- flags: $convertToArray($identityConversionFunction, true)(parameters?.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type(), value)),
1664
- hasValues: $convertToArray($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type(), value)),
1665
- ignoredProperties: $convertToMaybe($convertToArray(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type(), value)),
1666
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type(), value)),
1667
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type(), value)),
1668
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
1669
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type(), value)),
1670
- maxCount: $convertToMaybe($identityConversionFunction)(parameters?.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type(), value)),
1671
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type(), value)),
1672
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type(), value)),
1673
- maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type(), value)),
1674
- minCount: $convertToMaybe($identityConversionFunction)(parameters?.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type(), value)),
1675
- minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type(), value)),
1676
- minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type(), value)),
1677
- minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type(), value)),
1678
- node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type(), value)),
1679
- nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type(), value)),
1680
- not: $convertToArray($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type(), value)),
1681
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type(), value)),
1682
- patterns: $convertToArray($identityConversionFunction, true)(parameters?.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type(), value)),
1683
- properties: $convertToArray($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type(), value)),
1684
- subClassOf: $convertToArray(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type(), value)),
1685
- types: $convertToArray(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type(), value)),
1686
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type(), value)),
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)),
1591
+ closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
1592
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1593
+ datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
1594
+ 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)),
1599
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
1600
+ 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)),
1603
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
1604
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
1605
+ 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)),
1607
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
1608
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
1609
+ minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
1610
+ node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
1611
+ 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)),
1687
1619
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "NodeShape" }, { $toString }));
1688
1620
  }
1689
1621
  NodeShape.create = create;
@@ -1698,22 +1630,8 @@ export var NodeShape;
1698
1630
  })(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
1699
1631
  NodeShape._fromRdfResource = ($resource, _$options) => {
1700
1632
  return (!_$options.ignoreRdfType
1701
- ? $resource
1702
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
1703
- .chain((actualRdfType) => actualRdfType.toIri())
1704
- .chain((actualRdfType) => {
1705
- // Check the expected type and its known subtypes
1706
- switch (actualRdfType.value) {
1707
- case "http://www.w3.org/ns/shacl#NodeShape":
1708
- return Right(true);
1709
- }
1710
- // Check arbitrary rdfs:subClassOf's of the expected type
1711
- if ($resource.isInstanceOf(NodeShape.fromRdfType, {
1712
- graph: _$options.graph,
1713
- })) {
1714
- return Right(true);
1715
- }
1716
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#NodeShape)`));
1633
+ ? $ensureRdfResourceType($resource, [NodeShape.fromRdfType], {
1634
+ graph: _$options.graph,
1717
1635
  })
1718
1636
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1719
1637
  $identifier: Right(new Resource.Value({
@@ -2235,208 +2153,190 @@ export var NodeShape;
2235
2153
  properties: {
2236
2154
  $identifier: {
2237
2155
  kind: "Identifier",
2238
- type: () => ({ kind: "Identifier" }),
2239
- },
2240
- $type: {
2241
- kind: "Discriminant",
2242
- type: () => ({
2243
- kind: "TypeDiscriminant",
2244
- ownValues: ["NodeShape"],
2245
- }),
2156
+ type: { kind: "Identifier" },
2246
2157
  },
2247
2158
  and: {
2248
2159
  kind: "Shacl",
2249
- type: () => ({
2250
- kind: "Maybe",
2251
- item: () => ({
2252
- kind: "List",
2253
- item: () => ({ kind: "Identifier" }),
2254
- }),
2255
- }),
2256
2160
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
2161
+ type: {
2162
+ kind: "Option",
2163
+ itemType: {
2164
+ kind: "List",
2165
+ itemType: { kind: "Identifier" },
2166
+ },
2167
+ },
2257
2168
  },
2258
2169
  classes: {
2259
2170
  kind: "Shacl",
2260
- type: () => ({
2261
- kind: "Set",
2262
- item: () => ({ kind: "Iri" }),
2263
- }),
2264
2171
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
2172
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2265
2173
  },
2266
2174
  closed: {
2267
2175
  kind: "Shacl",
2268
- type: () => ({
2269
- kind: "Maybe",
2270
- item: () => ({ kind: "Boolean" }),
2271
- }),
2272
2176
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
2177
+ type: {
2178
+ kind: "Option",
2179
+ itemType: { kind: "Boolean" },
2180
+ },
2273
2181
  },
2274
2182
  comment: {
2275
2183
  kind: "Shacl",
2276
- type: () => ({
2277
- kind: "Maybe",
2278
- item: () => ({ kind: "String" }),
2279
- }),
2280
2184
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
2185
+ type: {
2186
+ kind: "Option",
2187
+ itemType: { kind: "String" },
2188
+ },
2281
2189
  },
2282
2190
  datatype: {
2283
2191
  kind: "Shacl",
2284
- type: () => ({
2285
- kind: "Maybe",
2286
- item: () => ({ kind: "Iri" }),
2287
- }),
2288
2192
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
2193
+ type: { kind: "Option", itemType: { kind: "Iri" } },
2289
2194
  },
2290
2195
  deactivated: {
2291
2196
  kind: "Shacl",
2292
- type: () => ({
2293
- kind: "Maybe",
2294
- item: () => ({ kind: "Boolean" }),
2295
- }),
2296
2197
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
2198
+ type: {
2199
+ kind: "Option",
2200
+ itemType: { kind: "Boolean" },
2201
+ },
2297
2202
  },
2298
2203
  flags: {
2299
2204
  kind: "Shacl",
2300
- type: () => ({
2301
- kind: "Set",
2302
- item: () => ({ kind: "String" }),
2303
- }),
2304
2205
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2206
+ type: { kind: "Set", itemType: { kind: "String" } },
2305
2207
  },
2306
2208
  hasValues: {
2307
2209
  kind: "Shacl",
2308
- type: () => ({
2309
- kind: "Set",
2310
- item: () => ({ kind: "Term" }),
2311
- }),
2312
2210
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
2211
+ type: { kind: "Set", itemType: { kind: "Term" } },
2313
2212
  },
2314
2213
  ignoredProperties: {
2315
2214
  kind: "Shacl",
2316
- type: () => ({
2317
- kind: "Maybe",
2318
- item: () => ({
2319
- kind: "List",
2320
- item: () => ({ kind: "Iri" }),
2321
- }),
2322
- }),
2323
2215
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
2216
+ type: {
2217
+ kind: "Option",
2218
+ itemType: {
2219
+ kind: "List",
2220
+ itemType: { kind: "Iri" },
2221
+ },
2222
+ },
2324
2223
  },
2325
2224
  in_: {
2326
2225
  kind: "Shacl",
2327
- type: () => ({
2328
- kind: "Maybe",
2329
- item: () => ({
2330
- kind: "List",
2331
- item: () => ({ kind: "Term" }),
2332
- }),
2333
- }),
2334
2226
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
2227
+ type: {
2228
+ kind: "Option",
2229
+ itemType: {
2230
+ kind: "List",
2231
+ itemType: { kind: "Term" },
2232
+ },
2233
+ },
2335
2234
  },
2336
2235
  isDefinedBy: {
2337
2236
  kind: "Shacl",
2338
- type: () => ({
2339
- kind: "Maybe",
2340
- item: () => ({ kind: "Identifier" }),
2341
- }),
2342
2237
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
2238
+ type: {
2239
+ kind: "Option",
2240
+ itemType: { kind: "Identifier" },
2241
+ },
2343
2242
  },
2344
2243
  label: {
2345
2244
  kind: "Shacl",
2346
- type: () => ({
2347
- kind: "Maybe",
2348
- item: () => ({ kind: "String" }),
2349
- }),
2350
2245
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
2246
+ type: {
2247
+ kind: "Option",
2248
+ itemType: { kind: "String" },
2249
+ },
2351
2250
  },
2352
2251
  languageIn: {
2353
2252
  kind: "Shacl",
2354
- type: () => ({
2355
- kind: "Maybe",
2356
- item: () => ({
2357
- kind: "List",
2358
- item: () => ({ kind: "String" }),
2359
- }),
2360
- }),
2361
2253
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
2254
+ type: {
2255
+ kind: "Option",
2256
+ itemType: {
2257
+ kind: "List",
2258
+ itemType: { kind: "String" },
2259
+ },
2260
+ },
2362
2261
  },
2363
2262
  maxCount: {
2364
2263
  kind: "Shacl",
2365
- type: () => ({
2366
- kind: "Maybe",
2367
- item: () => ({ kind: "BigInt" }),
2368
- }),
2369
2264
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
2265
+ type: {
2266
+ kind: "Option",
2267
+ itemType: { kind: "BigInt" },
2268
+ },
2370
2269
  },
2371
2270
  maxExclusive: {
2372
2271
  kind: "Shacl",
2373
- type: () => ({
2374
- kind: "Maybe",
2375
- item: () => ({ kind: "Literal" }),
2376
- }),
2377
2272
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
2273
+ type: {
2274
+ kind: "Option",
2275
+ itemType: { kind: "Literal" },
2276
+ },
2378
2277
  },
2379
2278
  maxInclusive: {
2380
2279
  kind: "Shacl",
2381
- type: () => ({
2382
- kind: "Maybe",
2383
- item: () => ({ kind: "Literal" }),
2384
- }),
2385
2280
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
2281
+ type: {
2282
+ kind: "Option",
2283
+ itemType: { kind: "Literal" },
2284
+ },
2386
2285
  },
2387
2286
  maxLength: {
2388
2287
  kind: "Shacl",
2389
- type: () => ({
2390
- kind: "Maybe",
2391
- item: () => ({ kind: "BigInt" }),
2392
- }),
2393
2288
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
2289
+ type: {
2290
+ kind: "Option",
2291
+ itemType: { kind: "BigInt" },
2292
+ },
2394
2293
  },
2395
2294
  minCount: {
2396
2295
  kind: "Shacl",
2397
- type: () => ({
2398
- kind: "Maybe",
2399
- item: () => ({ kind: "BigInt" }),
2400
- }),
2401
2296
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
2297
+ type: {
2298
+ kind: "Option",
2299
+ itemType: { kind: "BigInt" },
2300
+ },
2402
2301
  },
2403
2302
  minExclusive: {
2404
2303
  kind: "Shacl",
2405
- type: () => ({
2406
- kind: "Maybe",
2407
- item: () => ({ kind: "Literal" }),
2408
- }),
2409
2304
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
2305
+ type: {
2306
+ kind: "Option",
2307
+ itemType: { kind: "Literal" },
2308
+ },
2410
2309
  },
2411
2310
  minInclusive: {
2412
2311
  kind: "Shacl",
2413
- type: () => ({
2414
- kind: "Maybe",
2415
- item: () => ({ kind: "Literal" }),
2416
- }),
2417
2312
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
2313
+ type: {
2314
+ kind: "Option",
2315
+ itemType: { kind: "Literal" },
2316
+ },
2418
2317
  },
2419
2318
  minLength: {
2420
2319
  kind: "Shacl",
2421
- type: () => ({
2422
- kind: "Maybe",
2423
- item: () => ({ kind: "BigInt" }),
2424
- }),
2425
2320
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
2321
+ type: {
2322
+ kind: "Option",
2323
+ itemType: { kind: "BigInt" },
2324
+ },
2426
2325
  },
2427
2326
  node: {
2428
2327
  kind: "Shacl",
2429
- type: () => ({
2430
- kind: "Maybe",
2431
- item: () => ({ kind: "Identifier" }),
2432
- }),
2433
2328
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
2329
+ type: {
2330
+ kind: "Option",
2331
+ itemType: { kind: "Identifier" },
2332
+ },
2434
2333
  },
2435
2334
  nodeKind: {
2436
2335
  kind: "Shacl",
2437
- type: () => ({
2438
- kind: "Maybe",
2439
- item: () => ({
2336
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
2337
+ type: {
2338
+ kind: "Option",
2339
+ itemType: {
2440
2340
  kind: "Iri",
2441
2341
  in: [
2442
2342
  dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
@@ -2446,71 +2346,61 @@ export var NodeShape;
2446
2346
  dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
2447
2347
  dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
2448
2348
  ],
2449
- }),
2450
- }),
2451
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
2349
+ },
2350
+ },
2452
2351
  },
2453
2352
  not: {
2454
2353
  kind: "Shacl",
2455
- type: () => ({
2456
- kind: "Set",
2457
- item: () => ({ kind: "Identifier" }),
2458
- }),
2459
2354
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
2355
+ type: {
2356
+ kind: "Set",
2357
+ itemType: { kind: "Identifier" },
2358
+ },
2460
2359
  },
2461
2360
  or: {
2462
2361
  kind: "Shacl",
2463
- type: () => ({
2464
- kind: "Maybe",
2465
- item: () => ({
2466
- kind: "List",
2467
- item: () => ({ kind: "Identifier" }),
2468
- }),
2469
- }),
2470
2362
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
2363
+ type: {
2364
+ kind: "Option",
2365
+ itemType: {
2366
+ kind: "List",
2367
+ itemType: { kind: "Identifier" },
2368
+ },
2369
+ },
2471
2370
  },
2472
2371
  patterns: {
2473
2372
  kind: "Shacl",
2474
- type: () => ({
2475
- kind: "Set",
2476
- item: () => ({ kind: "String" }),
2477
- }),
2478
2373
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
2374
+ type: { kind: "Set", itemType: { kind: "String" } },
2479
2375
  },
2480
2376
  properties: {
2481
2377
  kind: "Shacl",
2482
- type: () => ({
2483
- kind: "Set",
2484
- item: () => ({ kind: "Identifier" }),
2485
- }),
2486
2378
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
2379
+ type: {
2380
+ kind: "Set",
2381
+ itemType: { kind: "Identifier" },
2382
+ },
2487
2383
  },
2488
2384
  subClassOf: {
2489
2385
  kind: "Shacl",
2490
- type: () => ({
2491
- kind: "Set",
2492
- item: () => ({ kind: "Iri" }),
2493
- }),
2494
2386
  path: $RdfVocabularies.rdfs.subClassOf,
2387
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2495
2388
  },
2496
2389
  types: {
2497
2390
  kind: "Shacl",
2498
- type: () => ({
2499
- kind: "Set",
2500
- item: () => ({ kind: "Iri" }),
2501
- }),
2502
2391
  path: $RdfVocabularies.rdf.type,
2392
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2503
2393
  },
2504
2394
  xone: {
2505
2395
  kind: "Shacl",
2506
- type: () => ({
2507
- kind: "Maybe",
2508
- item: () => ({
2509
- kind: "List",
2510
- item: () => ({ kind: "Identifier" }),
2511
- }),
2512
- }),
2513
2396
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
2397
+ type: {
2398
+ kind: "Option",
2399
+ itemType: {
2400
+ kind: "List",
2401
+ itemType: { kind: "Identifier" },
2402
+ },
2403
+ },
2514
2404
  },
2515
2405
  },
2516
2406
  };
@@ -2778,178 +2668,167 @@ export var Shape;
2778
2668
  properties: {
2779
2669
  and: {
2780
2670
  kind: "Shacl",
2781
- type: () => ({
2782
- kind: "Maybe",
2783
- item: () => ({
2784
- kind: "List",
2785
- item: () => ({ kind: "Identifier" }),
2786
- }),
2787
- }),
2788
2671
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
2672
+ type: {
2673
+ kind: "Option",
2674
+ itemType: {
2675
+ kind: "List",
2676
+ itemType: { kind: "Identifier" },
2677
+ },
2678
+ },
2789
2679
  },
2790
2680
  classes: {
2791
2681
  kind: "Shacl",
2792
- type: () => ({
2793
- kind: "Set",
2794
- item: () => ({ kind: "Iri" }),
2795
- }),
2796
2682
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
2683
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2797
2684
  },
2798
2685
  comment: {
2799
2686
  kind: "Shacl",
2800
- type: () => ({
2801
- kind: "Maybe",
2802
- item: () => ({ kind: "String" }),
2803
- }),
2804
2687
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
2688
+ type: {
2689
+ kind: "Option",
2690
+ itemType: { kind: "String" },
2691
+ },
2805
2692
  },
2806
2693
  datatype: {
2807
2694
  kind: "Shacl",
2808
- type: () => ({
2809
- kind: "Maybe",
2810
- item: () => ({ kind: "Iri" }),
2811
- }),
2812
2695
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
2696
+ type: { kind: "Option", itemType: { kind: "Iri" } },
2813
2697
  },
2814
2698
  deactivated: {
2815
2699
  kind: "Shacl",
2816
- type: () => ({
2817
- kind: "Maybe",
2818
- item: () => ({ kind: "Boolean" }),
2819
- }),
2820
2700
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
2701
+ type: {
2702
+ kind: "Option",
2703
+ itemType: { kind: "Boolean" },
2704
+ },
2821
2705
  },
2822
2706
  flags: {
2823
2707
  kind: "Shacl",
2824
- type: () => ({
2825
- kind: "Set",
2826
- item: () => ({ kind: "String" }),
2827
- }),
2828
2708
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2709
+ type: { kind: "Set", itemType: { kind: "String" } },
2829
2710
  },
2830
2711
  hasValues: {
2831
2712
  kind: "Shacl",
2832
- type: () => ({
2833
- kind: "Set",
2834
- item: () => ({ kind: "Term" }),
2835
- }),
2836
2713
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
2714
+ type: { kind: "Set", itemType: { kind: "Term" } },
2837
2715
  },
2838
2716
  in_: {
2839
2717
  kind: "Shacl",
2840
- type: () => ({
2841
- kind: "Maybe",
2842
- item: () => ({
2843
- kind: "List",
2844
- item: () => ({ kind: "Term" }),
2845
- }),
2846
- }),
2847
2718
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
2719
+ type: {
2720
+ kind: "Option",
2721
+ itemType: {
2722
+ kind: "List",
2723
+ itemType: { kind: "Term" },
2724
+ },
2725
+ },
2848
2726
  },
2849
2727
  isDefinedBy: {
2850
2728
  kind: "Shacl",
2851
- type: () => ({
2852
- kind: "Maybe",
2853
- item: () => ({ kind: "Identifier" }),
2854
- }),
2855
2729
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
2730
+ type: {
2731
+ kind: "Option",
2732
+ itemType: { kind: "Identifier" },
2733
+ },
2856
2734
  },
2857
2735
  label: {
2858
2736
  kind: "Shacl",
2859
- type: () => ({
2860
- kind: "Maybe",
2861
- item: () => ({ kind: "String" }),
2862
- }),
2863
2737
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
2738
+ type: {
2739
+ kind: "Option",
2740
+ itemType: { kind: "String" },
2741
+ },
2864
2742
  },
2865
2743
  languageIn: {
2866
2744
  kind: "Shacl",
2867
- type: () => ({
2868
- kind: "Maybe",
2869
- item: () => ({
2870
- kind: "List",
2871
- item: () => ({ kind: "String" }),
2872
- }),
2873
- }),
2874
2745
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
2746
+ type: {
2747
+ kind: "Option",
2748
+ itemType: {
2749
+ kind: "List",
2750
+ itemType: { kind: "String" },
2751
+ },
2752
+ },
2875
2753
  },
2876
2754
  maxCount: {
2877
2755
  kind: "Shacl",
2878
- type: () => ({
2879
- kind: "Maybe",
2880
- item: () => ({ kind: "BigInt" }),
2881
- }),
2882
2756
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
2757
+ type: {
2758
+ kind: "Option",
2759
+ itemType: { kind: "BigInt" },
2760
+ },
2883
2761
  },
2884
2762
  maxExclusive: {
2885
2763
  kind: "Shacl",
2886
- type: () => ({
2887
- kind: "Maybe",
2888
- item: () => ({ kind: "Literal" }),
2889
- }),
2890
2764
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
2765
+ type: {
2766
+ kind: "Option",
2767
+ itemType: { kind: "Literal" },
2768
+ },
2891
2769
  },
2892
2770
  maxInclusive: {
2893
2771
  kind: "Shacl",
2894
- type: () => ({
2895
- kind: "Maybe",
2896
- item: () => ({ kind: "Literal" }),
2897
- }),
2898
2772
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
2773
+ type: {
2774
+ kind: "Option",
2775
+ itemType: { kind: "Literal" },
2776
+ },
2899
2777
  },
2900
2778
  maxLength: {
2901
2779
  kind: "Shacl",
2902
- type: () => ({
2903
- kind: "Maybe",
2904
- item: () => ({ kind: "BigInt" }),
2905
- }),
2906
2780
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
2781
+ type: {
2782
+ kind: "Option",
2783
+ itemType: { kind: "BigInt" },
2784
+ },
2907
2785
  },
2908
2786
  minCount: {
2909
2787
  kind: "Shacl",
2910
- type: () => ({
2911
- kind: "Maybe",
2912
- item: () => ({ kind: "BigInt" }),
2913
- }),
2914
2788
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
2789
+ type: {
2790
+ kind: "Option",
2791
+ itemType: { kind: "BigInt" },
2792
+ },
2915
2793
  },
2916
2794
  minExclusive: {
2917
2795
  kind: "Shacl",
2918
- type: () => ({
2919
- kind: "Maybe",
2920
- item: () => ({ kind: "Literal" }),
2921
- }),
2922
2796
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
2797
+ type: {
2798
+ kind: "Option",
2799
+ itemType: { kind: "Literal" },
2800
+ },
2923
2801
  },
2924
2802
  minInclusive: {
2925
2803
  kind: "Shacl",
2926
- type: () => ({
2927
- kind: "Maybe",
2928
- item: () => ({ kind: "Literal" }),
2929
- }),
2930
2804
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
2805
+ type: {
2806
+ kind: "Option",
2807
+ itemType: { kind: "Literal" },
2808
+ },
2931
2809
  },
2932
2810
  minLength: {
2933
2811
  kind: "Shacl",
2934
- type: () => ({
2935
- kind: "Maybe",
2936
- item: () => ({ kind: "BigInt" }),
2937
- }),
2938
2812
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
2813
+ type: {
2814
+ kind: "Option",
2815
+ itemType: { kind: "BigInt" },
2816
+ },
2939
2817
  },
2940
2818
  node: {
2941
2819
  kind: "Shacl",
2942
- type: () => ({
2943
- kind: "Maybe",
2944
- item: () => ({ kind: "Identifier" }),
2945
- }),
2946
2820
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
2821
+ type: {
2822
+ kind: "Option",
2823
+ itemType: { kind: "Identifier" },
2824
+ },
2947
2825
  },
2948
2826
  nodeKind: {
2949
2827
  kind: "Shacl",
2950
- type: () => ({
2951
- kind: "Maybe",
2952
- item: () => ({
2828
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
2829
+ type: {
2830
+ kind: "Option",
2831
+ itemType: {
2953
2832
  kind: "Iri",
2954
2833
  in: [
2955
2834
  dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
@@ -2959,47 +2838,43 @@ export var Shape;
2959
2838
  dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
2960
2839
  dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
2961
2840
  ],
2962
- }),
2963
- }),
2964
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
2841
+ },
2842
+ },
2965
2843
  },
2966
2844
  not: {
2967
2845
  kind: "Shacl",
2968
- type: () => ({
2969
- kind: "Set",
2970
- item: () => ({ kind: "Identifier" }),
2971
- }),
2972
2846
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
2847
+ type: {
2848
+ kind: "Set",
2849
+ itemType: { kind: "Identifier" },
2850
+ },
2973
2851
  },
2974
2852
  or: {
2975
2853
  kind: "Shacl",
2976
- type: () => ({
2977
- kind: "Maybe",
2978
- item: () => ({
2979
- kind: "List",
2980
- item: () => ({ kind: "Identifier" }),
2981
- }),
2982
- }),
2983
2854
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
2855
+ type: {
2856
+ kind: "Option",
2857
+ itemType: {
2858
+ kind: "List",
2859
+ itemType: { kind: "Identifier" },
2860
+ },
2861
+ },
2984
2862
  },
2985
2863
  patterns: {
2986
2864
  kind: "Shacl",
2987
- type: () => ({
2988
- kind: "Set",
2989
- item: () => ({ kind: "String" }),
2990
- }),
2991
2865
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
2866
+ type: { kind: "Set", itemType: { kind: "String" } },
2992
2867
  },
2993
2868
  xone: {
2994
2869
  kind: "Shacl",
2995
- type: () => ({
2996
- kind: "Maybe",
2997
- item: () => ({
2998
- kind: "List",
2999
- item: () => ({ kind: "Identifier" }),
3000
- }),
3001
- }),
3002
2870
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
2871
+ type: {
2872
+ kind: "Option",
2873
+ itemType: {
2874
+ kind: "List",
2875
+ itemType: { kind: "Identifier" },
2876
+ },
2877
+ },
3003
2878
  },
3004
2879
  },
3005
2880
  };
@@ -3123,19 +2998,19 @@ export var $Object;
3123
2998
  properties: {
3124
2999
  comment: {
3125
3000
  kind: "Shacl",
3126
- type: () => ({
3127
- kind: "Maybe",
3128
- item: () => ({ kind: "String" }),
3129
- }),
3130
3001
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
3002
+ type: {
3003
+ kind: "Option",
3004
+ itemType: { kind: "String" },
3005
+ },
3131
3006
  },
3132
3007
  label: {
3133
3008
  kind: "Shacl",
3134
- type: () => ({
3135
- kind: "Maybe",
3136
- item: () => ({ kind: "String" }),
3137
- }),
3138
3009
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
3010
+ type: {
3011
+ kind: "Option",
3012
+ itemType: { kind: "String" },
3013
+ },
3139
3014
  },
3140
3015
  },
3141
3016
  };