@shaclmate/compiler 4.0.100 → 4.0.102

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.
@@ -6,6 +6,7 @@ export declare class Imports {
6
6
  readonly datasetFactory: import("ts-poet/build/Import.js").Import;
7
7
  readonly Either: import("ts-poet/build/Import.js").Import;
8
8
  readonly EitherAsync: import("ts-poet/build/Import.js").Import;
9
+ readonly expandIri: import("ts-poet/build/Import.js").Import;
9
10
  readonly GraphQLBigInt: import("ts-poet/build/Import.js").Import;
10
11
  readonly GraphQLBoolean: import("ts-poet/build/Import.js").Import;
11
12
  readonly GraphQLDate: import("ts-poet/build/Import.js").Import;
@@ -7,6 +7,7 @@ export class Imports {
7
7
  datasetFactory = imp("datasetFactory@@rdfx/collection");
8
8
  Either = imp("Either@purify-ts");
9
9
  EitherAsync = imp("EitherAsync@purify-ts");
10
+ expandIri = imp("expandIri@@rdfx/curie");
10
11
  GraphQLBigInt = imp("BigInt:GraphQLBigInt@graphql-scalars");
11
12
  GraphQLBoolean = imp("GraphQLBoolean@graphql");
12
13
  GraphQLDate = imp("Date:GraphQLDate@graphql-scalars");
@@ -190,7 +190,6 @@ export declare class Snippets {
190
190
  get iriFromJsonObject(): Snippet;
191
191
  get iriFromJsonString(): Snippet;
192
192
  get iriFromRdfResourceValues(): Snippet;
193
- get iriFromString(): Snippet;
194
193
  get iriLiteralFromJsonObject(): Snippet;
195
194
  get iriLiteralFromJsonString(): Snippet;
196
195
  get iriSparqlWherePatterns(): Snippet;
@@ -184,7 +184,6 @@ import { snippets_intFromRdfResourceValues } from "./_snippets/snippets_intFromR
184
184
  import { snippets_iriFromJsonObject } from "./_snippets/snippets_iriFromJsonObject.js";
185
185
  import { snippets_iriFromJsonString } from "./_snippets/snippets_iriFromJsonString.js";
186
186
  import { snippets_iriFromRdfResourceValues } from "./_snippets/snippets_iriFromRdfResourceValues.js";
187
- import { snippets_iriFromString } from "./_snippets/snippets_iriFromString.js";
188
187
  import { snippets_iriLiteralFromJsonObject } from "./_snippets/snippets_iriLiteralFromJsonObject.js";
189
188
  import { snippets_iriLiteralFromJsonString } from "./_snippets/snippets_iriLiteralFromJsonString.js";
190
189
  import { snippets_iriSparqlWherePatterns } from "./_snippets/snippets_iriSparqlWherePatterns.js";
@@ -795,9 +794,6 @@ export class Snippets {
795
794
  get iriFromRdfResourceValues() {
796
795
  return this.snippet(snippets_iriFromRdfResourceValues);
797
796
  }
798
- get iriFromString() {
799
- return this.snippet(snippets_iriFromString);
800
- }
801
797
  get iriLiteralFromJsonObject() {
802
798
  return this.snippet(snippets_iriLiteralFromJsonObject);
803
799
  }
@@ -1605,9 +1601,6 @@ __decorate([
1605
1601
  __decorate([
1606
1602
  Memoize()
1607
1603
  ], Snippets.prototype, "iriFromRdfResourceValues", null);
1608
- __decorate([
1609
- Memoize()
1610
- ], Snippets.prototype, "iriFromString", null);
1611
1604
  __decorate([
1612
1605
  Memoize()
1613
1606
  ], Snippets.prototype, "iriLiteralFromJsonObject", null);
@@ -5,7 +5,7 @@ function ${syntheticNamePrefix}convertToIdentifier<DefaultNamespaceT extends ${s
5
5
  case "object":
6
6
  return ${imports.Either}.of(value);
7
7
  case "string":
8
- return ${snippets.iriFromString}(value, { defaultNamespace });
8
+ return ${imports.expandIri}(value, { dataFactory: ${imports.dataFactory}, defaultNamespace });
9
9
  case "undefined":
10
10
  return ${imports.Either}.of(${imports.dataFactory}.blankNode());
11
11
  }
@@ -9,7 +9,7 @@ function ${syntheticNamePrefix}convertToIdentifierProperty<DefaultNamespaceT ext
9
9
  return ${imports.Either}.of(() => captureIdentifier);
10
10
  }
11
11
  case "string":
12
- return ${snippets.iriFromString}(identifier, { defaultNamespace }).map(iri => (() => iri));
12
+ return ${imports.expandIri}(identifier, { dataFactory: ${imports.dataFactory}, defaultNamespace }).map(iri => (() => iri));
13
13
  case "undefined": {
14
14
  const captureIdentifier = ${imports.dataFactory}.blankNode();
15
15
  return ${imports.Either}.of(() => captureIdentifier);
@@ -5,7 +5,7 @@ function ${syntheticNamePrefix}convertToIri<DefaultNamespaceT extends ${snippets
5
5
  case "object":
6
6
  return ${imports.Either}.of(value);
7
7
  case "string":
8
- return ${snippets.iriFromString}(value, { defaultNamespace });
8
+ return ${imports.expandIri}(value, { dataFactory: ${imports.dataFactory}, defaultNamespace });
9
9
  }
10
10
  }`);
11
11
  //# sourceMappingURL=snippets_convertToIri.js.map
@@ -9,7 +9,7 @@ function ${syntheticNamePrefix}convertToIriIdentifierProperty<DefaultNamespaceT
9
9
  return ${imports.Either}.of(() => captureIdentifier);
10
10
  }
11
11
  case "string": {
12
- return ${snippets.iriFromString}(identifier, { defaultNamespace }).map(iri => (() => iri));
12
+ return ${imports.expandIri}(identifier, { dataFactory: ${imports.dataFactory}, defaultNamespace }).map(iri => (() => iri));
13
13
  }
14
14
  }
15
15
  }`);
@@ -1,6 +1,6 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_iriFromJsonString = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}iriFromJsonString`, code `\
3
3
  function ${syntheticNamePrefix}iriFromJsonString(jsonString: string, options: Parameters<${snippets.FromJsonFunction}<string, ${imports.NamedNode}, object>>[1]): ${imports.Either}<Error, ${imports.NamedNode}> {
4
- return ${snippets.iriFromString}(jsonString, options);
4
+ return ${imports.expandIri}(jsonString, { ...options, dataFactory: ${imports.dataFactory} });
5
5
  }`);
6
6
  //# sourceMappingURL=snippets_iriFromJsonString.js.map
@@ -1,5 +1,5 @@
1
1
  import { datasetFactory, TermMap } from "@rdfx/collection";
2
- import { Curie } from "@rdfx/curie";
2
+ import { shrinkIri } from "@rdfx/curie";
3
3
  import dataFactory from "@rdfx/data-factory";
4
4
  import { ResourceSet } from "@rdfx/resource";
5
5
  import { AbstractShapesGraph } from "@shaclmate/shacl-ast";
@@ -31,7 +31,7 @@ export class ShapesGraph extends AbstractShapesGraph {
31
31
  if (cachedCurie) {
32
32
  return cachedCurie;
33
33
  }
34
- const curie = Curie.fromIri(term, {
34
+ const curie = shrinkIri(term, {
35
35
  prefixMap: options.prefixMap,
36
36
  }).extract();
37
37
  if (curie) {