@shaclmate/compiler 4.0.98 → 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 (88) 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 +21 -19
  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/IntType.js +4 -4
  43. package/dist/generators/ts/IriType.d.ts +5 -5
  44. package/dist/generators/ts/IriType.js +27 -22
  45. package/dist/generators/ts/LangStringType.d.ts +10 -10
  46. package/dist/generators/ts/LangStringType.js +21 -13
  47. package/dist/generators/ts/ListType.js +7 -7
  48. package/dist/generators/ts/LiteralType.d.ts +10 -10
  49. package/dist/generators/ts/LiteralType.js +21 -13
  50. package/dist/generators/ts/ObjectType.d.ts +13 -15
  51. package/dist/generators/ts/ObjectType.js +32 -9
  52. package/dist/generators/ts/OptionType.d.ts +2 -1
  53. package/dist/generators/ts/OptionType.js +16 -11
  54. package/dist/generators/ts/SetType.d.ts +2 -1
  55. package/dist/generators/ts/SetType.js +22 -10
  56. package/dist/generators/ts/Snippets.d.ts +1 -0
  57. package/dist/generators/ts/Snippets.js +7 -0
  58. package/dist/generators/ts/StringType.d.ts +6 -6
  59. package/dist/generators/ts/StringType.js +20 -17
  60. package/dist/generators/ts/TermType.d.ts +7 -7
  61. package/dist/generators/ts/TermType.js +18 -13
  62. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +1 -1
  63. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +39 -16
  64. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +49 -33
  65. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +1 -1
  66. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +1 -1
  67. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +4 -7
  68. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +1 -3
  69. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +0 -1
  70. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +0 -1
  71. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +3 -2
  72. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +30 -10
  73. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +3 -2
  74. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +26 -10
  75. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +3 -2
  76. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +46 -22
  77. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +1 -1
  78. package/package.json +2 -2
  79. package/dist/generators/ts/AbstractStructuredType.d.ts +0 -71
  80. package/dist/generators/ts/AbstractStructuredType.js +0 -273
  81. package/dist/generators/ts/ReferenceCallable.d.ts +0 -14
  82. package/dist/generators/ts/ReferenceCallable.js +0 -16
  83. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.d.ts +0 -5
  84. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js +0 -11
  85. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +0 -4
  86. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +0 -15
  87. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +0 -4
  88. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +0 -15
@@ -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 IntType extends AbstractNumericType {
14
14
  decodedIn = this.in_.map((in_) => LiteralDecoder.decodeFloatLiteral(in_).unsafeCoerce());
@@ -17,13 +17,13 @@ export class IntType extends AbstractNumericType {
17
17
  jsonValueType = this.jsonTypeFactory.createJsonNumberType({ in_: this.decodedIn });
18
18
  kind = "Int";
19
19
  get fromJsonObjectFunction() {
20
- return new ReferenceCallable(code `${this.reusables.snippets.intFromJsonObject}<${this.expression}>`);
20
+ return new BuiltinCallable(code `${this.reusables.snippets.intFromJsonObject}<${this.expression}>`);
21
21
  }
22
22
  get fromJsonValueFunction() {
23
- return new ReferenceCallable(code `${this.reusables.snippets.intFromJsonNumber}<${this.expression}>`);
23
+ return new BuiltinCallable(code `${this.reusables.snippets.intFromJsonNumber}<${this.expression}>`);
24
24
  }
25
25
  get fromRdfResourceValuesFunction() {
26
- return new ReferenceCallable(code `${this.reusables.snippets.intFromRdfResourceValues}<${this.expression}>`);
26
+ return new BuiltinCallable(code `${this.reusables.snippets.intFromRdfResourceValues}<${this.expression}>`);
27
27
  }
28
28
  get graphqlType() {
29
29
  return new AbstractNumericType.GraphqlType(code `${this.reusables.imports.GraphQLInt}`, this.reusables);
@@ -1,16 +1,16 @@
1
1
  import type { NamedNode } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractIdentifierType } from "./AbstractIdentifierType.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 IriType extends AbstractIdentifierType<NamedNode> {
8
- readonly filterFunction: ReferenceCallable;
9
+ readonly filterFunction: BuiltinCallable;
9
10
  readonly filterType: Code;
10
11
  readonly kind = "Iri";
11
12
  readonly nodeKinds: ReadonlySet<"IRI">;
12
- readonly schemaType: Code;
13
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
13
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
14
14
  get fromJsonValueFunction(): AbstractIdentifierType<NamedNode>["fromJsonValueFunction"];
15
15
  get fromJsonObjectFunction(): AbstractIdentifierType<NamedNode>["fromJsonObjectFunction"];
16
16
  get toJsonValueFunction(): AbstractIdentifierType<NamedNode>["toJsonValueFunction"];
@@ -22,7 +22,7 @@ export declare class IriType extends AbstractIdentifierType<NamedNode> {
22
22
  get parseFunction(): Callable;
23
23
  protected get inlineExpression(): Code;
24
24
  protected staticModuleDeclarations(name: string): Record<string, Code>;
25
- protected get schemaInitializers(): readonly Code[];
25
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
26
26
  protected get inlineValueTypeExpression(): Code;
27
27
  private get valueTypeExpression();
28
28
  }
@@ -8,37 +8,37 @@ import { Maybe } from "purify-ts";
8
8
  import { invariant } from "ts-invariant";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
12
  import { InlineCallable } from "./InlineCallable.js";
12
- import { ReferenceCallable } from "./ReferenceCallable.js";
13
- import { arrayOf, code, joinCode, literalOf, } from "./ts-poet-wrapper.js";
13
+ import { SchemaObject } from "./SchemaObject.js";
14
+ import { arrayOf, code, joinCode } from "./ts-poet-wrapper.js";
14
15
  export class IriType extends AbstractIdentifierType {
15
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterIri);
16
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterIri);
16
17
  filterType = code `${this.reusables.snippets.IriFilter}`;
17
18
  kind = "Iri";
18
19
  nodeKinds = nodeKinds;
19
- schemaType = code `${this.reusables.snippets.IriSchema}<${this.valueTypeExpression}>`;
20
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.iriSparqlWherePatterns);
20
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.iriSparqlWherePatterns);
21
21
  get fromJsonValueFunction() {
22
22
  if (this.in_.length > 0) {
23
- return new ReferenceCallable(code `${this.reusables.snippets.iriLiteralFromJsonString}<${this.valueTypeExpression}>`);
23
+ return new BuiltinCallable(code `${this.reusables.snippets.iriLiteralFromJsonString}<${this.valueTypeExpression}>`);
24
24
  }
25
25
  else {
26
- return new ReferenceCallable(this.reusables.snippets.iriFromJsonString);
26
+ return new BuiltinCallable(this.reusables.snippets.iriFromJsonString);
27
27
  }
28
28
  }
