@shaclmate/compiler 4.0.97 → 4.0.99

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.
Files changed (173) hide show
  1. package/dist/generators/ts/AbstractCollectionType.d.ts +2 -1
  2. package/dist/generators/ts/AbstractCollectionType.js +10 -5
  3. package/dist/generators/ts/AbstractCompoundType.d.ts +11 -8
  4. package/dist/generators/ts/AbstractCompoundType.js +5 -2
  5. package/dist/generators/ts/AbstractContainerType.d.ts +11 -11
  6. package/dist/generators/ts/AbstractContainerType.js +21 -15
  7. package/dist/generators/ts/AbstractDateType.d.ts +7 -6
  8. package/dist/generators/ts/AbstractDateType.js +16 -6
  9. package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +2 -3
  10. package/dist/generators/ts/AbstractDiscriminatedUnionType.js +25 -7
  11. package/dist/generators/ts/AbstractIntersectionType.d.ts +2 -2
  12. package/dist/generators/ts/AbstractIntersectionType.js +19 -8
  13. package/dist/generators/ts/AbstractLazyType.d.ts +23 -23
  14. package/dist/generators/ts/AbstractLazyType.js +23 -21
  15. package/dist/generators/ts/AbstractNumericType.d.ts +4 -3
  16. package/dist/generators/ts/AbstractNumericType.js +12 -7
  17. package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -2
  18. package/dist/generators/ts/AbstractPrimitiveType.js +4 -4
  19. package/dist/generators/ts/AbstractTermType.d.ts +17 -16
  20. package/dist/generators/ts/AbstractTermType.js +21 -11
  21. package/dist/generators/ts/AbstractType.d.ts +6 -15
  22. package/dist/generators/ts/AbstractType.js +14 -33
  23. package/dist/generators/ts/AbstractTypedLiteralType.d.ts +2 -1
  24. package/dist/generators/ts/AbstractTypedLiteralType.js +20 -2
  25. package/dist/generators/ts/BigDecimalType.d.ts +12 -11
  26. package/dist/generators/ts/BigDecimalType.js +28 -11
  27. package/dist/generators/ts/BigIntType.js +6 -6
  28. package/dist/generators/ts/BlankNodeType.d.ts +11 -10
  29. package/dist/generators/ts/BlankNodeType.js +27 -10
  30. package/dist/generators/ts/BooleanType.d.ts +6 -5
  31. package/dist/generators/ts/BooleanType.js +18 -8
  32. package/dist/generators/ts/Callable.d.ts +2 -2
  33. package/dist/generators/ts/DateTimeType.d.ts +6 -6
  34. package/dist/generators/ts/DateTimeType.js +6 -6
  35. package/dist/generators/ts/DateType.d.ts +6 -6
  36. package/dist/generators/ts/DateType.js +6 -6
  37. package/dist/generators/ts/DefaultValueType.d.ts +2 -2
  38. package/dist/generators/ts/DefaultValueType.js +18 -8
  39. package/dist/generators/ts/FloatType.js +4 -4
  40. package/dist/generators/ts/IdentifierType.d.ts +11 -10
  41. package/dist/generators/ts/IdentifierType.js +27 -10
  42. package/dist/generators/ts/Imports.d.ts +1 -0
  43. package/dist/generators/ts/Imports.js +1 -0
  44. package/dist/generators/ts/IntType.js +4 -4
  45. package/dist/generators/ts/IriType.d.ts +5 -5
  46. package/dist/generators/ts/IriType.js +36 -21
  47. package/dist/generators/ts/LangStringType.d.ts +10 -10
  48. package/dist/generators/ts/LangStringType.js +21 -13
  49. package/dist/generators/ts/ListType.js +7 -7
  50. package/dist/generators/ts/LiteralType.d.ts +10 -10
  51. package/dist/generators/ts/LiteralType.js +21 -13
  52. package/dist/generators/ts/ObjectType.d.ts +13 -15
  53. package/dist/generators/ts/ObjectType.js +32 -9
  54. package/dist/generators/ts/OptionType.d.ts +2 -1
  55. package/dist/generators/ts/OptionType.js +16 -11
  56. package/dist/generators/ts/SetType.d.ts +2 -1
  57. package/dist/generators/ts/SetType.js +22 -10
  58. package/dist/generators/ts/Snippets.d.ts +8 -6
  59. package/dist/generators/ts/Snippets.js +48 -34
  60. package/dist/generators/ts/StringType.d.ts +6 -6
  61. package/dist/generators/ts/StringType.js +20 -17
  62. package/dist/generators/ts/TermType.d.ts +7 -7
  63. package/dist/generators/ts/TermType.js +18 -13
  64. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +1 -1
  65. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +39 -16
  66. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +49 -33
  67. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +1 -1
  68. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromJsonObjectFunction.js +1 -1
  69. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +1 -1
  70. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +4 -7
  71. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +1 -3
  72. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +0 -1
  73. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +0 -1
  74. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +3 -2
  75. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +31 -11
  76. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +3 -2
  77. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +26 -10
  78. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +3 -2
  79. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +46 -22
  80. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonObjectFunction.js +7 -2
  81. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +1 -1
  82. package/dist/generators/ts/_ObjectType/ObjectType_toJsonObjectFunction.js +1 -1
  83. package/dist/generators/ts/_snippets/snippets_FromJsonFunction.d.ts +3 -0
  84. package/dist/generators/ts/_snippets/snippets_FromJsonFunction.js +28 -0
  85. package/dist/generators/ts/_snippets/snippets_ToJsonFunction.d.ts +3 -0
  86. package/dist/generators/ts/_snippets/snippets_ToJsonFunction.js +3 -0
  87. package/dist/generators/ts/_snippets/snippets_arrayFromJsonArray.js +1 -1
  88. package/dist/generators/ts/_snippets/snippets_arrayToJsonArray.js +1 -1
  89. package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonObject.js +1 -1
  90. package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonString.js +1 -1
  91. package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonObject.js +1 -1
  92. package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonString.js +1 -1
  93. package/dist/generators/ts/_snippets/snippets_bigIntFromJsonObject.js +1 -1
  94. package/dist/generators/ts/_snippets/snippets_bigIntFromJsonString.js +1 -1
  95. package/dist/generators/ts/_snippets/snippets_bigIntToJsonObject.js +1 -1
  96. package/dist/generators/ts/_snippets/snippets_bigIntToJsonString.js +1 -1
  97. package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonObject.js +1 -1
  98. package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonString.js +1 -1
  99. package/dist/generators/ts/_snippets/snippets_blankNodeToJsonObject.js +1 -1
  100. package/dist/generators/ts/_snippets/snippets_blankNodeToJsonString.js +1 -1
  101. package/dist/generators/ts/_snippets/snippets_booleanFromJsonBoolean.js +1 -1
  102. package/dist/generators/ts/_snippets/snippets_booleanFromJsonObject.js +1 -1
  103. package/dist/generators/ts/_snippets/snippets_convertToIdentifier.js +1 -1
  104. package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.js +2 -4
  105. package/dist/generators/ts/_snippets/snippets_convertToIri.js +1 -1
  106. package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.js +1 -2
  107. package/dist/generators/ts/_snippets/snippets_convertToIriLiteral.d.ts +3 -0
  108. package/dist/generators/ts/_snippets/snippets_convertToIriLiteral.js +11 -0
  109. package/dist/generators/ts/_snippets/snippets_convertToIriLiteralIdentifierProperty.d.ts +3 -0
  110. package/dist/generators/ts/_snippets/snippets_convertToIriLiteralIdentifierProperty.js +17 -0
  111. package/dist/generators/ts/_snippets/snippets_dateFromJsonObject.js +1 -1
  112. package/dist/generators/ts/_snippets/snippets_dateFromJsonString.js +1 -1
  113. package/dist/generators/ts/_snippets/snippets_dateTimeFromJsonObject.js +1 -1
  114. package/dist/generators/ts/_snippets/snippets_dateTimeToJsonString.js +1 -1
  115. package/dist/generators/ts/_snippets/snippets_dateToJsonObject.js +1 -1
  116. package/dist/generators/ts/_snippets/snippets_dateToJsonString.js +1 -1
  117. package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonObject.js +1 -1
  118. package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonValue.js +1 -1
  119. package/dist/generators/ts/_snippets/snippets_floatFromJsonNumber.js +1 -1
  120. package/dist/generators/ts/_snippets/snippets_floatFromJsonObject.js +1 -1
  121. package/dist/generators/ts/_snippets/snippets_identifierFromJsonObject.js +1 -1
  122. package/dist/generators/ts/_snippets/snippets_identifierFromJsonString.js +1 -1
  123. package/dist/generators/ts/_snippets/snippets_identifierToJsonObject.js +1 -1
  124. package/dist/generators/ts/_snippets/snippets_identifierToJsonString.js +1 -1
  125. package/dist/generators/ts/_snippets/snippets_intFromJsonNumber.js +1 -1
  126. package/dist/generators/ts/_snippets/snippets_intFromJsonObject.js +1 -1
  127. package/dist/generators/ts/_snippets/snippets_iriFromJsonObject.js +1 -1
  128. package/dist/generators/ts/_snippets/snippets_iriFromJsonString.js +2 -2
  129. package/dist/generators/ts/_snippets/snippets_iriFromString.d.ts +3 -0
  130. package/dist/generators/ts/_snippets/snippets_iriFromString.js +76 -0
  131. package/dist/generators/ts/_snippets/snippets_iriLiteralFromJsonObject.d.ts +3 -0
  132. package/dist/generators/ts/_snippets/snippets_iriLiteralFromJsonObject.js +6 -0
  133. package/dist/generators/ts/_snippets/snippets_iriLiteralFromJsonString.d.ts +3 -0
  134. package/dist/generators/ts/_snippets/snippets_iriLiteralFromJsonString.js +6 -0
  135. package/dist/generators/ts/_snippets/snippets_langStringFromJsonObject.js +1 -1
  136. package/dist/generators/ts/_snippets/snippets_langStringToJsonObject.js +1 -1
  137. package/dist/generators/ts/_snippets/snippets_listFromJsonObject.js +1 -1
  138. package/dist/generators/ts/_snippets/snippets_listToJsonObject.js +1 -1
  139. package/dist/generators/ts/_snippets/snippets_literalFromJsonObject.js +1 -1
  140. package/dist/generators/ts/_snippets/snippets_literalToJsonObject.js +1 -1
  141. package/dist/generators/ts/_snippets/snippets_maybeFromJsonObject.js +1 -1
  142. package/dist/generators/ts/_snippets/snippets_maybeFromJsonValue.js +1 -1
  143. package/dist/generators/ts/_snippets/snippets_maybeToJsonObject.js +1 -1
  144. package/dist/generators/ts/_snippets/snippets_maybeToJsonValue.js +1 -1
  145. package/dist/generators/ts/_snippets/snippets_primitiveToJsonObject.js +1 -1
  146. package/dist/generators/ts/_snippets/snippets_stringFromJsonObject.js +1 -1
  147. package/dist/generators/ts/_snippets/snippets_stringFromJsonString.js +1 -1
  148. package/dist/generators/ts/_snippets/snippets_termFromJsonObject.js +1 -1
  149. package/dist/generators/ts/_snippets/snippets_termToJsonObject.js +1 -1
  150. package/dist/generators/ts/_snippets/snippets_typedLiteralToJsonObject.js +1 -1
  151. package/package.json +16 -14
  152. package/dist/generators/ts/AbstractStructuredType.d.ts +0 -71
  153. package/dist/generators/ts/AbstractStructuredType.js +0 -273
  154. package/dist/generators/ts/ReferenceCallable.d.ts +0 -14
  155. package/dist/generators/ts/ReferenceCallable.js +0 -16
  156. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.d.ts +0 -5
  157. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js +0 -11
  158. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +0 -4
  159. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +0 -15
  160. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +0 -4
  161. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +0 -15
  162. package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.d.ts +0 -3
  163. package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.js +0 -21
  164. package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.d.ts +0 -3
  165. package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.js +0 -21
  166. package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.d.ts +0 -3
  167. package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.js +0 -3
  168. package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.d.ts +0 -3
  169. package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.js +0 -3
  170. package/dist/generators/ts/_snippets/snippets_convertToInIri.d.ts +0 -3
  171. package/dist/generators/ts/_snippets/snippets_convertToInIri.js +0 -11
  172. package/dist/generators/ts/_snippets/snippets_convertToInIriIdentifierProperty.d.ts +0 -3
  173. package/dist/generators/ts/_snippets/snippets_convertToInIriIdentifierProperty.js +0 -17
