@shaclmate/compiler 4.0.41 → 4.0.43

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 +11 -43
  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 +9 -4
  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 +511 -386
  256. package/dist/input/generated.js +1780 -2293
  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,21 +10,22 @@ import { Memoize } from "typescript-memoize";
10
10
  import { AbstractType } from "./AbstractType.js";
11
11
  import { arrayEquals } from "./equals.js";
12
12
  import { Type } from "./Type.js";
13
- export class ObjectType extends AbstractType {
13
+ export class StructType extends AbstractType {
14
14
  /**
15
- * Properties of this ObjectType.
15
+ * Fields of this StructType.
16
16
  *
17
17
  * Mutable to support cycle-handling logic in the compiler.
18
18
  */
19
- #properties = [];
19
+ #fields = [];
20
+ fieldNames = new Set();
20
21
  /**
21
- * If true, the code for this ObjectType is defined externally and should not be generated.
22
+ * If true, the code for this StructType is defined externally and should not be generated.
22
23
  *
23
24
  * Defaults to false.
24
25
  */
25
26
  extern;
26
27
  /**
27
- * The expected rdf:type of instances of this ObjectType.
28
+ * The expected rdf:type of instances of this StructType.
28
29
  *
29
30
  * This is usually the identifier of an sh:NodeShape that is also an rdfs:Class (i.e., a node shape with implicit
30
31
  * class targets).
@@ -37,7 +38,7 @@ export class ObjectType extends AbstractType {
37
38
  /**
38
39
  * Type discriminant.
39
40
  */
40
- kind = "Object";
41
+ kind = "Struct";
41
42
  nodeKinds = nodeKinds;
42
43
  /**
43
44
  * Was this type synthesized or did it come from SHACL?
@@ -53,7 +54,7 @@ export class ObjectType extends AbstractType {
53
54
  /**
54
55
  * TypeScript imports to add to generated code.
55
56
  *
56
- * This is often used in conjunction with extern=true to import the extern'd ObjectType code in order for generated
57
+ * This is often used in conjunction with extern=true to import the extern'd StructType code in order for generated
57
58
  * code to reference it.
58
59
  *
59
60
  * import { MyType } from "./MyType.js"
@@ -68,24 +69,26 @@ export class ObjectType extends AbstractType {
68
69
  this.toRdfTypes = toRdfTypes;
69
70
  this.tsImports = tsImports;
70
71
  }
71
- get properties() {
72
- return this.#properties;
72
+ get fields() {
73
+ return this.#fields;
73
74
  }
74
75
  get recursive() {
75
- return this.properties.some((property) => property.recursive);
76
+ return this.fields.some((field) => field.recursive);
76
77
  }
77
- addProperties(...properties) {
78
- this.#properties.push(...properties);
79
- for (const property of properties) {
80
- invariant(Object.is(property.objectType, this));
78
+ addFields(...fields) {
79
+ for (const field of fields) {
80
+ invariant(Object.is(field.structType, this), "field has unexpected .structType");
81
+ invariant(!this.fieldNames.has(field.name), `${field.structType.shapeIdentifier}: duplicate field name: ${field.name}`);
82
+ this.#fields.push(field);
83
+ this.fieldNames.add(field.name);
81
84
  }
82
85
  }
83
86
  equals(other) {
84
87
  // Don't recurse
85
88
  return this.shapeIdentifier.equals(other.shapeIdentifier);
86
89
  }
87
- sortProperties() {
88
- this.#properties.sort((left, right) => {
90
+ sortFields() {
91
+ this.#fields.sort((left, right) => {
89
92
  if (left.order < right.order) {
90
93
  return -1;
91
94
  }
@@ -106,8 +109,8 @@ export class ObjectType extends AbstractType {
106
109
  }
107
110
  }
108
111
  const nodeKinds = new Set(["BlankNode", "IRI"]);
109
- (function (ObjectType) {
110
- class Property {
112
+ (function (StructType) {
113
+ class Field {
111
114
  /**
112
115
  * Documentation comment from rdfs:comment.
113
116
  */
@@ -117,7 +120,7 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
117
120
  */
118
121
  description;
119
122
  /**
120
- * Should the property and its value be displayed in a toString()-type representation?
123
+ * Should the field and its value be displayed in a toString()-type representation?
121
124
  */
122
125
  display;
123
126
  /**
@@ -125,42 +128,42 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
125
128
  */
126
129
  label;
127
130
  /**
128
- * The property should be mutable in generated code i.e., it should be re-assignable. The property value may or may
131
+ * The field should be mutable in generated code i.e., it should be re-assignable. The field value may or may
129
132
  * not be mutable.
130
133
  */
131
134
  mutable;
132
135
  /**
133
- * Name of this property, derived from sh:name or shaclmate:name.
136
+ * Name of this field, derived from sh:name or shaclmate:name.
134
137
  */
135
138
  name;
136
139
  /**
137
- * Object type this property belongs to.
138
- */
139
- objectType;
140
- /**
141
- * Relative order of this property, derived from sh:order.
140
+ * Relative order of this field, derived from sh:order.
142
141
  */
143
142
  order;
144
143
  /**
145
- * SHACL property path (https://www.w3.org/TR/shacl/#property-paths)
144
+ * SHACL property path (https://www.w3.org/TR/shacl/#field-paths)
146
145
  */
147
146
  path;
148
147
  /**
149
- * Identifier of the property shape.
148
+ * Identifier of the field shape.
150
149
  */
151
150
  shapeIdentifier;
152
151
  /**
153
- * Type of this property.
152
+ * StructType this field belongs to.
153
+ */
154
+ structType;
155
+ /**
156
+ * Type of this field.
154
157
  */
155
158
  type;
156
- constructor({ comment, description, display, label, mutable, name, objectType, order, path, shapeIdentifier, type, }) {
159
+ constructor({ comment, description, display, label, mutable, name, order, path, shapeIdentifier, structType, type, }) {
157
160
  this.comment = comment;
158
161
  this.description = description;
159
162
  this.display = display;
160
163
  this.label = label;
161
164
  this.mutable = mutable;
162
165
  this.name = name;
163
- this.objectType = objectType;
166
+ this.structType = structType;
164
167
  this.order = order;
165
168
  this.path = path;
166
169
  this.shapeIdentifier = shapeIdentifier;
@@ -170,35 +173,35 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
170
173
  return this.shapeIdentifier.equals(other.shapeIdentifier);
171
174
  }
172
175
  /**
173
- * Does the property directly or indirectly reference the ObjectType itself?
176
+ * Does the field directly or indirectly reference the StructType itself?
174
177
  */
175
178
  get recursive() {
176
179
  const DEBUG = false;
177
- const rootObjectType = this.objectType;
178
- const rootProperty = this;
180
+ const rootField = this;
181
+ const rootStructType = this.structType;
179
182
  function helper(stack) {
180
183
  const currentStackFrame = stack.at(-1);
181
- const { objectType, property, propertyType } = currentStackFrame;
184
+ const { field, fieldType, structType } = currentStackFrame;
182
185
  if (DEBUG) {
183
186
  process.stderr.write(`${[
184
187
  stack.length.toString(),
185
- rootObjectType,
186
- rootProperty,
187
- objectType,
188
- property,
189
- propertyType
190
- ? `[${propertyType.map(Type.toString).join(", ")}]`
188
+ rootField,
189
+ rootStructType,
190
+ field,
191
+ fieldType
192
+ ? `[${fieldType.map(Type.toString).join(", ")}]`
191
193
  : "undefined",
194
+ structType,
192
195
  ].join(",")}\n`);
193
196
  }
194
197
  for (const lowerStackFrame of stack.slice(0, -1)) {
195
- if (!Type.equals(currentStackFrame.objectType, lowerStackFrame.objectType)) {
198
+ if (!Type.equals(currentStackFrame.structType, lowerStackFrame.structType)) {
196
199
  continue;
197
200
  }
198
- if (!currentStackFrame.property.equals(lowerStackFrame.property)) {
201
+ if (!currentStackFrame.field.equals(lowerStackFrame.field)) {
199
202
  continue;
200
203
  }
201
- if (!arrayEquals(Type.equals)(currentStackFrame.propertyType ?? [], lowerStackFrame.propertyType ?? [])) {
204
+ if (!arrayEquals(Type.equals)(currentStackFrame.fieldType ?? [], lowerStackFrame.fieldType ?? [])) {
202
205
  continue;
203
206
  }
204
207
  // We've seen this combination before and don't want to recurse further, to avoid infinite recursion
@@ -207,49 +210,49 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
207
210
  }
208
211
  return true;
209
212
  }
210
- if (!propertyType) {
213
+ if (!fieldType) {
211
214
  return helper(stack.concat({
212
- objectType,
213
- property,
214
- propertyType: [property.type],
215
+ field,
216
+ fieldType: [field.type],
217
+ structType,
215
218
  }));
216
219
  }
217
- invariant(propertyType.length > 0);
218
- const currentPropertyType = propertyType.at(-1);
219
- switch (currentPropertyType.kind) {
220
+ invariant(fieldType.length > 0);
221
+ const currentFieldType = fieldType.at(-1);
222
+ switch (currentFieldType.kind) {
220
223
  case "BlankNode":
221
224
  case "Identifier":
222
225
  case "Iri":
223
226
  case "Literal":
224
227
  case "Term":
225
228
  return false;
226
- case "LazyObjectOption":
227
- case "LazyObjectSet":
228
- case "LazyObject": {
229
+ case "LazyOption":
230
+ case "LazySet":
231
+ case "Lazy": {
229
232
  if (helper(stack.concat({
230
- objectType,
231
- property,
232
- propertyType: propertyType.concat(currentPropertyType.partialType),
233
+ field,
234
+ fieldType: fieldType.concat(currentFieldType.partialType),
235
+ structType,
233
236
  }))) {
234
237
  return true;
235
238
  }
236
239
  if (helper(stack.concat({
237
- objectType,
238
- property,
239
- propertyType: propertyType.concat(currentPropertyType.resolveType),
240
+ field,
241
+ fieldType: fieldType.concat(currentFieldType.resolveType),
242
+ structType,
240
243
  }))) {
241
244
  return true;
242
245
  }
243
246
  return false;
244
247
  }
245
- case "Object": {
248
+ case "Struct": {
246
249
  if (DEBUG) {
247
- process.stderr.write(`recurse into ${currentPropertyType}`);
250
+ process.stderr.write(`recurse into ${currentFieldType}`);
248
251
  }
249
- for (const property of currentPropertyType.properties) {
252
+ for (const field of currentFieldType.fields) {
250
253
  if (helper(stack.concat({
251
- objectType: currentPropertyType,
252
- property,
254
+ structType: currentFieldType,
255
+ field,
253
256
  }))) {
254
257
  return true;
255
258
  }
@@ -259,13 +262,13 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
259
262
  case "Intersection":
260
263
  case "Union": {
261
264
  if (DEBUG) {
262
- process.stderr.write(`recurse into ${currentPropertyType}`);
265
+ process.stderr.write(`recurse into ${currentFieldType}`);
263
266
  }
264
- for (const member of currentPropertyType.members) {
267
+ for (const member of currentFieldType.members) {
265
268
  if (helper(stack.concat({
266
- objectType,
267
- property,
268
- propertyType: propertyType.concat(member.type),
269
+ field,
270
+ fieldType: fieldType.concat(member.type),
271
+ structType,
269
272
  }))) {
270
273
  return true;
271
274
  }
@@ -277,13 +280,13 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
277
280
  case "Option":
278
281
  case "Set":
279
282
  return helper(stack.concat({
280
- objectType,
281
- property,
282
- propertyType: propertyType.concat(currentPropertyType.itemType),
283
+ field,
284
+ fieldType: fieldType.concat(currentFieldType.itemType),
285
+ structType,
283
286
  }));
284
287
  }
285
288
  }
286
- return helper([{ objectType: rootObjectType, property: rootProperty }]);
289
+ return helper([{ structType: rootStructType, field: rootField }]);
287
290
  }
288
291
  toJSON() {
289
292
  return {
@@ -305,7 +308,7 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
305
308
  }
306
309
  __decorate([
307
310
  Memoize()
308
- ], Property.prototype, "recursive", null);
309
- ObjectType.Property = Property;
310
- })(ObjectType || (ObjectType = {}));
311
- //# sourceMappingURL=ObjectType.js.map
311
+ ], Field.prototype, "recursive", null);
312
+ StructType.Field = Field;
313
+ })(StructType || (StructType = {}));
314
+ //# sourceMappingURL=StructType.js.map
@@ -0,0 +1,4 @@
1
+ import type { StructType } from "./StructType.js";
2
+ import type { UnionType } from "./UnionType.js";
3
+ export type StructUnionType = UnionType<UnionType<StructType> | StructType>;
4
+ //# sourceMappingURL=StructUnionType.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StructUnionType.js.map
@@ -3,17 +3,17 @@ import type { DefaultValueType } from "./DefaultValueType.js";
3
3
  import type { IdentifierType } from "./IdentifierType.js";
4
4
  import type { IntersectionType } from "./IntersectionType.js";
5
5
  import type { IriType } from "./IriType.js";
6
- import type { LazyObjectOptionType } from "./LazyObjectOptionType.js";
7
- import type { LazyObjectSetType } from "./LazyObjectSetType.js";
8
- import type { LazyObjectType } from "./LazyObjectType.js";
6
+ import type { LazyOptionType } from "./LazyOptionType.js";
7
+ import type { LazySetType } from "./LazySetType.js";
8
+ import type { LazyType } from "./LazyType.js";
9
9
  import type { ListType } from "./ListType.js";
10
10
  import type { LiteralType } from "./LiteralType.js";
11
- import type { ObjectType } from "./ObjectType.js";
12
11
  import type { OptionType } from "./OptionType.js";
13
12
  import type { SetType } from "./SetType.js";
13
+ import type { StructType } from "./StructType.js";
14
14
  import type { TermType } from "./TermType.js";
15
15
  import type { UnionType } from "./UnionType.js";
16
- export type Type = BlankNodeType | DefaultValueType | IdentifierType | IntersectionType | IriType | LazyObjectOptionType | LazyObjectSetType | LazyObjectType | ListType | LiteralType | ObjectType | OptionType | SetType | TermType | UnionType;
16
+ export type Type = BlankNodeType | DefaultValueType | IdentifierType | IntersectionType | IriType | LazyOptionType | LazySetType | LazyType | ListType | LiteralType | StructType | OptionType | SetType | TermType | UnionType;
17
17
  export declare namespace Type {
18
18
  function equals(left: Type, right: Type): boolean;
19
19
  }
package/dist/ast/Type.js CHANGED
@@ -17,15 +17,15 @@ export var Type;
17
17
  return left.equals(right);
18
18
  case "Literal":
19
19
  return left.equals(right);
20
- case "LazyObjectOption":
20
+ case "LazyOption":
21
21
  return left.equals(right);
22
- case "LazyObjectSet":
22
+ case "LazySet":
23
23
  return left.equals(right);
24
- case "LazyObject":
24
+ case "Lazy":
25
25
  return left.equals(right);
26
26
  case "List":
27
27
  return left.equals(right);
28
- case "Object":
28
+ case "Struct":
29
29
  return left.equals(right);
30
30
  case "Option":
31
31
  return left.equals(right);
@@ -1,12 +1,12 @@
1
1
  import type { Maybe } from "purify-ts";
2
2
  import { AbstractCompoundType } from "./AbstractCompoundType.js";
3
- import type { ObjectUnionType } from "./ObjectUnionType.js";
3
+ import type { StructUnionType } from "./StructUnionType.js";
4
4
  /**
5
5
  * A disjunction/union of types, corresponding to an sh:xone.
6
6
  */
7
7
  export declare class UnionType<MemberTypeT extends UnionType.MemberType = UnionType.MemberType> extends AbstractCompoundType<UnionType.Member<MemberTypeT>, MemberTypeT> {
8
8
  readonly kind = "Union";
9
- isObjectUnionType(): this is ObjectUnionType;
9
+ isStructUnionType(): this is StructUnionType;
10
10
  toJSON(): {
11
11
  members: {
12
12
  discriminantValue: string | number | undefined;
@@ -4,10 +4,10 @@ import { AbstractCompoundType } from "./AbstractCompoundType.js";
4
4
  */
5
5
  export class UnionType extends AbstractCompoundType {
6
6
  kind = "Union";
7
- isObjectUnionType() {
7
+ isStructUnionType() {
8
8
  return (this.members.length > 0 &&
9
- this.members.every((member) => member.type.kind === "Object" ||
10
- (member.type.kind === "Union" && member.type.isObjectUnionType())));
9
+ this.members.every((member) => member.type.kind === "Struct" ||
10
+ (member.type.kind === "Union" && member.type.isStructUnionType())));
11
11
  }
12
12
  toJSON() {
13
13
  return {
@@ -4,17 +4,17 @@ export * from "./DefaultValueType.js";
4
4
  export * from "./IdentifierType.js";
5
5
  export * from "./IntersectionType.js";
6
6
  export * from "./IriType.js";
7
- export * from "./LazyObjectOptionType.js";
8
- export * from "./LazyObjectSetType.js";
9
- export * from "./LazyObjectType.js";
7
+ export * from "./LazyOptionType.js";
8
+ export * from "./LazySetType.js";
9
+ export * from "./LazyType.js";
10
10
  export * from "./ListType.js";
11
11
  export * from "./LiteralType.js";
12
- export * from "./ObjectCompoundType.js";
13
- export * from "./ObjectIntersectionType.js";
14
- export * from "./ObjectType.js";
15
- export * from "./ObjectUnionType.js";
16
12
  export * from "./OptionType.js";
17
13
  export * from "./SetType.js";
14
+ export * from "./StructCompoundType.js";
15
+ export * from "./StructIntersectionType.js";
16
+ export * from "./StructType.js";
17
+ export * from "./StructUnionType.js";
18
18
  export * from "./TermType.js";
19
19
  export * from "./Type.js";
20
20
  export * from "./UnionType.js";
package/dist/ast/index.js CHANGED
@@ -4,17 +4,17 @@ export * from "./DefaultValueType.js";
4
4
  export * from "./IdentifierType.js";
5
5
  export * from "./IntersectionType.js";
6
6
  export * from "./IriType.js";
7
- export * from "./LazyObjectOptionType.js";
8
- export * from "./LazyObjectSetType.js";
9
- export * from "./LazyObjectType.js";
7
+ export * from "./LazyOptionType.js";
8
+ export * from "./LazySetType.js";
9
+ export * from "./LazyType.js";
10
10
  export * from "./ListType.js";
11
11
  export * from "./LiteralType.js";
12
- export * from "./ObjectCompoundType.js";
13
- export * from "./ObjectIntersectionType.js";
14
- export * from "./ObjectType.js";
15
- export * from "./ObjectUnionType.js";
16
12
  export * from "./OptionType.js";
17
13
  export * from "./SetType.js";
14
+ export * from "./StructCompoundType.js";
15
+ export * from "./StructIntersectionType.js";
16
+ export * from "./StructType.js";
17
+ export * from "./StructUnionType.js";
18
18
  export * from "./TermType.js";
19
19
  export * from "./Type.js";
20
20
  export * from "./UnionType.js";
@@ -3,9 +3,9 @@ export class AstJsonGenerator {
3
3
  return JSON.stringify({
4
4
  namedTypes: ast.namedTypes.map((namedType) => ({
5
5
  ...namedType.toJSON(),
6
- ...(namedType.kind === "Object"
6
+ ...(namedType.kind === "Struct"
7
7
  ? {
8
- properties: namedType.properties.map((property) => property.toJSON()),
8
+ properties: namedType.fields.map((property) => property.toJSON()),
9
9
  }
10
10
  : {}),
11
11
  })),
@@ -3,13 +3,13 @@ export function transformAstToLabeledPropertyGraph(ast) {
3
3
  const nodes = [];
4
4
  const relationships = [];
5
5
  for (const namedType of ast.namedTypes) {
6
- if (namedType.kind === "Object") {
7
- const namedObjectType = namedType;
6
+ if (namedType.kind === "Struct") {
7
+ const namedStructType = namedType;
8
8
  const id = typeId(namedType);
9
9
  const properties = {
10
10
  name: { type: "string", value: typeName(namedType) },
11
11
  };
12
- for (const namedObjectTypeProperty of namedObjectType.properties) {
12
+ for (const namedObjectTypeProperty of namedStructType.fields) {
13
13
  let itemType;
14
14
  switch (namedObjectTypeProperty.type.kind) {
15
15
  case "DefaultValue":
@@ -18,11 +18,11 @@ export function transformAstToLabeledPropertyGraph(ast) {
18
18
  case "Set":
19
19
  itemType = namedObjectTypeProperty.type.itemType;
20
20
  break;
21
- case "LazyObject":
21
+ case "Lazy":
22
22
  itemType = namedObjectTypeProperty.type.resolveType;
23
23
  break;
24
- case "LazyObjectOption":
25
- case "LazyObjectSet":
24
+ case "LazyOption":
25
+ case "LazySet":
26
26
  itemType = namedObjectTypeProperty.type.resolveType.itemType;
27
27
  break;
28
28
  default:
@@ -31,7 +31,7 @@ export function transformAstToLabeledPropertyGraph(ast) {
31
31
  }
32
32
  switch (itemType.kind) {
33
33
  case "Intersection":
34
- case "Object":
34
+ case "Struct":
35
35
  case "Union":
36
36
  if (itemType.name.isJust()) {
37
37
  relationships.push({
@@ -52,7 +52,7 @@ export function transformAstToLabeledPropertyGraph(ast) {
52
52
  }
53
53
  nodes.push({
54
54
  id,
55
- label: typeName(namedObjectType),
55
+ label: typeName(namedStructType),
56
56
  properties: properties,
57
57
  });
58
58
  }
@@ -35,7 +35,7 @@ export declare abstract class AbstractContainerType<ItemTypeT extends AbstractCo
35
35
  itemType: ItemTypeT;
36
36
  } & ConstructorParameters<typeof AbstractType>[0]);
37
37
  get recursive(): boolean;
38
- get referencesObjectType(): boolean;
38
+ get referencesNamedType(): boolean;
39
39
  protected get itemConversionFunctionDefault(): AbstractType.ConversionFunction;
40
40
  protected get itemValidationFunctionDefault(): Code;
41
41
  protected get schemaInitializers(): readonly Code[];
@@ -26,8 +26,8 @@ export class AbstractContainerType extends AbstractType {
26
26
  get recursive() {
27
27
  return this.itemType.recursive;
28
28
  }
29
- get referencesObjectType() {
30
- return this.itemType.referencesObjectType;
29
+ get referencesNamedType() {
30
+ return this.name.isJust() || this.itemType.referencesNamedType;
31
31
  }
32
32
  get itemConversionFunctionDefault() {
33
33
  return {
@@ -45,7 +45,7 @@ export class AbstractContainerType extends AbstractType {
45
45
  }
46
46
  get schemaInitializers() {
47
47
  const initializers = super.schemaInitializers.concat();
48
- if (this.recursive || this.itemType.referencesObjectType) {
48
+ if (this.recursive || this.referencesNamedType) {
49
49
  initializers.push(code `get itemType() { return ${this.itemType.schema}; }`);
50
50
  }
51
51
  else {
@@ -83,9 +83,9 @@ __decorate([
83
83
  case "Union":
84
84
  return true;
85
85
  case "DefaultValue":
86
- case "LazyObjectOption":
87
- case "LazyObjectSet":
88
- case "LazyObject":
86
+ case "LazyOption":
87
+ case "LazySet":
88
+ case "Lazy":
89
89
  case "Option":
90
90
  case "Set":
91
91
  return false;
@@ -1,8 +1,8 @@
1
1
  import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
2
2
  import { type Code } from "./ts-poet-wrapper.js";
3
3
  export declare abstract class AbstractDateType extends AbstractPrimitiveType<Date> {
4
+ protected readonly inlineExpression: Code;
4
5
  readonly equalsFunction: Code;
5
- readonly expression: Code;
6
6
  readonly filterFunction: Code;
7
7
  readonly filterType: Code;
8
8
  readonly jsTypes: readonly [{
@@ -16,12 +16,6 @@ export declare abstract class AbstractDateType extends AbstractPrimitiveType<Dat
16
16
  fromJsonExpression({ variables, }: Parameters<AbstractPrimitiveType<Date>["fromJsonExpression"]>[0]): Code;
17
17
  jsonType(): AbstractPrimitiveType.JsonType;
18
18
  toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<Date>["toRdfResourceValuesExpression"]>[0]): Code;
19
- protected abstract fromRdfResourceValueExpression(variables: {
20
- variables: {
21
- value: Code;
22
- };
23
- }): Code;
24
- protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<Date>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<Date>["fromRdfResourceValuesExpressionChain"]>;
25
19
  }
26
20
  export declare namespace AbstractDateType {
27
21
  type ConversionFunction = AbstractPrimitiveType.ConversionFunction;
@@ -8,8 +8,8 @@ import { Memoize } from "typescript-memoize";
8
8
  import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
9
9
  import { code } from "./ts-poet-wrapper.js";
10
10
  export class AbstractDateType extends AbstractPrimitiveType {
11
+ inlineExpression = code `Date`;
11
12
  equalsFunction = code `${this.reusables.snippets.dateEquals}`;
12
- expression = code `Date`;
13
13
  filterFunction = code `${this.reusables.snippets.filterDate}`;
14
14
  filterType = code `${this.reusables.snippets.DateFilter}`;
15
15
  jsTypes = [
@@ -30,16 +30,6 @@ export class AbstractDateType extends AbstractPrimitiveType {
30
30
  toRdfResourceValuesExpression({ variables, }) {
31
31
  return code `[${this.reusables.snippets.literalFactory}.date(${variables.value}, ${this.rdfjsTermExpression(this.datatype)})]`;
32
32
  }
33
- fromRdfResourceValuesExpressionChain({ variables, }) {
34
- return {
35
- ...super.fromRdfResourceValuesExpressionChain({ variables }),
36
- languageIn: undefined,
37
- preferredLanguages: undefined,
38
- valueTo: code `chain(values => values.chainMap(value => ${this.fromRdfResourceValueExpression({
39
- variables: { value: code `value` },
40
- })}))`,
41
- };
42
- }
43
33
  }
44
34
  __decorate([
45
35
  Memoize()