@shaclmate/compiler 4.0.41 → 4.0.42

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 (320) hide show
  1. package/dist/ShapesGraphToAstTransformer.d.ts +1 -0
  2. package/dist/ShapesGraphToAstTransformer.js +10 -45
  3. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
  4. package/dist/_ShapesGraphToAstTransformer/{transformPropertyShapeToAstObjectTypeProperty.js → transformPropertyShapeToAstStructTypeField.js} +71 -48
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +29 -20
  7. package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.d.ts → transformShapeToAstStructType.d.ts} +2 -2
  8. package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -29
  9. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +2 -1
  10. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
  11. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
  12. package/dist/ast/AbstractCompoundType.d.ts +2 -2
  13. package/dist/ast/AbstractCompoundType.js +4 -4
  14. package/dist/ast/AbstractContainerType.d.ts +2 -2
  15. package/dist/ast/AbstractContainerType.js +4 -4
  16. package/dist/ast/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +10 -10
  17. package/dist/ast/{AbstractLazyObjectType.js → AbstractLazyType.js} +3 -3
  18. package/dist/ast/AbstractType.d.ts +1 -1
  19. package/dist/ast/AbstractType.js +3 -0
  20. package/dist/ast/Ast.d.ts +2 -4
  21. package/dist/ast/DefaultValueType.js +2 -1
  22. package/dist/ast/IntersectionType.d.ts +2 -2
  23. package/dist/ast/IntersectionType.js +3 -3
  24. package/dist/ast/LazyOptionType.d.ts +6 -0
  25. package/dist/ast/LazyOptionType.js +5 -0
  26. package/dist/ast/LazySetType.d.ts +6 -0
  27. package/dist/ast/LazySetType.js +5 -0
  28. package/dist/ast/LazyType.d.ts +5 -0
  29. package/dist/ast/LazyType.js +5 -0
  30. package/dist/ast/ListType.d.ts +2 -2
  31. package/dist/ast/ListType.js +4 -4
  32. package/dist/ast/OptionType.js +2 -1
  33. package/dist/ast/SetType.js +2 -1
  34. package/dist/ast/StructCompoundType.d.ts +12 -0
  35. package/dist/ast/{ObjectCompoundType.js → StructCompoundType.js} +18 -18
  36. package/dist/ast/StructIntersectionType.d.ts +4 -0
  37. package/dist/ast/StructIntersectionType.js +2 -0
  38. package/dist/ast/{ObjectType.d.ts → StructType.d.ts} +28 -27
  39. package/dist/ast/{ObjectType.js → StructType.js} +81 -78
  40. package/dist/ast/StructUnionType.d.ts +4 -0
  41. package/dist/ast/StructUnionType.js +2 -0
  42. package/dist/ast/Type.d.ts +5 -5
  43. package/dist/ast/Type.js +4 -4
  44. package/dist/ast/UnionType.d.ts +2 -2
  45. package/dist/ast/UnionType.js +3 -3
  46. package/dist/ast/index.d.ts +7 -7
  47. package/dist/ast/index.js +7 -7
  48. package/dist/generators/AstJsonGenerator.js +2 -2
  49. package/dist/generators/transformAstToLabeledPropertyGraph.js +8 -8
  50. package/dist/generators/ts/AbstractContainerType.d.ts +1 -1
  51. package/dist/generators/ts/AbstractContainerType.js +6 -6
  52. package/dist/generators/ts/AbstractDateType.d.ts +1 -7
  53. package/dist/generators/ts/AbstractDateType.js +1 -11
  54. package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +7 -7
  55. package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +19 -17
  56. package/dist/generators/ts/AbstractLiteralType.d.ts +2 -5
  57. package/dist/generators/ts/AbstractLiteralType.js +0 -21
  58. package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
  59. package/dist/generators/ts/AbstractNumericType.js +15 -25
  60. package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
  61. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  62. package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -1
  63. package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
  64. package/dist/generators/ts/AbstractTermType.d.ts +6 -21
  65. package/dist/generators/ts/AbstractTermType.js +26 -55
  66. package/dist/generators/ts/AbstractType.d.ts +40 -47
  67. package/dist/generators/ts/AbstractType.js +17 -6
  68. package/dist/generators/ts/BigDecimalType.d.ts +3 -3
  69. package/dist/generators/ts/BigDecimalType.js +3 -8
  70. package/dist/generators/ts/BigIntType.d.ts +2 -2
  71. package/dist/generators/ts/BigIntType.js +7 -4
  72. package/dist/generators/ts/BlankNodeType.d.ts +2 -7
  73. package/dist/generators/ts/BlankNodeType.js +2 -7
  74. package/dist/generators/ts/BooleanType.d.ts +3 -3
  75. package/dist/generators/ts/BooleanType.js +12 -14
  76. package/dist/generators/ts/DateTimeType.d.ts +2 -2
  77. package/dist/generators/ts/DateTimeType.js +14 -4
  78. package/dist/generators/ts/DateType.d.ts +2 -2
  79. package/dist/generators/ts/DateType.js +14 -4
  80. package/dist/generators/ts/DefaultValueType.d.ts +8 -8
  81. package/dist/generators/ts/DefaultValueType.js +10 -12
  82. package/dist/generators/ts/FloatType.d.ts +2 -2
  83. package/dist/generators/ts/FloatType.js +7 -4
  84. package/dist/generators/ts/IdentifierType.d.ts +2 -2
  85. package/dist/generators/ts/IdentifierType.js +2 -7
  86. package/dist/generators/ts/IntType.d.ts +2 -2
  87. package/dist/generators/ts/IntType.js +7 -4
  88. package/dist/generators/ts/IriType.d.ts +2 -2
  89. package/dist/generators/ts/IriType.js +12 -14
  90. package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +12 -11
  91. package/dist/generators/ts/{LazyObjectOptionType.js → LazyOptionType.js} +23 -14
  92. package/dist/generators/ts/LazySetType.d.ts +20 -0
  93. package/dist/generators/ts/{LazyObjectSetType.js → LazySetType.js} +22 -13
  94. package/dist/generators/ts/LazyType.d.ts +19 -0
  95. package/dist/generators/ts/{LazyObjectType.js → LazyType.js} +22 -13
  96. package/dist/generators/ts/ListType.d.ts +1 -1
  97. package/dist/generators/ts/ListType.js +9 -19
  98. package/dist/generators/ts/LiteralType.d.ts +3 -2
  99. package/dist/generators/ts/LiteralType.js +6 -2
  100. package/dist/generators/ts/ObjectType.d.ts +16 -3
  101. package/dist/generators/ts/ObjectType.js +301 -91
  102. package/dist/generators/ts/ObjectUnionType.js +40 -40
  103. package/dist/generators/ts/OptionType.d.ts +2 -2
  104. package/dist/generators/ts/OptionType.js +7 -5
  105. package/dist/generators/ts/SetType.d.ts +3 -3
  106. package/dist/generators/ts/SetType.js +8 -10
  107. package/dist/generators/ts/Snippets.d.ts +26 -8
  108. package/dist/generators/ts/Snippets.js +161 -35
  109. package/dist/generators/ts/StringType.d.ts +4 -3
  110. package/dist/generators/ts/StringType.js +18 -11
  111. package/dist/generators/ts/TermType.d.ts +7 -5
  112. package/dist/generators/ts/TermType.js +28 -9
  113. package/dist/generators/ts/TsGenerator.js +11 -6
  114. package/dist/generators/ts/Type.d.ts +4 -4
  115. package/dist/generators/ts/TypeFactory.d.ts +5 -5
  116. package/dist/generators/ts/TypeFactory.js +79 -58
  117. package/dist/generators/ts/UnionType.d.ts +23 -18
  118. package/dist/generators/ts/UnionType.js +227 -221
  119. package/dist/generators/ts/ZodGenerator.js +15 -7
  120. package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +24 -15
  121. package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
  122. package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +8 -6
  123. package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +11 -24
  124. package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
  125. package/dist/generators/ts/_ObjectType/IdentifierProperty.js +44 -16
  126. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
  127. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
  128. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
  129. package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionDeclaration.js → ObjectType_equalsFunctionExpression.js} +6 -10
  130. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
  131. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
  132. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
  133. package/dist/generators/ts/_ObjectType/{ObjectType_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +6 -8
  134. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
  135. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionExpression.js} +5 -9
  136. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts} +2 -3
  137. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → ObjectType_focusSparqlWherePatternsFunctionExpression.js} +5 -9
  138. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
  139. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
  141. package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionExpression.js} +8 -16
  142. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
  143. package/dist/generators/ts/_ObjectType/{ObjectType_graphqlTypeVariableStatement.js → ObjectType_graphqlTypeExpression.js} +6 -13
  144. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.d.ts +4 -0
  145. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.js +30 -0
  146. package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +4 -0
  147. package/dist/generators/ts/_ObjectType/{identifierTypeDeclarations.js → ObjectType_identifierTypeDeclarations.js} +2 -5
  148. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +3 -3
  149. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +1 -2
  150. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +2 -6
  151. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
  152. package/dist/generators/ts/_ObjectType/{ObjectType_jsonSchemaFunctionDeclaration.js → ObjectType_jsonSchemaExpression.js} +3 -10
  153. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
  154. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
  155. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
  156. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
  157. package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +1 -1
  158. package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +2 -2
  159. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
  160. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +18 -0
  161. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +4 -0
  162. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +18 -0
  163. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -3
  164. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +5 -9
  165. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -3
  166. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +4 -8
  167. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +4 -0
  168. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +14 -0
  169. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +4 -0
  170. package/dist/generators/ts/_ObjectType/{ObjectType_toRdfResourceFunctionDeclaration.js → ObjectType_toRdfResourceFunctionExpression.js} +6 -12
  171. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.d.ts +4 -0
  172. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +7 -0
  173. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +4 -0
  174. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +5 -0
  175. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
  176. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
  177. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts} +2 -3
  178. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
  179. package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +9 -2
  180. package/dist/generators/ts/_ObjectType/ShaclProperty.js +65 -33
  181. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +4 -3
  182. package/dist/generators/ts/_snippets/snippets_DateSchema.js +4 -3
  183. package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
  184. package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +6 -5
  185. package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +2 -1
  186. package/dist/generators/ts/_snippets/snippets_IriSchema.js +1 -0
  187. package/dist/generators/ts/_snippets/snippets_Lazy.d.ts +3 -0
  188. package/dist/generators/ts/_snippets/snippets_Lazy.js +22 -0
  189. package/dist/generators/ts/_snippets/snippets_LazyOption.d.ts +3 -0
  190. package/dist/generators/ts/_snippets/snippets_LazyOption.js +25 -0
  191. package/dist/generators/ts/_snippets/snippets_LazySet.d.ts +3 -0
  192. package/dist/generators/ts/_snippets/snippets_LazySet.js +40 -0
  193. package/dist/generators/ts/_snippets/snippets_LiteralFilter.js +1 -3
  194. package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +1 -0
  195. package/dist/generators/ts/_snippets/snippets_NumericSchema.js +2 -1
  196. package/dist/generators/ts/_snippets/snippets_PropertyPath.js +6 -8
  197. package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +32 -32
  198. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
  199. package/dist/generators/ts/_snippets/snippets_StringSchema.js +5 -3
  200. package/dist/generators/ts/_snippets/snippets_TermFilter.js +3 -3
  201. package/dist/generators/ts/_snippets/snippets_TermSchema.js +4 -2
  202. package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.d.ts +3 -0
  203. package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +6 -0
  204. package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.d.ts +3 -0
  205. package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +6 -0
  206. package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.d.ts +3 -0
  207. package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +6 -0
  208. package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.d.ts +3 -0
  209. package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -0
  210. package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
  211. package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
  212. package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
  213. package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
  214. package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
  215. package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
  216. package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.d.ts +3 -0
  217. package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -0
  218. package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.d.ts +3 -0
  219. package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +6 -0
  220. package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.d.ts +3 -0
  221. package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
  222. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
  223. package/dist/generators/ts/_snippets/snippets_filterNumeric.js +1 -1
  224. package/dist/generators/ts/_snippets/snippets_filterTerm.js +1 -2
  225. package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.d.ts +3 -0
  226. package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.js +6 -0
  227. package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.d.ts +3 -0
  228. package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +6 -0
  229. package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.d.ts +3 -0
  230. package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.js +6 -0
  231. package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts +3 -0
  232. package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js +6 -0
  233. package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.d.ts +3 -0
  234. package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -0
  235. package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.d.ts +3 -0
  236. package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +6 -0
  237. package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.d.ts +3 -0
  238. package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -0
  239. package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.d.ts +3 -0
  240. package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.js +8 -0
  241. package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.d.ts +3 -0
  242. package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.js +8 -0
  243. package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +1 -1
  244. package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.d.ts +3 -0
  245. package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.js +9 -0
  246. package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.js +13 -7
  247. package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.d.ts +3 -0
  248. package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.js +6 -0
  249. package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.js +1 -1
  250. package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.d.ts +3 -0
  251. package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.js +17 -0
  252. package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.d.ts +3 -0
  253. package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.js +60 -0
  254. package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
  255. package/dist/input/generated.d.ts +464 -389
  256. package/dist/input/generated.js +1748 -2294
  257. package/package.json +2 -2
  258. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +0 -9
  259. package/dist/ast/LazyObjectOptionType.d.ts +0 -6
  260. package/dist/ast/LazyObjectOptionType.js +0 -5
  261. package/dist/ast/LazyObjectSetType.d.ts +0 -6
  262. package/dist/ast/LazyObjectSetType.js +0 -5
  263. package/dist/ast/LazyObjectType.d.ts +0 -5
  264. package/dist/ast/LazyObjectType.js +0 -5
  265. package/dist/ast/ObjectCompoundType.d.ts +0 -12
  266. package/dist/ast/ObjectIntersectionType.d.ts +0 -4
  267. package/dist/ast/ObjectIntersectionType.js +0 -2
  268. package/dist/ast/ObjectUnionType.d.ts +0 -4
  269. package/dist/ast/ObjectUnionType.js +0 -2
  270. package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
  271. package/dist/generators/ts/LazyObjectType.d.ts +0 -19
  272. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
  273. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -44
  274. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
  275. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
  276. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -21
  277. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -5
  278. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  279. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +0 -18
  280. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  281. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  282. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  283. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  284. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.js +0 -10
  285. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  286. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +0 -4
  287. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +0 -41
  288. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
  289. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -12
  290. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  291. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  292. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -9
  293. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  294. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -15
  295. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
  296. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -12
  297. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  298. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -20
  299. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  300. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +0 -4
  301. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.js +0 -29
  302. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +0 -11
  303. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +0 -13
  304. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
  305. package/dist/generators/ts/_snippets/snippets_LazyObject.d.ts +0 -3
  306. package/dist/generators/ts/_snippets/snippets_LazyObject.js +0 -22
  307. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.d.ts +0 -3
  308. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +0 -25
  309. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.d.ts +0 -3
  310. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +0 -40
  311. package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +0 -3
  312. package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +0 -15
  313. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +0 -3
  314. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +0 -31
  315. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +0 -3
  316. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +0 -25
  317. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.d.ts +0 -3
  318. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +0 -15
  319. package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.d.ts +0 -3
  320. package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.js +0 -23