@@ -1,10 +1,17 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
1
7
  import { Maybe } from "purify-ts";
8
+ import { Memoize } from "typescript-memoize";
2
9
  import { AbstractTypedLiteralType } from "./AbstractTypedLiteralType.js";
3
- import { ReferenceCallable } from "./ReferenceCallable.js";
10
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
+ import { SchemaObject } from "./SchemaObject.js";
4
12
  import { code, literalOf } from "./ts-poet-wrapper.js";
5
13
  export class BigDecimalType extends AbstractTypedLiteralType {
6
14
  inlineExpression = code `${this.reusables.imports.BigDecimal}`;
7
- jsonValueType = this.jsonTypeFactory.createJsonStringType();
8
15
  jsTypes = [
9
16
  {
10
17
  className: code `${this.reusables.imports.BigDecimal}`,
@@ -29,18 +36,25 @@ export class BigDecimalType extends AbstractTypedLiteralType {
29
36
  },
30
37
  ],
31
38
  });
32
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterBigDecimal);
39
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterBigDecimal);
33
40
  filterType = code `${this.reusables.snippets.NumericFilter}<${this.reusables.imports.BigDecimal}>`;
34
- fromJsonValueFunction = new ReferenceCallable(this.reusables.snippets.bigDecimalFromJsonString);
35
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.bigDecimalFromJsonObject);
36
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.bigDecimalFromRdfResourceValues);
41
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalFromJsonObject);
42
+ fromJsonValueFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalFromJsonString);
43
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalFromRdfResourceValues);
37
44
  graphqlType = new AbstractTypedLiteralType.GraphqlType(code `${this.reusables.imports.GraphQLString}`, this.reusables);
