@shaclmate/compiler 4.0.38 → 4.0.40

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 (256) hide show
  1. package/dist/ShapesGraphToAstTransformer.js +12 -12
  2. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +24 -24
  3. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +4 -4
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +16 -16
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
  7. package/dist/ast/AbstractCollectionType.d.ts +1 -1
  8. package/dist/ast/AbstractCompoundType.d.ts +1 -1
  9. package/dist/ast/AbstractCompoundType.js +15 -15
  10. package/dist/ast/AbstractContainerType.d.ts +1 -1
  11. package/dist/ast/AbstractContainerType.js +15 -15
  12. package/dist/ast/AbstractLazyObjectType.d.ts +1 -1
  13. package/dist/ast/AbstractTermType.d.ts +1 -1
  14. package/dist/ast/BlankNodeType.d.ts +1 -1
  15. package/dist/ast/BlankNodeType.js +1 -1
  16. package/dist/ast/DefaultValueType.d.ts +1 -1
  17. package/dist/ast/DefaultValueType.js +2 -2
  18. package/dist/ast/IdentifierType.d.ts +1 -1
  19. package/dist/ast/IdentifierType.js +1 -1
  20. package/dist/ast/IntersectionType.d.ts +1 -1
  21. package/dist/ast/IntersectionType.js +3 -3
  22. package/dist/ast/IriType.d.ts +1 -1
  23. package/dist/ast/IriType.js +1 -1
  24. package/dist/ast/LazyObjectOptionType.d.ts +1 -1
  25. package/dist/ast/LazyObjectOptionType.js +1 -1
  26. package/dist/ast/LazyObjectSetType.d.ts +1 -1
  27. package/dist/ast/LazyObjectSetType.js +1 -1
  28. package/dist/ast/LazyObjectType.d.ts +1 -1
  29. package/dist/ast/LazyObjectType.js +1 -1
  30. package/dist/ast/ListType.d.ts +1 -1
  31. package/dist/ast/ListType.js +16 -16
  32. package/dist/ast/LiteralType.d.ts +1 -1
  33. package/dist/ast/LiteralType.js +1 -1
  34. package/dist/ast/ObjectCompoundType.js +3 -3
  35. package/dist/ast/ObjectType.d.ts +1 -1
  36. package/dist/ast/ObjectType.js +16 -16
  37. package/dist/ast/OptionType.d.ts +1 -1
  38. package/dist/ast/OptionType.js +1 -1
  39. package/dist/ast/SetType.d.ts +1 -1
  40. package/dist/ast/SetType.js +1 -1
  41. package/dist/ast/TermType.d.ts +1 -1
  42. package/dist/ast/TermType.js +1 -1
  43. package/dist/ast/Type.js +15 -15
  44. package/dist/ast/UnionType.d.ts +1 -1
  45. package/dist/ast/UnionType.js +3 -3
  46. package/dist/generators/transformAstToLabeledPropertyGraph.js +10 -10
  47. package/dist/generators/ts/AbstractCollectionType.d.ts +2 -6
  48. package/dist/generators/ts/AbstractCollectionType.js +16 -15
  49. package/dist/generators/ts/AbstractContainerType.d.ts +7 -11
  50. package/dist/generators/ts/AbstractContainerType.js +35 -36
  51. package/dist/generators/ts/AbstractDateType.d.ts +4 -4
  52. package/dist/generators/ts/AbstractDateType.js +2 -2
  53. package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
  54. package/dist/generators/ts/AbstractLazyObjectType.d.ts +14 -17
  55. package/dist/generators/ts/AbstractLazyObjectType.js +26 -38
  56. package/dist/generators/ts/AbstractLiteralType.d.ts +1 -5
  57. package/dist/generators/ts/AbstractLiteralType.js +7 -6
  58. package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
  59. package/dist/generators/ts/AbstractNumericType.js +3 -3
  60. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  61. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  62. package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -6
  63. package/dist/generators/ts/AbstractPrimitiveType.js +9 -10
  64. package/dist/generators/ts/AbstractTermType.d.ts +1 -5
  65. package/dist/generators/ts/AbstractTermType.js +3 -17
  66. package/dist/generators/ts/AbstractType.d.ts +22 -15
  67. package/dist/generators/ts/AbstractType.js +18 -8
  68. package/dist/generators/ts/BigDecimalType.d.ts +2 -2
  69. package/dist/generators/ts/BigDecimalType.js +3 -3
  70. package/dist/generators/ts/BigIntType.d.ts +1 -1
  71. package/dist/generators/ts/BigIntType.js +3 -3
  72. package/dist/generators/ts/BlankNodeType.d.ts +4 -4
  73. package/dist/generators/ts/BlankNodeType.js +12 -12
  74. package/dist/generators/ts/BooleanType.d.ts +3 -3
  75. package/dist/generators/ts/BooleanType.js +11 -6
  76. package/dist/generators/ts/DateTimeType.d.ts +1 -1
  77. package/dist/generators/ts/DateTimeType.js +1 -1
  78. package/dist/generators/ts/DateType.d.ts +1 -1
  79. package/dist/generators/ts/DateType.js +1 -1
  80. package/dist/generators/ts/DefaultValueType.d.ts +3 -7
  81. package/dist/generators/ts/DefaultValueType.js +17 -21
  82. package/dist/generators/ts/FloatType.d.ts +1 -1
  83. package/dist/generators/ts/FloatType.js +1 -1
  84. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  85. package/dist/generators/ts/GraphqlSchema.js +4 -4
  86. package/dist/generators/ts/IdentifierType.d.ts +4 -4
  87. package/dist/generators/ts/IdentifierType.js +14 -14
  88. package/dist/generators/ts/IntType.d.ts +1 -1
  89. package/dist/generators/ts/IntType.js +1 -1
  90. package/dist/generators/ts/IriType.d.ts +4 -2
  91. package/dist/generators/ts/IriType.js +27 -22
  92. package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -1
  93. package/dist/generators/ts/LazyObjectOptionType.js +7 -7
  94. package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
  95. package/dist/generators/ts/LazyObjectSetType.js +6 -6
  96. package/dist/generators/ts/LazyObjectType.d.ts +1 -1
  97. package/dist/generators/ts/LazyObjectType.js +5 -5
  98. package/dist/generators/ts/ListType.d.ts +5 -6
  99. package/dist/generators/ts/ListType.js +24 -25
  100. package/dist/generators/ts/LiteralType.d.ts +3 -2
  101. package/dist/generators/ts/LiteralType.js +14 -7
  102. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +24 -24
  103. package/dist/generators/ts/ObjectType.js +350 -0
  104. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  105. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +54 -64
  106. package/dist/generators/ts/OptionType.d.ts +2 -6
  107. package/dist/generators/ts/OptionType.js +12 -18
  108. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -8
  109. package/dist/generators/ts/SetType.d.ts +1 -1
  110. package/dist/generators/ts/SetType.js +1 -1
  111. package/dist/generators/ts/Snippets.d.ts +1 -0
  112. package/dist/generators/ts/Snippets.js +7 -0
  113. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  114. package/dist/generators/ts/StringType.d.ts +3 -3
  115. package/dist/generators/ts/StringType.js +11 -6
  116. package/dist/generators/ts/TermType.d.ts +3 -3
  117. package/dist/generators/ts/TermType.js +13 -13
  118. package/dist/generators/ts/TsGenerator.js +12 -9
  119. package/dist/generators/ts/Type.d.ts +4 -5
  120. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  121. package/dist/generators/ts/TypeFactory.js +79 -80
  122. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +40 -15
  123. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +328 -135
  124. package/dist/generators/ts/ZodGenerator.js +7 -9
  125. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +13 -13
  126. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +11 -14
  127. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +3 -2
  128. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +24 -15
  129. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +3 -6
  130. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +20 -12
  131. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  132. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_createFunctionDeclaration.js → _ObjectType/ObjectType_createFunctionDeclaration.js} +6 -6
  133. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  134. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +5 -5
  135. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  136. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -3
  137. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  138. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +3 -3
  139. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  140. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  141. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  142. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +3 -3
  143. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  144. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js → _ObjectType/ObjectType_fromJsonFunctionDeclaration.js} +4 -4
  145. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  146. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js} +7 -31
  147. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  148. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  149. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  150. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  151. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  152. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  153. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  154. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js → _ObjectType/ObjectType_hashFunctionDeclarations.js} +8 -8
  155. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  156. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_interfaceDeclaration.js → _ObjectType/ObjectType_interfaceDeclaration.js} +5 -5
  157. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  158. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js → _ObjectType/ObjectType_isTypeFunctionDeclaration.js} +3 -3
  159. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  160. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  161. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  162. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +2 -2
  163. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  164. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js → _ObjectType/ObjectType_jsonTypeAliasDeclaration.js} +2 -2
  165. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  166. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
  167. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  168. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  169. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  170. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +14 -0
  171. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  172. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  173. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  174. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  175. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  176. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js → _ObjectType/ObjectType_toJsonFunctionDeclaration.js} +4 -4
  177. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  178. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  179. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  180. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +6 -6
  181. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  182. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  183. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  184. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  185. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +2 -6
  186. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +24 -28
  187. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  188. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/identifierTypeDeclarations.js +4 -2
  189. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +2 -2
  190. package/dist/generators/ts/_snippets/snippets_CollectionSchema.js +1 -1
  191. package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +1 -1
  192. package/dist/generators/ts/_snippets/snippets_IriSchema.js +2 -2
  193. package/dist/generators/ts/_snippets/snippets_MaybeSchema.js +2 -2
  194. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
  195. package/dist/generators/ts/_snippets/snippets_StringSchema.js +2 -2
  196. package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +1 -1
  197. package/dist/generators/ts/_snippets/snippets_convertToIri.js +1 -1
  198. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
  199. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.d.ts +3 -0
  200. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.js +16 -0
  201. package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +1 -1
  202. package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
  203. package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
  204. package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +1 -1
  205. package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +3 -3
  206. package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +1 -1
  207. package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +1 -1
  208. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +1 -1
  209. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +1 -1
  210. package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +1 -1
  211. package/dist/generators/ts/_snippets/snippets_validateArray.js +1 -1
  212. package/dist/generators/ts/_snippets/snippets_validateMaybe.js +1 -1
  213. package/dist/generators/ts/tsComment.js +1 -1
  214. package/dist/input/generated.d.ts +1399 -1468
  215. package/dist/input/generated.js +518 -655
  216. package/package.json +4 -4
  217. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  218. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  219. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  220. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  221. package/dist/generators/ts/NamedObjectType.js +0 -341
  222. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  223. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  224. package/dist/generators/ts/NamedUnionType.js +0 -13
  225. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  226. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  227. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  228. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  229. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  230. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  231. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  232. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  233. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  234. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  235. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  236. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  237. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  238. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  239. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  240. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  241. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  242. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  243. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  244. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  245. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  246. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  247. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  248. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  249. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  250. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  251. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  252. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  253. package/dist/generators/ts/removeUndefined.d.ts +0 -2
  254. package/dist/generators/ts/removeUndefined.js +0 -17
  255. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  256. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