29
29
  get fromJsonObjectFunction() {
30
30
  if (this.in_.length > 0) {
31
- return new ReferenceCallable(code `${this.reusables.snippets.iriLiteralFromJsonObject}<${this.valueTypeExpression}>`);
31
+ return new BuiltinCallable(code `${this.reusables.snippets.iriLiteralFromJsonObject}<${this.valueTypeExpression}>`);
32
32
  }
33
33
  else {
34
- return new ReferenceCallable(this.reusables.snippets.iriFromJsonObject);
34
+ return new BuiltinCallable(this.reusables.snippets.iriFromJsonObject);
35
35
  }
36
36
  }
37
37
  get toJsonValueFunction() {
38
- return new ReferenceCallable(code `${this.reusables.snippets.iriToJsonString}<${this.valueTypeExpression}>`);
38
+ return new BuiltinCallable(code `${this.reusables.snippets.iriToJsonString}<${this.valueTypeExpression}>`);
39
39
  }
40
40
  get toJsonObjectFunction() {
41
- return new ReferenceCallable(code `${this.reusables.snippets.iriToJsonObject}<${this.valueTypeExpression}>`);
41
+ return new BuiltinCallable(code `${this.reusables.snippets.iriToJsonObject}<${this.valueTypeExpression}>`);
42
42
  }
43
43
  get jsonValueType() {
44
44
  if (this.in_.length === 0) {
@@ -80,13 +80,13 @@ export class IriType extends AbstractIdentifierType {
80
80
  });
81
81
  }
82
82
  get fromRdfResourceValuesFunction() {
83
- return new ReferenceCallable(code `${this.reusables.snippets.iriFromRdfResourceValues}<${this.valueTypeExpression}>`);
83
+ return new BuiltinCallable(code `${this.reusables.snippets.iriFromRdfResourceValues}<${this.valueTypeExpression}>`);
84
84
  }
85
85
  get parseFunction() {
86
86
  if (this.in_.length > 0) {
87
87
  return new InlineCallable(code `(identifier: string) => ${this.reusables.snippets.parseIri}(identifier).chain((identifier) => { switch (identifier.value) { ${joinCode(this.in_.map((iri) => code `case "${iri.value}": return ${this.reusables.imports.Right}(identifier as ${this.expression});`))} default: return ${this.reusables.imports.Left}(new Error("expected NamedNode identifier to be one of ${this.in_.map((iri) => iri.value).join(" ")}")); } })`);
88
88
  }
89
- return new ReferenceCallable(this.reusables.snippets.parseIri);
89
+ return new BuiltinCallable(this.reusables.snippets.parseIri);
90
90
  }