38
- hashFunction = new ReferenceCallable(this.reusables.snippets.hashBigDecimal);
45
+ hashFunction = new BuiltinCallable(this.reusables.snippets.hashBigDecimal);
46
+ jsonValueType = this.jsonTypeFactory.createJsonStringType();
39
47
  kind = "BigDecimal";
40
- schemaType = code `${this.reusables.snippets.NumericSchema}<${this.reusables.imports.BigDecimal}>`;
41
- toJsonValueFunction = new ReferenceCallable(this.reusables.snippets.bigDecimalToJsonString);
42
- toJsonObjectFunction = new ReferenceCallable(code `${this.reusables.snippets.bigDecimalToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
43
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.bigDecimalSparqlWherePatterns);
48
+ toJsonObjectFunction = new BuiltinCallable(code `${this.reusables.snippets.bigDecimalToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
49
+ toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalToJsonString);
50
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalSparqlWherePatterns);
51
+ get schema() {
52
+ return new SchemaObject({
53
+ properties: super.schema.properties,
54
+ type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.NumericSchema}<${this.reusables.imports.BigDecimal}>`),
55
+ variable: super.schema.variable,
56
+ });
57
+ }
44
58
  graphqlResolveExpression({ variables, }) {
45
59
  return code `${variables.value}.toFixed()`;
46
60
  }
@@ -54,4 +68,7 @@ export class BigDecimalType extends AbstractTypedLiteralType {
54
68
  return code `new ${this.reusables.imports.BigDecimal}(${literalOf(literal.value)})`;
55
69
  }
56
70
  }
71
+ __decorate([
72
+ Memoize()
73
+ ], BigDecimalType.prototype, "schema", null);
57
74
  //# sourceMappingURL=BigDecimalType.js.map
@@ -8,7 +8,7 @@ import { LiteralDecoder } from "@rdfx/literal";
8
8
  import { Maybe } from "purify-ts";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractNumericType } from "./AbstractNumericType.js";
11
- import { ReferenceCallable } from "./ReferenceCallable.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
12
12
  import { code } from "./ts-poet-wrapper.js";
13
13
  export class BigIntType extends AbstractNumericType {
14
14
  decodedIn = this.in_.map((in_) => LiteralDecoder.decodeBigIntLiteral(in_).unsafeCoerce());
@@ -38,19 +38,19 @@ export class BigIntType extends AbstractNumericType {
38
38
  });
39
39
  kind = "BigInt";
40
40
  get fromJsonObjectFunction() {
41
- return new ReferenceCallable(code `${this.reusables.snippets.bigIntFromJsonObject}<${this.expression}>`);
41
+ return new BuiltinCallable(code `${this.reusables.snippets.bigIntFromJsonObject}<${this.expression}>`);
42
42
  }
43
43
  get fromJsonValueFunction() {
44
- return new ReferenceCallable(code `${this.reusables.snippets.bigIntFromJsonString}<${this.jsonValueType.expression}, ${this.expression}>`);
44
+ return new BuiltinCallable(code `${this.reusables.snippets.bigIntFromJsonString}<${this.jsonValueType.expression}, ${this.expression}>`);
45
45
  }
46
46
  get fromRdfResourceValuesFunction() {
47
- return new ReferenceCallable(code `${this.reusables.snippets.bigIntFromRdfResourceValues}<${this.expression}>`);
47
+ return new BuiltinCallable(code `${this.reusables.snippets.bigIntFromRdfResourceValues}<${this.expression}>`);
48
48
  }
49
49
  get toJsonObjectFunction() {
50
- return new ReferenceCallable(code `${this.reusables.snippets.bigIntToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
50
+ return new BuiltinCallable(code `${this.reusables.snippets.bigIntToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
51
51
  }
52
52
  get toJsonValueFunction() {
53
- return new ReferenceCallable(code `${this.reusables.snippets.bigIntToJsonString}`);
53
+ return new BuiltinCallable(code `${this.reusables.snippets.bigIntToJsonString}`);
54
54
  }
55
55
  valueExpression(literal) {
56
56
  return code `${typeof literal === "bigint" ? literal : LiteralDecoder.decodeBigIntLiteral(literal).unsafeCoerce()}n`;
@@ -1,22 +1,23 @@
1
1
  import type { BlankNode } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
4
- import { ReferenceCallable } from "./ReferenceCallable.js";
4
+ import { BuiltinCallable } from "./BuiltinCallable.js";
5
+ import { SchemaObject } from "./SchemaObject.js";
5
6
  export declare class BlankNodeType extends AbstractIdentifierType<BlankNode> {
6
7
  protected readonly inlineExpression: import("ts-poet/build/Code.js").Code;
7
8
  readonly conversionFunction: Maybe<AbstractIdentifierType.ConversionFunction>;
8
- readonly filterFunction: ReferenceCallable;
9
+ readonly filterFunction: BuiltinCallable;
9
10
  readonly filterType: import("ts-poet/build/Code.js").Code;
10
- readonly fromJsonValueFunction: ReferenceCallable;
11
- readonly fromJsonObjectFunction: ReferenceCallable;
12
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
11
+ readonly fromJsonObjectFunction: BuiltinCallable;
12
+ readonly fromJsonValueFunction: BuiltinCallable;
13
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
13
14
  readonly kind = "BlankNode";
14
15
  readonly nodeKinds: ReadonlySet<"BlankNode">;
15
- readonly parseFunction: ReferenceCallable;
16
- readonly schemaType: import("ts-poet/build/Code.js").Code;
17
- readonly toJsonValueFunction: ReferenceCallable;
18
- readonly toJsonObjectFunction: ReferenceCallable;
19
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
16
+ readonly parseFunction: BuiltinCallable;
17
+ readonly toJsonObjectFunction: BuiltinCallable;
18
+ readonly toJsonValueFunction: BuiltinCallable;
19
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
20
20
  constructor(superParameters: Omit<ConstructorParameters<typeof AbstractIdentifierType<BlankNode>>[0], "hasValues" | "in_">);
21
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
21
22
  }
22
23
  //# sourceMappingURL=BlankNodeType.d.ts.map
@@ -1,6 +1,14 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
1
7
  import { Maybe } from "purify-ts";
8
+ import { Memoize } from "typescript-memoize";
2
9
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
3
- import { ReferenceCallable } from "./ReferenceCallable.js";
10
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
+ import { SchemaObject } from "./SchemaObject.js";
4
12
  import { code } from "./ts-poet-wrapper.js";
5
13
  export class BlankNodeType extends AbstractIdentifierType {
6
14
  inlineExpression = code `${this.reusables.imports.BlankNode}`;
@@ -17,18 +25,17 @@ export class BlankNodeType extends AbstractIdentifierType {
17
25
  },
18
26
  ],
19
27
  });
20
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterBlankNode);
28
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterBlankNode);
21
29
  filterType = code `${this.reusables.snippets.BlankNodeFilter}`;
22
- fromJsonValueFunction = new ReferenceCallable(this.reusables.snippets.blankNodeFromJsonString);
23
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.blankNodeFromJsonObject);
24
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.blankNodeFromRdfResourceValues);
30
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.blankNodeFromJsonObject);
31
+ fromJsonValueFunction = new BuiltinCallable(this.reusables.snippets.blankNodeFromJsonString);
32
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.blankNodeFromRdfResourceValues);
25
33
  kind = "BlankNode";
26
34
  nodeKinds = nodeKinds;
27
- parseFunction = new ReferenceCallable(this.reusables.snippets.parseBlankNode);
28
- schemaType = code `${this.reusables.snippets.BlankNodeSchema}`;
29
- toJsonValueFunction = new ReferenceCallable(this.reusables.snippets.blankNodeToJsonString);
30
- toJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.blankNodeToJsonObject);
31
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.blankNodeSparqlWherePatterns);
35
+ parseFunction = new BuiltinCallable(this.reusables.snippets.parseBlankNode);
36
+ toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.blankNodeToJsonObject);
37
+ toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.blankNodeToJsonString);
38
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.blankNodeSparqlWherePatterns);
32
39
  constructor(superParameters) {
33
40
  super({
34
41
  ...superParameters,
@@ -36,6 +43,16 @@ export class BlankNodeType extends AbstractIdentifierType {
36
43
  in_: [],
37
44
  });
38
45
  }
46
+ get schema() {
47
+ return new SchemaObject({
48
+ properties: super.schema.properties,
49
+ type: new SchemaObject.BuiltinType(this.reusables.snippets.BlankNodeSchema),
50
+ variable: super.schema.variable,
51
+ });
52
+ }
39
53
  }
54
+ __decorate([
55
+ Memoize()
56
+ ], BlankNodeType.prototype, "schema", null);
40
57
  const nodeKinds = new Set(["BlankNode"]);
41
58
  //# sourceMappingURL=BlankNodeType.js.map
@@ -1,26 +1,27 @@
1
1
  import type { Literal } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
4
+ import { BuiltinCallable } from "./BuiltinCallable.js";
4
5
  import type { Callable } from "./Callable.js";
5
- import { ReferenceCallable } from "./ReferenceCallable.js";
6
+ import { SchemaObject } from "./SchemaObject.js";
6
7
  import { type Code } from "./ts-poet-wrapper.js";
7
8
  export declare class BooleanType extends AbstractPrimitiveType<boolean> {
8
9
  protected readonly decodedIn: boolean[];
9
10
  readonly conversionFunction: Maybe<AbstractPrimitiveType.ConversionFunction>;
10
- readonly filterFunction: ReferenceCallable;
11
+ readonly filterFunction: BuiltinCallable;
11
12
  readonly filterType: Code;
12
13
  readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
13
- readonly hashFunction: ReferenceCallable;
14
+ readonly hashFunction: BuiltinCallable;
14
15
  readonly jsTypes: readonly [{
15
16
  readonly typeof: "boolean";
16
17
  }];
17
18
  readonly jsonValueType: AbstractPrimitiveType.JsonType;
18
19
  readonly kind = "Boolean";
19
- readonly schemaType: Code;
20
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
20
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
21
21
  get fromJsonObjectFunction(): Callable;
22
22
  get fromJsonValueFunction(): Callable;
23
23
  get fromRdfResourceValuesFunction(): Callable;
24
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
24
25
  toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<boolean>["toRdfResourceValuesExpression"]>[0]): Code;
25
26
  valueExpression(literal: boolean | Literal): Code;
26
27
  }
@@ -8,28 +8,35 @@ import { LiteralDecoder } from "@rdfx/literal";
8
8
  import { Maybe } from "purify-ts";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
11
- import { ReferenceCallable } from "./ReferenceCallable.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
12
+ import { SchemaObject } from "./SchemaObject.js";
12
13
  import { code } from "./ts-poet-wrapper.js";
13
14
  export class BooleanType extends AbstractPrimitiveType {
14
15
  decodedIn = this.in_.map((in_) => LiteralDecoder.decodeBooleanLiteral(in_).unsafeCoerce());
15
16
  conversionFunction = Maybe.empty();
16
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterBoolean);
17
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterBoolean);
17
18
  filterType = code `${this.reusables.snippets.BooleanFilter}`;
18
19
  graphqlType = new AbstractPrimitiveType.GraphqlType(code `${this.reusables.imports.GraphQLBoolean}`, this.reusables);
19
- hashFunction = new ReferenceCallable(this.reusables.snippets.hashBoolean);
20
+ hashFunction = new BuiltinCallable(this.reusables.snippets.hashBoolean);
20
21
  jsTypes = [{ typeof: "boolean" }];
21
22
  jsonValueType = this.jsonTypeFactory.createJsonBooleanType({ in_: this.decodedIn });
22
23
  kind = "Boolean";
23
- schemaType = code `${this.reusables.snippets.BooleanSchema}<${this.expression}>`;
24
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.booleanSparqlWherePatterns);
24
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.booleanSparqlWherePatterns);
25
25
  get fromJsonObjectFunction() {
26
- return new ReferenceCallable(code `${this.reusables.snippets.booleanFromJsonObject}<${this.expression}>`);
26
+ return new BuiltinCallable(code `${this.reusables.snippets.booleanFromJsonObject}<${this.expression}>`);
27
27
  }
28
28
  get fromJsonValueFunction() {
29
- return new ReferenceCallable(code `${this.reusables.snippets.booleanFromJsonBoolean}<${this.expression}>`);
29
+ return new BuiltinCallable(code `${this.reusables.snippets.booleanFromJsonBoolean}<${this.expression}>`);
30
30
  }
31
31
  get fromRdfResourceValuesFunction() {
32
- return new ReferenceCallable(code `${this.reusables.snippets.booleanFromRdfResourceValues}<${this.expression}>`);
32
+ return new BuiltinCallable(code `${this.reusables.snippets.booleanFromRdfResourceValues}<${this.expression}>`);
33
+ }
34
+ get schema() {
35
+ return new SchemaObject({
36
+ properties: super.schema.properties,
37
+ type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.BooleanSchema}<${this.expression}>`),
38
+ variable: super.schema.variable,
39
+ });
33
40
  }