@@ -7,48 +7,55 @@ 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 { AbstractIdentifierType } from "./AbstractIdentifierType.js";
10
- import { arrayOf, code, joinCode, literalOf, } from "./ts-poet-wrapper.js";
10
+ import { arrayOf, code, joinCode } from "./ts-poet-wrapper.js";
11
11
  export class IriType extends AbstractIdentifierType {
12
12
  filterFunction = code `${this.reusables.snippets.filterIri}`;
13
13
  filterType = code `${this.reusables.snippets.IriFilter}`;
14
- kind = "IriType";
14
+ kind = "Iri";
15
15
  nodeKinds = nodeKinds;
16
- schemaType = code `${this.reusables.snippets.IriSchema}`;
16
+ schemaType = code `${this.reusables.snippets.IriSchema}<${this.valueTypeExpression}>`;
17
17
  valueSparqlWherePatternsFunction = code `${this.reusables.snippets.iriSparqlWherePatterns}`;
18
18
  get conversionFunction() {
19
- const IriT = this.in_.length > 0
20
- ? code `${joinCode(this.in_.map((iri) => code `${literalOf(iri.value)}`), { on: "| " })}`
21
- : code `string`;
22
19
  return Maybe.of({
23
- code: code `${this.reusables.snippets.convertToIri}<${IriT}>`,
20
+ code: code `${this.reusables.snippets.convertToIri}<${this.valueTypeExpression}>`,
24
21
  sourceTypes: [
25
22
  {
26
- name: IriT,
23
+ expression: this.valueTypeExpression,
27
24
  typeof: "string",
28
25
  },
29
26
  {
30
- name: this.name,
27
+ expression: this.expression,
31
28
  typeof: "object",
32
29
  },
33
30
  ],
34
31
  });
35
32
  }
36
- get name() {
33
+ get expression() {
37
34
  if (this.in_.length > 0) {
38
- // Treat sh:in as a union of the IRIs
39
- // rdfjs.NamedNode<"http://example.com/1" | "http://example.com/2">
40
- return code `${this.reusables.imports.NamedNode}<${joinCode(this.in_.map((iri) => code `${literalOf(iri.value)}`), { on: "| " })}>`;
35
+ return code `${this.reusables.imports.NamedNode}<${this.valueTypeExpression}>`;
41
36
  }
42
37
  return code `${this.reusables.imports.NamedNode}`;
43
38
  }
44
39
  get parseFunction() {
45
40
  if (this.in_.length > 0) {
46
- return 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.name});`))} default: return ${this.reusables.imports.Left}(new Error("expected NamedNode identifier to be one of ${this.in_.map((iri) => iri.value).join(" ")}")); } })`;
41
+ return 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(" ")}")); } })`;
47
42
  }