91
91
  get inlineExpression() {
92
92
  if (this.in_.length > 0) {
@@ -103,16 +103,18 @@ export class IriType extends AbstractIdentifierType {
103
103
  inValues: code `const inValues = ${arrayOf(...this.in_.map((in_) => in_.value))} as const;`,
104
104
  };
105
105
  }
106
- get schemaInitializers() {
107
- if (this.in_.length === 0 || this.name.isNothing()) {
108
- return super.schemaInitializers;
106
+ get schema() {
107
+ const thisProperties = {};
108
+ if (this.in_.length > 0 && this.name.isJust()) {
109
+ thisProperties["in"] =
110
+ code `in: inValues.map(inValue => ${this.reusables.imports.dataFactory}.namedNode(inValue))`;
111
+ thisProperties["inValues"] = code `inValues`;
109
112
  }
110
- let initializers = [code `kind: ${literalOf(this.kind)} as const`];
111
- if (this.hasValues.length > 0) {
112
- initializers = initializers.concat(code `hasValues: ${arrayOf(...this.hasValues.map((hasValue) => this.rdfjsTermExpression(hasValue)))}`);
113
- }
114
- initializers = initializers.concat(code `in: inValues.map(inValue => ${this.reusables.imports.dataFactory}.namedNode(inValue))`, code `inValues`);
115
- return initializers;
113
+ return new SchemaObject({
114
+ properties: { ...super.schema.properties, ...thisProperties },
115
+ type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.IriSchema}<${this.valueTypeExpression}>`),
116
+ variable: super.schema.variable,
117
+ });
116
118
  }
117
119
  get inlineValueTypeExpression() {
118
120
  if (this.in_.length === 0) {
@@ -161,6 +163,9 @@ __decorate([
161
163
  __decorate([
162
164
  Memoize()
163
165
  ], IriType.prototype, "inlineExpression", null);
166
+ __decorate([
167
+ Memoize()
168
+ ], IriType.prototype, "schema", null);
164
169
  __decorate([
165
170
  Memoize()
166
171
  ], IriType.prototype, "inlineValueTypeExpression", null);
@@ -1,17 +1,18 @@
1
1
  import type { Literal } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
4
- import { ReferenceCallable } from "./ReferenceCallable.js";
4
+ import { BuiltinCallable } from "./BuiltinCallable.js";
5
+ import { SchemaObject } from "./SchemaObject.js";
5
6
  import { type Code } from "./ts-poet-wrapper.js";
6
7
  export declare class LangStringType extends AbstractLiteralType {
7
8
  private readonly languageIn;
8
9
  protected readonly inlineExpression: Code;
9
10
  readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
10
- readonly filterFunction: ReferenceCallable;
11
+ readonly filterFunction: BuiltinCallable;
11
12
  readonly filterType: Code;
12
- readonly fromJsonObjectFunction: ReferenceCallable;
13
- readonly fromJsonValueFunction: ReferenceCallable;
14
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
13
+ readonly fromJsonObjectFunction: BuiltinCallable;
14
+ readonly fromJsonValueFunction: BuiltinCallable;
15
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
15
16
  readonly jsTypes: readonly [{
16
17
  readonly instanceof: "Object";
17
18
  readonly typeof: "object";
@@ -19,16 +20,15 @@ export declare class LangStringType extends AbstractLiteralType {
19
20
  readonly jsonObjectType: AbstractLiteralType["jsonObjectType"];
20
21
  readonly jsonValueType: AbstractLiteralType["jsonValueType"];
21
22
  readonly kind = "LangString";
22
- readonly schemaType: Code;
23
- readonly toJsonObjectFunction: ReferenceCallable;
24
- readonly toJsonValueFunction: ReferenceCallable;
25
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
23
+ readonly toJsonObjectFunction: BuiltinCallable;
24
+ readonly toJsonValueFunction: BuiltinCallable;
25
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
26
26
  constructor({ languageIn, ...superParameters }: {
27
27
  languageIn: readonly string[];
28
28
  } & ConstructorParameters<typeof AbstractLiteralType>[0]);
29
29
  get discriminatedType(): Maybe<AbstractLiteralType.DiscriminatedType>;
30
30
  get graphqlType(): AbstractLiteralType.GraphqlType;
31
- protected get schemaInitializers(): readonly Code[];
31
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
32
32
  graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
33
33
  toLoggableExpression({ variables, }: Parameters<AbstractLiteralType["toLoggableExpression"]>[0]): Code;
34
34
  valueExpression(literal: Literal): Code;
@@ -7,7 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Maybe } from "purify-ts";
8
8
  import { Memoize } from "typescript-memoize";
9
9
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
10
- import { ReferenceCallable } from "./ReferenceCallable.js";
10
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
+ import { SchemaObject } from "./SchemaObject.js";
11
12
  import { arrayOf, code } from "./ts-poet-wrapper.js";
12
13
  export class LangStringType extends AbstractLiteralType {
13
14
  languageIn;
@@ -21,11 +22,11 @@ export class LangStringType extends AbstractLiteralType {
21
22
  },
22
23
  ],
23
24
  });
24
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterLiteral);
25
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterLiteral);
25
26
  filterType = code `${this.reusables.snippets.LiteralFilter}`;
26
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.langStringFromJsonObject);
27
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.langStringFromJsonObject);
27
28
  fromJsonValueFunction = this.fromJsonObjectFunction;
28
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.langStringFromRdfResourceValues);
29
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.langStringFromRdfResourceValues);
29
30
  jsTypes = [
30
31
  { instanceof: "Object", typeof: "object" },
31
32
  ];
@@ -37,10 +38,9 @@ export class LangStringType extends AbstractLiteralType {
37
38
  }, { snippet: this.reusables.snippets.LangStringJsonObject });
38
39
  jsonValueType = this.jsonObjectType;
39
40
  kind = "LangString";
40
- schemaType = code `${this.reusables.snippets.LangStringSchema}`;
41
- toJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.langStringToJsonObject);
41
+ toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.langStringToJsonObject);
42
42
  toJsonValueFunction = this.toJsonObjectFunction;
43
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.langStringSparqlWherePatterns);
43
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.langStringSparqlWherePatterns);
44
44
  constructor({ languageIn, ...superParameters }) {
45
45
  super(superParameters);
46
46
  this.languageIn = languageIn;
@@ -58,12 +58,17 @@ export class LangStringType extends AbstractLiteralType {
58
58
  get graphqlType() {
59
59
  throw new Error("not implemented");
60
60
  }
61
- get schemaInitializers() {
62
- let initializers = super.schemaInitializers;
63
- if (this.languageIn.length > 0) {
64
- initializers = initializers.concat(code `languageIn: ${arrayOf(...this.languageIn)}`);
65
- }
66
- return initializers;
61
+ get schema() {
62
+ return new SchemaObject({
63
+ properties: this.languageIn.length > 0
64
+ ? {
65
+ ...super.schema.properties,
66
+ languageIn: code `languageIn: ${arrayOf(...this.languageIn)}`,
67
+ }
68
+ : super.schema.properties,
69
+ type: new SchemaObject.BuiltinType(this.reusables.snippets.LangStringSchema),
70
+ variable: super.schema.variable,
71
+ });
67
72
  }
68
73
  graphqlResolveExpression(_parameters) {
69
74
  throw new Error("not implemented");
@@ -78,4 +83,7 @@ export class LangStringType extends AbstractLiteralType {
78
83
  __decorate([
79
84
  Memoize()
80
85
  ], LangStringType.prototype, "discriminatedType", null);
86
+ __decorate([
87
+ Memoize()
88
+ ], LangStringType.prototype, "schema", null);
81
89
  //# sourceMappingURL=LangStringType.js.map
@@ -8,8 +8,8 @@ import { rdf } from "@tpluscode/rdf-ns-builders";
8
8
  import { Maybe } from "purify-ts";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractCollectionType } from "./AbstractCollectionType.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
12
  import { InlineCallable } from "./InlineCallable.js";
12
- import { ReferenceCallable } from "./ReferenceCallable.js";
13
13
  import { code, joinCode } from "./ts-poet-wrapper.js";
14
14
  export class ListType extends AbstractCollectionType {
15
15
  identifierNodeKind;
@@ -44,16 +44,16 @@ export class ListType extends AbstractCollectionType {
44
44
  });
45
45
  }
46
46
  get fromJsonValueFunction() {
47
- return new ReferenceCallable(code `${this.reusables.snippets.arrayFromJsonArray}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
47
+ return new BuiltinCallable(code `${this.reusables.snippets.arrayFromJsonArray}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
48
48
  }
49
49
  get fromJsonObjectFunction() {
50
- return new ReferenceCallable(code `${this.reusables.snippets.listFromJsonObject}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
50
+ return new BuiltinCallable(code `${this.reusables.snippets.listFromJsonObject}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
51
51
  }
52
52
  get fromRdfResourceValuesFunction() {
53
- return new InlineCallable(code `${this._mutable ? this.reusables.snippets.mutableListFromRdfResourceValues : this.reusables.snippets.listFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schemaType}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
53
+ return new InlineCallable(code `${this._mutable ? this.reusables.snippets.mutableListFromRdfResourceValues : this.reusables.snippets.listFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schema.type.expression}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
54
54
  }
55
55
  get toJsonValueFunction() {
56
- return new ReferenceCallable(code `${this.reusables.snippets.arrayToJsonArray}(${this.itemType.toJsonValueFunction.annotatedUsage})`);
56
+ return new BuiltinCallable(code `${this.reusables.snippets.arrayToJsonArray}(${this.itemType.toJsonValueFunction.annotatedUsage})`);
57
57
  }
58
58
  get toJsonObjectFunction() {
59
59
  return new InlineCallable(code `${this.reusables.snippets.listToJsonObject}(${this.itemType.toJsonValueFunction.annotatedUsage})`);
@@ -62,10 +62,10 @@ export class ListType extends AbstractCollectionType {
62
62
  return new Set(["BlankNode", "NamedNode"]); // List or rdf:nil
63
63
  }
64
64
  get valueSparqlConstructTriplesFunction() {
65
- return new InlineCallable(code `${this.reusables.snippets.listSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlConstructTriplesFunction.unannotatedUsage})`);
65
+ return new InlineCallable(code `${this.reusables.snippets.listSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schema.type.expression}>(${this.itemType.valueSparqlConstructTriplesFunction.unannotatedUsage})`);
66
66
  }
67
67
  get valueSparqlWherePatternsFunction() {
68
- return new InlineCallable(code `${this.reusables.snippets.listSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
68
+ return new InlineCallable(code `${this.reusables.snippets.listSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schema.type.expression}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
69
69
  }
70
70
  toRdfResourceValuesExpression({ variables, }) {
71
71
  let mintListIdentifierFunction;
@@ -1,33 +1,33 @@
1
1
  import type { Literal } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
4
- import { ReferenceCallable } from "./ReferenceCallable.js";
4
+ import { BuiltinCallable } from "./BuiltinCallable.js";
5
+ import { SchemaObject } from "./SchemaObject.js";
5
6
  import { type Code } from "./ts-poet-wrapper.js";
6
7
  export declare class LiteralType extends AbstractLiteralType {
7
8
  private readonly languageIn;
8
9
  protected readonly inlineExpression: Code;
9
10
  readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
10
- readonly filterFunction: ReferenceCallable;
11
+ readonly filterFunction: BuiltinCallable;
11
12
  readonly filterType: Code;
12
- readonly fromJsonObjectFunction: ReferenceCallable;
13
- readonly fromJsonValueFunction: ReferenceCallable;
14
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
13
+ readonly fromJsonObjectFunction: BuiltinCallable;
14
+ readonly fromJsonValueFunction: BuiltinCallable;
15
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
15
16
  readonly jsTypes: readonly [{
16
17
  readonly instanceof: "Object";
17
18
  readonly typeof: "object";
18
19
  }];
19
20
  readonly jsonValueType: AbstractLiteralType["jsonValueType"];
20
21
  readonly kind = "Literal";
21
- readonly schemaType: Code;
22
- readonly toJsonObjectFunction: ReferenceCallable;
23
- readonly toJsonValueFunction: ReferenceCallable;
24
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
22
+ readonly toJsonObjectFunction: BuiltinCallable;
23
+ readonly toJsonValueFunction: BuiltinCallable;
24
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
25
25
  constructor({ languageIn, ...superParameters }: {
26
26
  languageIn: readonly string[];
27
27
  } & ConstructorParameters<typeof AbstractLiteralType>[0]);
28
28
  get discriminatedType(): Maybe<AbstractLiteralType.DiscriminatedType>;
29
29
  get graphqlType(): AbstractLiteralType.GraphqlType;
30
- protected get schemaInitializers(): readonly Code[];
30
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
31
31
  graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
32
32
  toLoggableExpression({ variables, }: Parameters<AbstractLiteralType["toLoggableExpression"]>[0]): Code;
33
33
  valueExpression(literal: Literal): Code;
@@ -7,7 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Maybe } from "purify-ts";
8
8
  import { Memoize } from "typescript-memoize";
9
9
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
10
- import { ReferenceCallable } from "./ReferenceCallable.js";
10
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
+ import { SchemaObject } from "./SchemaObject.js";
11
12
  import { arrayOf, code } from "./ts-poet-wrapper.js";
12
13
  export class LiteralType extends AbstractLiteralType {
13
14
  languageIn;
@@ -29,20 +30,19 @@ export class LiteralType extends AbstractLiteralType {
29
30
  },
30
31
  ],
31
32
  });
32
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterLiteral);
33
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterLiteral);
33
34
  filterType = code `${this.reusables.snippets.LiteralFilter}`;
34
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.literalFromJsonObject);
35
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.literalFromJsonObject);
35
36
  fromJsonValueFunction = this.fromJsonObjectFunction;
36
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.literalFromRdfResourceValues);
37
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.literalFromRdfResourceValues);
37
38
  jsTypes = [
38
39
  { instanceof: "Object", typeof: "object" },
39
40
  ];
40
41
  jsonValueType = this.jsonObjectType;
41
42
  kind = "Literal";
42
- schemaType = code `${this.reusables.snippets.LiteralSchema}`;
43
- toJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.literalToJsonObject);
43
+ toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.literalToJsonObject);
44
44
  toJsonValueFunction = this.toJsonObjectFunction;
45
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.literalSparqlWherePatterns);
45
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.literalSparqlWherePatterns);
46
46
  constructor({ languageIn, ...superParameters }) {
47
47
  super(superParameters);
48
48
  this.languageIn = languageIn;
@@ -60,12 +60,17 @@ export class LiteralType extends AbstractLiteralType {
60
60
  get graphqlType() {
61
61
  throw new Error("not implemented");
62
62
  }
63
- get schemaInitializers() {
64
- let initializers = super.schemaInitializers;
65
- if (this.languageIn.length > 0) {
66
- initializers = initializers.concat(code `languageIn: ${arrayOf(...this.languageIn)}`);
67
- }
68
- return initializers;
63
+ get schema() {
64
+ return new SchemaObject({
65
+ properties: this.languageIn.length > 0
66
+ ? {
67
+ ...super.schema.properties,
68
+ languageIn: code `languageIn: ${arrayOf(...this.languageIn)}`,
69
+ }
70
+ : super.schema.properties,
71
+ type: new SchemaObject.BuiltinType(this.reusables.snippets.LiteralSchema),
72
+ variable: super.schema.variable,
73
+ });
69
74
  }
70
75
  graphqlResolveExpression(_parameters) {
71
76
  throw new Error("not implemented");
@@ -80,4 +85,7 @@ export class LiteralType extends AbstractLiteralType {
80
85
  __decorate([
81
86
  Memoize()
82
87
  ], LiteralType.prototype, "discriminatedType", null);
88
+ __decorate([
89
+ Memoize()
90
+ ], LiteralType.prototype, "schema", null);
83
91
  //# sourceMappingURL=LiteralType.js.map
@@ -10,22 +10,21 @@ import { ObjectType_IdentifierProperty } from "./_ObjectType/ObjectType_Identifi
10
10
  import type { ObjectType_Property } from "./_ObjectType/ObjectType_Property.js";
11
11
  import { ObjectType_RdfTypeProperty } from "./_ObjectType/ObjectType_RdfTypeProperty.js";
12
12
  import { ObjectType_ShaclProperty } from "./_ObjectType/ObjectType_ShaclProperty.js";
13
- import { ObjectType_schemaExpression } from "./_ObjectType/ObjectType_schemaExpression.js";
14
- import { ObjectType_schemaTypeExpression } from "./_ObjectType/ObjectType_schemaTypeExpression.js";
15
13
  import { ObjectType_toJsonObjectFunctionExpression, ObjectType_toJsonObjectFunctionType } from "./_ObjectType/ObjectType_toJsonObjectFunction.js";
16
14
  import { ObjectType_toLoggableFunctionExpression, ObjectType_toLoggableFunctionType } from "./_ObjectType/ObjectType_toLoggableFunction.js";
17
15
  import { ObjectType_toRdfResourceValuesFunctionExpression, ObjectType_toRdfResourceValuesFunctionType } from "./_ObjectType/ObjectType_toRdfResourceValuesFunction.js";
18
16
  import { ObjectType_toStringFunctionExpression, ObjectType_toStringFunctionType } from "./_ObjectType/ObjectType_toStringFunction.js";
19
17
  import { ObjectType_valueSparqlConstructTriplesFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlConstructTriplesFunction.js";
20
18
  import { ObjectType_valueSparqlWherePatternsFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlWherePatternsFunction.js";
21
- import { AbstractStructuredType } from "./AbstractStructuredType.js";
19
+ import { AbstractUserDefinedType } from "./AbstractUserDefinedType.js";
22
20
  import type { BlankNodeType } from "./BlankNodeType.js";
23
21
  import type { Callable } from "./Callable.js";
24
22
  import type { IdentifierType } from "./IdentifierType.js";
25
23
  import type { IriType } from "./IriType.js";
24
+ import { SchemaObject } from "./SchemaObject.js";
26
25
  import type { Type } from "./Type.js";
27
26
  import { type Code } from "./ts-poet-wrapper.js";
28
- export declare class ObjectType extends AbstractStructuredType {
27
+ export declare class ObjectType extends AbstractUserDefinedType {
29
28
  private readonly rdfTypeProperty;
30
29
  protected equalsFunctionExpression: typeof ObjectType_equalsFunctionExpression;
31
30
  protected equalsFunctionType: typeof ObjectType_equalsFunctionType;
@@ -38,8 +37,6 @@ export declare class ObjectType extends AbstractStructuredType {
38
37
  protected fromRdfResourceValuesFunctionType: typeof ObjectType_fromRdfResourceValuesFunctionType;
39
38
  protected hashFunctionExpression: typeof ObjectType_hashFunctionExpression;
40
39
  protected hashFunctionType: typeof ObjectType_hashFunctionType;
41
- protected schemaExpression: typeof ObjectType_schemaExpression;
42
- protected schemaTypeExpression: typeof ObjectType_schemaTypeExpression;
43
40
  protected toJsonObjectFunctionExpression: typeof ObjectType_toJsonObjectFunctionExpression;
44
41
  protected toJsonObjectFunctionType: typeof ObjectType_toJsonObjectFunctionType;
45
42
  protected toLoggableFunctionExpression: typeof ObjectType_toLoggableFunctionExpression;
@@ -50,9 +47,9 @@ export declare class ObjectType extends AbstractStructuredType {
50
47
  protected toStringFunctionType: typeof ObjectType_toStringFunctionType;
51
48
  protected valueSparqlConstructTriplesFunctionExpression: typeof ObjectType_valueSparqlConstructTriplesFunctionExpression;
52
49
  protected valueSparqlWherePatternsFunctionExpression: typeof ObjectType_valueSparqlWherePatternsFunctionExpression;
53
- readonly discriminatedType: Maybe<AbstractStructuredType.DiscriminatedType>;
50
+ readonly discriminatedType: Maybe<AbstractUserDefinedType.DiscriminatedType>;
54
51
  readonly extern: boolean;
55
- readonly graphqlArgs: AbstractStructuredType["graphqlArgs"];
52
+ readonly graphqlArgs: AbstractUserDefinedType["graphqlArgs"];
56
53
  readonly identifierProperty: Maybe<ObjectType.IdentifierProperty>;
57
54
  readonly identifierType: BlankNodeType | IdentifierType | IriType;
58
55
  readonly jsTypes: readonly [{
@@ -62,7 +59,7 @@ export declare class ObjectType extends AbstractStructuredType {
62
59
  readonly kind = "Object";
63
60
  readonly recursive: boolean;
64
61
  readonly synthetic: boolean;
65
- readonly validationFunction: AbstractStructuredType["validationFunction"];
62
+ readonly validationFunction: AbstractUserDefinedType["validationFunction"];
66
63
  constructor({ discriminantProperty, extern, identifierProperty, identifierType, lazyProperties, rdfTypeProperty, recursive, synthetic, ...superParameters }: {
67
64
  discriminantProperty: Maybe<ObjectType.DiscriminantProperty>;
68
65
  comment: Maybe<string>;
@@ -74,21 +71,22 @@ export declare class ObjectType extends AbstractStructuredType {
74
71
  rdfTypeProperty: Maybe<ObjectType.RdfTypeProperty>;
75
72
  recursive: boolean;
76
73
  synthetic: boolean;
77
- } & ConstructorParameters<typeof AbstractStructuredType>[0]);
74
+ } & ConstructorParameters<typeof AbstractUserDefinedType>[0]);
78
75
  get _fromRdfResourceFunction(): Callable;
79
76
  get _toRdfResourceFunction(): Callable;
80
- get jsonValueType(): AbstractStructuredType["jsonObjectType"];
81
- get conversionFunction(): Maybe<AbstractStructuredType.ConversionFunction>;
77
+ get jsonValueType(): AbstractUserDefinedType["jsonObjectType"];
78
+ get conversionFunction(): Maybe<AbstractUserDefinedType.ConversionFunction>;
82
79
  get createFunction(): Callable;
83
80
  get createFunctionParameters(): ObjectType.CreateFunctionParameters;
84
81
  get createUnsafeFunction(): Callable;
85
82
  get declaration(): Maybe<Code>;
86
- get jsonObjectType(): AbstractStructuredType["jsonObjectType"];
83
+ get jsonObjectType(): AbstractUserDefinedType["jsonObjectType"];
84
+ get schema(): SchemaObject<SchemaObject.UserDefinedType>;
87
85
  get focusSparqlConstructTriplesFunction(): Callable;
88
86
  get focusSparqlWherePatternsFunction(): Callable;
89
87
  get fromRdfResourceFunction(): Callable;
90
88
  get fromRdfTypeVariable(): Maybe<Code>;
91
- get graphqlType(): AbstractStructuredType.GraphqlType;
89
+ get graphqlType(): AbstractUserDefinedType.GraphqlType;
92
90
  get identifierTypeAlias(): Code;
93
91
  get mutable(): boolean;
94
92
  get objectSetMethodNames(): ObjectType.ObjectSetMethodNames;
@@ -97,7 +95,7 @@ export declare class ObjectType extends AbstractStructuredType {
97
95
  get sparqlConstructQueryFunction(): Callable;
98
96
  get sparqlConstructQueryStringFunction(): Callable;
99
97
  get toRdfResourceFunction(): Callable;
100
- get toRdfResourceValueTypes(): AbstractStructuredType["toRdfResourceValueTypes"];
98
+ get toRdfResourceValueTypes(): AbstractUserDefinedType["toRdfResourceValueTypes"];
101
99
  get toRdfjsResourceType(): Code;
102
100
  get toStringRecordFunction(): Callable;
103
101
  get typeGuardFunction(): Maybe<Callable>;
@@ -28,11 +28,10 @@ import { ObjectType_graphqlTypeExpression } from "./_ObjectType/ObjectType_graph
28
28
  import { ObjectType_hashFunctionExpression, ObjectType_hashFunctionType, } from "./_ObjectType/ObjectType_hashFunction.js";
29
29
  import { ObjectType_IdentifierProperty } from "./_ObjectType/ObjectType_IdentifierProperty.js";
30
30
  import { ObjectType_identifierTypeDeclarations } from "./_ObjectType/ObjectType_identifierTypeDeclarations.js";
31
+ import { ObjectType_jsonObjectType } from "./_ObjectType/ObjectType_jsonObjectType.js";
31
32
  import { ObjectType_objectSetMethodNames } from "./_ObjectType/ObjectType_objectSetMethodNames.js";
32
33
  import { ObjectType_RdfTypeProperty } from "./_ObjectType/ObjectType_RdfTypeProperty.js";
33
34
  import { ObjectType_ShaclProperty } from "./_ObjectType/ObjectType_ShaclProperty.js";
34
- import { ObjectType_schemaExpression } from "./_ObjectType/ObjectType_schemaExpression.js";
35
- import { ObjectType_schemaTypeExpression } from "./_ObjectType/ObjectType_schemaTypeExpression.js";
36
35
  import { ObjectType_sparqlConstructQueryFunction } from "./_ObjectType/ObjectType_sparqlConstructQueryFunction.js";
37
36
  import { ObjectType_sparqlConstructQueryStringFunction } from "./_ObjectType/ObjectType_sparqlConstructQueryStringFunction.js";
38
37
  import { ObjectType_toJsonObjectFunctionExpression, ObjectType_toJsonObjectFunctionType, } from "./_ObjectType/ObjectType_toJsonObjectFunction.js";
@@ -44,10 +43,11 @@ import { ObjectType_toStringRecordFunction } from "./_ObjectType/ObjectType_toSt
44
43
  import { ObjectType_typeGuardFunction } from "./_ObjectType/ObjectType_typeGuardFunction.js";
45
44
  import { ObjectType_valueSparqlConstructTriplesFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlConstructTriplesFunction.js";
46
45
  import { ObjectType_valueSparqlWherePatternsFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlWherePatternsFunction.js";
47
- import { AbstractStructuredType } from "./AbstractStructuredType.js";
46
+ import { AbstractUserDefinedType } from "./AbstractUserDefinedType.js";
48
47
  import { DeclaredCallable } from "./DeclaredCallable.js";
48
+ import { SchemaObject } from "./SchemaObject.js";
49
49
  import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
50
- export class ObjectType extends AbstractStructuredType {
50
+ export class ObjectType extends AbstractUserDefinedType {
51
51
  rdfTypeProperty;
52
52
  equalsFunctionExpression = ObjectType_equalsFunctionExpression;
53
53
  equalsFunctionType = ObjectType_equalsFunctionType;
@@ -60,8 +60,6 @@ export class ObjectType extends AbstractStructuredType {
60
60
  fromRdfResourceValuesFunctionType = ObjectType_fromRdfResourceValuesFunctionType;
61
61
  hashFunctionExpression = ObjectType_hashFunctionExpression;
62
62
  hashFunctionType = ObjectType_hashFunctionType;
63
- schemaExpression = ObjectType_schemaExpression;
64
- schemaTypeExpression = ObjectType_schemaTypeExpression;
65
63
  toJsonObjectFunctionExpression = ObjectType_toJsonObjectFunctionExpression;
66
64
  toJsonObjectFunctionType = ObjectType_toJsonObjectFunctionType;
67
65
  toLoggableFunctionExpression = ObjectType_toLoggableFunctionExpression;
@@ -125,8 +123,30 @@ export class ObjectType extends AbstractStructuredType {
125
123
  return !this.extern ? super.declaration : Maybe.empty();
126
124
  }
127
125
  get jsonObjectType() {
128
- return this.jsonTypeFactory.createJsonObjectType(this.properties.flatMap((property) => property.jsonObjectMember.toList()), {
129
- name: this.name.map((name) => [name, "Json"]).extract(),
126
+ return ObjectType_jsonObjectType.call(this);
127
+ }
128
+ get schema() {
129
+ return new SchemaObject({
130
+ properties: {
131
+ ...super.schema.properties,
132
+ properties: () => code `properties: { ${joinCode(this.properties.flatMap((property) => property.schema
133
+ .map((propertySchema) => [
134
+ code `${property.name}: ${propertySchema.literalExpression}`,
135
+ ])
136
+ .orDefault([])), { on: "," })} }`,
137
+ },
138
+ type: new SchemaObject.UserDefinedType({
139
+ members: {
140
+ ...super.schema.type.members,
141
+ properties: () => code `properties: { ${joinCode(this.properties.flatMap((property) => property.schema
142
+ .map((propertySchema) => [
143
+ code `${property.name}: ${propertySchema.type.literalExpression}`,
144
+ ])
145
+ .orDefault([])), { on: "," })} }`,
146
+ },
147
+ name: super.schema.type.name,
148
+ }),
149
+ variable: super.schema.variable,
130
150
  });
131
151
  }
132
152
  get focusSparqlConstructTriplesFunction() {
@@ -144,7 +164,7 @@ export class ObjectType extends AbstractStructuredType {
144
164
  .orDefaultLazy(() => this.rdfjsTermExpression(rdfTypeProperty.fromRdfType)));
145
165
  }
146
166
  get graphqlType() {
147
- return new AbstractStructuredType.GraphqlType(this.name
167
+ return new AbstractUserDefinedType.GraphqlType(this.name
148
168
  .map((name) => code `${name}.GraphQL`)
149
169
  .orDefaultLazy(() => ObjectType_graphqlTypeExpression.call(this)), this.reusables);
150
170
  }
@@ -343,6 +363,9 @@ __decorate([
343
363
  __decorate([
344
364
  Memoize()
345
365
  ], ObjectType.prototype, "jsonObjectType", null);
366
+ __decorate([
367
+ Memoize()
368
+ ], ObjectType.prototype, "schema", null);
346
369
  __decorate([
347
370
  Memoize()
348
371
  ], ObjectType.prototype, "focusSparqlConstructTriplesFunction", null);
@@ -1,6 +1,7 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { AbstractContainerType } from "./AbstractContainerType.js";
3
3
  import type { Callable } from "./Callable.js";
4
+ import { SchemaObject } from "./SchemaObject.js";
4
5
  import { type Code } from "./ts-poet-wrapper.js";
5
6
  export declare class OptionType<ItemTypeT extends OptionType.ItemType> extends AbstractContainerType<ItemTypeT> {
6
7
  readonly graphqlArgs: AbstractContainerType<ItemTypeT>["graphqlArgs"];
@@ -21,7 +22,7 @@ export declare class OptionType<ItemTypeT extends OptionType.ItemType> extends A
21
22
  get graphqlType(): AbstractContainerType.GraphqlType;
22
23
  get hashFunction(): Callable;
23
24
  get mutable(): boolean;
24
- get schemaType(): Code;
25
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
25
26
  get toJsonValueFunction(): AbstractContainerType<ItemTypeT>["toJsonValueFunction"];
26
27
  get toJsonObjectFunction(): AbstractContainerType<ItemTypeT>["toJsonObjectFunction"];
27
28
  get toRdfResourceValueTypes(): AbstractContainerType<ItemTypeT>["toRdfResourceValueTypes"];