34
41
  toRdfResourceValuesExpression({ variables, }) {
35
42
  return code `[${this.reusables.snippets.literalFactory}.boolean(${variables.value}, ${this.rdfjsTermExpression(this.datatype)})]`;
@@ -47,4 +54,7 @@ __decorate([
47
54
  __decorate([
48
55
  Memoize()
49
56
  ], BooleanType.prototype, "fromRdfResourceValuesFunction", null);
57
+ __decorate([
58
+ Memoize()
59
+ ], BooleanType.prototype, "schema", null);
50
60
  //# sourceMappingURL=BooleanType.js.map
@@ -1,5 +1,5 @@
1
+ import type { BuiltinCallable } from "./BuiltinCallable.js";
1
2
  import type { DeclaredCallable } from "./DeclaredCallable.js";
2
3
  import type { InlineCallable } from "./InlineCallable.js";
3
- import type { ReferenceCallable } from "./ReferenceCallable.js";
4
- export type Callable = InlineCallable | DeclaredCallable | ReferenceCallable;
4
+ export type Callable = InlineCallable | DeclaredCallable | BuiltinCallable;
5
5
  //# sourceMappingURL=Callable.d.ts.map
@@ -1,16 +1,16 @@
1
1
  import type { Literal } from "@rdfjs/types";
2
2
  import { AbstractDateType } from "./AbstractDateType.js";
3
- import { ReferenceCallable } from "./ReferenceCallable.js";
3
+ import { BuiltinCallable } from "./BuiltinCallable.js";
4
4
  import { type Code } from "./ts-poet-wrapper.js";
5
5
  export declare class DateTimeType extends AbstractDateType {
6
- readonly fromJsonObjectFunction: ReferenceCallable;
7
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
6
+ readonly fromJsonObjectFunction: BuiltinCallable;
7
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
8
8
  readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
9
9
  protected readonly jsonStringFormat = "datetime";
10
- readonly hashFunction: ReferenceCallable;
10
+ readonly hashFunction: BuiltinCallable;
11
11
  readonly kind = "DateTime";
12
- readonly toJsonValueFunction: ReferenceCallable;
13
- readonly toJsonObjectFunction: ReferenceCallable;
12
+ readonly toJsonValueFunction: BuiltinCallable;
13
+ readonly toJsonObjectFunction: BuiltinCallable;
14
14
  valueExpression(literal: Date | Literal): Code;
15
15
  }
16
16
  //# sourceMappingURL=DateTimeType.d.ts.map
@@ -1,16 +1,16 @@
1
1
  import { LiteralDecoder } from "@rdfx/literal";
2
2
  import { AbstractDateType } from "./AbstractDateType.js";
3
- import { ReferenceCallable } from "./ReferenceCallable.js";
3
+ import { BuiltinCallable } from "./BuiltinCallable.js";
4
4
  import { code } from "./ts-poet-wrapper.js";
5
5
  export class DateTimeType extends AbstractDateType {
6
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.dateTimeFromJsonObject);
7
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.dateTimeFromRdfResourceValues);
6
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.dateTimeFromJsonObject);
7
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.dateTimeFromRdfResourceValues);
8
8
  graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDateTime}`, this.reusables);
9
9
  jsonStringFormat = "datetime";
10
- hashFunction = new ReferenceCallable(this.reusables.snippets.hashDateTime);
10
+ hashFunction = new BuiltinCallable(this.reusables.snippets.hashDateTime);
11
11
  kind = "DateTime";
12
- toJsonValueFunction = new ReferenceCallable(this.reusables.snippets.dateTimeToJsonString);
13
- toJsonObjectFunction = new ReferenceCallable(code `${this.reusables.snippets.dateToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
12
+ toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.dateTimeToJsonString);
13
+ toJsonObjectFunction = new BuiltinCallable(code `${this.reusables.snippets.dateToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
14
14
  valueExpression(literal) {
15
15
  return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateTimeLiteral(literal).unsafeCoerce()).toISOString()}")`;
16
16
  }