48
43
  return code `${this.reusables.snippets.parseIri}`;
49
44
  }
45
+ get schemaInitializers() {
46
+ let initializers = super.schemaInitializers;
47
+ if (this.in_.length > 0) {
48
+ initializers = initializers.concat(code `in: ${arrayOf(...this.in_.map((in_) => this.rdfjsTermExpression(in_)))}`);
49
+ }
50
+ return initializers;
51
+ }
52
+ get valueTypeExpression() {
53
+ return this.in_.length > 0
54
+ ? code `(${this.in_.map((in_) => `"${in_.value}"`).join(" | ")})`
55
+ : code `string`;
56
+ }
50
57
  fromJsonExpression({ variables, }) {
51
- return code `${this.reusables.imports.Either}.of<Error, ${this.name}>(${this.reusables.imports.dataFactory}.namedNode(${variables.value}["@id"]))`;
58
+ return code `${this.reusables.imports.Either}.of<Error, ${this.expression}>(${this.reusables.imports.dataFactory}.namedNode(${variables.value}["@id"]))`;
52
59
  }
53
60
  jsonSchema({ includeDiscriminantProperty, }) {
54
61
  let idSchema;
@@ -69,12 +76,7 @@ export class IriType extends AbstractIdentifierType {
69
76
  const discriminantProperty = parameters?.includeDiscriminantProperty
70
77
  ? `, readonly termType: "NamedNode"`
71
78
  : "";
72
- if (this.in_.length > 0) {
73
- // Treat sh:in as a union of the IRIs
74
- // rdfjs.NamedNode<"http://example.com/1" | "http://example.com/2">
75
- return new AbstractIdentifierType.JsonType(code `{ readonly "@id": ${this.in_.map((iri) => `"${iri.value}"`).join(" | ")}${discriminantProperty} }`);
76
- }
77
- return new AbstractIdentifierType.JsonType(code `{ readonly "@id": string${discriminantProperty} }`);
79
+ return new AbstractIdentifierType.JsonType(code `{ readonly "@id": ${this.valueTypeExpression}${discriminantProperty} }`);
78
80
  }
79
81
  toJsonExpression({ includeDiscriminantProperty, variables, }) {
80
82
  const discriminantProperty = includeDiscriminantProperty
@@ -96,10 +98,13 @@ __decorate([
96
98
  ], IriType.prototype, "conversionFunction", null);
97
99
  __decorate([
98
100
  Memoize()
99
- ], IriType.prototype, "name", null);
101
+ ], IriType.prototype, "expression", null);
100
102
  __decorate([
101
103
  Memoize()
102
104
  ], IriType.prototype, "parseFunction", null);