@@ -10,17 +10,15 @@ import { Maybe } from "purify-ts";
10
10
  import { invariant } from "ts-invariant";
11
11
  import { Memoize } from "typescript-memoize";
12
12
  import { AbstractTermType } from "./AbstractTermType.js";
13
- import { code, joinCode } from "./ts-poet-wrapper.js";
13
+ import { arrayOf, code, joinCode } from "./ts-poet-wrapper.js";
14
14
  export class TermType extends AbstractTermType {
15
15
  conversionFunction = Maybe.empty();
16
16
  filterFunction = code `${this.reusables.snippets.filterTerm}`;
17
- filterType = code `${this.reusables.snippets.TermFilter}`;
18
- kind = "Term";
19
- nodeKinds;
20
- schemaType = code `${this.reusables.snippets.TermSchema}`;
21
17
  jsTypes = [
22
18
  { instanceof: "Object", typeof: "object" },
23
19
  ];
20
+ kind = "Term";
21
+ nodeKinds;
24
22
  valueSparqlWherePatternsFunction = code `${this.reusables.snippets.termSparqlWherePatterns}`;
25
23
  constructor({ nodeKinds, ...superParameters }) {
26
24
  super(superParameters);
@@ -28,7 +26,19 @@ export class TermType extends AbstractTermType {
28
26
  invariant(this.nodeKinds.has("Literal") &&
29
27
  (this.nodeKinds.has("BlankNode") || this.nodeKinds.has("IRI")), "should be IdentifierType or LiteralType");
30
28
  }
31
- get expression() {
29
+ get fromRdfResourceValuesFunction() {
30
+ return code `${this.reusables.snippets.termFromRdfResourceValues}<${this.expression}>`;
31
+ }
32
+ get filterType() {
33
+ return code `${this.reusables.snippets.TermFilter}<${this.expression}>`;
34
+ }
35
+ get graphqlType() {
36
+ throw new Error("not implemented");
37
+ }
38
+ get schemaType() {
39
+ return code `${this.reusables.snippets.TermSchema}<${this.expression}>`;
40
+ }
41
+ get inlineExpression() {
32
42
  return code `(${joinCode([...this.nodeKinds]
33
43
  .map((nodeKind) => {
34
44
  switch (nodeKind) {
@@ -45,8 +55,8 @@ export class TermType extends AbstractTermType {
45
55
  })
46
56
  .map((import_) => code `${import_}`), { on: " | " })})`;
47
57
  }
48
- get graphqlType() {
49
- throw new Error("not implemented");
58
+ get schemaInitializers() {
59
+ return super.schemaInitializers.concat(code `types: ${arrayOf(...[...this.nodeKinds].map(NodeKind.toTermType))}`);
50
60
  }
51
61
  fromJsonExpression({ variables, }) {
52
62
  return code `${this.reusables.imports.Either}.of<Error, ${this.expression}>(${[
@@ -117,7 +127,16 @@ export class TermType extends AbstractTermType {
117
127
  }
118
128
  __decorate([
119
129
  Memoize()
120
- ], TermType.prototype, "expression", null);
130
+ ], TermType.prototype, "fromRdfResourceValuesFunction", null);
131
+ __decorate([
132
+ Memoize()
133
+ ], TermType.prototype, "filterType", null);
134
+ __decorate([
135
+ Memoize()
136
+ ], TermType.prototype, "schemaType", null);
137
+ __decorate([
138
+ Memoize()
139
+ ], TermType.prototype, "inlineExpression", null);
121
140
  __decorate([
122
141
  Memoize()
123
142
  ], TermType.prototype, "jsonType", null);
@@ -1,3 +1,4 @@
1
+ import dataFactory from "@rdfx/data-factory";
1
2
  import { Maybe } from "purify-ts";
2
3
  import { invariant } from "ts-invariant";
3
4
  import { BlankNodeType } from "./BlankNodeType.js";
@@ -12,7 +13,7 @@ import { SparqlObjectSetType } from "./SparqlObjectSetType.js";
12
13
  import { TypeFactory } from "./TypeFactory.js";
13
14
  import { code, joinCode } from "./ts-poet-wrapper.js";
14
15
  function compareTsNamedType(left, right) {
15
- return left.alias.unsafeCoerce().localeCompare(right.alias.unsafeCoerce());
16
+ return left.name.unsafeCoerce().localeCompare(right.name.unsafeCoerce());
16
17
  }
17
18
  export class TsGenerator {
18
19
  configuration;
@@ -39,7 +40,7 @@ export class TsGenerator {
39
40
  for (const astNamedType of ast_.namedTypes) {
40
41
  const tsNamedType = typeFactory.createType(astNamedType);
41
42
  tsNamedTypes.push(tsNamedType);
42
- if (astNamedType.kind === "Object") {
43
+ if (astNamedType.kind === "Struct") {
43
44
  for (const tsImport of astNamedType.tsImports) {
44
45
  declarations.push(code `${tsImport}`);
45
46
  }
@@ -152,29 +153,31 @@ export class TsGenerator {
152
153
  let identifierType;
153
154
  if (nodeKinds.size === 2) {
154
155
  identifierType = new IdentifierType({
155
- alias: Maybe.empty(),
156
+ name: Maybe.empty(),
156
157
  comment: Maybe.empty(),
157
158
  configuration,
158
159
  label: Maybe.empty(),
159
160
  logger: this.logger,
160
161
  reusables,
162
+ shapeIdentifier: dataFactory.blankNode(),
161
163
  });
162
164
  }
163
165
  else {
164
166
  switch ([...nodeKinds][0]) {
165
167
  case "BlankNode":
166
168
  identifierType = new BlankNodeType({
167
- alias: Maybe.empty(),
169
+ name: Maybe.empty(),
168
170
  comment: Maybe.empty(),
169
171
  configuration,
170
172
  label: Maybe.empty(),
171
173
  logger: this.logger,
172
174
  reusables,
175
+ shapeIdentifier: dataFactory.blankNode(),
173
176
  });
174
177
  break;
175
178
  case "IRI":
176
179
  identifierType = new IriType({
177
- alias: Maybe.empty(),
180
+ name: Maybe.empty(),
178
181
  comment: Maybe.empty(),
179
182
  configuration,
180
183
  hasValues: [],
@@ -182,12 +185,13 @@ export class TsGenerator {
182
185
  label: Maybe.empty(),
183
186
  logger: this.logger,
184
187
  reusables,
188
+ shapeIdentifier: dataFactory.blankNode(),
185
189
  });
186
190
  break;
187
191
  }
188
192
  }
189
193
  return new ObjectUnionType({
190
- alias: Maybe.of(`${configuration.syntheticNamePrefix}Object`),
194
+ name: Maybe.of(`${configuration.syntheticNamePrefix}Object`),
191
195
  comment: Maybe.empty(),
192
196
  configuration,
193
197
  identifierType: Maybe.of(identifierType),
@@ -199,6 +203,7 @@ export class TsGenerator {
199
203
  })),
200
204
  recursive: false,
201
205
  reusables,
206
+ shapeIdentifier: dataFactory.blankNode(),
202
207
  synthetic: true,
203
208
  });
204
209
  }
@@ -9,9 +9,9 @@ import type { FloatType } from "./FloatType.js";
9
9
  import type { IdentifierType } from "./IdentifierType.js";
10
10
  import type { IntType } from "./IntType.js";
11
11
  import type { IriType } from "./IriType.js";
12
- import type { LazyObjectOptionType } from "./LazyObjectOptionType.js";
13
- import type { LazyObjectSetType } from "./LazyObjectSetType.js";
14
- import type { LazyObjectType } from "./LazyObjectType.js";
12
+ import type { LazyOptionType } from "./LazyOptionType.js";
13
+ import type { LazySetType } from "./LazySetType.js";
14
+ import type { LazyType } from "./LazyType.js";
15
15
  import type { ListType } from "./ListType.js";
16
16
  import type { LiteralType } from "./LiteralType.js";
17
17
  import type { ObjectType } from "./ObjectType.js";
@@ -21,5 +21,5 @@ import type { SetType } from "./SetType.js";
21
21
  import type { StringType } from "./StringType.js";
22
22
  import type { TermType } from "./TermType.js";
23
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 | ObjectUnionType | ObjectType | OptionType<OptionType.ItemType> | SetType<SetType.ItemType> | StringType | TermType | UnionType<Type>;
24
+ export type Type = BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | DefaultValueType<DefaultValueType.ItemType> | FloatType | IdentifierType | IntType | IriType | LazyOptionType | LazySetType | LazyType | ListType<ListType.ItemType> | LiteralType | ObjectUnionType | ObjectType | OptionType<OptionType.ItemType> | SetType<SetType.ItemType> | StringType | TermType | UnionType<Type>;
25
25
  //# sourceMappingURL=Type.d.ts.map
@@ -19,8 +19,8 @@ export declare class TypeFactory {
19
19
  logger: Logger;
20
20
  reusables: Reusables;
21
21
  });
22
- createObjectType(astType: ast.ObjectType): ObjectType;
23
- createObjectUnionType(astType: ast.ObjectUnionType): ObjectUnionType;
22
+ createObjectType(astType: ast.StructType): ObjectType;
23
+ createObjectUnionType(astType: ast.StructUnionType): ObjectUnionType;
24
24
  createType(astType: ast.Type, parameters?: {
25
25
  defaultValue?: Literal | NamedNode;
26
26
  }): Type;
@@ -29,9 +29,9 @@ export declare class TypeFactory {
29
29
  private createDefaultValueType;
30
30
  private createIdentifierType;
31
31
  private createIriType;
32
- private createLazyObjectOptionType;
33
- private createLazyObjectSetType;
34
- private createLazyObjectType;
32
+ private createLazyOptionType;
33
+ private createLazySetType;
34
+ private createLazyType;
35
35
  private createListType;
36
36
  private createLiteralType;
37
37
  private createObjectTypeProperty;
@@ -18,9 +18,9 @@ import { FloatType } from "./FloatType.js";
18
18
  import { IdentifierType } from "./IdentifierType.js";
19
19
  import { IntType } from "./IntType.js";
20
20
  import { IriType } from "./IriType.js";
21
- import { LazyObjectOptionType } from "./LazyObjectOptionType.js";
22
- import { LazyObjectSetType } from "./LazyObjectSetType.js";
23
- import { LazyObjectType } from "./LazyObjectType.js";
21
+ import { LazyOptionType } from "./LazyOptionType.js";
22
+ import { LazySetType } from "./LazySetType.js";
23
+ import { LazyType } from "./LazyType.js";
24
24
  import { ListType } from "./ListType.js";
25
25
  import { LiteralType } from "./LiteralType.js";
26
26
  import { ObjectType } from "./ObjectType.js";
@@ -53,13 +53,12 @@ export class TypeFactory {
53
53
  configuration: this.configuration,
54
54
  logger: this.logger,
55
55
  name: `${this.configuration.syntheticNamePrefix}type`,
56
- objectType: { alias: astType.name },
56
+ objectType: { name: astType.name },
57
57
  reusables: this.reusables,
58
58
  value: name,
59
59
  }));
60
60
  const identifierType = this.createIdentifierType(astType.identifierType);
61
61
  const objectType = new ObjectType({
62
- alias: astType.name.map((name) => this.tsName(name, { synthetic: astType.synthetic })),
63
62
  discriminantProperty,
64
63
  comment: astType.comment,
65
64
  configuration: this.configuration,
@@ -68,7 +67,7 @@ export class TypeFactory {
68
67
  identifierType,
69
68
  label: astType.label,
70
69
  lazyProperties: (objectType) => {
71
- const properties = astType.properties
70
+ const properties = astType.fields
72
71
  .toSorted((left, right) => {
73
72
  if (left.order < right.order) {
74
73
  return -1;
@@ -78,8 +77,8 @@ export class TypeFactory {
78
77
  }
79
78
  return this.tsName(left.name).localeCompare(this.tsName(right.name));
80
79
  })
81
- .map((astProperty) => this.createObjectTypeProperty({
82
- astObjectTypeProperty: astProperty,
80
+ .map((astField) => this.createObjectTypeProperty({
81
+ astStructField: astField,
83
82
  objectType,
84
83
  }));
85
84
  discriminantProperty.ifJust((discriminantProperty) => {
@@ -96,8 +95,10 @@ export class TypeFactory {
96
95
  return properties;
97
96
  },
98
97
  logger: this.logger,
98
+ name: astType.name.map((name) => this.tsName(name, { synthetic: astType.synthetic })),
99
99
  recursive: astType.recursive,
100
100
  reusables: this.reusables,
101
+ shapeIdentifier: astType.shapeIdentifier,
101
102
  synthetic: astType.synthetic,
102
103
  toRdfTypes: astType.toRdfTypes,
103
104
  });
@@ -112,18 +113,19 @@ export class TypeFactory {
112
113
  }
113
114
  }
114
115
  const objectUnionType = new ObjectUnionType({
115
- alias: astType.name.map((name) => this.tsName(name)),
116
116
  comment: astType.comment,
117
117
  configuration: this.configuration,
118
- identifierType: Maybe.of(this.createIdentifierType(ast.ObjectCompoundType.identifierType(astType))),
118
+ identifierType: Maybe.of(this.createIdentifierType(ast.StructCompoundType.identifierType(astType))),
119
119
  label: astType.label,
120
120
  logger: this.logger,
121
- members: ast.ObjectCompoundType.memberObjectTypes(astType).map((namedObjectType) => ({
121
+ members: ast.StructCompoundType.memberStructTypes(astType).map((astStructType) => ({
122
122
  discriminantValue: Maybe.empty(),
123
- type: this.createObjectType(namedObjectType),
123
+ type: this.createObjectType(astStructType),
124
124
  })),
125
+ name: astType.name.map((name) => this.tsName(name)),
125
126
  recursive: astType.recursive,
126
127
  reusables: this.reusables,
128
+ shapeIdentifier: astType.shapeIdentifier,
127
129
  synthetic: astType.synthetic,
128
130
  });
129
131
  this.cachedObjectUnionTypesByShapeIdentifier.set(astType.shapeIdentifier, objectUnionType);
@@ -141,22 +143,22 @@ export class TypeFactory {
141
143
  throw new Error("not implemented");
142
144
  case "Iri":
143
145
  return this.createIriType(astType);
144
- case "LazyObjectOption":
145
- return this.createLazyObjectOptionType(astType);
146
- case "LazyObjectSet":
147
- return this.createLazyObjectSetType(astType);
148
- case "LazyObject":
149
- return this.createLazyObjectType(astType);
146
+ case "Lazy":
147
+ return this.createLazyType(astType);
148
+ case "LazyOption":
149
+ return this.createLazyOptionType(astType);
150
+ case "LazySet":
151
+ return this.createLazySetType(astType);
150
152
  case "List":
151
153
  return this.createListType(astType);
152
154
  case "Literal":
153
155
  return this.createLiteralType(astType, parameters);
154
- case "Object":
155
- return this.createObjectType(astType);
156
156
  case "Option":
157
157
  return this.createOptionType(astType);
158
158
  case "Set":
159
159
  return this.createSetType(astType);
160
+ case "Struct":
161
+ return this.createObjectType(astType);
160
162
  case "Term":
161
163
  return this.createTermType(astType);
162
164
  case "Union":
@@ -164,11 +166,10 @@ export class TypeFactory {
164
166
  }
165
167
  }
166
168
  createUnionType(astType) {
167
- if (astType.isObjectUnionType()) {
169
+ if (astType.isStructUnionType()) {
168
170
  return this.createObjectUnionType(astType);
169
171
  }
170
172
  return new UnionType({
171
- alias: astType.name.map((name) => this.tsName(name)),
172
173
  comment: astType.comment,
173
174
  configuration: this.configuration,
174
175
  identifierType: Maybe.empty(),
@@ -178,19 +179,22 @@ export class TypeFactory {
178
179
  discriminantValue: member.discriminantValue,
179
180
  type: this.createType(member.type),
180
181
  })),
182
+ name: astType.name.map((name) => this.tsName(name)),
181
183
  recursive: astType.recursive,
182
184
  reusables: this.reusables,
185
+ shapeIdentifier: astType.shapeIdentifier,
183
186
  synthetic: astType.synthetic,
184
187
  });
185
188
  }
186
189
  createBlankNodeType(astType) {
187
190
  return new BlankNodeType({
188
- alias: astType.name.map((name) => this.tsName(name)),
189
191
  comment: astType.comment,
190
192
  configuration: this.configuration,
191
193
  label: astType.label,
192
194
  logger: this.logger,
195
+ name: astType.name.map((name) => this.tsName(name)),
193
196
  reusables: this.reusables,
197
+ shapeIdentifier: astType.shapeIdentifier,
194
198
  });
195
199
  }
196
200
  createDefaultValueType(astType) {
@@ -199,14 +203,15 @@ export class TypeFactory {
199
203
  });
200
204
  invariant(DefaultValueType.isItemType(itemType));
201
205
  return new DefaultValueType({
202
- alias: astType.name.map((name) => this.tsName(name)),
203
206
  comment: astType.comment,
204
207
  configuration: this.configuration,
205
208
  defaultValue: astType.defaultValue,
206
209
  itemType,
207
210
  label: astType.label,
208
211
  logger: this.logger,
212
+ name: astType.name.map((name) => this.tsName(name)),
209
213
  reusables: this.reusables,
214
+ shapeIdentifier: astType.shapeIdentifier,
210
215
  });
211
216
  }
212
217
  createIdentifierType(astType) {
@@ -215,12 +220,13 @@ export class TypeFactory {
215
220
  return this.createBlankNodeType(astType);
216
221
  case "Identifier":
217
222
  return new IdentifierType({
218
- alias: astType.name.map((name) => this.tsName(name)),
219
223
  comment: astType.comment,
220
224
  configuration: this.configuration,
221
225
  label: astType.label,
222
226
  logger: this.logger,
227
+ name: astType.name.map((name) => this.tsName(name)),
223
228
  reusables: this.reusables,
229
+ shapeIdentifier: astType.shapeIdentifier,
224
230
  });
225
231
  case "Iri":
226
232
  return this.createIriType(astType);
@@ -228,57 +234,60 @@ export class TypeFactory {
228
234
  }
229
235
  createIriType(astType) {
230
236
  return new IriType({
231
- alias: astType.name.map((name) => this.tsName(name)),
232
237
  comment: astType.comment,
233
238
  configuration: this.configuration,
234
239
  hasValues: astType.hasValues,
235
240
  in_: astType.in_,
236
241
  label: astType.label,
237
242
  logger: this.logger,
243
+ name: astType.name.map((name) => this.tsName(name)),
238
244
  reusables: this.reusables,
245
+ shapeIdentifier: astType.shapeIdentifier,
239
246
  });
240
247
  }
241
- createLazyObjectOptionType(astType) {
242
- return new LazyObjectOptionType({
243
- alias: astType.name.map((name) => this.tsName(name)),
248
+ createLazyOptionType(astType) {
249
+ return new LazyOptionType({
244
250
  comment: astType.comment,
245
251
  configuration: this.configuration,
246
252
  label: astType.label,
247
253
  logger: this.logger,
254
+ name: astType.name.map((name) => this.tsName(name)),
248
255
  partialType: this.createOptionType(astType.partialType),
249
256
  resolveType: this.createOptionType(astType.resolveType),
250
257
  reusables: this.reusables,
258
+ shapeIdentifier: astType.shapeIdentifier,
251
259
  });
252
260
  }
253
- createLazyObjectSetType(astType) {
254
- return new LazyObjectSetType({
255
- alias: astType.name.map((name) => this.tsName(name)),
261
+ createLazySetType(astType) {
262
+ return new LazySetType({
256
263
  comment: astType.comment,
257
264
  configuration: this.configuration,
258
265
  label: astType.label,
259
266
  logger: this.logger,
267
+ name: astType.name.map((name) => this.tsName(name)),
260
268
  partialType: this.createSetType(astType.partialType),
261
269
  resolveType: this.createSetType(astType.resolveType),
262
270
  reusables: this.reusables,
271
+ shapeIdentifier: astType.shapeIdentifier,
263
272
  });
264
273
  }
265
- createLazyObjectType(astType) {
266
- return new LazyObjectType({
267
- alias: astType.name.map((name) => this.tsName(name)),
274
+ createLazyType(astType) {
275
+ return new LazyType({
268
276
  comment: astType.comment,
269
277
  configuration: this.configuration,
270
278
  label: astType.label,
271
279
  logger: this.logger,
280
+ name: astType.name.map((name) => this.tsName(name)),
272
281
  partialType: this.createType(astType.partialType),
273
282
  resolveType: this.createType(astType.resolveType),
274
283
  reusables: this.reusables,
284
+ shapeIdentifier: astType.shapeIdentifier,
275
285
  });
276
286
  }
277
287
  createListType(astType) {
278
288
  const itemType = this.createType(astType.itemType);
279
289
  invariant(ListType.isItemType(itemType));
280
290
  return new ListType({
281
- alias: astType.name.map((name) => this.tsName(name)),
282
291
  comment: astType.comment,
283
292
  configuration: this.configuration,
284
293
  identifierNodeKind: astType.identifierNodeKind,
@@ -286,7 +295,9 @@ export class TypeFactory {
286
295
  label: astType.label,
287
296
  logger: this.logger,
288
297
  mutable: astType.mutable,
298
+ name: astType.name.map((name) => this.tsName(name)),
289
299
  reusables: this.reusables,
300
+ shapeIdentifier: astType.shapeIdentifier,
290
301
  toRdfTypes: astType.toRdfTypes,
291
302
  });
292
303
  }
@@ -315,7 +326,6 @@ export class TypeFactory {
315
326
  switch (datatypeDefinition.kind) {
316
327
  case "bigdecimal":
317
328
  return new BigDecimalType({
318
- alias: astType.name.map((name) => this.tsName(name)),
319
329
  comment: astType.comment,
320
330
  configuration: this.configuration,
321
331
  hasValues: astType.hasValues,
@@ -323,11 +333,12 @@ export class TypeFactory {
323
333
  label: astType.label,
324
334
  languageIn: [],
325
335
  logger: this.logger,
336
+ name: astType.name.map((name) => this.tsName(name)),
326
337
  reusables: this.reusables,
338
+ shapeIdentifier: astType.shapeIdentifier,
327
339
  });
328
340
  case "bigint":
329
341
  return new BigIntType({
330
- alias: astType.name.map((name) => this.tsName(name)),
331
342
  comment: astType.comment,
332
343
  configuration: this.configuration,
333
344
  datatype,
@@ -336,12 +347,13 @@ export class TypeFactory {
336
347
  label: astType.label,
337
348
  languageIn: [],
338
349
  logger: this.logger,
350
+ name: astType.name.map((name) => this.tsName(name)),
339
351
  primitiveIn: astType.in_.map((value) => LiteralDecoder.decodeBigIntLiteral(value).unsafeCoerce()),
340
352
  reusables: this.reusables,
353
+ shapeIdentifier: astType.shapeIdentifier,
341
354
  });
342
355
  case "boolean":
343
356
  return new BooleanType({
344
- alias: astType.name.map((name) => this.tsName(name)),
345
357
  comment: astType.comment,
346
358
  configuration: this.configuration,
347
359
  datatype,
@@ -350,13 +362,14 @@ export class TypeFactory {
350
362
  languageIn: [],
351
363
  in_: astType.in_,
352
364
  logger: this.logger,
365
+ name: astType.name.map((name) => this.tsName(name)),
353
366
  primitiveIn: astType.in_.map((value) => LiteralDecoder.decodeBooleanLiteral(value).unsafeCoerce()),
354
367
  reusables: this.reusables,
368
+ shapeIdentifier: astType.shapeIdentifier,
355
369
  });
356
370
  case "date":
357
371
  case "datetime":
358
372
  return new (datatypeDefinition.kind === "date" ? DateType : DateTimeType)({
359
- alias: astType.name.map((name) => this.tsName(name)),
360
373
  comment: astType.comment,
361
374
  configuration: this.configuration,
362
375
  datatype,
@@ -365,15 +378,16 @@ export class TypeFactory {
365
378
  label: astType.label,
366
379
  languageIn: [],
367
380
  logger: this.logger,
381
+ name: astType.name.map((name) => this.tsName(name)),
368
382
  primitiveIn: astType.in_.map((value) => (datatypeDefinition.kind === "date"
369
383
  ? LiteralDecoder.decodeDateLiteral
370
384
  : LiteralDecoder.decodeDateTimeLiteral)(value).unsafeCoerce()),
371
385
  reusables: this.reusables,
386
+ shapeIdentifier: astType.shapeIdentifier,
372
387
  });
373
388
  case "float":
374
389
  case "int":
375
390
  return new (datatypeDefinition.kind === "float" ? FloatType : IntType)({
376
- alias: astType.name.map((name) => this.tsName(name)),
377
391
  comment: astType.comment,
378
392
  configuration: this.configuration,
379
393
  datatype,
@@ -382,15 +396,16 @@ export class TypeFactory {
382
396
  label: astType.label,
383
397
  languageIn: [],
384
398
  logger: this.logger,
399
+ name: astType.name.map((name) => this.tsName(name)),
385
400
  primitiveIn: astType.in_.map((value) => (datatypeDefinition.kind === "float"
386
401
  ? LiteralDecoder.decodeFloatLiteral
387
402
  : LiteralDecoder.decodeIntLiteral)(value).unsafeCoerce()),
388
403
  reusables: this.reusables,
404
+ shapeIdentifier: astType.shapeIdentifier,
389
405
  });
390
406
  case "string":
391
407
  if (!datatype.equals(rdf.langString)) {
392
408
  return new StringType({
393
- alias: astType.name.map((name) => this.tsName(name)),
394
409
  comment: astType.comment,
395
410
  configuration: this.configuration,
396
411
  datatype,
@@ -399,8 +414,10 @@ export class TypeFactory {
399
414
  label: astType.label,
400
415
  languageIn: astType.languageIn,
401
416
  logger: this.logger,
417
+ name: astType.name.map((name) => this.tsName(name)),
402
418
  primitiveIn: astType.in_.map((value) => value.value),
403
419
  reusables: this.reusables,
420
+ shapeIdentifier: astType.shapeIdentifier,
404
421
  });
405
422
  }
406
423
  break;
@@ -420,7 +437,6 @@ export class TypeFactory {
420
437
  // // this.logger.debug("literal type has no datatypes");
421
438
  // }
422
439
  return new LiteralType({
423
- alias: astType.name.map((name) => this.tsName(name)),
424
440
  comment: astType.comment,
425
441
  configuration: this.configuration,
426
442
  hasValues: astType.hasValues,
@@ -428,52 +444,54 @@ export class TypeFactory {
428
444
  label: astType.label,
429
445
  languageIn: astType.languageIn,
430
446
  logger: this.logger,
447
+ name: astType.name.map((name) => this.tsName(name)),
431
448
  reusables: this.reusables,
449
+ shapeIdentifier: astType.shapeIdentifier,
432
450
  });
433
451
  }
434
- createObjectTypeProperty({ astObjectTypeProperty, objectType, }) {
452
+ createObjectTypeProperty({ astStructField, objectType, }) {
435
453
  {
436
- const cachedProperty = this.cachedObjectTypePropertiesByShapeIdentifier.get(astObjectTypeProperty.shapeIdentifier);
454
+ const cachedProperty = this.cachedObjectTypePropertiesByShapeIdentifier.get(astStructField.shapeIdentifier);
437
455
  if (cachedProperty) {
438
456
  return cachedProperty;
439
457
  }
440
458
  }
441
459
  const property = new ObjectType.ShaclProperty({
442
- comment: astObjectTypeProperty.comment,
460
+ comment: astStructField.comment,
443
461
  configuration: this.configuration,
444
- description: astObjectTypeProperty.description,
445
- display: astObjectTypeProperty.display,
446
- label: astObjectTypeProperty.label,
462
+ description: astStructField.description,
463
+ display: astStructField.display,
464
+ label: astStructField.label,
447
465
  logger: this.logger,
448
- mutable: astObjectTypeProperty.mutable,
466
+ mutable: astStructField.mutable,
467
+ name: this.tsName(astStructField.name),
449
468
  objectType,
450
- name: this.tsName(astObjectTypeProperty.name),
451
- path: astObjectTypeProperty.path,
452
- recursive: !!astObjectTypeProperty.recursive,
469
+ path: astStructField.path,
470
+ recursive: !!astStructField.recursive,
453
471
  reusables: this.reusables,
454
- type: this.createType(astObjectTypeProperty.type),
472
+ type: this.createType(astStructField.type),
455
473
  });
456
- this.cachedObjectTypePropertiesByShapeIdentifier.set(astObjectTypeProperty.shapeIdentifier, property);
474
+ this.cachedObjectTypePropertiesByShapeIdentifier.set(astStructField.shapeIdentifier, property);
457
475
  return property;
458
476
  }
459
477
  createOptionType(astType) {
460
478
  const itemType = this.createType(astType.itemType);
461
479
  invariant(OptionType.isItemType(itemType));
462
480
  return new OptionType({
463
- alias: astType.name.map((name) => this.tsName(name)),
464
481
  comment: astType.comment,
465
482
  configuration: this.configuration,
466
483
  itemType,
467
484
  label: astType.label,
468
485
  logger: this.logger,
486
+ name: astType.name.map((name) => this.tsName(name)),
469
487
  reusables: this.reusables,
488
+ shapeIdentifier: astType.shapeIdentifier,
470
489
  });
471
490
  }
472
491
  createSetType(astType) {
473
492
  const itemType = this.createType(astType.itemType);
474
493
  invariant(SetType.isItemType(itemType));
475
494
  return new SetType({
476
- alias: astType.name.map((name) => this.tsName(name)),
477
495
  comment: astType.comment,
478
496
  configuration: this.configuration,
479
497
  itemType,
@@ -481,20 +499,23 @@ export class TypeFactory {
481
499
  logger: this.logger,
482
500
  mutable: astType.mutable,
483
501
  minCount: astType.minCount,
502
+ name: astType.name.map((name) => this.tsName(name)),
484
503
  reusables: this.reusables,
504
+ shapeIdentifier: astType.shapeIdentifier,
485
505
  });
486
506
  }
487
507
  createTermType(astType) {
488
508
  return new TermType({
489
- alias: astType.name.map((name) => this.tsName(name)),
490
509
  comment: astType.comment,
491
510
  configuration: this.configuration,
492
511
  hasValues: astType.hasValues,
493
512
  in_: astType.in_,
494
513
  label: astType.label,
495
514
  logger: this.logger,
515
+ name: astType.name.map((name) => this.tsName(name)),
496
516
  nodeKinds: astType.nodeKinds,
497
517
  reusables: this.reusables,
518
+ shapeIdentifier: astType.shapeIdentifier,
498
519
  });
499
520
  }
500
521
  tsName(name, options) {