@@ -1,16 +1,16 @@
1
1
  import type { Literal } from "@rdfjs/types";
2
2
  import { AbstractDateType } from "./AbstractDateType.js";
3
- import { ReferenceCallable } from "./ReferenceCallable.js";
3
+ import { BuiltinCallable } from "./BuiltinCallable.js";
4
4
  import { type Code } from "./ts-poet-wrapper.js";
5
5
  export declare class DateType extends AbstractDateType {
6
- readonly fromJsonObjectFunction: ReferenceCallable;
7
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
6
+ readonly fromJsonObjectFunction: BuiltinCallable;
7
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
8
8
  readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
9
- readonly hashFunction: ReferenceCallable;
9
+ readonly hashFunction: BuiltinCallable;
10
10
  readonly kind = "Date";
11
11
  protected readonly jsonStringFormat = "date";
12
- readonly toJsonValueFunction: ReferenceCallable;
13
- readonly toJsonObjectFunction: ReferenceCallable;
12
+ readonly toJsonValueFunction: BuiltinCallable;
13
+ readonly toJsonObjectFunction: BuiltinCallable;
14
14
  valueExpression(literal: Date | Literal): Code;
15
15
  }
16
16
  //# sourceMappingURL=DateType.d.ts.map
@@ -1,17 +1,17 @@
1
1
  import { LiteralDecoder } from "@rdfx/literal";
