@shaclmate/compiler 4.0.39 → 4.0.41

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 (211) hide show
  1. package/dist/ShapesGraphToAstTransformer.d.ts +0 -8
  2. package/dist/ShapesGraphToAstTransformer.js +5 -85
  3. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +128 -160
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +0 -16
  6. package/dist/ast/AbstractCompoundType.d.ts +2 -1
  7. package/dist/ast/AbstractCompoundType.js +1 -1
  8. package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
  9. package/dist/ast/Ast.d.ts +1 -3
  10. package/dist/ast/ListType.d.ts +1 -1
  11. package/dist/ast/ListType.js +1 -1
  12. package/dist/ast/ObjectType.d.ts +0 -12
  13. package/dist/ast/ObjectType.js +0 -78
  14. package/dist/generators/AstJsonGenerator.js +7 -3
  15. package/dist/generators/transformAstToLabeledPropertyGraph.js +59 -56
  16. package/dist/generators/ts/AbstractCollectionType.d.ts +5 -12
  17. package/dist/generators/ts/AbstractCollectionType.js +9 -68
  18. package/dist/generators/ts/AbstractContainerType.d.ts +4 -6
  19. package/dist/generators/ts/AbstractContainerType.js +5 -9
  20. package/dist/generators/ts/AbstractDateType.d.ts +6 -3
  21. package/dist/generators/ts/AbstractDateType.js +7 -2
  22. package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -0
  23. package/dist/generators/ts/AbstractIdentifierType.js +3 -0
  24. package/dist/generators/ts/AbstractLazyObjectType.d.ts +9 -9
  25. package/dist/generators/ts/AbstractLazyObjectType.js +30 -19
  26. package/dist/generators/ts/AbstractLiteralType.d.ts +1 -0
  27. package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
  28. package/dist/generators/ts/AbstractNumericType.js +9 -9
  29. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  30. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  31. package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -0
  32. package/dist/generators/ts/AbstractPrimitiveType.js +2 -2
  33. package/dist/generators/ts/AbstractTermType.d.ts +1 -2
  34. package/dist/generators/ts/AbstractTermType.js +3 -5
  35. package/dist/generators/ts/AbstractType.d.ts +61 -26
  36. package/dist/generators/ts/AbstractType.js +37 -17
  37. package/dist/generators/ts/BigDecimalType.d.ts +5 -1
  38. package/dist/generators/ts/BigDecimalType.js +6 -3
  39. package/dist/generators/ts/BigIntType.d.ts +3 -1
  40. package/dist/generators/ts/BigIntType.js +3 -3
  41. package/dist/generators/ts/BlankNodeType.d.ts +3 -3
  42. package/dist/generators/ts/BlankNodeType.js +13 -13
  43. package/dist/generators/ts/BooleanType.d.ts +5 -3
  44. package/dist/generators/ts/BooleanType.js +11 -6
  45. package/dist/generators/ts/DefaultValueType.d.ts +40 -2
  46. package/dist/generators/ts/DefaultValueType.js +14 -12
  47. package/dist/generators/ts/FloatType.d.ts +3 -1
  48. package/dist/generators/ts/FloatType.js +1 -1
  49. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  50. package/dist/generators/ts/GraphqlSchema.js +6 -6
  51. package/dist/generators/ts/IdentifierType.d.ts +3 -3
  52. package/dist/generators/ts/IdentifierType.js +19 -17
  53. package/dist/generators/ts/IntType.d.ts +3 -1
  54. package/dist/generators/ts/IntType.js +1 -1
  55. package/dist/generators/ts/IriType.d.ts +2 -2
  56. package/dist/generators/ts/IriType.js +21 -19
  57. package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -0
  58. package/dist/generators/ts/LazyObjectOptionType.js +14 -10
  59. package/dist/generators/ts/LazyObjectSetType.js +14 -8
  60. package/dist/generators/ts/LazyObjectType.js +9 -6
  61. package/dist/generators/ts/ListType.d.ts +13 -5
  62. package/dist/generators/ts/ListType.js +48 -12
  63. package/dist/generators/ts/LiteralType.d.ts +5 -1
  64. package/dist/generators/ts/LiteralType.js +11 -8
  65. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +19 -34
  66. package/dist/generators/ts/ObjectType.js +282 -0
  67. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  68. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +52 -60
  69. package/dist/generators/ts/OptionType.d.ts +6 -2
  70. package/dist/generators/ts/OptionType.js +20 -15
  71. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -11
  72. package/dist/generators/ts/SetType.d.ts +16 -1
  73. package/dist/generators/ts/SetType.js +80 -2
  74. package/dist/generators/ts/Snippets.d.ts +3 -1
  75. package/dist/generators/ts/Snippets.js +18 -4
  76. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  77. package/dist/generators/ts/StringType.d.ts +5 -3
  78. package/dist/generators/ts/StringType.js +15 -6
  79. package/dist/generators/ts/TermType.d.ts +6 -2
  80. package/dist/generators/ts/TermType.js +15 -12
  81. package/dist/generators/ts/TsGenerator.d.ts +1 -1
  82. package/dist/generators/ts/TsGenerator.js +60 -32
  83. package/dist/generators/ts/Type.d.ts +4 -5
  84. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  85. package/dist/generators/ts/TypeFactory.js +62 -76
  86. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +36 -11
  87. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +296 -105
  88. package/dist/generators/ts/ZodGenerator.d.ts +1 -1
  89. package/dist/generators/ts/ZodGenerator.js +21 -16
  90. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +9 -6
  91. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +3 -3
  92. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +9 -13
  93. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +22 -39
  94. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +1 -5
  95. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +18 -13
  96. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  97. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +44 -0
  98. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  99. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +3 -7
  100. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  101. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -6
  102. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  103. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +2 -5
  104. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  105. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +2 -6
  106. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  107. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -24
  108. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  109. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +18 -0
  110. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  111. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js +51 -0
  112. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  113. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  114. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  115. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  116. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  117. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  118. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  119. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +41 -0
  120. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  121. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +12 -0
  122. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  123. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +20 -0
  124. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  125. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  126. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  127. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +5 -11
  128. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  129. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +9 -0
  130. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  131. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -6
  132. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  133. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  134. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  135. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +12 -0
  136. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  137. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  138. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  139. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  141. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +20 -0
  142. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  143. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  144. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  145. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +7 -14
  146. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  147. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  148. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  149. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  150. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +12 -12
  151. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  152. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.js +16 -0
  153. package/dist/generators/ts/_snippets/snippets_convertToArraySet.d.ts +3 -0
  154. package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
  155. package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
  156. package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
  157. package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
  158. package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -0
  159. package/dist/input/generated.d.ts +758 -117
  160. package/dist/input/generated.js +636 -128
  161. package/package.json +4 -6
  162. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  163. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  164. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  165. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  166. package/dist/generators/ts/NamedObjectType.js +0 -342
  167. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  168. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  169. package/dist/generators/ts/NamedUnionType.js +0 -13
  170. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  171. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +0 -65
  172. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  173. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  174. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  175. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  176. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  177. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  178. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +0 -43
  179. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  180. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +0 -80
  181. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  182. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  183. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  184. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  185. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  186. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +0 -45
  187. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  188. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +0 -16
  189. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  190. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +0 -17
  191. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  192. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  193. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  194. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +0 -16
  195. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  196. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  197. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  198. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  199. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  200. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +0 -41
  201. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  202. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  203. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  204. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  205. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  206. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.js +0 -25
  207. package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +0 -3
  208. package/dist/generators/ts/_snippets/snippets_convertToArray.js +0 -8
  209. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  210. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
  211. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +0 -0
