@shaclmate/compiler 4.0.7 → 4.0.9

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 (306) hide show
  1. package/dist/Compiler.d.ts +1 -4
  2. package/dist/Compiler.js +1 -5
  3. package/dist/ShapesGraphToAstTransformer.d.ts +2 -11
  4. package/dist/ShapesGraphToAstTransformer.js +25 -27
  5. package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.d.ts +3 -0
  6. package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.js +5 -0
  7. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +4 -0
  8. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +27 -0
  9. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +74 -19
  10. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
  11. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +45 -91
  12. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +11 -0
  13. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +146 -0
  14. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +7 -0
  15. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +182 -0
  16. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +9 -7
  17. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +3 -5
  18. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +33 -10
  19. package/dist/ast/AbstractCompoundType.d.ts +26 -8
  20. package/dist/ast/AbstractCompoundType.js +84 -16
  21. package/dist/ast/AbstractContainerType.d.ts +2 -4
  22. package/dist/ast/AbstractContainerType.js +3 -4
  23. package/dist/ast/AbstractLazyObjectType.d.ts +1 -0
  24. package/dist/ast/AbstractLazyObjectType.js +3 -0
  25. package/dist/ast/AbstractTermType.d.ts +1 -0
  26. package/dist/ast/AbstractTermType.js +1 -0
  27. package/dist/ast/AbstractType.d.ts +16 -1
  28. package/dist/ast/AbstractType.js +11 -1
  29. package/dist/ast/Ast.d.ts +4 -4
  30. package/dist/ast/BlankNodeType.d.ts +1 -1
  31. package/dist/ast/DefaultValueType.d.ts +1 -2
  32. package/dist/ast/DefaultValueType.js +2 -0
  33. package/dist/ast/IdentifierType.d.ts +1 -1
  34. package/dist/ast/IntersectionType.d.ts +7 -2
  35. package/dist/ast/IntersectionType.js +8 -0
  36. package/dist/ast/ListType.d.ts +2 -9
  37. package/dist/ast/ListType.js +1 -9
  38. package/dist/ast/LiteralType.d.ts +1 -0
  39. package/dist/ast/LiteralType.js +26 -0
  40. package/dist/ast/ObjectCompoundType.d.ts +12 -0
  41. package/dist/ast/ObjectCompoundType.js +88 -0
  42. package/dist/ast/ObjectIntersectionType.d.ts +3 -7
  43. package/dist/ast/ObjectIntersectionType.js +1 -7
  44. package/dist/ast/ObjectType.d.ts +14 -31
  45. package/dist/ast/ObjectType.js +41 -73
  46. package/dist/ast/ObjectUnionType.d.ts +3 -7
  47. package/dist/ast/ObjectUnionType.js +1 -7
  48. package/dist/ast/OptionType.d.ts +1 -2
  49. package/dist/ast/OptionType.js +2 -0
  50. package/dist/ast/SetType.d.ts +1 -2
  51. package/dist/ast/SetType.js +2 -0
  52. package/dist/ast/Type.d.ts +1 -4
  53. package/dist/ast/Type.js +0 -6
  54. package/dist/ast/UnionType.d.ts +11 -6
  55. package/dist/ast/UnionType.js +6 -4
  56. package/dist/ast/index.d.ts +1 -2
  57. package/dist/ast/index.js +1 -2
  58. package/dist/generators/json/AstJsonGenerator.js +16 -14
  59. package/dist/generators/ts/AbstractCollectionType.js +8 -10
  60. package/dist/generators/ts/AbstractContainerType.d.ts +8 -3
  61. package/dist/generators/ts/AbstractContainerType.js +9 -2
  62. package/dist/generators/ts/AbstractDateType.d.ts +2 -2
  63. package/dist/generators/ts/AbstractDateType.js +2 -2
  64. package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
  65. package/dist/generators/ts/AbstractIdentifierType.js +1 -1
  66. package/dist/generators/ts/AbstractLazyObjectType.d.ts +11 -8
  67. package/dist/generators/ts/AbstractLazyObjectType.js +19 -14
  68. package/dist/generators/ts/AbstractNamedUnionType.d.ts +33 -0
  69. package/dist/generators/ts/AbstractNamedUnionType.js +193 -0
  70. package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
  71. package/dist/generators/ts/AbstractNumericType.js +3 -3
  72. package/dist/generators/ts/AbstractTermType.d.ts +7 -4
  73. package/dist/generators/ts/AbstractTermType.js +7 -4
  74. package/dist/generators/ts/AbstractType.d.ts +29 -14
  75. package/dist/generators/ts/AbstractUnionType.d.ts +80 -0
  76. package/dist/generators/ts/AbstractUnionType.js +514 -0
  77. package/dist/generators/ts/AnonymousUnionType.d.ts +26 -0
  78. package/dist/generators/ts/AnonymousUnionType.js +56 -0
  79. package/dist/generators/ts/BigDecimalType.d.ts +3 -3
  80. package/dist/generators/ts/BigDecimalType.js +3 -3
  81. package/dist/generators/ts/BlankNodeType.d.ts +1 -1
  82. package/dist/generators/ts/BlankNodeType.js +1 -1
  83. package/dist/generators/ts/BooleanType.d.ts +2 -2
  84. package/dist/generators/ts/BooleanType.js +2 -2
  85. package/dist/generators/ts/DefaultValueType.d.ts +4 -4
  86. package/dist/generators/ts/DefaultValueType.js +14 -13
  87. package/dist/generators/ts/IdentifierType.d.ts +1 -1
  88. package/dist/generators/ts/IdentifierType.js +1 -1
  89. package/dist/generators/ts/IriType.d.ts +1 -1
  90. package/dist/generators/ts/IriType.js +1 -1
  91. package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
  92. package/dist/generators/ts/LazyObjectOptionType.js +9 -9
  93. package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
  94. package/dist/generators/ts/LazyObjectSetType.js +7 -7
  95. package/dist/generators/ts/LazyObjectType.d.ts +1 -1
  96. package/dist/generators/ts/LazyObjectType.js +7 -8
  97. package/dist/generators/ts/ListType.d.ts +8 -7
  98. package/dist/generators/ts/ListType.js +14 -13
  99. package/dist/generators/ts/LiteralType.d.ts +1 -1
  100. package/dist/generators/ts/LiteralType.js +2 -2
  101. package/dist/generators/ts/NamedObjectUnionType.d.ts +35 -0
  102. package/dist/generators/ts/NamedObjectUnionType.js +221 -0
  103. package/dist/generators/ts/NamedUnionType.d.ts +11 -0
  104. package/dist/generators/ts/NamedUnionType.js +13 -0
  105. package/dist/generators/ts/ObjectType.d.ts +34 -25
  106. package/dist/generators/ts/ObjectType.js +62 -52
  107. package/dist/generators/ts/OptionType.d.ts +4 -4
  108. package/dist/generators/ts/OptionType.js +10 -10
  109. package/dist/generators/ts/SetType.d.ts +4 -4
  110. package/dist/generators/ts/SetType.js +13 -11
  111. package/dist/generators/ts/StringType.d.ts +2 -2
  112. package/dist/generators/ts/StringType.js +2 -2
  113. package/dist/generators/ts/TermType.d.ts +1 -1
  114. package/dist/generators/ts/TermType.js +2 -2
  115. package/dist/generators/ts/TsGenerator.js +23 -15
  116. package/dist/generators/ts/Type.d.ts +4 -3
  117. package/dist/generators/ts/TypeFactory.d.ts +7 -5
  118. package/dist/generators/ts/TypeFactory.js +117 -90
  119. package/dist/generators/ts/ZodGenerator.js +6 -6
  120. package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +3 -3
  121. package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.d.ts → DiscriminantProperty.d.ts} +14 -14
  122. package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.js → DiscriminantProperty.js} +10 -10
  123. package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.d.ts +2 -2
  124. package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.js +2 -2
  125. package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +2 -2
  126. package/dist/generators/ts/_ObjectType/IdentifierProperty.js +7 -4
  127. package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.js +8 -8
  128. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  129. package/dist/generators/ts/_ObjectType/{ObjectType_sparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +6 -5
  130. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  131. package/dist/generators/ts/_ObjectType/{ObjectType_sparqlWherePatternsFunctionDeclarations.js → ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -5
  132. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  133. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +20 -0
  134. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  135. package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionDeclaration.js} +6 -7
  136. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  137. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +20 -0
  138. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +2 -2
  139. package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.d.ts +5 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.js +19 -0
  141. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
  142. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js +38 -0
  143. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
  144. package/dist/generators/ts/_ObjectType/{ObjectType_propertiesFromRdfFunctionDeclaration.js → ObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +16 -15
  145. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +1 -2
  146. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +2 -2
  147. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
  148. package/dist/generators/ts/_ObjectType/{ObjectType_toRdfFunctionOrMethodDeclaration.js → ObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +10 -8
  149. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  150. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +13 -0
  151. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  152. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +15 -0
  153. package/dist/generators/ts/_ObjectType/Property.d.ts +2 -2
  154. package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +2 -2
  155. package/dist/generators/ts/_ObjectType/ShaclProperty.js +6 -6
  156. package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.d.ts +2 -0
  157. package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.js +12 -0
  158. package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.d.ts +2 -0
  159. package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.js +14 -0
  160. package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.d.ts +2 -0
  161. package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.js +15 -0
  162. package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.d.ts +2 -0
  163. package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +17 -0
  164. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.d.ts +2 -0
  165. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.js +15 -0
  166. package/dist/generators/ts/_snippets/snippets_PropertyPath.d.ts +5 -0
  167. package/dist/generators/ts/_snippets/snippets_PropertyPath.js +35 -0
  168. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +2 -2
  169. package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.d.ts +2 -0
  170. package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +7 -0
  171. package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.d.ts +2 -0
  172. package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +16 -0
  173. package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.d.ts +2 -0
  174. package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.js +13 -0
  175. package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.d.ts +2 -0
  176. package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.js +16 -0
  177. package/dist/generators/ts/_snippets/snippets_bigDecimalSparqlWherePatterns.js +2 -2
  178. package/dist/generators/ts/_snippets/snippets_blankNodeSparqlWherePatterns.js +2 -2
  179. package/dist/generators/ts/_snippets/snippets_booleanEquals.js +1 -1
  180. package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +2 -2
  181. package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +2 -2
  182. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +2 -2
  183. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +1 -1
  184. package/dist/generators/ts/_snippets/snippets_identifierSparqlWherePatterns.js +2 -2
  185. package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +2 -2
  186. package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
  187. package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
  188. package/dist/generators/ts/_snippets/snippets_literalSparqlWherePatterns.js +2 -2
  189. package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +2 -2
  190. package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +2 -2
  191. package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +2 -3
  192. package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +2 -2
  193. package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +2 -2
  194. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +4 -3
  195. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +4 -3
  196. package/dist/generators/ts/_snippets/snippets_sparqlPropertyPath.js +3 -2
  197. package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +2 -2
  198. package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
  199. package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +2 -2
  200. package/dist/generators/ts/graphqlSchemaVariableStatement.js +4 -4
  201. package/dist/generators/ts/imports.d.ts +1 -1
  202. package/dist/generators/ts/imports.js +1 -1
  203. package/dist/generators/ts/objectSetDeclarations.d.ts +3 -3
  204. package/dist/generators/ts/objectSetDeclarations.js +15 -15
  205. package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +3 -3
  206. package/dist/generators/ts/objectSetInterfaceDeclaration.js +2 -2
  207. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +3 -3
  208. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +16 -17
  209. package/dist/generators/ts/snippets.d.ts +10 -6
  210. package/dist/generators/ts/snippets.js +20 -12
  211. package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +3 -3
  212. package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +7 -8
  213. package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -2
  214. package/dist/generators/ts/synthesizeUberObjectUnionType.js +9 -4
  215. package/dist/input/NodeShape.d.ts +5 -6
  216. package/dist/input/NodeShape.js +19 -22
  217. package/dist/input/Ontology.d.ts +4 -4
  218. package/dist/input/Ontology.js +10 -10
  219. package/dist/input/PropertyShape.d.ts +4 -4
  220. package/dist/input/PropertyShape.js +10 -10
  221. package/dist/input/ShapesGraph.d.ts +3 -2
  222. package/dist/input/ShapesGraph.js +13 -8
  223. package/dist/input/generated.d.ts +2551 -2040
  224. package/dist/input/generated.js +2806 -2346
  225. package/package.json +3 -5
  226. package/dist/_ShapesGraphToAstTransformer/CurieFactory.d.ts +0 -16
  227. package/dist/_ShapesGraphToAstTransformer/CurieFactory.js +0 -45
  228. package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.d.ts +0 -3
  229. package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.js +0 -2
  230. package/dist/_ShapesGraphToAstTransformer/index.d.ts +0 -6
  231. package/dist/_ShapesGraphToAstTransformer/index.js +0 -6
  232. package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.d.ts +0 -5
  233. package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.js +0 -9
  234. package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.d.ts +0 -11
  235. package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.js +0 -338
  236. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.d.ts +0 -12
  237. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.js +0 -31
  238. package/dist/ast/AbstractObjectCompoundType.d.ts +0 -45
  239. package/dist/ast/AbstractObjectCompoundType.js +0 -180
  240. package/dist/ast/Curie.d.ts +0 -21
  241. package/dist/ast/Curie.js +0 -29
  242. package/dist/ast/PlaceholderType.d.ts +0 -15
  243. package/dist/ast/PlaceholderType.js +0 -19
  244. package/dist/generators/codeName.d.ts +0 -6
  245. package/dist/generators/codeName.js +0 -66
  246. package/dist/generators/ts/AbstractDeclaredType.d.ts +0 -23
  247. package/dist/generators/ts/AbstractDeclaredType.js +0 -17
  248. package/dist/generators/ts/ObjectUnionType.d.ts +0 -65
  249. package/dist/generators/ts/ObjectUnionType.js +0 -257
  250. package/dist/generators/ts/UnionType.d.ts +0 -40
  251. package/dist/generators/ts/UnionType.js +0 -527
  252. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.d.ts +0 -4
  253. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.js +0 -66
  254. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfFunctionDeclaration.d.ts +0 -5
  255. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.d.ts +0 -5
  256. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  257. package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts +0 -5
  258. package/dist/generators/ts/_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.d.ts +0 -5
  259. package/dist/generators/ts/_ObjectUnionType/MemberType.d.ts +0 -34
  260. package/dist/generators/ts/_ObjectUnionType/MemberType.js +0 -105
  261. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.d.ts +0 -5
  262. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.js +0 -29
  263. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.d.ts +0 -4
  264. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.js +0 -19
  265. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.d.ts +0 -4
  266. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.js +0 -10
  267. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.d.ts +0 -5
  268. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.js +0 -19
  269. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.d.ts +0 -5
  270. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.js +0 -20
  271. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.d.ts +0 -5
  272. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.js +0 -18
  273. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.d.ts +0 -5
  274. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.js +0 -28
  275. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.d.ts +0 -4
  276. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.js +0 -9
  277. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.d.ts +0 -5
  278. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.js +0 -13
  279. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.d.ts +0 -5
  280. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.js +0 -10
  281. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
  282. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js +0 -14
  283. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.d.ts +0 -4
  284. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.js +0 -37
  285. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  286. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js +0 -15
  287. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  288. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.js +0 -35
  289. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.d.ts +0 -5
  290. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.js +0 -26
  291. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.d.ts +0 -5
  292. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.js +0 -43
  293. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.d.ts +0 -4
  294. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.js +0 -10
  295. package/dist/generators/ts/_snippets/snippets_FromRdfOptions.d.ts +0 -2
  296. package/dist/generators/ts/_snippets/snippets_FromRdfOptions.js +0 -5
  297. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.d.ts +0 -2
  298. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.js +0 -5
  299. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.d.ts +0 -2
  300. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.js +0 -6
  301. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.d.ts +0 -2
  302. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.js +0 -12
  303. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.d.ts +0 -2
  304. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.js +0 -6
  305. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.d.ts +0 -2
  306. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.js +0 -15
@@ -6,8 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { camelCase } from "change-case";
8
8
  import { Maybe, NonEmptyList } from "purify-ts";
9
- import { invariant } from "ts-invariant";
10
9
  import { Memoize } from "typescript-memoize";
10
+ import { DiscriminantProperty as _DiscriminantProperty } from "./_ObjectType/DiscriminantProperty.js";
11
11
  import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_ObjectType/IdentifierPrefixProperty.js";
12
12
  import { IdentifierProperty as _IdentifierProperty } from "./_ObjectType/IdentifierProperty.js";
13
13
  import { identifierTypeDeclarations } from "./_ObjectType/identifierTypeDeclarations.js";
@@ -16,8 +16,11 @@ import { ObjectType_createFunctionDeclaration } from "./_ObjectType/ObjectType_c
16
16
  import { ObjectType_equalsFunctionOrMethodDeclaration } from "./_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.js";
17
17
  import { ObjectType_filterFunctionDeclaration } from "./_ObjectType/ObjectType_filterFunctionDeclaration.js";
18
18
  import { ObjectType_filterTypeDeclaration } from "./_ObjectType/ObjectType_filterTypeDeclaration.js";
19
- import { ObjectType_fromJsonFunctionDeclarations } from "./_ObjectType/ObjectType_fromJsonFunctionDeclarations.js";
20
- import { ObjectType_fromRdfFunctionDeclaration } from "./_ObjectType/ObjectType_fromRdfFunctionDeclaration.js";
19
+ import { ObjectType_focusSparqlConstructTriplesFunctionDeclaration } from "./_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js";
20
+ import { ObjectType_focusSparqlWherePatternsFunctionDeclaration } from "./_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js";
21
+ import { ObjectType_fromJsonFunctionDeclaration } from "./_ObjectType/ObjectType_fromJsonFunctionDeclaration.js";
22
+ import { ObjectType_fromRdfResourceFunctionDeclaration } from "./_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js";
23
+ import { ObjectType_fromRdfResourceValuesFunctionDeclaration } from "./_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js";
21
24
  import { ObjectType_fromRdfTypeVariableStatement } from "./_ObjectType/ObjectType_fromRdfTypeVariableStatement.js";
22
25
  import { ObjectType_graphqlTypeVariableStatement } from "./_ObjectType/ObjectType_graphqlTypeVariableStatement.js";
23
26
  import { ObjectType_hashFunctionOrMethodDeclarations } from "./_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.js";
@@ -28,39 +31,43 @@ import { ObjectType_jsonTypeAliasDeclaration } from "./_ObjectType/ObjectType_js
28
31
  import { ObjectType_jsonUiSchemaFunctionDeclaration } from "./_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js";
29
32
  import { ObjectType_jsonZodSchemaFunctionDeclaration } from "./_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js";
30
33
  import { ObjectType_objectSetMethodNames } from "./_ObjectType/ObjectType_objectSetMethodNames.js";
31
- import { ObjectType_propertiesFromRdfFunctionDeclaration } from "./_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.js";
34
+ import { ObjectType_parseJsonFunctionDeclaration } from "./_ObjectType/ObjectType_parseJsonFunctionDeclaration.js";
35
+ import { ObjectType_propertiesFromJsonFunctionDeclaration } from "./_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js";
36
+ import { ObjectType_propertiesFromRdfResourceFunctionDeclaration } from "./_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.js";
32
37
  import { ObjectType_schemaVariableStatement } from "./_ObjectType/ObjectType_schemaVariableStatement.js";
33
38
  import { ObjectType_sparqlConstructQueryFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js";
34
39
  import { ObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
35
- import { ObjectType_sparqlConstructTriplesFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.js";
36
- import { ObjectType_sparqlWherePatternsFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.js";
37
40
  import { ObjectType_toJsonFunctionOrMethodDeclaration } from "./_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.js";
38
- import { ObjectType_toRdfFunctionOrMethodDeclaration } from "./_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.js";
41
+ import { ObjectType_toRdfResourceFunctionOrMethodDeclaration } from "./_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.js";
42
+ import { ObjectType_valueSparqlConstructTriplesFunctionDeclaration } from "./_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js";
43
+ import { ObjectType_valueSparqlWherePatternsFunctionDeclaration } from "./_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js";
39
44
  import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
40
- import { TypeDiscriminantProperty as _TypeDiscriminantProperty } from "./_ObjectType/TypeDiscriminantProperty.js";
41
- import { AbstractDeclaredType } from "./AbstractDeclaredType.js";
45
+ import { AbstractType } from "./AbstractType.js";
42
46
  import { imports } from "./imports.js";
43
- import { snippets } from "./snippets.js";
44
47
  import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
45
48
  import { code, def, joinCode } from "./ts-poet-wrapper.js";
46
- export class ObjectType extends AbstractDeclaredType {
49
+ export class ObjectType extends AbstractType {
47
50
  imports;
48
51
  toRdfTypes;
49
52
  abstract;
50
53
  declarationType;
51
54
  extern;
55
+ features;
52
56
  fromRdfType;
53
57
  graphqlArgs = Maybe.empty();
54
58
  identifierType;
55
59
  kind = "ObjectType";
60
+ name;
61
+ recursive;
56
62
  staticModuleName;
57
63
  synthetic;
58
64
  typeofs = NonEmptyList(["object"]);
59
- constructor({ abstract, declarationType, extern, fromRdfType, identifierType, imports, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyParentObjectTypes, lazyProperties, staticModuleName, synthetic, toRdfTypes, ...superParameters }) {
65
+ constructor({ abstract, declarationType, extern, features, fromRdfType, identifierType, imports, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyDiscriminantProperty, lazyIdentifierProperty, lazyParentObjectTypes, lazyProperties, name, recursive, staticModuleName, synthetic, toRdfTypes, ...superParameters }) {
60
66
  super(superParameters);
61
67
  this.abstract = abstract;
62
68
  this.declarationType = declarationType;
63
69
  this.extern = extern;
70
+ this.features = features;
64
71
  this.fromRdfType = fromRdfType;
65
72
  this.identifierType = identifierType;
66
73
  this.imports = imports;
@@ -68,21 +75,16 @@ export class ObjectType extends AbstractDeclaredType {
68
75
  this.lazyAncestorObjectTypes = lazyAncestorObjectTypes;
69
76
  this.lazyChildObjectTypes = lazyChildObjectTypes;
70
77
  this.lazyDescendantObjectTypes = lazyDescendantObjectTypes;
78
+ this.lazyDiscriminantProperty = lazyDiscriminantProperty;
79
+ this.lazyIdentifierProperty = lazyIdentifierProperty;
71
80
  this.lazyParentObjectTypes = lazyParentObjectTypes;
72
81
  this.lazyProperties = lazyProperties;
82
+ this.name = name;
83
+ this.recursive = recursive;
73
84
  this.staticModuleName = staticModuleName;
74
85
  this.synthetic = synthetic;
75
86
  this.toRdfTypes = toRdfTypes;
76
87
  }
77
- get _discriminantProperty() {
78
- const discriminantProperty = this.properties.find((property) => property instanceof ObjectType.TypeDiscriminantProperty);
79
- invariant(discriminantProperty);
80
- return {
81
- name: discriminantProperty.name,
82
- ownValues: discriminantProperty.type.ownValues,
83
- descendantValues: discriminantProperty.type.descendantValues,
84
- };
85
- }
86
88
  get ancestorObjectTypes() {
87
89
  return this.lazyAncestorObjectTypes();
88
90
  }
@@ -108,20 +110,20 @@ export class ObjectType extends AbstractDeclaredType {
108
110
  const staticModuleDeclarations = [];
109
111
  switch (this.declarationType) {
110
112
  case "class": {
111
- declarations.push(ObjectType_classDeclaration.bind(this)());
113
+ declarations.push(ObjectType_classDeclaration.call(this));
112
114
  break;
113
115
  }
114
116
  case "interface": {
115
- declarations.push(ObjectType_interfaceDeclaration.bind(this)());
116
- staticModuleDeclarations.push(...ObjectType_createFunctionDeclaration.bind(this)().toList(), ...ObjectType_equalsFunctionOrMethodDeclaration.bind(this)().toList(), ...ObjectType_hashFunctionOrMethodDeclarations.bind(this)());
117
+ declarations.push(ObjectType_interfaceDeclaration.call(this));
118
+ staticModuleDeclarations.push(...ObjectType_createFunctionDeclaration.call(this).toList(), ...ObjectType_equalsFunctionOrMethodDeclaration.bind(this)().toList(), ...ObjectType_hashFunctionOrMethodDeclarations.call(this));
117
119
  break;
118
120
  }
119
121
  }
120
- staticModuleDeclarations.push(...ObjectType_graphqlTypeVariableStatement.bind(this)().toList(), ...identifierTypeDeclarations.bind(this)(), ...ObjectType_jsonTypeAliasDeclaration.bind(this)().toList(), ObjectType_filterFunctionDeclaration.bind(this)(), ObjectType_filterTypeDeclaration.bind(this)(), ...ObjectType_fromJsonFunctionDeclarations.bind(this)(), ...ObjectType_fromRdfFunctionDeclaration.bind(this)().toList(), ...ObjectType_fromRdfTypeVariableStatement.bind(this)().toList(), ObjectType_isTypeFunctionDeclaration.bind(this)(), ...ObjectType_jsonSchemaFunctionDeclaration.bind(this)().toList(), ...ObjectType_jsonUiSchemaFunctionDeclaration.bind(this)().toList(), ...ObjectType_jsonZodSchemaFunctionDeclaration.bind(this)().toList(), ...ObjectType_propertiesFromRdfFunctionDeclaration.bind(this)().toList(), ObjectType_schemaVariableStatement.bind(this)(), ...ObjectType_sparqlConstructQueryFunctionDeclaration.bind(this)().toList(), ...ObjectType_sparqlConstructQueryStringFunctionDeclaration.bind(this)().toList(), ...ObjectType_sparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...ObjectType_sparqlWherePatternsFunctionDeclaration.bind(this)().toList(), ...(this.declarationType === "interface"
121
- ? ObjectType_toJsonFunctionOrMethodDeclaration.bind(this)().toList()
122
+ staticModuleDeclarations.push(...ObjectType_graphqlTypeVariableStatement.call(this).toList(), ...identifierTypeDeclarations.call(this), ...ObjectType_jsonTypeAliasDeclaration.call(this).toList(), ObjectType_filterFunctionDeclaration.call(this), ObjectType_filterTypeDeclaration.call(this), ...ObjectType_focusSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...ObjectType_focusSparqlWherePatternsFunctionDeclaration.bind(this)().toList(), ...ObjectType_fromJsonFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfResourceFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfResourceValuesFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfTypeVariableStatement.call(this).toList(), ObjectType_isTypeFunctionDeclaration.call(this), ...ObjectType_jsonSchemaFunctionDeclaration.call(this).toList(), ...ObjectType_jsonUiSchemaFunctionDeclaration.call(this).toList(), ...ObjectType_jsonZodSchemaFunctionDeclaration.call(this).toList(), ...ObjectType_parseJsonFunctionDeclaration.call(this).toList(), ...ObjectType_propertiesFromJsonFunctionDeclaration.bind(this)().toList(), ...ObjectType_propertiesFromRdfResourceFunctionDeclaration.bind(this)().toList(), ObjectType_schemaVariableStatement.call(this), ...ObjectType_sparqlConstructQueryFunctionDeclaration.bind(this)().toList(), ...ObjectType_sparqlConstructQueryStringFunctionDeclaration.bind(this)().toList(), ...(this.declarationType === "interface"
123
+ ? ObjectType_toJsonFunctionOrMethodDeclaration.call(this).toList()
122
124
  : []), ...(this.declarationType === "interface"
123
- ? ObjectType_toRdfFunctionOrMethodDeclaration.bind(this)().toList()
124
- : []));
125
+ ? ObjectType_toRdfResourceFunctionOrMethodDeclaration.call(this).toList()
126
+ : []), ...ObjectType_valueSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...ObjectType_valueSparqlWherePatternsFunctionDeclaration.bind(this)().toList());
125
127
  if (staticModuleDeclarations.length > 0) {
126
128
  declarations.push(code `\
127
129
  export namespace ${def(this.staticModuleName)} {
@@ -129,7 +131,7 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
129
131
  }`);
130
132
  }
131
133
  }
132
- return joinCode(declarations, { on: "\n\n" });
134
+ return Maybe.of(joinCode(declarations, { on: "\n\n" }));
133
135
  }
134
136
  get descendantFromRdfTypeVariables() {
135
137
  return this.descendantObjectTypes.flatMap((descendantObjectType) => descendantObjectType.fromRdfTypeVariable.toList());
@@ -141,7 +143,11 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
141
143
  return this.lazyDescendantObjectTypes();
142
144
  }
143
145
  get discriminantProperty() {
144
- return Maybe.of(this._discriminantProperty);
146
+ return Maybe.of({
147
+ name: this._discriminantProperty.name,
148
+ ownValues: this._discriminantProperty.type.ownValues,
149
+ descendantValues: this._discriminantProperty.type.descendantValues,
150
+ });
145
151
  }
146
152
  get discriminantValue() {
147
153
  return this.name;
@@ -166,12 +172,10 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
166
172
  return this.fromRdfType.map(() => code `${this.staticModuleName}.${syntheticNamePrefix}fromRdfType`);
167
173
  }
168
174
  get graphqlType() {
169
- return new AbstractDeclaredType.GraphqlType(code `${this.staticModuleName}.${syntheticNamePrefix}GraphQL`);
175
+ return new AbstractType.GraphqlType(code `${this.staticModuleName}.${syntheticNamePrefix}GraphQL`);
170
176
  }
171
177
  get identifierProperty() {
172
- const identifierProperty = this.properties.find((property) => property.kind === "IdentifierProperty");
173
- invariant(identifierProperty);
174
- return identifierProperty;
178
+ return this.lazyIdentifierProperty(this);
175
179
  }
176
180
  get identifierTypeAlias() {
177
181
  return code `${this.staticModuleName}.${syntheticNamePrefix}Identifier`;
@@ -180,7 +184,7 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
180
184
  return this.properties.some((property) => property.mutable);
181
185
  }
182
186
  get objectSetMethodNames() {
183
- return ObjectType_objectSetMethodNames.bind(this)();
187
+ return ObjectType_objectSetMethodNames.call(this);
184
188
  }
185
189
  get ownProperties() {
186
190
  if (this.parentObjectTypes.length === 0) {
@@ -213,11 +217,11 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
213
217
  get schemaType() {
214
218
  return code `typeof ${this.schema}`;
215
219
  }
216
- get sparqlConstructTriplesFunction() {
217
- return code `(({ filter, ignoreRdfType, valueVariable, variablePrefix }: ${snippets.SparqlConstructTriplesFunctionParameters}<${this.filterType}, ${this.schemaType}>) => ${this.staticModuleName}.${syntheticNamePrefix}sparqlConstructTriples({ filter, focusIdentifier: valueVariable, ignoreRdfType, variablePrefix }))`;
220
+ get valueSparqlConstructTriplesFunction() {
221
+ return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlConstructTriples`;
218
222
  }
219
- get sparqlWherePatternsFunction() {
220
- return code `(({ filter, ignoreRdfType, preferredLanguages, propertyPatterns, valueVariable, variablePrefix }: ${snippets.SparqlWherePatternsFunctionParameters}<${this.filterType}, ${this.schemaType}>) => (propertyPatterns as readonly ${snippets.SparqlPattern}[]).concat(${this.staticModuleName}.${syntheticNamePrefix}sparqlWherePatterns({ filter, focusIdentifier: valueVariable, ignoreRdfType, preferredLanguages, variablePrefix })))`;
223
+ get valueSparqlWherePatternsFunction() {
224
+ return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlWherePatterns`;
221
225
  }
222
226
  get toRdfjsResourceType() {
223
227
  if (this.parentObjectTypes.length > 0) {
@@ -225,6 +229,9 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
225
229
  }
226
230
  return code `${imports.Resource}${this.identifierType.kind === "IriType" ? code `<${imports.NamedNode}>` : ""}`;
227
231
  }
232
+ get _discriminantProperty() {
233
+ return this.lazyDiscriminantProperty(this);
234
+ }
228
235
  get thisVariable() {
229
236
  switch (this.declarationType) {
230
237
  case "class":
@@ -237,10 +244,11 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
237
244
  }
238
245
  fromJsonExpression({ variables, }) {
239
246
  // Assumes the JSON object has been recursively validated already.
240
- return code `${this.staticModuleName}.${syntheticNamePrefix}fromJson(${variables.value}).unsafeCoerce()`;
247
+ return code `${this.staticModuleName}.${syntheticNamePrefix}fromJson(${variables.value})`;
241
248
  }
242
- fromRdfExpression({ variables, }) {
243
- return code `${variables.resourceValues}.chain(values => values.chainMap(value => value.toResource().chain(resource => ${this.staticModuleName}.${syntheticNamePrefix}fromRdf(resource, { context: ${variables.context}, ${variables.ignoreRdfType ? "ignoreRdfType: true, " : ""}objectSet: ${variables.objectSet}, preferredLanguages: ${variables.preferredLanguages} }))))`;
249
+ fromRdfResourceValuesExpression({ variables, }) {
250
+ const { resourceValues, ...options } = variables;
251
+ return code `${this.staticModuleName}.${syntheticNamePrefix}fromRdfResourceValues(${resourceValues}, ${options})`;
244
252
  }
245
253
  graphqlResolveExpression({ variables, }) {
246
254
  return variables.value;
@@ -258,7 +266,7 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
258
266
  }
259
267
  }
260
268
  jsonType() {
261
- return new AbstractDeclaredType.JsonType(code `${this.staticModuleName}.${syntheticNamePrefix}Json`);
269
+ return new AbstractType.JsonType(code `${this.staticModuleName}.${syntheticNamePrefix}Json`);
262
270
  }
263
271
  jsonUiSchemaElement({ variables, }) {
264
272
  return Maybe.of(code `${this.staticModuleName}.${syntheticNamePrefix}jsonUiSchema({ scopePrefix: ${variables.scopePrefix} })`);
@@ -287,12 +295,12 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
287
295
  return code `${this.staticModuleName}.${syntheticNamePrefix}toJson(${variables.value})`;
288
296
  }
289
297
  }
290
- toRdfExpression({ variables, }) {
298
+ toRdfResourceValuesExpression({ variables, }) {
291
299
  switch (this.declarationType) {
292
300
  case "class":
293
- return code `[${variables.value}.${syntheticNamePrefix}toRdf({ graph: ${variables.graph}, resourceSet: ${variables.resourceSet} }).identifier]`;
301
+ return code `[${variables.value}.${syntheticNamePrefix}toRdfResource({ graph: ${variables.graph}, resourceSet: ${variables.resourceSet} }).identifier]`;
294
302
  case "interface":
295
- return code `[${this.staticModuleName}.${syntheticNamePrefix}toRdf(${variables.value}, { graph: ${variables.graph}, resourceSet: ${variables.resourceSet} }).identifier]`;
303
+ return code `[${this.staticModuleName}.${syntheticNamePrefix}toRdfResource(${variables.value}, { graph: ${variables.graph}, resourceSet: ${variables.resourceSet} }).identifier]`;
296
304
  }
297
305
  }
298
306
  ensureAtMostOneSuperObjectType() {
@@ -303,12 +311,11 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
303
311
  lazyAncestorObjectTypes;
304
312
  lazyChildObjectTypes;
305
313
  lazyDescendantObjectTypes;
314
+ lazyDiscriminantProperty;
315
+ lazyIdentifierProperty;
306
316
  lazyParentObjectTypes;
307
317
  lazyProperties;
308
318
  }
309
- __decorate([
310
- Memoize()
311
- ], ObjectType.prototype, "_discriminantProperty", null);
312
319
  __decorate([
313
320
  Memoize()
314
321
  ], ObjectType.prototype, "ancestorObjectTypes", null);
@@ -380,13 +387,16 @@ __decorate([
380
387
  ], ObjectType.prototype, "schemaType", null);
381
388
  __decorate([
382
389
  Memoize()
383
- ], ObjectType.prototype, "sparqlConstructTriplesFunction", null);
390
+ ], ObjectType.prototype, "valueSparqlConstructTriplesFunction", null);
384
391
  __decorate([
385
392
  Memoize()
386
- ], ObjectType.prototype, "sparqlWherePatternsFunction", null);
393
+ ], ObjectType.prototype, "valueSparqlWherePatternsFunction", null);
387
394
  __decorate([
388
395
  Memoize()
389
396
  ], ObjectType.prototype, "toRdfjsResourceType", null);
397
+ __decorate([
398
+ Memoize()
399
+ ], ObjectType.prototype, "_discriminantProperty", null);
390
400
  __decorate([
391
401
  Memoize()
392
402
  ], ObjectType.prototype, "thisVariable", null);
@@ -397,6 +407,6 @@ __decorate([
397
407
  ObjectType.IdentifierPrefixProperty = _IdentifierPrefixProperty;
398
408
  ObjectType.IdentifierProperty = _IdentifierProperty;
399
409
  ObjectType.ShaclProperty = _ShaclProperty;
400
- ObjectType.TypeDiscriminantProperty = _TypeDiscriminantProperty;
410
+ ObjectType.DiscriminantProperty = _DiscriminantProperty;
401
411
  })(ObjectType || (ObjectType = {}));
402
412
  //# sourceMappingURL=ObjectType.js.map
@@ -14,21 +14,21 @@ export declare class OptionType<ItemTypeT extends OptionType.ItemType> extends A
14
14
  get mutable(): boolean;
15
15
  get name(): Code;
16
16
  get schemaType(): Code;
17
- get sparqlConstructTriplesFunction(): Code;
18
- get sparqlWherePatternsFunction(): Code;
17
+ get valueSparqlConstructTriplesFunction(): Code;
18
+ get valueSparqlWherePatternsFunction(): Code;
19
19
  protected get schemaObject(): {
20
20
  kind: Code;
21
21
  item: Code;
22
22
  };
23
23
  fromJsonExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["fromJsonExpression"]>[0]): Code;
24
- fromRdfExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["fromRdfExpression"]>[0]): Code;
24
+ fromRdfResourceValuesExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["fromRdfResourceValuesExpression"]>[0]): Code;
25
25
  graphqlResolveExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
26
26
  hashStatements({ depth, variables, }: Parameters<AbstractContainerType<ItemTypeT>["hashStatements"]>[0]): readonly Code[];
27
27
  jsonType(parameters?: Parameters<AbstractContainerType<ItemTypeT>["jsonType"]>[0]): AbstractContainerType.JsonType;
28
28
  jsonUiSchemaElement(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonUiSchemaElement"]>[0]): Maybe<Code>;
29
29
  jsonZodSchema(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonZodSchema"]>[0]): Code;
30
30
  toJsonExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toJsonExpression"]>[0]): Code;
31
- toRdfExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toRdfExpression"]>[0]): Code;
31
+ toRdfResourceValuesExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toRdfResourceValuesExpression"]>[0]): Code;
32
32
  }
33
33
  export declare namespace OptionType {
34
34
  type ItemType = AbstractContainerType.ItemType;
@@ -70,11 +70,11 @@ export class OptionType extends AbstractContainerType {
70
70
  get schemaType() {
71
71
  return code `${snippets.MaybeSchema}<${this.itemType.schemaType}>`;
72
72
  }
73
- get sparqlConstructTriplesFunction() {
74
- return code `${snippets.maybeSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.sparqlConstructTriplesFunction})`;
73
+ get valueSparqlConstructTriplesFunction() {
74
+ return code `${snippets.maybeSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlConstructTriplesFunction})`;
75
75
  }
76
- get sparqlWherePatternsFunction() {
77
- return code `${snippets.maybeSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.sparqlWherePatternsFunction})`;
76
+ get valueSparqlWherePatternsFunction() {
77
+ return code `${snippets.maybeSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlWherePatternsFunction})`;
78
78
  }
79
79
  get schemaObject() {
80
80
  return {
@@ -92,9 +92,9 @@ export class OptionType extends AbstractContainerType {
92
92
  ? expression
93
93
  : code `${expression}.map(item => (${itemFromJsonExpression}))`;
94
94
  }
95
- fromRdfExpression(parameters) {
95
+ fromRdfResourceValuesExpression(parameters) {
96
96
  const { variables } = parameters;
97
- return code `${this.itemType.fromRdfExpression(parameters)}.map(values => values.length > 0 ? values.map(value => ${imports.Maybe}.of(value)) : ${imports.Resource}.Values.fromValue<${imports.Maybe}<${this.itemType.name}>>({ focusResource: ${variables.resource}, propertyPath: ${variables.propertyPath}, value: ${imports.Maybe}.empty() }))`;
97
+ return code `${this.itemType.fromRdfResourceValuesExpression(parameters)}.map(values => values.length > 0 ? values.map(value => ${imports.Maybe}.of(value)) : ${imports.Resource}.Values.fromValue<${imports.Maybe}<${this.itemType.name}>>({ focusResource: ${variables.resource}, propertyPath: ${variables.propertyPath}, value: ${imports.Maybe}.empty() }))`;
98
98
  }
99
99
  graphqlResolveExpression(parameters) {
100
100
  return code `${this.itemType.graphqlResolveExpression(parameters)}.extractNullable()`;
@@ -128,8 +128,8 @@ export class OptionType extends AbstractContainerType {
128
128
  toJsonExpression({ variables, }) {
129
129
  return code `${variables.value}.map(item => (${this.itemType.toJsonExpression({ variables: { value: code `item` } })})).extract()`;
130
130
  }
131
- toRdfExpression({ variables, }) {
132
- const itemTypeToRdfExpression = this.itemType.toRdfExpression({
131
+ toRdfResourceValuesExpression({ variables, }) {
132
+ const itemTypeToRdfExpression = this.itemType.toRdfResourceValuesExpression({
133
133
  variables: { ...variables, value: code `value` },
134
134
  });
135
135
  let toRdfExpression = code `${variables.value}.toList()`;
@@ -162,10 +162,10 @@ __decorate([
162
162
  ], OptionType.prototype, "schemaType", null);
163
163
  __decorate([
164
164
  Memoize()
165
- ], OptionType.prototype, "sparqlConstructTriplesFunction", null);
165
+ ], OptionType.prototype, "valueSparqlConstructTriplesFunction", null);
166
166
  __decorate([
167
167
  Memoize()
168
- ], OptionType.prototype, "sparqlWherePatternsFunction", null);
168
+ ], OptionType.prototype, "valueSparqlWherePatternsFunction", null);
169
169
  __decorate([
170
170
  Memoize()
171
171
  ], OptionType.prototype, "jsonType", null);
@@ -3,11 +3,11 @@ import { type Code } from "./ts-poet-wrapper.js";
3
3
  export declare class SetType<ItemTypeT extends SetType.ItemType> extends AbstractCollectionType<ItemTypeT> {
4
4
  readonly graphqlArgs: AbstractCollectionType<ItemTypeT>["graphqlArgs"];
5
5
  readonly kind = "SetType";
6
- get sparqlConstructTriplesFunction(): Code;
7
- get sparqlWherePatternsFunction(): Code;
8
- fromRdfExpression(parameters: Parameters<AbstractCollectionType<ItemTypeT>["fromRdfExpression"]>[0]): Code;
6
+ get valueSparqlConstructTriplesFunction(): Code;
7
+ get valueSparqlWherePatternsFunction(): Code;
8
+ fromRdfResourceValuesExpression(parameters: Parameters<AbstractCollectionType<ItemTypeT>["fromRdfResourceValuesExpression"]>[0]): Code;
9
9
  jsonType(): AbstractCollectionType.JsonType;
10
- toRdfExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["toRdfExpression"]>[0]): Code;
10
+ toRdfResourceValuesExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["toRdfResourceValuesExpression"]>[0]): Code;
11
11
  }
12
12
  export declare namespace SetType {
13
13
  type ItemType = AbstractCollectionType.ItemType;
@@ -13,15 +13,17 @@ import { code, joinCode } from "./ts-poet-wrapper.js";
13
13
  export class SetType extends AbstractCollectionType {
14
14
  graphqlArgs = Maybe.empty();
15
15
  kind = "SetType";
16
- get sparqlConstructTriplesFunction() {
17
- return code `${snippets.setSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.sparqlConstructTriplesFunction})`;
16
+ get valueSparqlConstructTriplesFunction() {
17
+ return code `${snippets.setSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlConstructTriplesFunction})`;
18
18
  }
19
- get sparqlWherePatternsFunction() {
20
- return code `${snippets.setSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.sparqlWherePatternsFunction})`;
19
+ get valueSparqlWherePatternsFunction() {
20
+ return code `${snippets.setSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlWherePatternsFunction})`;
21
21
  }
22
- fromRdfExpression(parameters) {
22
+ fromRdfResourceValuesExpression(parameters) {
23
23
  const { variables } = parameters;
24
- const chain = [this.itemType.fromRdfExpression(parameters)];
24
+ const chain = [
25
+ this.itemType.fromRdfResourceValuesExpression(parameters),
26
+ ];
25
27
  if (this.minCount === 0 || this._mutable) {
26
28
  chain.push(code `map(values => values.toArray()${this._mutable ? ".concat()" : ""})`);
27
29
  }
@@ -32,24 +34,24 @@ export class SetType extends AbstractCollectionType {
32
34
  return joinCode(chain, { on: "." });
33
35
  }
34
36
  jsonType() {
35
- const name = code `readonly (${this.itemType.jsonType().name})[]`;
37
+ const name = code `${!this.mutable ? "readonly " : ""}(${this.itemType.jsonType().name})[]`;
36
38
  if (this.minCount === 0) {
37
39
  return new AbstractCollectionType.JsonType(name, { optional: true });
38
40
  }
39
41
  return new AbstractCollectionType.JsonType(name);
40
42
  }
41
- toRdfExpression({ variables, }) {
42
- return code `${variables.value}.flatMap((item) => ${this.itemType.toRdfExpression({
43
+ toRdfResourceValuesExpression({ variables, }) {
44
+ return code `${variables.value}.flatMap((item) => ${this.itemType.toRdfResourceValuesExpression({
43
45
  variables: { ...variables, value: code `item` },
44
46
  })})`;
45
47
  }
46
48
  }
47
49
  __decorate([
48
50
  Memoize()
49
- ], SetType.prototype, "sparqlConstructTriplesFunction", null);
51
+ ], SetType.prototype, "valueSparqlConstructTriplesFunction", null);
50
52
  __decorate([
51
53
  Memoize()
52
- ], SetType.prototype, "sparqlWherePatternsFunction", null);
54
+ ], SetType.prototype, "valueSparqlWherePatternsFunction", null);
53
55
  __decorate([
54
56
  Memoize()
55
57
  ], SetType.prototype, "jsonType", null);
@@ -7,7 +7,7 @@ export declare class StringType extends AbstractPrimitiveType<string> {
7
7
  readonly graphqlType: import("./AbstractType.js").AbstractType.GraphqlType;
8
8
  readonly kind = "StringType";
9
9
  readonly schemaType: Code;
10
- readonly sparqlWherePatternsFunction: Code;
10
+ readonly valueSparqlWherePatternsFunction: Code;
11
11
  readonly typeofs: NonEmptyList<"string">;
12
12
  get name(): string;
13
13
  protected get schemaObject(): {
@@ -17,7 +17,7 @@ export declare class StringType extends AbstractPrimitiveType<string> {
17
17
  };
18
18
  hashStatements({ variables, }: Parameters<AbstractPrimitiveType<string>["hashStatements"]>[0]): readonly Code[];
19
19
  jsonZodSchema(_parameters: Parameters<AbstractPrimitiveType<string>["jsonZodSchema"]>[0]): Code;
20
- toRdfExpression({ variables, }: Parameters<AbstractPrimitiveType<string>["toRdfExpression"]>[0]): Code;
20
+ toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<string>["toRdfResourceValuesExpression"]>[0]): Code;
21
21
  protected fromRdfExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<string>["fromRdfExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<string>["fromRdfExpressionChain"]>;
22
22
  }
23
23
  //# sourceMappingURL=StringType.d.ts.map
@@ -18,7 +18,7 @@ export class StringType extends AbstractPrimitiveType {
18
18
  graphqlType = new AbstractPrimitiveType.GraphqlType(code `${imports.GraphQLString}`);
19
19
  kind = "StringType";
20
20
  schemaType = code `${snippets.StringSchema}`;
21
- sparqlWherePatternsFunction = code `${snippets.stringSparqlWherePatterns}`;
21
+ valueSparqlWherePatternsFunction = code `${snippets.stringSparqlWherePatterns}`;
22
22
  typeofs = NonEmptyList(["string"]);
23
23
  get name() {
24
24
  if (this.primitiveIn.length > 0) {
@@ -47,7 +47,7 @@ export class StringType extends AbstractPrimitiveType {
47
47
  return code `${imports.z}.enum(${arrayOf(...this.primitiveIn)})`;
48
48
  }
49
49
  }
50
- toRdfExpression({ variables, }) {
50
+ toRdfResourceValuesExpression({ variables, }) {
51
51
  return code `[${snippets.literalFactory}.string(${variables.value}${!this.datatype.equals(xsd.string) ? `, ${rdfjsTermExpression(this.datatype)}` : ""})]`;
52
52
  }
53
53
  fromRdfExpressionChain({ variables, }) {
@@ -8,7 +8,7 @@ export declare class TermType<ConstantTermT extends Literal | NamedNode = Litera
8
8
  readonly kind = "TermType";
9
9
  readonly nodeKinds: ReadonlySet<NodeKind>;
10
10
  readonly schemaType: Code;
11
- readonly sparqlWherePatternsFunction: Code;
11
+ readonly valueSparqlWherePatternsFunction: Code;
12
12
  constructor({ nodeKinds, ...superParameters }: ConstructorParameters<typeof AbstractTermType<ConstantTermT, RuntimeTermT>>[0] & {
13
13
  nodeKinds: ReadonlySet<NodeKind>;
14
14
  });
@@ -19,7 +19,7 @@ export class TermType extends AbstractTermType {
19
19
  kind = "TermType";
20
20
  nodeKinds;
21
21
  schemaType = code `${snippets.TermSchema}`;
22
- sparqlWherePatternsFunction = code `${snippets.termSparqlWherePatterns}`;
22
+ valueSparqlWherePatternsFunction = code `${snippets.termSparqlWherePatterns}`;
23
23
  constructor({ nodeKinds, ...superParameters }) {
24
24
  super(superParameters);
25
25
  this.nodeKinds = nodeKinds;
@@ -63,7 +63,7 @@ export class TermType extends AbstractTermType {
63
63
  valueToNodeKind = code `${imports.dataFactory}.namedNode(${variables.value}["@id"])`;
64
64
  break;
65
65
  case "Literal":
66
- valueToNodeKind = code `${imports.dataFactory}.literal(${variables.value}["@value"], ${variables.value}["@language"] !== undefined ? ${variables.value}["@language"] : (${variables.value}["@type"] !== undefined ? ${imports.dataFactory}.namedNode(${variables.value}["@type"]) : undefined))`;
66
+ valueToNodeKind = code `${imports.dataFactory}.literal(${variables.value}["@value"], ${variables.value}["@language"] !== undefined ? ${variables.value}["@language"] : (${variables.value}["@type"] !== undefined ? ${imports.dataFactory}.namedNode(${variables.value}["@type"]!) : undefined))`;
67
67
  break;
68
68
  default:
69
69
  throw new RangeError(nodeKind);
@@ -1,38 +1,46 @@
1
1
  import * as ast from "../../ast/index.js";
2
2
  import { graphqlSchemaVariableStatement } from "./graphqlSchemaVariableStatement.js";
3
3
  import { objectSetDeclarations } from "./objectSetDeclarations.js";
4
- // import { graphqlSchemaVariableStatement } from "./graphqlSchemaVariableStatement.js";
5
- // import { objectSetDeclarations } from "./objectSetDeclarations.js";
6
4
  import { snippets } from "./snippets.js";
7
5
  import { synthesizeUberObjectUnionType } from "./synthesizeUberObjectUnionType.js";
8
- // import { synthesizeUberObjectUnionType } from "./synthesizeUberObjectUnionType.js";
9
6
  import { TypeFactory } from "./TypeFactory.js";
10
7
  import { code, joinCode } from "./ts-poet-wrapper.js";
11
8
  export class TsGenerator {
12
9
  typeFactory = new TypeFactory();
13
10
  generate(ast_) {
14
- const declarations = [];
11
+ let declarations = [];
12
+ for (const astNamedUnionType of ast_.namedUnionTypes) {
13
+ if (astNamedUnionType.isObjectUnionType()) {
14
+ continue;
15
+ }
16
+ declarations = declarations.concat(this.typeFactory.createType(astNamedUnionType).declaration.toList());
17
+ }
15
18
  const objectTypesToposorted = ast.ObjectType.toposort(ast_.objectTypes).map((astObjectType) => this.typeFactory.createObjectType(astObjectType));
16
- const objectUnionTypesToposorted = ast_.objectUnionTypes.map((astObjectUnionType) => this.typeFactory.createObjectUnionType(astObjectUnionType));
19
+ const namedObjectUnionTypesToposorted = ast_.namedUnionTypes
20
+ .filter((_) => _.isObjectUnionType())
21
+ .map((astObjectUnionType) => this.typeFactory.createNamedObjectUnionType(astObjectUnionType));
17
22
  for (const objectType of objectTypesToposorted) {
18
- declarations.push(objectType.declaration);
23
+ declarations = declarations.concat(objectType.declaration.toList());
19
24
  }
20
- for (const objectUnionType of objectUnionTypesToposorted) {
21
- declarations.push(objectUnionType.declaration);
25
+ for (const namedObjectUnionType of namedObjectUnionTypesToposorted) {
26
+ declarations = declarations.concat(namedObjectUnionType.declaration.toList());
22
27
  }
23
28
  const objectTypesNameSorted = objectTypesToposorted.toSorted((left, right) => left.name.localeCompare(right.name));
24
- const objectUnionTypesNameSorted = objectUnionTypesToposorted.toSorted((left, right) => left.name.localeCompare(right.name));
25
- const uberObjectUnionType = synthesizeUberObjectUnionType({
26
- objectTypes: objectTypesToposorted.toReversed(), // Reverse topological order so children ane before parents
27
- });
28
- declarations.push(uberObjectUnionType.declaration);
29
+ const namedObjectUnionTypesNameSorted = namedObjectUnionTypesToposorted.toSorted((left, right) => left.name.localeCompare(right.name));
30
+ if (objectTypesToposorted.length > 0) {
31
+ const uberObjectUnionType = synthesizeUberObjectUnionType({
32
+ objectTypes: objectTypesToposorted.toReversed(), // Reverse topological order so children ane before parents
33
+ });
34
+ declarations = declarations.concat(uberObjectUnionType.declaration.toList());
35
+ namedObjectUnionTypesNameSorted.push(uberObjectUnionType);
36
+ }
29
37
  declarations.push(...objectSetDeclarations({
30
38
  objectTypes: objectTypesNameSorted,
31
- objectUnionTypes: objectUnionTypesNameSorted.concat(uberObjectUnionType),
39
+ namedObjectUnionTypes: namedObjectUnionTypesNameSorted,
32
40
  }));
33
41
  declarations.push(...graphqlSchemaVariableStatement({
34
42
  objectTypes: objectTypesNameSorted,
35
- objectUnionTypes: objectUnionTypesNameSorted.concat(uberObjectUnionType),
43
+ namedObjectUnionTypes: namedObjectUnionTypesNameSorted,
36
44
  }).toList());
37
45
  declarations.splice(0, 0, joinCode(Object.values(snippets)
38
46
  .sort((left, right) => left.usageSiteName.localeCompare(right.usageSiteName))
@@ -1,3 +1,4 @@
1
+ import type { AnonymousUnionType } from "./AnonymousUnionType.js";
1
2
  import type { BigDecimalType } from "./BigDecimalType.js";
2
3
  import type { BigIntType } from "./BigIntType.js";
3
4
  import type { BlankNodeType } from "./BlankNodeType.js";
@@ -14,12 +15,12 @@ import type { LazyObjectSetType } from "./LazyObjectSetType.js";
14
15
  import type { LazyObjectType } from "./LazyObjectType.js";
15
16
  import type { ListType } from "./ListType.js";
16
17
  import type { LiteralType } from "./LiteralType.js";
18
+ import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
19
+ import type { NamedUnionType } from "./NamedUnionType.js";
17
20
  import type { ObjectType } from "./ObjectType.js";
18
- import type { ObjectUnionType } from "./ObjectUnionType.js";
19
21
  import type { OptionType } from "./OptionType.js";
20
22
  import type { SetType } from "./SetType.js";
21
23
  import type { StringType } from "./StringType.js";
22
24
  import type { TermType } from "./TermType.js";
23
- import type { UnionType } from "./UnionType.js";
24
- export type Type = BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | DefaultValueType<DefaultValueType.ItemType> | FloatType | IdentifierType | IntType | IriType | LazyObjectOptionType | LazyObjectSetType | LazyObjectType | ListType<ListType.ItemType> | LiteralType | ObjectType | ObjectUnionType | OptionType<OptionType.ItemType> | SetType<SetType.ItemType> | StringType | TermType | UnionType;
25
+ export type Type = AnonymousUnionType | BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | DefaultValueType<DefaultValueType.ItemType> | FloatType | IdentifierType | IntType | IriType | LazyObjectOptionType | LazyObjectSetType | LazyObjectType | ListType<ListType.ItemType> | LiteralType | NamedObjectUnionType | NamedUnionType | ObjectType | OptionType<OptionType.ItemType> | SetType<SetType.ItemType> | StringType | TermType;
25
26
  //# sourceMappingURL=Type.d.ts.map
@@ -1,17 +1,20 @@
1
1
  import type { Literal, NamedNode } from "@rdfjs/types";
2
- import type * as ast from "../../ast/index.js";
2
+ import * as ast from "../../ast/index.js";
3
+ import { AnonymousUnionType } from "./AnonymousUnionType.js";
4
+ import { NamedObjectUnionType } from "./NamedObjectUnionType.js";
5
+ import { NamedUnionType } from "./NamedUnionType.js";
3
6
  import { ObjectType } from "./ObjectType.js";
4
- import { ObjectUnionType } from "./ObjectUnionType.js";
5
7
  import type { Type } from "./Type.js";
6
8
  export declare class TypeFactory {
9
+ private cachedNamedObjectUnionTypesByShapeIdentifier;
7
10
  private cachedObjectTypePropertiesByShapeIdentifier;
8
11
  private cachedObjectTypesByShapeIdentifier;
9
- private cachedObjectUnionTypesByShapeIdentifier;
12
+ createNamedObjectUnionType(astType: ast.ObjectUnionType): NamedObjectUnionType;
10
13
  createObjectType(astType: ast.ObjectType): ObjectType;
11
- createObjectUnionType(astType: ast.ObjectUnionType): ObjectUnionType;
12
14
  createType(astType: ast.Type, parameters?: {
13
15
  defaultValue?: Literal | NamedNode;
14
16
  }): Type;
17
+ createUnionType(astType: ast.UnionType): AnonymousUnionType | NamedUnionType | NamedObjectUnionType;
15
18
  private createBlankNodeType;
16
19
  private createDefaultValueType;
17
20
  private createIdentifierType;
@@ -25,6 +28,5 @@ export declare class TypeFactory {
25
28
  private createOptionType;
26
29
  private createSetType;
27
30
  private createTermType;
28
- private createUnionType;
29
31
  }
30
32
  //# sourceMappingURL=TypeFactory.d.ts.map