2
2
  import { AbstractDateType } from "./AbstractDateType.js";
3
+ import { BuiltinCallable } from "./BuiltinCallable.js";
3
4
  import { DateTimeType } from "./DateTimeType.js";
4
- import { ReferenceCallable } from "./ReferenceCallable.js";
5
5
  import { code } from "./ts-poet-wrapper.js";
6
6
  export class DateType extends AbstractDateType {
7
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.dateFromJsonObject);
8
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.dateFromRdfResourceValues);
7
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.dateFromJsonObject);
8
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.dateFromRdfResourceValues);
9
9
  graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDate}`, this.reusables);
10
- hashFunction = new ReferenceCallable(this.reusables.snippets.hashDate);
10
+ hashFunction = new BuiltinCallable(this.reusables.snippets.hashDate);
11
11
  kind = "Date";
12
12
  jsonStringFormat = "date";
13
- toJsonValueFunction = new ReferenceCallable(this.reusables.snippets.dateToJsonString);
14
- toJsonObjectFunction = new ReferenceCallable(code `${this.reusables.snippets.dateToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
13
+ toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.dateToJsonString);
14
+ toJsonObjectFunction = new BuiltinCallable(code `${this.reusables.snippets.dateToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
15
15
  valueExpression(literal) {
16
16
  return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateLiteral(literal).unsafeCoerce()).toISOString()}")`;
17
17
  }
@@ -3,6 +3,7 @@ import { Maybe } from "purify-ts";
3
3
  import { AbstractContainerType } from "./AbstractContainerType.js";
4
4
  import type { BlankNodeType } from "./BlankNodeType.js";
5
5
  import { InlineCallable } from "./InlineCallable.js";
6
+ import { SchemaObject } from "./SchemaObject.js";
6
7
  import type { Type } from "./Type.js";
7
8
  import { type Code } from "./ts-poet-wrapper.js";
8
9
  export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemType> extends AbstractContainerType<ItemTypeT> {
@@ -10,7 +11,6 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
10
11
  readonly equalsFunction: import("./Callable.js").Callable;
11
12
  readonly filterFunction: import("./Callable.js").Callable;
12
13
  readonly filterType: Code;
13
- readonly schemaType: Code;
14
14
  readonly fromRdfResourceValuesFunction: InlineCallable;
15
15
  readonly graphqlArgs: AbstractContainerType<ItemTypeT>["graphqlArgs"];
16
16
  readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
@@ -74,7 +74,7 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
74
74
  get conversionFunction(): Maybe<AbstractContainerType.ConversionFunction>;
75
75
  get fromJsonObjectFunction(): AbstractContainerType<ItemTypeT>["fromJsonObjectFunction"];
76
76
  get fromJsonValueFunction(): AbstractContainerType<ItemTypeT>["fromJsonValueFunction"];
77
- protected get schemaInitializers(): Code[];
77
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
78
78
  private get defaultValueExpression();
79
79
  graphqlResolveExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
80
80
  toLoggableExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["toLoggableExpression"]>[0]): Code;