@@ -5,38 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { PropertyPath } from "@rdfx/resource";
8
- import { NTriplesIdentifier } from "@rdfx/string";
9
- import genericToposort from "toposort";
10
8
  import { invariant } from "ts-invariant";
11
9
  import { Memoize } from "typescript-memoize";
12
10
  import { AbstractType } from "./AbstractType.js";
13
11
  import { arrayEquals } from "./equals.js";
14
12
  import { Type } from "./Type.js";
15
13
  export class ObjectType extends AbstractType {
16
- /**
17
- * Ancestor (parents, their parents, ad nauseum) ObjectTypes of this ObjectType.
18
- *
19
- * Mutable to support cycle-handling logic in the compiler.
20
- */
21
- #ancestorObjectTypes = [];
22
- /**
23
- * Immediate child ObjectTypes of this ObjectType.
24
- *
25
- * Mutable to support cycle-handling logic in the compiler.
26
- */
27
- #childObjectTypes = [];
28
- /**
29
- * Descendant (children, their children, ad nauseum) ObjectTypes of this ObjectType.
30
- *
31
- * Mutable to support cycle-handling logic in the compiler.
32
- */
33
- #descendantObjectTypes = [];
34
- /**
35
- * Immediate parent ObjectTypes of this Object types.
36
- *
37
- * Mutable to support cycle-handling logic in the compiler.
38
- */
39
- #parentObjectTypes = [];
40
14
  /**
41
15
  * Properties of this ObjectType.
42
16
  *
@@ -94,36 +68,12 @@ export class ObjectType extends AbstractType {
94
68
  this.toRdfTypes = toRdfTypes;
95
69
  this.tsImports = tsImports;
96
70
  }
97
- get ancestorObjectTypes() {
98
- return this.#ancestorObjectTypes;
99
- }
100
- get childObjectTypes() {
101
- return this.#childObjectTypes;
102
- }
103
- get descendantObjectTypes() {
104
- return this.#descendantObjectTypes;
105
- }
106
- get parentObjectTypes() {
107
- return this.#parentObjectTypes;
108
- }
109
71
  get properties() {
110
72
  return this.#properties;
111
73
  }
112
74
  get recursive() {
113
75
  return this.properties.some((property) => property.recursive);
114
76
  }
115
- addAncestorObjectTypes(...ancestorObjectTypes) {
116
- this.#ancestorObjectTypes.push(...ancestorObjectTypes);
117
- }
118
- addChildObjectTypes(...childObjectTypes) {
119
- this.#childObjectTypes.push(...childObjectTypes);
120
- }
121
- addDescendantObjectTypes(...descendantObjectTypes) {
122
- this.#descendantObjectTypes.push(...descendantObjectTypes);
123
- }
124
- addParentObjectTypes(...parentObjectTypes) {
125
- this.#parentObjectTypes.push(...parentObjectTypes);
126
- }
127
77
  addProperties(...properties) {
128
78
  this.#properties.push(...properties);
129
79
  for (const property of properties) {
@@ -150,10 +100,6 @@ export class ObjectType extends AbstractType {
150
100
  ...super.toJSON(),
151
101
  fromRdfType: this.fromRdfType.extract(),
152
102
  identifierType: this.identifierType.toJSON(),
153
- parentObjectTypes: this.parentObjectTypes.length > 0
154
- ? this.parentObjectTypes.map((parentObjectType) => parentObjectType.name.extract() ??
155
- parentObjectType.shapeIdentifier)
156
- : undefined,
157
103
  synthetic: this.synthetic ? true : undefined,
158
104
  toRdfTypes: this.toRdfTypes.length > 0 ? this.toRdfTypes : undefined,
159
105
  };
@@ -362,28 +308,4 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
362
308
  ], Property.prototype, "recursive", null);
363
309
  ObjectType.Property = Property;
364
310
  })(ObjectType || (ObjectType = {}));
365
- (function (ObjectType) {
366
- function toposort(objectTypes) {
367
- const objectTypesByShapeIdentifier = {};
368
- const objectTypeGraphNodes = [];
369
- const objectTypeGraphEdges = [];
370
- for (const objectType of objectTypes) {
371
- const objectTypeShapeIdentifier = NTriplesIdentifier.stringify(objectType.shapeIdentifier);
372
- invariant(!objectTypesByShapeIdentifier[objectTypeShapeIdentifier]);
373
- objectTypesByShapeIdentifier[objectTypeShapeIdentifier] = objectType;
374
- objectTypeGraphNodes.push(objectTypeShapeIdentifier);
375
- for (const parentAstObjectType of objectType.parentObjectTypes) {
376
- objectTypeGraphEdges.push([
377
- objectTypeShapeIdentifier,
378
- NTriplesIdentifier.stringify(parentAstObjectType.shapeIdentifier),
379
- ]);
380
- }
381
- }
382
- return genericToposort
383
- .array(objectTypeGraphNodes, objectTypeGraphEdges)
384
- .map((objectTypeIdentifier) => objectTypesByShapeIdentifier[objectTypeIdentifier])
385
- .reverse();
386
- }
387
- ObjectType.toposort = toposort;
388
- })(ObjectType || (ObjectType = {}));
389
311
  //# sourceMappingURL=ObjectType.js.map
@@ -1,9 +1,13 @@
1
1
  export class AstJsonGenerator {
2
2
  generate(ast) {
3
3
  return JSON.stringify({
4
- objectTypes: ast.namedObjectTypes.map((objectType) => ({
5
- ...objectType.toJSON(),
6
- properties: objectType.properties.map((property) => property.toJSON()),
4
+ namedTypes: ast.namedTypes.map((namedType) => ({
5
+ ...namedType.toJSON(),
6
+ ...(namedType.kind === "Object"
7
+ ? {
8
+ properties: namedType.properties.map((property) => property.toJSON()),
9
+ }
10
+ : {}),
7
11
  })),
8
12
  }, undefined, 2);
9
13
  }
@@ -2,64 +2,67 @@ import { Maybe } from "purify-ts";
2
2
  export function transformAstToLabeledPropertyGraph(ast) {
3
3
  const nodes = [];
4
4
  const relationships = [];
5
- for (const namedObjectType of ast.namedObjectTypes) {
6
- const id = typeId(namedObjectType);
7
- const properties = {
8
- name: { type: "string", value: typeName(namedObjectType) },
9
- };
10
- for (const namedObjectTypeProperty of namedObjectType.properties) {
11
- let itemType;
12
- switch (namedObjectTypeProperty.type.kind) {
13
- case "DefaultValue":
14
- case "List":
15
- case "Option":
16
- case "Set":
17
- itemType = namedObjectTypeProperty.type.itemType;
18
- break;
19
- case "LazyObject":
20
- itemType = namedObjectTypeProperty.type.resolveType;
21
- break;
22
- case "LazyObjectOption":
23
- case "LazyObjectSet":
24
- itemType = namedObjectTypeProperty.type.resolveType.itemType;
25
- break;
26
- default:
27
- itemType = namedObjectTypeProperty.type;
28
- break;
29
- }
30
- switch (itemType.kind) {
31
- case "Intersection":
32
- case "Object":
33
- case "Union":
34
- if (itemType.name.isJust()) {
35
- relationships.push({
36
- id: namedObjectTypeProperty.shapeIdentifier.toString(),
37
- label: Maybe.of(namedObjectTypeProperty.name),
38
- properties: {},
39
- sourceNodeId: id,
40
- targetNodeId: typeId(itemType),
41
- });
42
- }
43
- break;
44
- default:
45
- properties[namedObjectTypeProperty.name] = {
46
- type: "string",
47
- value: namedObjectTypeProperty.toString(),
48
- };
5
+ for (const namedType of ast.namedTypes) {
6
+ if (namedType.kind === "Object") {
7
+ const namedObjectType = namedType;
8
+ const id = typeId(namedType);
9
+ const properties = {
10
+ name: { type: "string", value: typeName(namedType) },
11
+ };
12
+ for (const namedObjectTypeProperty of namedObjectType.properties) {
13
+ let itemType;
14
+ switch (namedObjectTypeProperty.type.kind) {
15
+ case "DefaultValue":
16
+ case "List":
17
+ case "Option":
18
+ case "Set":
19
+ itemType = namedObjectTypeProperty.type.itemType;
20
+ break;
21
+ case "LazyObject":
22
+ itemType = namedObjectTypeProperty.type.resolveType;
23
+ break;
24
+ case "LazyObjectOption":
25
+ case "LazyObjectSet":
26
+ itemType = namedObjectTypeProperty.type.resolveType.itemType;
27
+ break;
28
+ default:
29
+ itemType = namedObjectTypeProperty.type;
30
+ break;
31
+ }
32
+ switch (itemType.kind) {
33
+ case "Intersection":
34
+ case "Object":
35
+ case "Union":
36
+ if (itemType.name.isJust()) {
37
+ relationships.push({
38
+ id: namedObjectTypeProperty.shapeIdentifier.toString(),
39
+ label: Maybe.of(namedObjectTypeProperty.name),
40
+ properties: {},
41
+ sourceNodeId: id,
42
+ targetNodeId: typeId(itemType),
43
+ });
44
+ }
45
+ break;
46
+ default:
47
+ properties[namedObjectTypeProperty.name] = {
48
+ type: "string",
49
+ value: namedObjectTypeProperty.toString(),
50
+ };
51
+ }
49
52
  }
53
+ nodes.push({
54
+ id,
55
+ label: typeName(namedObjectType),
56
+ properties: properties,
57
+ });
58
+ }
59
+ else if (namedType.kind === "Union") {
60
+ nodes.push({
61
+ id: typeId(namedType),
62
+ label: typeName(namedType),
63
+ properties: {},
64
+ });
50
65
  }
51
- nodes.push({
52
- id,
53
- label: typeName(namedObjectType),
54
- properties: properties,
55
- });
56
- }
57
- for (const namedUnionType of ast.namedUnionTypes) {
58
- nodes.push({
59
- id: typeId(namedUnionType),
60
- label: typeName(namedUnionType),
61
- properties: {},
62
- });
63
66
  }
64
67
  return {
65
68
  nodes,
@@ -1,44 +1,37 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { AbstractContainerType } from "./AbstractContainerType.js";
3
- import type { AbstractType } from "./AbstractType.js";
4
3
  import { type Code } from "./ts-poet-wrapper.js";
5
4
  /**
6
5
  * Abstract base class for ListType and SetType.
7
6
  */
8
7
  export declare abstract class AbstractCollectionType<ItemTypeT extends AbstractCollectionType.ItemType> extends AbstractContainerType<ItemTypeT> {
9
8
  protected readonly _mutable: boolean;
10
- protected readonly minCount: bigint;
11
9
  readonly discriminantProperty: Maybe<AbstractContainerType.DiscriminantProperty>;
12
10
  readonly graphqlArgs: AbstractContainerType<ItemTypeT>["graphqlArgs"];
13
- readonly typeofs: "object"[];
14
- constructor({ minCount, mutable, ...superParameters }: {
15
- minCount: bigint;
11
+ constructor({ mutable, ...superParameters }: {
16
12
  mutable: boolean;
17
13
  } & ConstructorParameters<typeof AbstractContainerType<ItemTypeT>>[0]);
18
- get conversionFunction(): Maybe<AbstractType.ConversionFunction>;
19
14
  get equalsFunction(): Code;
15
+ get expression(): Code;
20
16
  get filterFunction(): Code;
21
17
  get filterType(): Code;
22
18
  get graphqlType(): AbstractContainerType.GraphqlType;
23
19
  get hashFunction(): Code;
24
20
  get mutable(): boolean;
25
- get name(): Code;
26
21
  get schemaType(): Code;
27
22
  get validationFunction(): Maybe<Code>;
28
- protected get schemaInitializers(): readonly Code[];
29
- fromJsonExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["fromJsonExpression"]>[0]): Code;
30
23
  graphqlResolveExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
31
- jsonSchema(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonSchema"]>[0]): Code;
32
24
  jsonUiSchemaElement(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonUiSchemaElement"]>[0]): Maybe<Code>;
33
25
  toJsonExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toJsonExpression"]>[0]): Code;
34
26
  }
35
27
  export declare namespace AbstractCollectionType {
28
+ type ConversionFunction = AbstractContainerType.ConversionFunction;
36
29
  type DiscriminantProperty = AbstractContainerType.DiscriminantProperty;
37
- const GraphqlType: typeof AbstractType.GraphqlType;
30
+ const GraphqlType: typeof import("./AbstractType.js").AbstractType.GraphqlType;
38
31
  type GraphqlType = AbstractContainerType.GraphqlType;
39
32
  const isItemType: typeof AbstractContainerType.isItemType;
40
33
  type ItemType = AbstractContainerType.ItemType;
41
- const JsonType: typeof AbstractType.JsonType;
34
+ const JsonType: typeof import("./AbstractType.js").AbstractType.JsonType;
42
35
  type JsonType = AbstractContainerType.JsonType;
43
36
  }
44
37
  //# sourceMappingURL=AbstractCollectionType.d.ts.map
@@ -5,58 +5,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Maybe } from "purify-ts";
8
- import { invariant } from "ts-invariant";
9
8
  import { Memoize } from "typescript-memoize";
10
9
  import { AbstractContainerType } from "./AbstractContainerType.js";
11
- import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
10
+ import { code, literalOf } from "./ts-poet-wrapper.js";
12
11
  /**
13
12
  * Abstract base class for ListType and SetType.
14
13
  */
15
14
  export class AbstractCollectionType extends AbstractContainerType {
16
15
  _mutable;
17
- minCount;
18
16
  discriminantProperty = Maybe.empty();
19
17
  graphqlArgs = Maybe.empty();
20
- typeofs = ["object"];
21
- constructor({ minCount, mutable, ...superParameters }) {
18
+ constructor({ mutable, ...superParameters }) {
22
19
  super(superParameters);
23
- this.minCount = minCount;
24
- invariant(this.minCount >= 0n);
25
20
  this._mutable = mutable;
26
- if (mutable) {
27
- invariant(this.minCount === 0n);
28
- }
29
- }
30
- get conversionFunction() {
31
- const itemConversionFunction = this.itemType.conversionFunction.orDefault(this.itemConversionFunctionDefault);
32
- const sourceTypes = [
33
- {
34
- name: code `readonly (${joinCode(itemConversionFunction.sourceTypes.map((itemSourceType) => code `${itemSourceType.name}`), { on: " | " })})[]`,
35
- typeof: "object",
36
- },
37
- ];
38
- if (this.minCount === 0n) {
39
- sourceTypes.push({
40
- name: "undefined",
41
- typeof: "undefined",
42
- });
43
- }
44
- return Maybe.of({
45
- code: code `${this.reusables.snippets.convertToArray}(${itemConversionFunction.code}, ${literalOf(!this._mutable)})`,
46
- sourceTypes,
47
- });
48
21
  }
49
22
  get equalsFunction() {
50
23
  return code `((left, right) => ${this.reusables.snippets.arrayEquals}(left, right, ${this.itemType.equalsFunction}))`;
51
24
  }
25
+ get expression() {
26
+ return code `${!this._mutable ? "readonly " : ""}(${this.itemType.expression})[]`;
27
+ }
52
28
  get filterFunction() {
53
- return code `${this.reusables.snippets.filterArray}<${this.itemType.name}, ${this.itemType.filterType}>(${this.itemType.filterFunction})`;
29
+ return code `${this.reusables.snippets.filterArray}<${this.itemType.expression}, ${this.itemType.filterType}>(${this.itemType.filterFunction})`;
54
30
  }
55
31
  get filterType() {
56
32
  return code `${this.reusables.snippets.CollectionFilter}<${this.itemType.filterType}>`;
57
33
  }
58
34
  get graphqlType() {
59
- return new AbstractContainerType.GraphqlType(code `new ${this.reusables.imports.GraphQLList}(${this.itemType.graphqlType.name})`, this.reusables);
35
+ return new AbstractContainerType.GraphqlType(code `new ${this.reusables.imports.GraphQLList}(${this.itemType.graphqlType.expression})`, this.reusables);
60
36
  }
61
37
  get hashFunction() {
62
38
  return code `${this.reusables.snippets.hashArray}(${this.itemType.hashFunction})`;
@@ -64,47 +40,15 @@ export class AbstractCollectionType extends AbstractContainerType {
64
40
  get mutable() {
65
41
  return this._mutable || this.itemType.mutable;
66
42
  }
67
- get name() {
68
- return code `${!this._mutable ? "readonly " : ""}(${this.itemType.name})[]`;
69
- }
70
43
  get schemaType() {
71
44
  return code `${this.reusables.snippets.CollectionSchema}<${this.itemType.schemaType}>`;
72
45
  }
73
46
  get validationFunction() {
74
47
  return Maybe.of(code `${this.reusables.snippets.validateArray}(${this.itemType.validationFunction.orDefault(this.itemValidationFunctionDefault)}, ${literalOf(!this._mutable)})`);
75
48
  }
76
- get schemaInitializers() {
77
- let schemaInitializers = super.schemaInitializers;
78
- if (this.minCount > 0n) {
79
- schemaInitializers = schemaInitializers.concat(code `minCount: ${Number(this.minCount)}`);
80
- }
81
- return schemaInitializers;
82
- }
83
- fromJsonExpression({ variables, }) {
84
- let expression = variables.value;
85
- if (this.minCount === 0n) {
86
- expression = code `(${expression} ?? [])`;
87
- }
88
- return code `${this.reusables.imports.Either}.sequence<Error, ${this.itemType.name}>(${expression}.map(item => (${this.itemType.fromJsonExpression({
89
- variables: { value: code `item` },
90
- })})))`;
91
- }
92
49
  graphqlResolveExpression({ variables, }) {
93
50
  return variables.value;
94
51
  }
95
- jsonSchema(parameters) {
96
- let schema = code `${this.itemType.jsonSchema(parameters)}.array()`;
97
- if (this.minCount > 0n) {
98
- schema = code `${schema}.nonempty().min(${this.minCount})`;
99
- }
100
- else {
101
- schema = code `${schema}.optional()`;
102
- }
103
- if (!this._mutable) {
104
- schema = code `${schema}.readonly()`;
105
- }
106
- return schema;
107
- }
108
52
  jsonUiSchemaElement(parameters) {
109
53
  return this.itemType.jsonUiSchemaElement(parameters);
110
54
  }
@@ -114,10 +58,10 @@ export class AbstractCollectionType extends AbstractContainerType {
114
58
  }
115
59
  __decorate([
116
60
  Memoize()
117
- ], AbstractCollectionType.prototype, "conversionFunction", null);
61
+ ], AbstractCollectionType.prototype, "equalsFunction", null);
118
62
  __decorate([
119
63
  Memoize()
120
- ], AbstractCollectionType.prototype, "equalsFunction", null);
64
+ ], AbstractCollectionType.prototype, "expression", null);
121
65
  __decorate([
122
66
  Memoize()
123
67
  ], AbstractCollectionType.prototype, "filterFunction", null);
@@ -130,9 +74,6 @@ __decorate([
130
74
  __decorate([
131
75
  Memoize()
132
76
  ], AbstractCollectionType.prototype, "hashFunction", null);
133
- __decorate([
134
- Memoize()
135
- ], AbstractCollectionType.prototype, "name", null);
136
77
  __decorate([
137
78
  Memoize()
138
79
  ], AbstractCollectionType.prototype, "schemaType", null);
@@ -1,6 +1,5 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { AbstractType } from "./AbstractType.js";
3
- import type { AnonymousUnionType } from "./AnonymousUnionType.js";
4
3
  import type { BigDecimalType } from "./BigDecimalType.js";
5
4
  import type { BigIntType } from "./BigIntType.js";
6
5
  import type { BlankNodeType } from "./BlankNodeType.js";
@@ -13,13 +12,13 @@ import type { IntType } from "./IntType.js";
13
12
  import type { IriType } from "./IriType.js";
14
13
  import type { ListType } from "./ListType.js";
15
14
  import type { LiteralType } from "./LiteralType.js";
16
- import type { NamedObjectType } from "./NamedObjectType.js";
17
- import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
18
- import type { NamedUnionType } from "./NamedUnionType.js";
15
+ import type { ObjectType } from "./ObjectType.js";
16
+ import type { ObjectUnionType } from "./ObjectUnionType.js";
19
17
  import type { StringType } from "./StringType.js";
20
18
  import type { TermType } from "./TermType.js";
21
19
  import type { Type } from "./Type.js";
22
20
  import { type Code } from "./ts-poet-wrapper.js";
21
+ import type { UnionType } from "./UnionType.js";
23
22
  /**
24
23
  * Abstract base class for types that contain other types e.g., ListType, OptionType, SetType.
25
24
  */
@@ -37,7 +36,6 @@ export declare abstract class AbstractContainerType<ItemTypeT extends AbstractCo
37
36
  } & ConstructorParameters<typeof AbstractType>[0]);
38
37
  get recursive(): boolean;
39
38
  get referencesObjectType(): boolean;
40
- get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
41
39
  protected get itemConversionFunctionDefault(): AbstractType.ConversionFunction;
42
40
  protected get itemValidationFunctionDefault(): Code;
43
41
  protected get schemaInitializers(): readonly Code[];
@@ -47,7 +45,7 @@ export declare namespace AbstractContainerType {
47
45
  type DiscriminantProperty = AbstractType.DiscriminantProperty;
48
46
  const GraphqlType: typeof AbstractType.GraphqlType;
49
47
  type GraphqlType = AbstractType.GraphqlType;
50
- type ItemType = AnonymousUnionType | BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | FloatType | IdentifierType | IntType | IriType | ListType<ListType.ItemType> | LiteralType | NamedObjectUnionType | NamedUnionType | NamedObjectType | StringType | TermType;
48
+ type ItemType = BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | FloatType | IdentifierType | IntType | IriType | ListType<ListType.ItemType> | LiteralType | ObjectUnionType | ObjectType | StringType | TermType | UnionType<Type>;
51
49
  function isItemType(type: Type): type is ItemType;
52
50
  const JsonType: typeof AbstractType.JsonType;
53
51
  type JsonType = AbstractType.JsonType;
@@ -29,16 +29,13 @@ export class AbstractContainerType extends AbstractType {
29
29
  get referencesObjectType() {
30
30
  return this.itemType.referencesObjectType;
31
31
  }
32
- get toRdfResourceValueTypes() {
33
- return this.itemType.toRdfResourceValueTypes;
34
- }
35
32
  get itemConversionFunctionDefault() {
36
33
  return {
37
34
  code: code `${this.reusables.snippets.identityConversionFunction}`,
38
35
  sourceTypes: [
39
36
  {
40
- name: this.itemType.name,
41
- typeof: this.itemType.typeofs[0],
37
+ expression: this.itemType.expression,
38
+ jsType: this.itemType.jsTypes[0],
42
39
  },
43
40
  ],
44
41
  };
@@ -67,7 +64,6 @@ __decorate([
67
64
  AbstractContainerType.GraphqlType = AbstractType.GraphqlType;
68
65
  function isItemType(type) {
69
66
  switch (type.kind) {
70
- case "AnonymousUnion":
71
67
  case "BigDecimal":
72
68
  case "BigInt":
73
69
  case "BlankNode":
@@ -80,11 +76,11 @@ __decorate([
80
76
  case "Iri":
81
77
  case "List":
82
78
  case "Literal":
83
- case "NamedObjectUnion":
84
- case "NamedUnion":
85
- case "NamedObjectType":
79
+ case "Object":
80
+ case "ObjectUnion":
86
81
  case "String":
87
82
  case "Term":
83
+ case "Union":
88
84
  return true;
89
85
  case "DefaultValue":
90
86
  case "LazyObjectOption":
@@ -2,23 +2,26 @@ import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
2
2
  import { type Code } from "./ts-poet-wrapper.js";
3
3
  export declare abstract class AbstractDateType extends AbstractPrimitiveType<Date> {
4
4
  readonly equalsFunction: Code;
5
+ readonly expression: Code;
5
6
  readonly filterFunction: Code;
6
7
  readonly filterType: Code;
8
+ readonly jsTypes: readonly [{
9
+ readonly instanceof: "Date";
10
+ readonly typeof: "object";
11
+ }];
7
12
  abstract readonly kind: "DateTime" | "Date";
8
13
  readonly mutable = false;
9
- readonly name = "Date";
10
14
  readonly schemaType: Code;
11
15
  readonly valueSparqlWherePatternsFunction: Code;
12
- readonly typeofs: "object"[];
13
16
  fromJsonExpression({ variables, }: Parameters<AbstractPrimitiveType<Date>["fromJsonExpression"]>[0]): Code;
14
17
  jsonType(): AbstractPrimitiveType.JsonType;
15
18
  toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<Date>["toRdfResourceValuesExpression"]>[0]): Code;
16
- protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<Date>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<Date>["fromRdfResourceValuesExpressionChain"]>;
17
19
  protected abstract fromRdfResourceValueExpression(variables: {
18
20
  variables: {
19
21
  value: Code;
20
22
  };
21
23
  }): Code;
24
+ protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<Date>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<Date>["fromRdfResourceValuesExpressionChain"]>;
22
25
  }
23
26
  export declare namespace AbstractDateType {
24
27
  type ConversionFunction = AbstractPrimitiveType.ConversionFunction;
@@ -9,13 +9,18 @@ import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
9
9
  import { code } from "./ts-poet-wrapper.js";
10
10
  export class AbstractDateType extends AbstractPrimitiveType {
11
11
  equalsFunction = code `${this.reusables.snippets.dateEquals}`;
12
+ expression = code `Date`;
12
13
  filterFunction = code `${this.reusables.snippets.filterDate}`;
13
14
  filterType = code `${this.reusables.snippets.DateFilter}`;
15
+ jsTypes = [
16
+ {
17
+ instanceof: "Date",
18
+ typeof: "object",
19
+ },
20
+ ];
14
21
  mutable = false;
15
- name = "Date";
16
22
  schemaType = code `${this.reusables.snippets.DateSchema}`;
17
23
  valueSparqlWherePatternsFunction = code `${this.reusables.snippets.dateSparqlWherePatterns}`;
18
- typeofs = ["object"];
19
24
  fromJsonExpression({ variables, }) {
20
25
  return code `${this.reusables.imports.Either}.of<Error, Date>(new Date(${variables.value}))`;
21
26
  }
@@ -3,6 +3,10 @@ import type { IdentifierNodeKind } from "@shaclmate/shacl-ast";
3
3
  import { AbstractTermType } from "./AbstractTermType.js";
4
4
  import { type Code } from "./ts-poet-wrapper.js";
5
5
  export declare abstract class AbstractIdentifierType<IdentifierT extends BlankNode | NamedNode> extends AbstractTermType<NamedNode, IdentifierT> {
6
+ readonly jsTypes: readonly [{
7
+ readonly instanceof: "Object";
8
+ readonly typeof: "object";
9
+ }];
6
10
  abstract readonly kind: "BlankNode" | "Identifier" | "Iri";
7
11
  abstract readonly nodeKinds: ReadonlySet<IdentifierNodeKind>;
8
12
  abstract readonly parseFunction: Code;
@@ -8,6 +8,9 @@ import { Memoize } from "typescript-memoize";
8
8
  import { AbstractTermType } from "./AbstractTermType.js";
9
9
  import { code } from "./ts-poet-wrapper.js";
10
10
  export class AbstractIdentifierType extends AbstractTermType {
11
+ jsTypes = [
12
+ { instanceof: "Object", typeof: "object" },
13
+ ];
11
14
  stringifyFunction = code `${this.reusables.imports.NTriplesTerm}.stringify`;
12
15
  get graphqlType() {
13
16
  return new AbstractTermType.GraphqlType(code `${this.reusables.imports.GraphQLString}`, this.reusables);