@shaclmate/shacl-ast 4.0.93 → 4.0.94

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.
@@ -26,7 +26,7 @@ export type $FromRdfResourceValuesFunction<ValueT, ValueSchemaT> = (resourceValu
26
26
  /**
27
27
  * NamespaceBuilder type excerpted from @rdfjs/namespace (MIT license) in lieu of a type import.
28
28
  */
29
- type $NamespaceBuilder<TermNames extends string = any> = Record<TermNames, NamedNode> & ((property?: TemplateStringsArray | TermNames) => NamedNode);
29
+ export type $NamespaceBuilder<TermNames extends string = any> = Record<TermNames, NamedNode> & ((property?: TemplateStringsArray | TermNames) => NamedNode);
30
30
  export type $PropertyPath = RdfxResourcePropertyPath;
31
31
  export declare namespace $PropertyPath {
32
32
  const fromRdfResource: $FromRdfResourceFunction<$PropertyPath>;
@@ -99,11 +99,11 @@ export declare namespace NodeShape {
99
99
  readonly languageIn?: readonly string[] | Maybe<readonly string[]>;
100
100
  readonly maxExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
101
101
  readonly maxInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
102
- readonly maxLength?: bigint | Maybe<bigint>;
102
+ readonly maxLength?: bigint | number | string | Maybe<bigint>;
103
103
  readonly message?: string | Maybe<string>;
104
104
  readonly minExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
105
105
  readonly minInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
106
- readonly minLength?: bigint | Maybe<bigint>;
106
+ readonly minLength?: bigint | number | string | Maybe<bigint>;
107
107
  readonly node?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | Maybe<BlankNode | NamedNode>;
108
108
  readonly nodeKind?: ("http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal") | NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal"> | Maybe<NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal">>;
109
109
  readonly not?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | readonly (BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | undefined)[];
@@ -137,11 +137,11 @@ export declare namespace NodeShape {
137
137
  readonly languageIn?: readonly string[] | Maybe<readonly string[]>;
138
138
  readonly maxExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
139
139
  readonly maxInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
140
- readonly maxLength?: bigint | Maybe<bigint>;
140
+ readonly maxLength?: bigint | number | string | Maybe<bigint>;
141
141
  readonly message?: string | Maybe<string>;
142
142
  readonly minExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
143
143
  readonly minInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
144
- readonly minLength?: bigint | Maybe<bigint>;
144
+ readonly minLength?: bigint | number | string | Maybe<bigint>;
145
145
  readonly node?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | Maybe<BlankNode | NamedNode>;
146
146
  readonly nodeKind?: ("http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal") | NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal"> | Maybe<NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal">>;
147
147
  readonly not?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | readonly (BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | undefined)[];
@@ -767,15 +767,15 @@ export declare namespace PropertyShape {
767
767
  readonly languageIn?: readonly string[] | Maybe<readonly string[]>;
768
768
  readonly lessThan?: (keyof $DefaultNamespaceT & string) | NamedNode | readonly ((keyof $DefaultNamespaceT & string) | NamedNode)[];
769
769
  readonly lessThanOrEquals?: (keyof $DefaultNamespaceT & string) | NamedNode | readonly ((keyof $DefaultNamespaceT & string) | NamedNode)[];
770
- readonly maxCount?: bigint | Maybe<bigint>;
770
+ readonly maxCount?: bigint | number | string | Maybe<bigint>;
771
771
  readonly maxExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
772
772
  readonly maxInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
773
- readonly maxLength?: bigint | Maybe<bigint>;
773
+ readonly maxLength?: bigint | number | string | Maybe<bigint>;
774
774
  readonly message?: string | Maybe<string>;
775
- readonly minCount?: bigint | Maybe<bigint>;
775
+ readonly minCount?: bigint | number | string | Maybe<bigint>;
776
776
  readonly minExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
777
777
  readonly minInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
778
- readonly minLength?: bigint | Maybe<bigint>;
778
+ readonly minLength?: bigint | number | string | Maybe<bigint>;
779
779
  readonly name?: string | Maybe<string>;
780
780
  readonly node?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | Maybe<BlankNode | NamedNode>;
781
781
  readonly nodeKind?: ("http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal") | NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal"> | Maybe<NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal">>;
@@ -784,8 +784,8 @@ export declare namespace PropertyShape {
784
784
  readonly order?: number | Maybe<number>;
785
785
  readonly path: $PropertyPath;
786
786
  readonly pattern?: string | Maybe<string>;
787
- readonly qualifiedMaxCount?: bigint | Maybe<bigint>;
788
- readonly qualifiedMinCount?: bigint | Maybe<bigint>;
787
+ readonly qualifiedMaxCount?: bigint | number | string | Maybe<bigint>;
788
+ readonly qualifiedMinCount?: bigint | number | string | Maybe<bigint>;
789
789
  readonly qualifiedValueShape?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | Maybe<BlankNode | NamedNode>;
790
790
  readonly qualifiedValueShapesDisjoint?: boolean | Maybe<boolean>;
791
791
  readonly severity?: Severity["value"] | Severity | Maybe<Severity>;
@@ -817,15 +817,15 @@ export declare namespace PropertyShape {
817
817
  readonly languageIn?: readonly string[] | Maybe<readonly string[]>;
818
818
  readonly lessThan?: (keyof $DefaultNamespaceT & string) | NamedNode | readonly ((keyof $DefaultNamespaceT & string) | NamedNode)[];
819
819
  readonly lessThanOrEquals?: (keyof $DefaultNamespaceT & string) | NamedNode | readonly ((keyof $DefaultNamespaceT & string) | NamedNode)[];
820
- readonly maxCount?: bigint | Maybe<bigint>;
820
+ readonly maxCount?: bigint | number | string | Maybe<bigint>;
821
821
  readonly maxExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
822
822
  readonly maxInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
823
- readonly maxLength?: bigint | Maybe<bigint>;
823
+ readonly maxLength?: bigint | number | string | Maybe<bigint>;
824
824
  readonly message?: string | Maybe<string>;
825
- readonly minCount?: bigint | Maybe<bigint>;
825
+ readonly minCount?: bigint | number | string | Maybe<bigint>;
826
826
  readonly minExclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
827
827
  readonly minInclusive?: bigint | boolean | number | string | Date | Literal | Maybe<Literal>;
828
- readonly minLength?: bigint | Maybe<bigint>;
828
+ readonly minLength?: bigint | number | string | Maybe<bigint>;
829
829
  readonly name?: string | Maybe<string>;
830
830
  readonly node?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | Maybe<BlankNode | NamedNode>;
831
831
  readonly nodeKind?: ("http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal") | NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal"> | Maybe<NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal">>;
@@ -834,8 +834,8 @@ export declare namespace PropertyShape {
834
834
  readonly order?: number | Maybe<number>;
835
835
  readonly path: $PropertyPath;
836
836
  readonly pattern?: string | Maybe<string>;
837
- readonly qualifiedMaxCount?: bigint | Maybe<bigint>;
838
- readonly qualifiedMinCount?: bigint | Maybe<bigint>;
837
+ readonly qualifiedMaxCount?: bigint | number | string | Maybe<bigint>;
838
+ readonly qualifiedMinCount?: bigint | number | string | Maybe<bigint>;
839
839
  readonly qualifiedValueShape?: BlankNode | NamedNode | (keyof $DefaultNamespaceT & string) | Maybe<BlankNode | NamedNode>;
840
840
  readonly qualifiedValueShapesDisjoint?: boolean | Maybe<boolean>;
841
841
  readonly severity?: Severity["value"] | Severity | Maybe<Severity>;
@@ -24,6 +24,7 @@ function $compactRecord(record) {
24
24
  return definedProperties;
25
25
  }, {});
26
26
  }
27
+ const $convertToBigInt = (value) => Either.encase(() => BigInt(value));
27
28
  function $convertToIdentifier(value, defaultNamespace) {
28
29
  switch (typeof value) {
29
30
  case "object":
@@ -649,11 +650,11 @@ export var NodeShape;
649
650
  languageIn: $convertToMaybe($convertToList($identityConversionFunction))(parameters?.languageIn, parameters?.$defaultNamespace).chain((value) => $validateMaybe($validateArray($identityValidationFunction))(NodeShape.schema.properties.languageIn.type, value)),
650
651
  maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
651
652
  maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
652
- maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
653
+ maxLength: $convertToMaybe($convertToBigInt)(parameters?.maxLength, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
653
654
  message: $convertToMaybe($identityConversionFunction)(parameters?.message, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
654
655
  minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
655
656
  minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
656
- minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
657
+ minLength: $convertToMaybe($convertToBigInt)(parameters?.minLength, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
657
658
  node: $convertToMaybe($convertToIdentifier)(parameters?.node, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
658
659
  nodeKind: $convertToMaybe(($convertToInIri))(parameters?.nodeKind, parameters?.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
659
660
  not: $convertToScalarSet($convertToIdentifier)(parameters?.not, parameters?.$defaultNamespace).chain((value) => $validateArray($identityValidationFunction)(NodeShape.schema.properties.not.type, value)),
@@ -1521,15 +1522,15 @@ export var PropertyShape;
1521
1522
  languageIn: $convertToMaybe($convertToList($identityConversionFunction))(parameters.languageIn, parameters.$defaultNamespace).chain((value) => $validateMaybe($validateArray($identityValidationFunction))(NodeShape.schema.properties.languageIn.type, value)),
1522
1523
  lessThan: $convertToScalarSet($convertToIri)(parameters.lessThan, parameters.$defaultNamespace).chain((value) => $validateArray($identityValidationFunction)(PropertyShape.schema.properties.lessThan.type, value)),
1523
1524
  lessThanOrEquals: $convertToScalarSet($convertToIri)(parameters.lessThanOrEquals, parameters.$defaultNamespace).chain((value) => $validateArray($identityValidationFunction)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
1524
- maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
1525
+ maxCount: $convertToMaybe($convertToBigInt)(parameters.maxCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
1525
1526
  maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
1526
1527
  maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
1527
- maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
1528
+ maxLength: $convertToMaybe($convertToBigInt)(parameters.maxLength, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
1528
1529
  message: $convertToMaybe($identityConversionFunction)(parameters.message, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
1529
- minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
1530
+ minCount: $convertToMaybe($convertToBigInt)(parameters.minCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
1530
1531
  minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
1531
1532
  minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
1532
- minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
1533
+ minLength: $convertToMaybe($convertToBigInt)(parameters.minLength, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
1533
1534
  name: $convertToMaybe($identityConversionFunction)(parameters.name, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
1534
1535
  node: $convertToMaybe($convertToIdentifier)(parameters.node, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
1535
1536
  nodeKind: $convertToMaybe(($convertToInIri))(parameters.nodeKind, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
@@ -1538,8 +1539,8 @@ export var PropertyShape;
1538
1539
  order: $convertToMaybe($identityConversionFunction)(parameters.order, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
1539
1540
  path: Either.of(parameters.path),
1540
1541
  pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
1541
- qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
1542
- qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
1542
+ qualifiedMaxCount: $convertToMaybe($convertToBigInt)(parameters.qualifiedMaxCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
1543
+ qualifiedMinCount: $convertToMaybe($convertToBigInt)(parameters.qualifiedMinCount, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
1543
1544
  qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
1544
1545
  qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
1545
1546
  severity: $convertToMaybe(($convertToInIri))(parameters.severity, parameters.$defaultNamespace).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
@@ -2282,20 +2283,71 @@ export var Shape;
2282
2283
  ...options,
2283
2284
  ignoreRdfType: false,
2284
2285
  }));
2285
- Shape.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
2286
- const valueAsValues = value.toValues();
2287
- return NodeShape.fromRdfResourceValues(valueAsValues, {
2288
- ...options,
2289
- ignoreRdfType: false,
2290
- schema: options.schema.members["NodeShape"].type,
2291
- })
2292
- .altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
2293
- ...options,
2294
- ignoreRdfType: false,
2295
- schema: options.schema.members["PropertyShape"].type,
2296
- }))
2297
- .chain((values) => values.head());
2298
- }));
2286
+ Shape.fromRdfResourceValues = ((inputValues, options) => {
2287
+ const memberInputValues = Array.from({ length: 2 }).map(() => Resource.Values.empty({
2288
+ focusResource: inputValues.focusResource,
2289
+ propertyPath: inputValues.propertyPath,
2290
+ }));
2291
+ for (const inputValue of inputValues) {
2292
+ const inputValueAsValues = inputValue.toValues();
2293
+ let memberOutputValuesEither;
2294
+ for (let memberI = 0; memberI < 2; memberI++) {
2295
+ if (memberI === 0) {
2296
+ memberOutputValuesEither = NodeShape.fromRdfResourceValues(inputValueAsValues, {
2297
+ ...options,
2298
+ ignoreRdfType: false,
2299
+ schema: options.schema.members["NodeShape"].type,
2300
+ });
2301
+ if (memberOutputValuesEither.isRight()) {
2302
+ memberInputValues[memberI] =
2303
+ memberInputValues[memberI].concat(inputValue);
2304
+ break;
2305
+ }
2306
+ }
2307
+ else if (memberI === 1) {
2308
+ memberOutputValuesEither = PropertyShape.fromRdfResourceValues(inputValueAsValues, {
2309
+ ...options,
2310
+ ignoreRdfType: false,
2311
+ schema: options.schema.members["PropertyShape"].type,
2312
+ });
2313
+ if (memberOutputValuesEither.isRight()) {
2314
+ memberInputValues[memberI] =
2315
+ memberInputValues[memberI].concat(inputValue);
2316
+ break;
2317
+ }
2318
+ }
2319
+ }
2320
+ if (memberOutputValuesEither.isLeft()) {
2321
+ return memberOutputValuesEither;
2322
+ }
2323
+ }
2324
+ let collectedOutputValues = Resource.Values.empty({
2325
+ focusResource: inputValues.focusResource,
2326
+ propertyPath: inputValues.propertyPath,
2327
+ });
2328
+ for (let memberI = 0; memberI < 2; memberI++) {
2329
+ if (memberInputValues[memberI].length === 0) {
2330
+ continue;
2331
+ }
2332
+ switch (memberI) {
2333
+ case 0:
2334
+ collectedOutputValues = collectedOutputValues.concat(...NodeShape.fromRdfResourceValues(memberInputValues[memberI], {
2335
+ ...options,
2336
+ ignoreRdfType: false,
2337
+ schema: options.schema.members["NodeShape"].type,
2338
+ }).unsafeCoerce());
2339
+ break;
2340
+ case 1:
2341
+ collectedOutputValues = collectedOutputValues.concat(...PropertyShape.fromRdfResourceValues(memberInputValues[memberI], {
2342
+ ...options,
2343
+ ignoreRdfType: false,
2344
+ schema: options.schema.members["PropertyShape"].type,
2345
+ }).unsafeCoerce());
2346
+ break;
2347
+ }
2348
+ }
2349
+ return Right(collectedOutputValues);
2350
+ });
2299
2351
  let Identifier;
2300
2352
  (function (Identifier) {
2301
2353
  Identifier.parse = $parseIdentifier;
package/package.json CHANGED
@@ -52,5 +52,5 @@
52
52
  },
53
53
  "type": "module",
54
54
  "types": "./dist/index.d.ts",
55
- "version": "4.0.93"
55
+ "version": "4.0.94"
56
56
  }