@@ -8,16 +8,16 @@ import { Maybe } from "purify-ts";
8
8
  import { invariant } from "ts-invariant";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractContainerType } from "./AbstractContainerType.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
12
  import { InlineCallable } from "./InlineCallable.js";
12
- import { ReferenceCallable } from "./ReferenceCallable.js";
13
+ import { SchemaObject } from "./SchemaObject.js";
13
14
  import { code } from "./ts-poet-wrapper.js";
14
15
  export class DefaultValueType extends AbstractContainerType {
15
16
  defaultValue;
16
17
  equalsFunction = this.itemType.equalsFunction;
17
18
  filterFunction = this.itemType.filterFunction;
18
19
  filterType = this.itemType.filterType;
19
- schemaType = code `${this.reusables.snippets.DefaultValueSchema}<${this.itemType.schemaType}>`;
20
- fromRdfResourceValuesFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schemaType}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
20
+ fromRdfResourceValuesFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schema.type.expression}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
21
21
  graphqlArgs = Maybe.empty();
22
22
  graphqlType = this.itemType.graphqlType;
23
23
  hashFunction = this.itemType.hashFunction;
@@ -32,7 +32,7 @@ export class DefaultValueType extends AbstractContainerType {
32
32
  toRdfResourceValueTypes = this.itemType.toRdfResourceValueTypes;
33
33
  validationFunction = this.itemType.validationFunction;
34
34
  valueSparqlConstructTriplesFunction = this.itemType.valueSparqlConstructTriplesFunction;
35
- valueSparqlWherePatternsFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
35
+ valueSparqlWherePatternsFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schema.type.expression}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
36
36
  constructor({ defaultValue, ...superParameters }) {
37
37
  super(superParameters);
38
38
  this.defaultValue = defaultValue;
@@ -50,13 +50,20 @@ export class DefaultValueType extends AbstractContainerType {
50
50
  });
51
51
  }
52
52
  get fromJsonObjectFunction() {
53
- return new ReferenceCallable(code `${this.reusables.snippets.defaultValueFromJsonObject}(${this.itemType.fromJsonObjectFunction.annotatedUsage})`);
53
+ return new BuiltinCallable(code `${this.reusables.snippets.defaultValueFromJsonObject}(${this.itemType.fromJsonObjectFunction.annotatedUsage})`);
54
54
  }