105
+ __decorate([
106
+ Memoize()
107
+ ], IriType.prototype, "valueTypeExpression", null);
103
108
  __decorate([
104
109
  Memoize()
105
110
  ], IriType.prototype, "jsonType", null);
@@ -7,6 +7,7 @@ declare const Super: (abstract new ({ partialType, resolveType, ...superParamete
7
7
  partialType: OptionType<AbstractLazyObjectType.ObjectTypeConstraint>;
8
8
  resolveType: OptionType<AbstractLazyObjectType.ObjectTypeConstraint>;
9
9
  } & {
10
+ alias: Maybe<string>;
10
11
  comment: Maybe<string>;
11
12
  configuration: import("./TsGenerator.js").TsGenerator.Configuration;
12
13
  label: Maybe<string>;
@@ -18,7 +19,7 @@ declare const Super: (abstract new ({ partialType, resolveType, ...superParamete
18
19
  };
19
20
  export declare class LazyObjectOptionType extends Super {
20
21
  readonly graphqlArgs: Super["graphqlArgs"];
21
- readonly kind = "LazyObjectOptionType";
22
+ readonly kind = "LazyObjectOption";
22
23
  get conversionFunction(): Maybe<AbstractLazyObjectType.ConversionFunction>;
23
24
  protected get runtimeClass(): {
24
25
  name: Code;
@@ -11,25 +11,25 @@ import { code } from "./ts-poet-wrapper.js";
11
11
  const Super = (AbstractLazyObjectType);
12
12
  export class LazyObjectOptionType extends Super {
13
13
  graphqlArgs = Maybe.empty();
14
- kind = "LazyObjectOptionType";
14
+ kind = "LazyObjectOption";
15
15
  get conversionFunction() {
16
16
  return Maybe.of({
17
- code: code `${this.reusables.snippets.convertToLazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.name}, ${this.resolveType.itemType.name}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
17
+ code: code `${this.reusables.snippets.convertToLazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
18
18
  sourceTypes: [
19
19
  {
20
- name: this.name,
20
+ expression: this.expression,
21
21
  typeof: "object",
22
22
  },
23
23
  {
24
- name: this.resolveType.name,
24
+ expression: this.resolveType.expression,
25
25
  typeof: "object",
26
26
  },
27
27
  {
28
- name: this.resolveType.itemType.name,
28
+ expression: this.resolveType.itemType.expression,
29
29
  typeof: "object",
30
30
  },
31
31
  {
32
- name: "undefined",
32
+ expression: code `undefined`,
33
33
  typeof: "undefined",
34
34
  },
35
35
  ],
@@ -37,7 +37,7 @@ export class LazyObjectOptionType extends Super {
37
37
  }
38
38
  get runtimeClass() {
39
39
  return {
40
- name: code `${this.reusables.snippets.LazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.name}, ${this.resolveType.itemType.name}>`,
40
+ name: code `${this.reusables.snippets.LazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
41
41
  partialPropertyName: "partial",
42
42
  rawName: code `${this.reusables.snippets.LazyObjectOption}`,
43
43
  };
@@ -4,7 +4,7 @@ import type { SetType } from "./SetType.js";
4
4
  import { type Code } from "./ts-poet-wrapper.js";
5
5
  export declare class LazyObjectSetType extends AbstractLazyObjectType<SetType<AbstractLazyObjectType.ObjectTypeConstraint>, SetType<AbstractLazyObjectType.ObjectTypeConstraint>> {
6
6
  readonly graphqlArgs: Super["graphqlArgs"];
7
- readonly kind = "LazyObjectSetType";
7
+ readonly kind = "LazyObjectSet";
8
8
  get conversionFunction(): Maybe<AbstractLazyObjectType.ConversionFunction>;
9
9
  protected get runtimeClass(): {
10
10
  name: Code;
@@ -17,21 +17,21 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
17
17
  type: code `${this.reusables.imports.GraphQLInt}`,
18
18
  },
19
19
  });
20
- kind = "LazyObjectSetType";
20
+ kind = "LazyObjectSet";
21
21
  get conversionFunction() {
22
22
  return Maybe.of({
23
- code: code `${this.reusables.snippets.convertToLazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.name}, ${this.resolveType.itemType.name}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
23
+ code: code `${this.reusables.snippets.convertToLazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
24
24
  sourceTypes: [
25
25
  {
26
- name: this.name,
26
+ expression: this.expression,
27
27
  typeof: "object",
28
28
  },
29
29
  {
30
- name: this.resolveType.name,
30
+ expression: this.resolveType.expression,
31
31
  typeof: "object",
32
32
  },
33
33
  {
34
- name: "undefined",
34
+ expression: code `undefined`,
35
35
  typeof: "undefined",
36
36
  },
37
37
  ],
@@ -39,7 +39,7 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
39
39
  }
40
40
  get runtimeClass() {
41
41
  return {
42
- name: code `${this.reusables.snippets.LazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.name}, ${this.resolveType.itemType.name}>`,
42
+ name: code `${this.reusables.snippets.LazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
43
43
  partialPropertyName: "partials",
44
44
  rawName: code `${this.reusables.snippets.LazyObjectSet}`,
45
45
  };
@@ -3,7 +3,7 @@ import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
3
3
  import { type Code } from "./ts-poet-wrapper.js";
4
4
  export declare class LazyObjectType extends AbstractLazyObjectType<AbstractLazyObjectType.ObjectTypeConstraint, AbstractLazyObjectType.ObjectTypeConstraint> {
5
5
  readonly graphqlArgs: Super["graphqlArgs"];
6
- readonly kind = "LazyObjectType";
6
+ readonly kind = "LazyObject";
7
7
  get conversionFunction(): Maybe<AbstractLazyObjectType.ConversionFunction>;
8
8
  protected get runtimeClass(): {
9
9
  name: Code;
@@ -10,17 +10,17 @@ import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
10
10
  import { code } from "./ts-poet-wrapper.js";
11
11
  export class LazyObjectType extends AbstractLazyObjectType {
12
12
  graphqlArgs = Maybe.empty();
13
- kind = "LazyObjectType";
13
+ kind = "LazyObject";
14
14
  get conversionFunction() {
15
15
  return Maybe.of({
16
- code: code `${this.reusables.snippets.convertToLazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.name}, ${this.resolveType.name}>(${this.resolveToPartialFunction({ partialType: this.partialType, resolveType: this.resolveType })})`,
16
+ code: code `${this.reusables.snippets.convertToLazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.expression}, ${this.resolveType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType, resolveType: this.resolveType })})`,
17
17
  sourceTypes: [
18
18
  {
19
- name: this.name,
19
+ expression: this.expression,
20
20
  typeof: "object",
21
21
  },
22
22
  {
23
- name: this.resolveType.name,
23
+ expression: this.resolveType.expression,
24
24
  typeof: "object",
25
25
  },
26
26
  ],
@@ -28,7 +28,7 @@ export class LazyObjectType extends AbstractLazyObjectType {
28
28
  }
29
29
  get runtimeClass() {
30
30
  return {
31
- name: code `${this.reusables.snippets.LazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.name}, ${this.resolveType.name}>`,
31
+ name: code `${this.reusables.snippets.LazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.expression}, ${this.resolveType.expression}>`,
32
32
  partialPropertyName: "partial",
33
33
  rawName: code `${this.reusables.snippets.LazyObject}`,
34
34
  };
@@ -1,6 +1,5 @@
1
1
  import type { NamedNode } from "@rdfjs/types";
2
2
  import { AbstractCollectionType } from "./AbstractCollectionType.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";
@@ -12,17 +11,17 @@ import type { IdentifierType } from "./IdentifierType.js";
12
11
  import type { IntType } from "./IntType.js";
13
12
  import type { IriType } from "./IriType.js";
14
13
  import type { LiteralType } from "./LiteralType.js";
15
- import type { NamedObjectType } from "./NamedObjectType.js";
16
- import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
17
- import type { NamedUnionType } from "./NamedUnionType.js";
14
+ import type { ObjectType } from "./ObjectType.js";
15
+ import type { ObjectUnionType } from "./ObjectUnionType.js";
18
16
  import type { StringType } from "./StringType.js";
19
17
  import type { TermType } from "./TermType.js";
20
18
  import type { Type } from "./Type.js";
21
19
  import { type Code } from "./ts-poet-wrapper.js";
20
+ import type { UnionType } from "./UnionType.js";
22
21
  export declare class ListType<ItemTypeT extends ListType.ItemType> extends AbstractCollectionType<ItemTypeT> {
23
22
  private readonly identifierNodeKind;
24
23
  private readonly toRdfTypes;
25
- readonly kind = "ListType";
24
+ readonly kind = "List";
26
25
  constructor({ identifierNodeKind, toRdfTypes, ...superParameters }: {
27
26
  identifierNodeKind: ListType<ItemTypeT>["identifierNodeKind"];
28
27
  toRdfTypes: readonly NamedNode[];
@@ -35,7 +34,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType> extends Abstr
35
34
  toStringExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["toStringExpression"]>[0]): Code;
36
35
  }
37
36
  export declare namespace ListType {
38
- type ItemType = AnonymousUnionType | BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | FloatType | IdentifierType | IntType | IriType | LiteralType | NamedObjectUnionType | NamedUnionType | NamedObjectType | StringType | TermType;
37
+ type ItemType = BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | FloatType | IdentifierType | IntType | IriType | LiteralType | ObjectUnionType | ObjectType | StringType | TermType | UnionType<Type>;
39
38
  function isItemType(type: Type): type is ItemType;
40
39
  }
41
40
  //# sourceMappingURL=ListType.d.ts.map
@@ -11,7 +11,7 @@ import { code, joinCode } from "./ts-poet-wrapper.js";
11
11
  export class ListType extends AbstractCollectionType {
12
12
  identifierNodeKind;
13
13
  toRdfTypes;
14
- kind = "ListType";
14
+ kind = "List";
15
15
  constructor({ identifierNodeKind, toRdfTypes, ...superParameters }) {
16
16
  super(superParameters);
17
17
  this.identifierNodeKind = identifierNodeKind;
@@ -102,31 +102,30 @@ __decorate([
102
102
  (function (ListType) {
103
103
  function isItemType(type) {
104
104
  switch (type.kind) {
105
- case "AnonymousUnionType":
106
- case "BigDecimalType":
107
- case "BigIntType":
108
- case "BlankNodeType":
109
- case "BooleanType":
110
- case "DateTimeType":
111
- case "DateType":
112
- case "FloatType":
113
- case "IdentifierType":
114
- case "IriType":
115
- case "IntType":
116
- case "LiteralType":
117
- case "NamedObjectUnionType":
118
- case "NamedUnionType":
119
- case "NamedObjectType":
120
- case "StringType":
121
- case "TermType":
105
+ case "BigDecimal":
106
+ case "BigInt":
107
+ case "BlankNode":
108
+ case "Boolean":
109
+ case "DateTime":
110
+ case "Date":
111
+ case "Float":
112
+ case "Identifier":
113
+ case "Iri":
114
+ case "Int":
115
+ case "Literal":
116
+ case "ObjectUnion":
117
+ case "Object":
118
+ case "String":
119
+ case "Term":
120
+ case "Union":
122
121
  return true;
123
- case "DefaultValueType":
124
- case "LazyObjectOptionType":
125
- case "LazyObjectSetType":
126
- case "LazyObjectType":
127
- case "ListType":
128
- case "OptionType":
129
- case "SetType":
122
+ case "DefaultValue":
123
+ case "LazyObjectOption":
124
+ case "LazyObjectSet":
125
+ case "LazyObject":
126
+ case "List":
127
+ case "Option":
128
+ case "Set":
130
129
  return false;
131
130
  }
132
131
  }
@@ -3,14 +3,15 @@ import { Maybe } from "purify-ts";
3
3
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
4
4
  import { type Code } from "./ts-poet-wrapper.js";
5
5
  export declare class LiteralType extends AbstractLiteralType {
6
- readonly name: Code;
6
+ readonly expression: Code;
7
7
  readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
8
8
  readonly filterFunction: Code;
9
9
  readonly filterType: Code;
10
- readonly kind = "LiteralType";
10
+ readonly kind = "Literal";
11
11
  readonly schemaType: Code;
12
12
  readonly valueSparqlWherePatternsFunction: Code;
13
13
  get graphqlType(): AbstractLiteralType.GraphqlType;
14
+ protected get schemaInitializers(): readonly Code[];
14
15
  fromJsonExpression({ variables, }: Parameters<AbstractLiteralType["fromJsonExpression"]>[0]): Code;
15
16
  graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
16
17
  jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractLiteralType["jsonSchema"]>[0]): Code;
@@ -1,36 +1,43 @@
1
1
  import { xsd } from "@tpluscode/rdf-ns-builders";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
4
- import { code } from "./ts-poet-wrapper.js";
4
+ import { arrayOf, code } from "./ts-poet-wrapper.js";
5
5
  export class LiteralType extends AbstractLiteralType {
6
- name = code `${this.reusables.imports.Literal}`;
6
+ expression = code `${this.reusables.imports.Literal}`;
7
7
  conversionFunction = Maybe.of({
8
8
  code: code `${this.reusables.snippets.convertToLiteral}`,
9
9
  sourceTypes: [
10
10
  ...["bigint", "boolean", "number", "string"].map((typeof_) => ({
11
- name: typeof_,
11
+ expression: code `${typeof_}`,
12
12
  typeof: typeof_,
13
13
  })),
14
14
  {
15
- name: "Date",
15
+ expression: code `Date`,
16
16
  typeof: "object",
17
17
  },
18
18
  {
19
- name: code `${this.reusables.imports.Literal}`,
19
+ expression: code `${this.reusables.imports.Literal}`,
20
20
  typeof: "object",
21
21
  },
22
22
  ],
23
23
  });
24
24
  filterFunction = code `${this.reusables.snippets.filterLiteral}`;
25
25
  filterType = code `${this.reusables.snippets.LiteralFilter}`;
26
- kind = "LiteralType";
26
+ kind = "Literal";
27
27
  schemaType = code `${this.reusables.snippets.LiteralSchema}`;
28
28
  valueSparqlWherePatternsFunction = code `${this.reusables.snippets.literalSparqlWherePatterns}`;
29
29
  get graphqlType() {
30
30
  throw new Error("not implemented");
31
31
  }
32
+ get schemaInitializers() {
33
+ let initializers = super.schemaInitializers;
34
+ if (this.in_.length > 0) {
35
+ initializers = initializers.concat(code `in: ${arrayOf(...this.in_.map((in_) => this.rdfjsTermExpression(in_)))}`);
36
+ }
37
+ return initializers;
38
+ }
32
39
  fromJsonExpression({ variables, }) {
33
- return code `${this.reusables.imports.Either}.of<Error, ${this.name}>(${this.reusables.imports.dataFactory}.literal(${variables.value}["@value"], ${variables.value}["@language"] !== undefined ? ${variables.value}["@language"] : (${variables.value}["@type"] !== undefined ? ${this.reusables.imports.dataFactory}.namedNode(${variables.value}["@type"]!) : undefined)))`;
40
+ return code `${this.reusables.imports.Either}.of<Error, ${this.expression}>(${this.reusables.imports.dataFactory}.literal(${variables.value}["@value"], ${variables.value}["@language"] !== undefined ? ${variables.value}["@language"] : (${variables.value}["@type"] !== undefined ? ${this.reusables.imports.dataFactory}.namedNode(${variables.value}["@type"]!) : undefined)))`;
34
41
  }
35
42
  graphqlResolveExpression(_parameters) {
36
43
  throw new Error("not implemented");
@@ -1,55 +1,55 @@
1
1
  import type { NamedNode } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
- import { DiscriminantProperty as _DiscriminantProperty } from "./_NamedObjectType/DiscriminantProperty.js";
4
- import { IdentifierProperty as _IdentifierProperty } from "./_NamedObjectType/IdentifierProperty.js";
5
- import type { Property as _Property } from "./_NamedObjectType/Property.js";
6
- import { ShaclProperty as _ShaclProperty } from "./_NamedObjectType/ShaclProperty.js";
3
+ import { DiscriminantProperty as _DiscriminantProperty } from "./_ObjectType/DiscriminantProperty.js";
4
+ import { IdentifierProperty as _IdentifierProperty } from "./_ObjectType/IdentifierProperty.js";
5
+ import type { Property as _Property } from "./_ObjectType/Property.js";
6
+ import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
7
7
  import { AbstractType } from "./AbstractType.js";
8
8
  import type { BlankNodeType } from "./BlankNodeType.js";
9
9
  import type { IdentifierType } from "./IdentifierType.js";
10
10
  import type { IriType } from "./IriType.js";
11
11
  import type { Type } from "./Type.js";
12
12
  import { type Code } from "./ts-poet-wrapper.js";
13
- export declare class NamedObjectType extends AbstractType {
13
+ export declare class ObjectType extends AbstractType {
14
14
  protected readonly toRdfTypes: readonly NamedNode[];
15
15
  readonly conversionFunction: Maybe<AbstractType.ConversionFunction>;
16
16
  readonly extern: boolean;
17
17
  readonly fromRdfType: Maybe<NamedNode>;
18
18
  readonly graphqlArgs: AbstractType["graphqlArgs"];
19
19
  readonly identifierType: BlankNodeType | IdentifierType | IriType;
20
- readonly kind = "NamedObjectType";
21
- readonly name: string;
20
+ readonly kind = "Object";
22
21
  readonly recursive: boolean;
22
+ readonly referencesObjectType = true;
23
23
  readonly synthetic: boolean;
24
24
  readonly typeofs: "object"[];
25
25
  readonly validationFunction: Maybe<Code>;
26
- constructor({ extern, fromRdfType, identifierType, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyDiscriminantProperty, lazyParentObjectTypes, lazyProperties, name, recursive, synthetic, toRdfTypes, ...superParameters }: {
26
+ constructor({ extern, fromRdfType, identifierType, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyDiscriminantProperty, lazyParentObjectTypes, lazyProperties, recursive, synthetic, toRdfTypes, ...superParameters }: {
27
27
  comment: Maybe<string>;
28
28
  extern: boolean;
29
29
  fromRdfType: Maybe<NamedNode>;
30
30
  identifierType: BlankNodeType | IdentifierType | IriType;
31
31
  label: Maybe<string>;
32
- lazyAncestorObjectTypes: () => readonly NamedObjectType[];
33
- lazyChildObjectTypes: () => readonly NamedObjectType[];
34
- lazyDiscriminantProperty: (namedObjectType: NamedObjectType) => NamedObjectType.DiscriminantProperty;
35
- lazyDescendantObjectTypes: () => readonly NamedObjectType[];
36
- lazyParentObjectTypes: () => readonly NamedObjectType[];
37
- lazyProperties: (namedObjectType: NamedObjectType) => readonly NamedObjectType.Property[];
38
- name: string;
32
+ lazyAncestorObjectTypes: () => readonly ObjectType[];
33
+ lazyChildObjectTypes: () => readonly ObjectType[];
34
+ lazyDiscriminantProperty: (namedObjectType: ObjectType) => ObjectType.DiscriminantProperty;
35
+ lazyDescendantObjectTypes: () => readonly ObjectType[];
36
+ lazyParentObjectTypes: () => readonly ObjectType[];
37
+ lazyProperties: (namedObjectType: ObjectType) => readonly ObjectType.Property[];
39
38
  recursive: boolean;
40
39
  synthetic: boolean;
41
40
  toRdfTypes: readonly NamedNode[];
42
41
  } & ConstructorParameters<typeof AbstractType>[0]);
43
- get _discriminantProperty(): NamedObjectType.DiscriminantProperty;
44
- get ancestorObjectTypes(): readonly NamedObjectType[];
45
- get childObjectTypes(): readonly NamedObjectType[];
42
+ get _discriminantProperty(): ObjectType.DiscriminantProperty;
43
+ get ancestorObjectTypes(): readonly ObjectType[];
44
+ get childObjectTypes(): readonly ObjectType[];
46
45
  get declaration(): Maybe<Code>;
47
46
  get descendantFromRdfTypeVariables(): readonly Code[];
48
47
  get descendantFromRdfTypes(): readonly NamedNode[];
49
- get descendantObjectTypes(): readonly NamedObjectType[];
48
+ get descendantObjectTypes(): readonly ObjectType[];
50
49
  get discriminantProperty(): Maybe<AbstractType.DiscriminantProperty>;
51
50
  get discriminantValue(): string;
52
51
  get equalsFunction(): Code;
52
+ get expression(): Code;
53
53
  get filterFunction(): Code;
54
54
  get filterType(): Code;
55
55
  get fromRdfTypeVariable(): Maybe<Code>;
@@ -57,9 +57,9 @@ export declare class NamedObjectType extends AbstractType {
57
57
  get hashFunction(): Code;
58
58
  get identifierTypeAlias(): Code;
59
59
  get mutable(): boolean;
60
- get objectSetMethodNames(): NamedObjectType.ObjectSetMethodNames;
61
- get parentObjectTypes(): readonly NamedObjectType[];
62
- get properties(): readonly NamedObjectType.Property[];
60
+ get objectSetMethodNames(): ObjectType.ObjectSetMethodNames;
61
+ get parentObjectTypes(): readonly ObjectType[];
62
+ get properties(): readonly ObjectType.Property[];
63
63
  get schema(): Code;
64
64
  get schemaType(): Code;
65
65
  get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
@@ -87,7 +87,7 @@ export declare class NamedObjectType extends AbstractType {
87
87
  private readonly lazyParentObjectTypes;
88
88
  private readonly lazyProperties;
89
89
  }
90
- export declare namespace NamedObjectType {
90
+ export declare namespace ObjectType {
91
91
  const IdentifierProperty: typeof _IdentifierProperty;
92
92
  type IdentifierProperty = _IdentifierProperty;
93
93
  type ObjectSetMethodNames = {
@@ -102,4 +102,4 @@ export declare namespace NamedObjectType {
102
102
  const DiscriminantProperty: typeof _DiscriminantProperty;
103
103
  type DiscriminantProperty = _DiscriminantProperty;
104
104
  }
105
- //# sourceMappingURL=NamedObjectType.d.ts.map
105
+ //# sourceMappingURL=ObjectType.d.ts.map