55
55
  get fromJsonValueFunction() {
56
- return new ReferenceCallable(code `${this.reusables.snippets.defaultValueFromJsonValue}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
56
+ return new BuiltinCallable(code `${this.reusables.snippets.defaultValueFromJsonValue}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
57
57
  }
58
- get schemaInitializers() {
59
- return super.schemaInitializers.concat(code `defaultValue: ${this.rdfjsTermExpression(this.defaultValue)}`);
58
+ get schema() {
59
+ return new SchemaObject({
60
+ properties: {
61
+ ...super.schema.properties,
62
+ defaultValue: code `defaultValue: ${this.rdfjsTermExpression(this.defaultValue)}`,
63
+ },
64
+ type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.DefaultValueSchema}<${this.itemType.schema.type.expression}>`),
65
+ variable: super.schema.variable,
66
+ });
60
67
  }
61
68
  get defaultValueExpression() {
62
69
  switch (this.itemType.kind) {
@@ -98,6 +105,9 @@ __decorate([
98
105
  __decorate([
99
106
  Memoize()
100
107
  ], DefaultValueType.prototype, "fromJsonValueFunction", null);
108
+ __decorate([
109
+ Memoize()
110
+ ], DefaultValueType.prototype, "schema", null);
101
111
  __decorate([
102
112
  Memoize()
103
113
  ], DefaultValueType.prototype, "defaultValueExpression", null);
@@ -8,7 +8,7 @@ import { LiteralDecoder } from "@rdfx/literal";
8
8
  import { Maybe } from "purify-ts";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractNumericType } from "./AbstractNumericType.js";
11
- import { ReferenceCallable } from "./ReferenceCallable.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
12
12
  import { code } from "./ts-poet-wrapper.js";
13
13
  export class FloatType extends AbstractNumericType {
14
14
  decodedIn = this.in_.map((in_) => LiteralDecoder.decodeFloatLiteral(in_).unsafeCoerce());
@@ -18,13 +18,13 @@ export class FloatType extends AbstractNumericType {
18
18
  jsonValueType = this.jsonTypeFactory.createJsonNumberType({ in_: this.decodedIn });
19
19
  kind = "Float";
20
20
  get fromJsonObjectFunction() {
21
- return new ReferenceCallable(code `${this.reusables.snippets.floatFromJsonObject}<${this.expression}>`);
21
+ return new BuiltinCallable(code `${this.reusables.snippets.floatFromJsonObject}<${this.expression}>`);
22
22
  }
23
23
  get fromJsonValueFunction() {
24
- return new ReferenceCallable(code `${this.reusables.snippets.floatFromJsonNumber}<${this.expression}>`);
24
+ return new BuiltinCallable(code `${this.reusables.snippets.floatFromJsonNumber}<${this.expression}>`);
25
25
  }
26
26
  get fromRdfResourceValuesFunction() {
27
- return new ReferenceCallable(code `${this.reusables.snippets.floatFromRdfResourceValues}<${this.expression}>`);
27
+ return new BuiltinCallable(code `${this.reusables.snippets.floatFromRdfResourceValues}<${this.expression}>`);
28
28
  }
29
29
  valueExpression(literal) {
30
30
  return code `${typeof literal === "number" ? literal : LiteralDecoder.decodeFloatLiteral(literal).unsafeCoerce()}`;
@@ -2,22 +2,23 @@ import type { BlankNode, NamedNode } from "@rdfjs/types";
2
2
  import type { IdentifierNodeKind } from "@shaclmate/shacl-ast";
3
3
  import { Maybe } from "purify-ts";
4
4
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
5
- import { ReferenceCallable } from "./ReferenceCallable.js";
5
+ import { BuiltinCallable } from "./BuiltinCallable.js";
6
+ import { SchemaObject } from "./SchemaObject.js";
6
7
  export declare class IdentifierType extends AbstractIdentifierType<BlankNode | NamedNode> {
7
8
  protected readonly inlineExpression: import("ts-poet/build/Code.js").Code;
8
9
  readonly conversionFunction: Maybe<AbstractIdentifierType.ConversionFunction>;
9
- readonly filterFunction: ReferenceCallable;
10
- readonly fromJsonValueFunction: ReferenceCallable;
11
- readonly fromJsonObjectFunction: ReferenceCallable;
10
+ readonly filterFunction: BuiltinCallable;
11
+ readonly fromJsonValueFunction: BuiltinCallable;
12
+ readonly fromJsonObjectFunction: BuiltinCallable;
12
13
  readonly filterType: import("ts-poet/build/Code.js").Code;
13
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
14
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
14
15
  readonly kind = "Identifier";
15
16
  readonly nodeKinds: ReadonlySet<IdentifierNodeKind>;
16
- readonly parseFunction: ReferenceCallable;
17
- readonly schemaType: import("ts-poet/build/Code.js").Code;
18
- readonly toJsonValueFunction: ReferenceCallable;
19
- readonly toJsonObjectFunction: ReferenceCallable;
20
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
17
+ readonly parseFunction: BuiltinCallable;
18
+ readonly toJsonValueFunction: BuiltinCallable;
19
+ readonly toJsonObjectFunction: BuiltinCallable;
20
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
21
21
  constructor(parameters: Omit<ConstructorParameters<typeof AbstractIdentifierType<BlankNode | NamedNode>>[0], "hasValues" | "in_">);
22
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
22
23
  }
23
24
  //# sourceMappingURL=IdentifierType.d.ts.map
@@ -1,6 +1,14 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
1
7
  import { Maybe } from "purify-ts";
8
+ import { Memoize } from "typescript-memoize";
2
9
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
3
- import { ReferenceCallable } from "./ReferenceCallable.js";
10
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
+ import { SchemaObject } from "./SchemaObject.js";
4
12
  import { code } from "./ts-poet-wrapper.js";
5
13
  export class IdentifierType extends AbstractIdentifierType {
6
14
  inlineExpression = code `(${this.reusables.imports.BlankNode} | ${this.reusables.imports.NamedNode})`;
@@ -27,18 +35,17 @@ export class IdentifierType extends AbstractIdentifierType {
27
35
  },
28
36
  ],
29
37
  });
30
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterIdentifier);
31
- fromJsonValueFunction = new ReferenceCallable(this.reusables.snippets.identifierFromJsonString);
32
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.identifierFromJsonObject);
38
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterIdentifier);
39
+ fromJsonValueFunction = new BuiltinCallable(this.reusables.snippets.identifierFromJsonString);
40
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.identifierFromJsonObject);
33
41
  filterType = code `${this.reusables.snippets.IdentifierFilter}`;
34
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.identifierFromRdfResourceValues);
42
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.identifierFromRdfResourceValues);
35
43
  kind = "Identifier";
36
44
  nodeKinds = nodeKinds;
37
- parseFunction = new ReferenceCallable(this.reusables.snippets.parseIdentifier);
38
- schemaType = code `${this.reusables.snippets.IdentifierSchema}`;
39
- toJsonValueFunction = new ReferenceCallable(this.reusables.snippets.identifierToJsonString);
40
- toJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.identifierToJsonObject);
41
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.identifierSparqlWherePatterns);
45
+ parseFunction = new BuiltinCallable(this.reusables.snippets.parseIdentifier);
46
+ toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.identifierToJsonString);
47
+ toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.identifierToJsonObject);
48
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.identifierSparqlWherePatterns);
42
49
  constructor(parameters) {
43
50
  super({
44
51
  ...parameters,
@@ -46,7 +53,17 @@ export class IdentifierType extends AbstractIdentifierType {
46
53
  in_: [],
47
54
  });
48
55
  }
56
+ get schema() {
57
+ return new SchemaObject({
58
+ properties: super.schema.properties,
59
+ type: new SchemaObject.BuiltinType(this.reusables.snippets.IdentifierSchema),
60
+ variable: super.schema.variable,
61
+ });
62
+ }
49
63
  }
64
+ __decorate([
65
+ Memoize()
66
+ ], IdentifierType.prototype, "schema", null);
50
67
  const nodeKinds = new Set([
51
68
  "BlankNode",
52
69
  "IRI",
@@ -36,6 +36,7 @@ export declare class Imports {
36
36
  readonly NTriplesTerm: import("ts-poet/build/Import.js").Import;
37
37
  readonly Quad: import("ts-poet/build/Import.js").Import;
38
38
  readonly Quad_Graph: import("ts-poet/build/Import.js").Import;
39
+ readonly PrefixMap: import("ts-poet/build/Import.js").Import;
39
40
  readonly RdfxResourcePropertyPath: import("ts-poet/build/Import.js").Import;
40
41
  readonly Resource: import("ts-poet/build/Import.js").Import;
41
42
  readonly ResourceSet: import("ts-poet/build/Import.js").Import;
@@ -37,6 +37,7 @@ export class Imports {
37
37
  NTriplesTerm = imp("NTriplesTerm@@rdfx/string");
38
38
  Quad = imp("t:Quad@@rdfjs/types");
39
39
  Quad_Graph = imp("t:Quad_Graph@@rdfjs/types");
40
+ PrefixMap = imp("t:PrefixMap@@rdfx/collection");
40
41
  RdfxResourcePropertyPath = imp("PropertyPath:RdfxResourcePropertyPath@@rdfx/resource");
41
42
  Resource = imp("Resource@@rdfx/resource");
42
43
  ResourceSet = imp("ResourceSet@@rdfx/resource");