@shaclmate/compiler 4.0.38 → 4.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/ShapesGraphToAstTransformer.js +12 -12
  2. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +24 -24
  3. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +4 -4
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +16 -16
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
  7. package/dist/ast/AbstractCollectionType.d.ts +1 -1
  8. package/dist/ast/AbstractCompoundType.d.ts +1 -1
  9. package/dist/ast/AbstractCompoundType.js +15 -15
  10. package/dist/ast/AbstractContainerType.d.ts +1 -1
  11. package/dist/ast/AbstractContainerType.js +15 -15
  12. package/dist/ast/AbstractLazyObjectType.d.ts +1 -1
  13. package/dist/ast/AbstractTermType.d.ts +1 -1
  14. package/dist/ast/BlankNodeType.d.ts +1 -1
  15. package/dist/ast/BlankNodeType.js +1 -1
  16. package/dist/ast/DefaultValueType.d.ts +1 -1
  17. package/dist/ast/DefaultValueType.js +2 -2
  18. package/dist/ast/IdentifierType.d.ts +1 -1
  19. package/dist/ast/IdentifierType.js +1 -1
  20. package/dist/ast/IntersectionType.d.ts +1 -1
  21. package/dist/ast/IntersectionType.js +3 -3
  22. package/dist/ast/IriType.d.ts +1 -1
  23. package/dist/ast/IriType.js +1 -1
  24. package/dist/ast/LazyObjectOptionType.d.ts +1 -1
  25. package/dist/ast/LazyObjectOptionType.js +1 -1
  26. package/dist/ast/LazyObjectSetType.d.ts +1 -1
  27. package/dist/ast/LazyObjectSetType.js +1 -1
  28. package/dist/ast/LazyObjectType.d.ts +1 -1
  29. package/dist/ast/LazyObjectType.js +1 -1
  30. package/dist/ast/ListType.d.ts +1 -1
  31. package/dist/ast/ListType.js +16 -16
  32. package/dist/ast/LiteralType.d.ts +1 -1
  33. package/dist/ast/LiteralType.js +1 -1
  34. package/dist/ast/ObjectCompoundType.js +3 -3
  35. package/dist/ast/ObjectType.d.ts +1 -1
  36. package/dist/ast/ObjectType.js +16 -16
  37. package/dist/ast/OptionType.d.ts +1 -1
  38. package/dist/ast/OptionType.js +1 -1
  39. package/dist/ast/SetType.d.ts +1 -1
  40. package/dist/ast/SetType.js +1 -1
  41. package/dist/ast/TermType.d.ts +1 -1
  42. package/dist/ast/TermType.js +1 -1
  43. package/dist/ast/Type.js +15 -15
  44. package/dist/ast/UnionType.d.ts +1 -1
  45. package/dist/ast/UnionType.js +3 -3
  46. package/dist/generators/transformAstToLabeledPropertyGraph.js +10 -10
  47. package/dist/generators/ts/AbstractCollectionType.d.ts +2 -6
  48. package/dist/generators/ts/AbstractCollectionType.js +16 -15
  49. package/dist/generators/ts/AbstractContainerType.d.ts +7 -11
  50. package/dist/generators/ts/AbstractContainerType.js +35 -36
  51. package/dist/generators/ts/AbstractDateType.d.ts +4 -4
  52. package/dist/generators/ts/AbstractDateType.js +2 -2
  53. package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
  54. package/dist/generators/ts/AbstractLazyObjectType.d.ts +14 -17
  55. package/dist/generators/ts/AbstractLazyObjectType.js +26 -38
  56. package/dist/generators/ts/AbstractLiteralType.d.ts +1 -5
  57. package/dist/generators/ts/AbstractLiteralType.js +7 -6
  58. package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
  59. package/dist/generators/ts/AbstractNumericType.js +3 -3
  60. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  61. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  62. package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -6
  63. package/dist/generators/ts/AbstractPrimitiveType.js +9 -10
  64. package/dist/generators/ts/AbstractTermType.d.ts +1 -5
  65. package/dist/generators/ts/AbstractTermType.js +3 -17
  66. package/dist/generators/ts/AbstractType.d.ts +22 -15
  67. package/dist/generators/ts/AbstractType.js +18 -8
  68. package/dist/generators/ts/BigDecimalType.d.ts +2 -2
  69. package/dist/generators/ts/BigDecimalType.js +3 -3
  70. package/dist/generators/ts/BigIntType.d.ts +1 -1
  71. package/dist/generators/ts/BigIntType.js +3 -3
  72. package/dist/generators/ts/BlankNodeType.d.ts +4 -4
  73. package/dist/generators/ts/BlankNodeType.js +12 -12
  74. package/dist/generators/ts/BooleanType.d.ts +3 -3
  75. package/dist/generators/ts/BooleanType.js +11 -6
  76. package/dist/generators/ts/DateTimeType.d.ts +1 -1
  77. package/dist/generators/ts/DateTimeType.js +1 -1
  78. package/dist/generators/ts/DateType.d.ts +1 -1
  79. package/dist/generators/ts/DateType.js +1 -1
  80. package/dist/generators/ts/DefaultValueType.d.ts +3 -7
  81. package/dist/generators/ts/DefaultValueType.js +17 -21
  82. package/dist/generators/ts/FloatType.d.ts +1 -1
  83. package/dist/generators/ts/FloatType.js +1 -1
  84. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  85. package/dist/generators/ts/GraphqlSchema.js +4 -4
  86. package/dist/generators/ts/IdentifierType.d.ts +4 -4
  87. package/dist/generators/ts/IdentifierType.js +14 -14
  88. package/dist/generators/ts/IntType.d.ts +1 -1
  89. package/dist/generators/ts/IntType.js +1 -1
  90. package/dist/generators/ts/IriType.d.ts +4 -2
  91. package/dist/generators/ts/IriType.js +27 -22
  92. package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -1
  93. package/dist/generators/ts/LazyObjectOptionType.js +7 -7
  94. package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
  95. package/dist/generators/ts/LazyObjectSetType.js +6 -6
  96. package/dist/generators/ts/LazyObjectType.d.ts +1 -1
  97. package/dist/generators/ts/LazyObjectType.js +5 -5
  98. package/dist/generators/ts/ListType.d.ts +5 -6
  99. package/dist/generators/ts/ListType.js +24 -25
  100. package/dist/generators/ts/LiteralType.d.ts +3 -2
  101. package/dist/generators/ts/LiteralType.js +14 -7
  102. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +24 -24
  103. package/dist/generators/ts/ObjectType.js +350 -0
  104. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  105. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +54 -64
  106. package/dist/generators/ts/OptionType.d.ts +2 -6
  107. package/dist/generators/ts/OptionType.js +12 -18
  108. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -8
  109. package/dist/generators/ts/SetType.d.ts +1 -1
  110. package/dist/generators/ts/SetType.js +1 -1
  111. package/dist/generators/ts/Snippets.d.ts +1 -0
  112. package/dist/generators/ts/Snippets.js +7 -0
  113. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  114. package/dist/generators/ts/StringType.d.ts +3 -3
  115. package/dist/generators/ts/StringType.js +11 -6
  116. package/dist/generators/ts/TermType.d.ts +3 -3
  117. package/dist/generators/ts/TermType.js +13 -13
  118. package/dist/generators/ts/TsGenerator.js +12 -9
  119. package/dist/generators/ts/Type.d.ts +4 -5
  120. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  121. package/dist/generators/ts/TypeFactory.js +79 -80
  122. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +40 -15
  123. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +328 -135
  124. package/dist/generators/ts/ZodGenerator.js +7 -9
  125. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +13 -13
  126. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +11 -14
  127. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +3 -2
  128. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +24 -15
  129. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +3 -6
  130. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +20 -12
  131. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  132. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_createFunctionDeclaration.js → _ObjectType/ObjectType_createFunctionDeclaration.js} +6 -6
  133. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  134. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +5 -5
  135. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  136. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -3
  137. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  138. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +3 -3
  139. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  140. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  141. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  142. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +3 -3
  143. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  144. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js → _ObjectType/ObjectType_fromJsonFunctionDeclaration.js} +4 -4
  145. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  146. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js} +7 -31
  147. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  148. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  149. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  150. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  151. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  152. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  153. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  154. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js → _ObjectType/ObjectType_hashFunctionDeclarations.js} +8 -8
  155. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  156. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_interfaceDeclaration.js → _ObjectType/ObjectType_interfaceDeclaration.js} +5 -5
  157. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  158. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js → _ObjectType/ObjectType_isTypeFunctionDeclaration.js} +3 -3
  159. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  160. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  161. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  162. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +2 -2
  163. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  164. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js → _ObjectType/ObjectType_jsonTypeAliasDeclaration.js} +2 -2
  165. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  166. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
  167. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  168. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  169. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  170. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +14 -0
  171. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  172. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  173. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  174. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  175. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  176. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js → _ObjectType/ObjectType_toJsonFunctionDeclaration.js} +4 -4
  177. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  178. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  179. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  180. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +6 -6
  181. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  182. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  183. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  184. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  185. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +2 -6
  186. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +24 -28
  187. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  188. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/identifierTypeDeclarations.js +4 -2
  189. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +2 -2
  190. package/dist/generators/ts/_snippets/snippets_CollectionSchema.js +1 -1
  191. package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +1 -1
  192. package/dist/generators/ts/_snippets/snippets_IriSchema.js +2 -2
  193. package/dist/generators/ts/_snippets/snippets_MaybeSchema.js +2 -2
  194. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
  195. package/dist/generators/ts/_snippets/snippets_StringSchema.js +2 -2
  196. package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +1 -1
  197. package/dist/generators/ts/_snippets/snippets_convertToIri.js +1 -1
  198. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
  199. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.d.ts +3 -0
  200. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.js +16 -0
  201. package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +1 -1
  202. package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
  203. package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
  204. package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +1 -1
  205. package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +3 -3
  206. package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +1 -1
  207. package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +1 -1
  208. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +1 -1
  209. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +1 -1
  210. package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +1 -1
  211. package/dist/generators/ts/_snippets/snippets_validateArray.js +1 -1
  212. package/dist/generators/ts/_snippets/snippets_validateMaybe.js +1 -1
  213. package/dist/generators/ts/tsComment.js +1 -1
  214. package/dist/input/generated.d.ts +1399 -1468
  215. package/dist/input/generated.js +518 -655
  216. package/package.json +4 -4
  217. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  218. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  219. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  220. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  221. package/dist/generators/ts/NamedObjectType.js +0 -341
  222. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  223. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  224. package/dist/generators/ts/NamedUnionType.js +0 -13
  225. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  226. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  227. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  228. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  229. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  230. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  231. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  232. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  233. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  234. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  235. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  236. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  237. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  238. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  239. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  240. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  241. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  242. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  243. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  244. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  245. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  246. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  247. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  248. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  249. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  250. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  251. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  252. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  253. package/dist/generators/ts/removeUndefined.d.ts +0 -2
  254. package/dist/generators/ts/removeUndefined.js +0 -17
  255. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  256. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
@@ -1,11 +1,11 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration() {
3
+ export function ObjectType_valueSparqlConstructTriplesFunctionDeclaration() {
4
4
  if (!this.configuration.features.has("Object.SPARQL")) {
5
5
  return Maybe.empty();
6
6
  }
7
7
  return Maybe.of(code `\
8
8
  export const valueSparqlConstructTriples: ${this.reusables.snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.schemaType}> = ({ filter, ignoreRdfType, valueVariable, variablePrefix }) =>
9
- ${this.name}.focusSparqlConstructTriples({ filter, focusIdentifier: valueVariable, ignoreRdfType, variablePrefix });`);
9
+ ${this.alias.unsafeCoerce()}.focusSparqlConstructTriples({ filter, focusIdentifier: valueVariable, ignoreRdfType, variablePrefix });`);
10
10
  }
11
- //# sourceMappingURL=NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js.map
11
+ //# sourceMappingURL=ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_valueSparqlWherePatternsFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts.map
@@ -1,13 +1,13 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_valueSparqlWherePatternsFunctionDeclaration() {
3
+ export function ObjectType_valueSparqlWherePatternsFunctionDeclaration() {
4
4
  if (!this.configuration.features.has("Object.SPARQL")) {
5
5
  return Maybe.empty();
6
6
  }
7
7
  return Maybe.of(code `\
8
8
  export const valueSparqlWherePatterns: ${this.reusables.snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.schemaType}> = ({ filter, ignoreRdfType, preferredLanguages, propertyPatterns, valueVariable, variablePrefix }) =>
9
9
  (propertyPatterns as readonly ${this.reusables.snippets.SparqlPattern}[]).concat(
10
- ${this.name}.focusSparqlWherePatterns({ filter, focusIdentifier: valueVariable, ignoreRdfType, preferredLanguages, variablePrefix })
10
+ ${this.alias.unsafeCoerce()}.focusSparqlWherePatterns({ filter, focusIdentifier: valueVariable, ignoreRdfType, preferredLanguages, variablePrefix })
11
11
  );`);
12
12
  }
13
- //# sourceMappingURL=NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js.map
13
+ //# sourceMappingURL=ObjectType_valueSparqlWherePatternsFunctionDeclaration.js.map
@@ -8,7 +8,7 @@ export declare class ShaclProperty<TypeT extends Type> extends AbstractProperty<
8
8
  private readonly description;
9
9
  private readonly display;
10
10
  private readonly label;
11
- readonly kind = "ShaclProperty";
11
+ readonly kind = "Shacl";
12
12
  readonly mutable: boolean;
13
13
  readonly path: PropertyPath;
14
14
  readonly recursive: boolean;
@@ -30,11 +30,7 @@ export declare class ShaclProperty<TypeT extends Type> extends AbstractProperty<
30
30
  get graphqlField(): AbstractProperty<TypeT>["graphqlField"];
31
31
  get jsonSchema(): AbstractProperty<TypeT>["jsonSchema"];
32
32
  get jsonSignature(): Maybe<Code>;
33
- protected get schemaObject(): {
34
- path: Code | undefined;
35
- kind: Code;
36
- type: Code;
37
- };
33
+ protected get schemaInitializers(): readonly Code[];
38
34
  constructorInitializer({ variables, }: Parameters<AbstractProperty<TypeT>["constructorInitializer"]>[0]): Maybe<Code>;
39
35
  fromJsonInitializer({ variables, }: Parameters<AbstractProperty<TypeT>["fromJsonInitializer"]>[0]): Maybe<Code>;
40
36
  fromRdfResourceValuesInitializer({ variables, }: Parameters<AbstractProperty<TypeT>["fromRdfResourceValuesInitializer"]>[0]): Maybe<Code>;
@@ -14,7 +14,7 @@ export class ShaclProperty extends AbstractProperty {
14
14
  description;
15
15
  display;
16
16
  label;
17
- kind = "ShaclProperty";
17
+ kind = "Shacl";
18
18
  mutable;
19
19
  path;
20
20
  recursive;
@@ -31,7 +31,7 @@ export class ShaclProperty extends AbstractProperty {
31
31
  get constructorParameter() {
32
32
  const conversionFunction = this.type.conversionFunction.extract();
33
33
  if (!conversionFunction) {
34
- return Maybe.of(code `readonly ${this.name}: ${this.type.name};`);
34
+ return Maybe.of(code `readonly ${this.name}: ${this.type.expression};`);
35
35
  }
36
36
  let hasQuestionToken = false;
37
37
  const typeNames = [];
@@ -40,7 +40,7 @@ export class ShaclProperty extends AbstractProperty {
40
40
  hasQuestionToken = true;
41
41
  }
42
42
  else {
43
- typeNames.push(code `${type.name}`);
43
+ typeNames.push(code `${type.expression}`);
44
44
  }
45
45
  }
46
46
  return Maybe.of(code `readonly ${this.name}${hasQuestionToken ? "?" : ""}: ${joinCode(typeNames, { on: "|" })};`);
@@ -55,7 +55,7 @@ export class ShaclProperty extends AbstractProperty {
55
55
  .alt(this.description)
56
56
  .alt(this.label)
57
57
  .map(tsComment)
58
- .orDefault("")}${joinCode(lhs, { on: " " })}: ${this.type.name};`;
58
+ .orDefault("")}${joinCode(lhs, { on: " " })}: ${this.type.expression};`;
59
59
  }
60
60
  get filterProperty() {
61
61
  return Maybe.of({
@@ -97,24 +97,20 @@ export class ShaclProperty extends AbstractProperty {
97
97
  const typeJsonType = this.type.jsonType();
98
98
  return Maybe.of(code `${!this.mutable ? "readonly " : ""}${this.name}${typeJsonType.optional ? "?" : ""}: ${typeJsonType.requiredName}`);
99
99
  }
100
- get schemaObject() {
101
- return {
102
- ...super.schemaObject,
103
- // comment: this.comment.map(JSON.stringify).extract(),
104
- // description: this.description.map(JSON.stringify).extract(),
105
- path: this.configuration.features.has("Object.fromRdf") ||
106
- this.configuration.features.has("Object.toRdf") ||
107
- this.configuration.features.has("Object.SPARQL")
108
- ? this.propertyPathToCode(this.path)
109
- : undefined,
110
- // label: this.label.map(JSON.stringify).extract(),
111
- // mutable: this.mutable ? true : undefined,
112
- // recursive: this.recursive ? true : undefined,
113
- // visibility:
114
- // this.visibility !== "public"
115
- // ? `${JSON.stringify(this.visibility)} as const`
116
- // : undefined,
117
- };
100
+ get schemaInitializers() {
101
+ const initializers = super.schemaInitializers.concat();
102
+ if (this.configuration.features.has("Object.fromRdf") ||
103
+ this.configuration.features.has("Object.toRdf")) {
104
+ initializers.push(code `path: ${this.propertyPathToCode(this.path)}`);
105
+ }
106
+ // Use a getter if the type is recursive or the type is an object type, which may have forward references in the file
107
+ if (this.recursive || this.type.referencesObjectType) {
108
+ initializers.push(code `get type() { return ${this.type.schema}; }`);
109
+ }
110
+ else {
111
+ initializers.push(code `type: ${this.type.schema}`);
112
+ }
113
+ return initializers;
118
114
  }
119
115
  constructorInitializer({ variables, }) {
120
116
  const parameterVariable = code `${variables.parameters}.${this.name}`;
@@ -122,13 +118,13 @@ export class ShaclProperty extends AbstractProperty {
122
118
  const validationFunction = this.type.validationFunction.extract();
123
119
  let rhs;
124
120
  if (conversionFunction && validationFunction) {
125
- rhs = code `${conversionFunction}(${parameterVariable}).chain(value => ${validationFunction}(${this.namedObjectType.name}.schema.properties.${this.name}.type(), value))`;
121
+ rhs = code `${conversionFunction}(${parameterVariable}).chain(value => ${validationFunction}(${this.objectType.alias.unsafeCoerce()}.schema.properties.${this.name}.type, value))`;
126
122
  }
127
123
  else if (conversionFunction) {
128
124
  rhs = code `${conversionFunction}(${parameterVariable})`;
129
125
  }
130
126
  else if (validationFunction) {
131
- rhs = code `${validationFunction}(${this.namedObjectType.name}.schema.properties.${this.name}.type(), ${parameterVariable})`;
127
+ rhs = code `${validationFunction}(${this.objectType.alias.unsafeCoerce()}.schema.properties.${this.name}.type, ${parameterVariable})`;
132
128
  }
133
129
  else {
134
130
  rhs = code `${this.reusables.imports.Either}.of(${parameterVariable})`;
@@ -152,7 +148,7 @@ export class ShaclProperty extends AbstractProperty {
152
148
  variables: {
153
149
  ...variables,
154
150
  ignoreRdfType: true,
155
- propertyPath: code `${this.namedObjectType.name}.schema.properties.${this.name}.path`,
151
+ propertyPath: code `${this.objectType.alias.unsafeCoerce()}.schema.properties.${this.name}.path`,
156
152
  resourceValues: code `resourceValues`,
157
153
  },
158
154
  })})`,
@@ -213,7 +209,7 @@ export class ShaclProperty extends AbstractProperty {
213
209
  default:
214
210
  return [];
215
211
  }
216
- const propertyPath = code `${this.namedObjectType.name}.schema.properties.${this.name}.path`;
212
+ const propertyPath = code `${this.objectType.alias.unsafeCoerce()}.schema.properties.${this.name}.path`;
217
213
  return [
218
214
  code `${variables.resource}.add(${propertyPath}, ${this.type.toRdfResourceValuesExpression({
219
215
  variables: { ...variables, propertyPath },
@@ -230,12 +226,12 @@ export class ShaclProperty extends AbstractProperty {
230
226
  switch (propertyPath.termType) {
231
227
  case "AlternativePath":
232
228
  case "SequencePath":
233
- return code `{ members: [${joinCode(propertyPath.members.map((member) => this.propertyPathToCode(member)), { on: "," })}] as const, termType: ${literalOf(propertyPath.termType)} as const }`;
229
+ return code `{ members: [${joinCode(propertyPath.members.map((member) => this.propertyPathToCode(member)), { on: "," })}], termType: ${literalOf(propertyPath.termType)} }`;
234
230
  case "InversePath":
235
231
  case "OneOrMorePath":
236
232
  case "ZeroOrMorePath":
237
233
  case "ZeroOrOnePath":
238
- return code `{ path: ${this.propertyPathToCode(propertyPath.path)}, termType: ${literalOf(propertyPath.termType)} as const }`;
234
+ return code `{ path: ${this.propertyPathToCode(propertyPath.path)}, termType: ${literalOf(propertyPath.termType)} }`;
239
235
  case "NamedNode":
240
236
  return this.rdfjsTermExpression(propertyPath);
241
237
  }
@@ -0,0 +1,4 @@
1
+ import type { ObjectType } from "../ObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function identifierTypeDeclarations(this: ObjectType): readonly Code[];
4
+ //# sourceMappingURL=identifierTypeDeclarations.d.ts.map
@@ -1,9 +1,11 @@
1
+ import { codeEquals } from "../codeEquals.js";
1
2
  import { code } from "../ts-poet-wrapper.js";
2
3
  export function identifierTypeDeclarations() {
3
4
  if (!this.configuration.features.has("Object.type")) {
4
5
  return [];
5
6
  }
6
- const ancestorObjectTypeWithSameIdentifierType = this.ancestorObjectTypes.find((ancestorObjectType) => ancestorObjectType.identifierType.name === this.identifierType.name);
7
+ const ancestorObjectTypeWithSameIdentifierType = this.ancestorObjectTypes.find((ancestorObjectType) => ancestorObjectType.identifierType.kind === this.identifierType.kind &&
8
+ codeEquals(ancestorObjectType.identifierType.expression, this.identifierType.expression));
7
9
  if (ancestorObjectTypeWithSameIdentifierType) {
8
10
  // This object type's identifier type has the same identifier type as an ancestor object type,
9
11
  // so just reuse the latter.
@@ -14,7 +16,7 @@ export function identifierTypeDeclarations() {
14
16
  }
15
17
  // Bespoke identifier type and associated functions
16
18
  return [
17
- code `export type Identifier = ${this.identifierType.name};`,
19
+ code `export type Identifier = ${this.identifierType.expression};`,
18
20
  code `\
19
21
  export namespace Identifier {
20
22
  export const parse = ${this.identifierType.parseFunction};
@@ -1,7 +1,7 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_BooleanSchema = ({ syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}BooleanSchema`, code `\
3
- interface ${syntheticNamePrefix}BooleanSchema {
3
+ interface ${syntheticNamePrefix}BooleanSchema<T extends boolean> {
4
+ readonly in?: readonly T[];
4
5
  readonly kind: "Boolean";
5
- readonly in?: readonly boolean[];
6
6
  }`);
7
7
  //# sourceMappingURL=snippets_BooleanSchema.js.map
@@ -1,7 +1,7 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_CollectionSchema = ({ syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}CollectionSchema`, code `\
3
3
  interface ${syntheticNamePrefix}CollectionSchema<ItemSchemaT> {
4
- readonly item: () => ItemSchemaT;
4
+ readonly itemType: ItemSchemaT;
5
5
  readonly kind: "List" | "Set";
6
6
  readonly minCount?: number;
7
7
  }`);
@@ -2,7 +2,7 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_DefaultValueSchema = ({ syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}DefaultValueSchema`, code `\
3
3
  interface ${syntheticNamePrefix}DefaultValueSchema<DefaultValueT, ItemSchemaT> {
4
4
  readonly defaultValue: DefaultValueT;
5
- readonly item: () => ItemSchemaT;
5
+ readonly itemType: ItemSchemaT;
6
6
  readonly kind: "DefaultValue";
7
7
  }`);
8
8
  //# sourceMappingURL=snippets_DefaultValueSchema.js.map
@@ -1,7 +1,7 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_IriSchema = ({ imports, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}IriSchema`, code `\
3
- interface ${syntheticNamePrefix}IriSchema {
4
- readonly in?: readonly ${imports.NamedNode}[];
3
+ interface ${syntheticNamePrefix}IriSchema<IriT extends string = string> {
4
+ readonly in?: readonly ${imports.NamedNode}<IriT>[];
5
5
  readonly kind: "Iri";
6
6
  }`);
7
7
  //# sourceMappingURL=snippets_IriSchema.js.map
@@ -1,7 +1,7 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_MaybeSchema = ({ syntheticNamePrefix }) => conditionalOutput(`${syntheticNamePrefix}MaybeSchema`, code `\
3
3
  interface ${syntheticNamePrefix}MaybeSchema<ItemSchemaT>{
4
- readonly item: () => ItemSchemaT;
5
- readonly kind: "Maybe";
4
+ readonly itemType: ItemSchemaT;
5
+ readonly kind: "Option";
6
6
  }`);
7
7
  //# sourceMappingURL=snippets_MaybeSchema.js.map
@@ -3,6 +3,6 @@ export const snippets_ShaclPropertySchema = ({ snippets, syntheticNamePrefix, })
3
3
  export interface ${syntheticNamePrefix}ShaclPropertySchema<TypeSchemaT = object> {
4
4
  readonly kind: "Shacl";
5
5
  readonly path: ${snippets.PropertyPath};
6
- readonly type: () => TypeSchemaT;
6
+ readonly type: TypeSchemaT;
7
7
  }`);
8
8
  //# sourceMappingURL=snippets_ShaclPropertySchema.js.map
@@ -1,7 +1,7 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_StringSchema = ({ syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}StringSchema`, code `\
3
- interface ${syntheticNamePrefix}StringSchema {
4
- readonly in?: readonly string[];
3
+ interface ${syntheticNamePrefix}StringSchema<T extends string> {
4
+ readonly in?: readonly T[];
5
5
  readonly kind: "String";
6
6
  }`);
7
7
  //# sourceMappingURL=snippets_StringSchema.js.map
@@ -1,6 +1,6 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_booleanSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}booleanSparqlWherePatterns`, code `\
3
- const ${syntheticNamePrefix}booleanSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.BooleanFilter}, ${snippets.BooleanSchema}> =
3
+ const ${syntheticNamePrefix}booleanSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.BooleanFilter}, ${snippets.BooleanSchema}<boolean>> =
4
4
  ({ filter, valueVariable, ...otherParameters }) => {
5
5
  const filterPatterns: ${snippets.SparqlFilterPattern}[] = [];
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_convertToIri = ({ imports, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}convertToIri`, code `\
3
- function ${syntheticNamePrefix}convertToIri<IriT extends string = string>(value: IriT | ${imports.NamedNode}<IriT>): ${imports.Either}<Error, ${imports.NamedNode}<IriT>> {
3
+ function ${syntheticNamePrefix}convertToIri<IriT extends string>(value: IriT | ${imports.NamedNode}<IriT>): ${imports.Either}<Error, ${imports.NamedNode}<IriT>> {
4
4
  switch (typeof value) {
5
5
  case "object":
6
6
  return ${imports.Either}.of(value);
@@ -2,7 +2,7 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_defaultValueSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}defaultValueSparqlWherePatterns`, code `\
3
3
  function ${syntheticNamePrefix}defaultValueSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets.ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets.ValueSparqlWherePatternsFunction}<ItemFilterT, ${snippets.DefaultValueSchema}<unknown, ItemSchemaT>> {
4
4
  return ({ schema, ...otherParameters }) => {
5
- const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets.liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, schema: schema.item() }));
5
+ const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets.liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, schema: schema.itemType }));
6
6
  return [{ patterns: itemSparqlWherePatterns.concat(), type: "optional" }, ...liftSparqlPatterns];
7
7
  }
8
8
  }`);
@@ -0,0 +1,3 @@
1
+ import type { SnippetFactory } from "../SnippetFactory.js";
2
+ export declare const snippets_ensureRdfResourceType: SnippetFactory;
3
+ //# sourceMappingURL=snippets_ensureRdfResourceType.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { rdf } from "@tpluscode/rdf-ns-builders";
2
+ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
3
+ export const snippets_ensureRdfResourceType = ({ imports, rdfjsTermExpression, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}ensureRdfResourceType`, code `\
4
+ function ${syntheticNamePrefix}ensureRdfResourceType(resource: ${imports.Resource}, types: readonly ${imports.NamedNode}[], options: { graph: Exclude<${imports.Quad_Graph}, ${imports.Variable}> | undefined }): ${imports.Either}<Error, undefined> {
5
+ return resource.value(${rdfjsTermExpression(rdf.type)}, options).chain(actualRdfTypeValue => actualRdfTypeValue.toIri()).chain(actualRdfType => {
6
+ // Check the expected type and its known subtypes
7
+ for (const type of types) {
8
+ if (resource.isInstanceOf(type, options)) {
9
+ return ${imports.Right}(undefined);
10
+ }
11
+ }
12
+
13
+ return ${imports.Left}(new Error(\`\${resource.identifier} has unexpected RDF type (actual: \${actualRdfType}, expected one of \${types})\`));
14
+ });
15
+ }`);
16
+ //# sourceMappingURL=snippets_ensureRdfResourceType.js.map
@@ -1,6 +1,6 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_iriSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}iriSparqlWherePatterns`, code `\
3
- const ${syntheticNamePrefix}iriSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.IriFilter}, ${snippets.IriSchema}> =
3
+ const ${syntheticNamePrefix}iriSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.IriFilter}, ${snippets.IriSchema}<string>> =
4
4
  ({ filter, valueVariable, ...otherParameters }) => {
5
5
  const filterPatterns: ${snippets.SparqlFilterPattern}[] = [];
6
6
 
@@ -10,7 +10,7 @@ function ${syntheticNamePrefix}listSparqlConstructTriples<ItemFilterT, ItemSchem
10
10
  // ?list rdf:first ?item0
11
11
  const item0Variable = variable("Item0");
12
12
  triples.push({ subject: listVariable, predicate: ${snippets.RdfVocabularies}.rdf.first, object: item0Variable });
13
- triples = triples.concat(itemSparqlConstructTriplesFunction({ filter, ignoreRdfType: false, schema: schema.item(), valueVariable: item0Variable, variablePrefix: variablePrefix("Item0") }));
13
+ triples = triples.concat(itemSparqlConstructTriplesFunction({ filter, ignoreRdfType: false, schema: schema.itemType, valueVariable: item0Variable, variablePrefix: variablePrefix("Item0") }));
14
14
  }
15
15
 
16
16
  {
@@ -25,7 +25,7 @@ function ${syntheticNamePrefix}listSparqlConstructTriples<ItemFilterT, ItemSchem
25
25
  // ?rest rdf:first ?itemN
26
26
  const itemNVariable = variable("ItemN");
27
27
  triples.push({ subject: restNVariable, predicate: ${snippets.RdfVocabularies}.rdf.first, object: itemNVariable });
28
- triples = triples.concat(itemSparqlConstructTriplesFunction({ filter, ignoreRdfType: false, schema: schema.item(), valueVariable: itemNVariable, variablePrefix: variablePrefix("ItemN") }));
28
+ triples = triples.concat(itemSparqlConstructTriplesFunction({ filter, ignoreRdfType: false, schema: schema.itemType, valueVariable: itemNVariable, variablePrefix: variablePrefix("ItemN") }));
29
29
  }
30
30
 
31
31
  // ?restN rdf:rest ?restNBasic to get the rdf:rest statement in the CONSTRUCT
@@ -32,7 +32,7 @@ function ${syntheticNamePrefix}listSparqlWherePatterns<ItemFilterT, ItemSchemaT>
32
32
  ignoreRdfType: parameters.ignoreRdfType,
33
33
  preferredLanguages: parameters.preferredLanguages,
34
34
  propertyPatterns: [],
35
- schema: parameters.schema.item(),
35
+ schema: parameters.schema.itemType,
36
36
  valueVariable: item0Variable,
37
37
  variablePrefix: variablePrefix("Item0"),
38
38
  }),
@@ -88,7 +88,7 @@ function ${syntheticNamePrefix}listSparqlWherePatterns<ItemFilterT, ItemSchemaT>
88
88
  ignoreRdfType: parameters.ignoreRdfType,
89
89
  preferredLanguages: parameters.preferredLanguages,
90
90
  propertyPatterns: [],
91
- schema: parameters.schema.item(),
91
+ schema: parameters.schema.itemType,
92
92
  valueVariable: itemNVariable,
93
93
  variablePrefix: variablePrefix("ItemN"),
94
94
  }),
@@ -1,6 +1,6 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_maybeSparqlConstructTriples = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}maybeSparqlConstructTriples`, code `\
3
3
  function ${syntheticNamePrefix}maybeSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${snippets.ValueSparqlConstructTriplesFunction}<ItemFilterT, ItemSchemaT>): ${snippets.ValueSparqlConstructTriplesFunction}<${snippets.MaybeFilter}<ItemFilterT>, ${snippets.MaybeSchema}<ItemSchemaT>> {
4
- return ({ filter, schema, ...otherParameters }) => itemSparqlConstructTriplesFunction({ ...otherParameters, filter: filter ?? undefined, schema: schema.item() });
4
+ return ({ filter, schema, ...otherParameters }) => itemSparqlConstructTriplesFunction({ ...otherParameters, filter: filter ?? undefined, schema: schema.itemType });
5
5
  }`);
6
6
  //# sourceMappingURL=snippets_maybeSparqlConstructTriples.js.map
@@ -4,18 +4,18 @@ function ${syntheticNamePrefix}maybeSparqlWherePatterns<ItemFilterT, ItemSchemaT
4
4
  return ({ filter, schema, ...otherParameters }) => {
5
5
  if (filter === undefined) {
6
6
  // Treat the item's patterns as optional
7
- const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets.liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, filter, schema: schema.item() }));
7
+ const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets.liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, filter, schema: schema.itemType }));
8
8
  return [{ patterns: itemSparqlWherePatterns.concat(), type: "optional" }, ...liftSparqlPatterns];
9
9
  }
10
10
 
11
11
  if (filter === null) {
12
12
  // Use FILTER NOT EXISTS around the item's patterns
13
- const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets.liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, filter: undefined, schema: schema.item() }));
13
+ const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets.liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, filter: undefined, schema: schema.itemType }));
14
14
  return [{ expression: { args: itemSparqlWherePatterns.concat(), operator: "notexists", type: "operation" }, lift: true, type: "filter" }, ...liftSparqlPatterns]
15
15
  }
16
16
 
17
17
  // Treat the item as required.
18
- return itemSparqlWherePatternsFunction({ ...otherParameters, filter, schema: schema.item() });
18
+ return itemSparqlWherePatternsFunction({ ...otherParameters, filter, schema: schema.itemType });
19
19
  }
20
20
  }`);
21
21
  //# sourceMappingURL=snippets_maybeSparqlWherePatterns.js.map
@@ -1,6 +1,6 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_setSparqlConstructTriples = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}setSparqlConstructTriples`, code `\
3
3
  function ${syntheticNamePrefix}setSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${snippets.ValueSparqlConstructTriplesFunction}<ItemFilterT, ItemSchemaT>): ${snippets.ValueSparqlConstructTriplesFunction}<${snippets.CollectionFilter}<ItemFilterT>, ${snippets.CollectionSchema}<ItemSchemaT>> {
4
- return ({ schema, ...otherParameters }) => itemSparqlConstructTriplesFunction({ ...otherParameters, schema: schema.item() });
4
+ return ({ schema, ...otherParameters }) => itemSparqlConstructTriplesFunction({ ...otherParameters, schema: schema.itemType });
5
5
  }`);
6
6
  //# sourceMappingURL=snippets_setSparqlConstructTriples.js.map
@@ -2,7 +2,7 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_setSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}setSparqlWherePatterns`, code `\
3
3
  function ${syntheticNamePrefix}setSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets.ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets.ValueSparqlWherePatternsFunction}<${snippets.CollectionFilter}<ItemFilterT>, ${snippets.CollectionSchema}<ItemSchemaT>> {
4
4
  return ({ filter, schema, ...otherParameters }) => {
5
- const itemSparqlWherePatterns = itemSparqlWherePatternsFunction({ ...otherParameters, filter, schema: schema.item() });
5
+ const itemSparqlWherePatterns = itemSparqlWherePatternsFunction({ ...otherParameters, filter, schema: schema.itemType });
6
6
 
7
7
  const minCount = filter?.${syntheticNamePrefix}minCount ?? schema.minCount ?? 0;
8
8
  if (minCount > 0) {
@@ -82,7 +82,7 @@ function ${syntheticNamePrefix}shaclPropertySparqlConstructTriples<FilterT, Type
82
82
  .concat(typeSparqlConstructTriples({
83
83
  filter,
84
84
  ignoreRdfType,
85
- schema: propertySchema.type(),
85
+ schema: propertySchema.type,
86
86
  valueVariable,
87
87
  variablePrefix: valueString
88
88
  }));
@@ -78,7 +78,7 @@ function ${syntheticNamePrefix}shaclPropertySparqlWherePatterns<FilterT, TypeSch
78
78
  ignoreRdfType,
79
79
  preferredLanguages,
80
80
  propertyPatterns,
81
- schema: propertySchema.type(),
81
+ schema: propertySchema.type,
82
82
  valueVariable,
83
83
  variablePrefix: valueString
84
84
  });
@@ -1,6 +1,6 @@
1
1
  import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_stringSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}stringSparqlWherePatterns`, code `\
3
- const ${syntheticNamePrefix}stringSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.StringFilter}, ${snippets.StringSchema}> =
3
+ const ${syntheticNamePrefix}stringSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.StringFilter}, ${snippets.StringSchema}<string>> =
4
4
  ({ filter, valueVariable, ...otherParameters }) => {
5
5
  const filterPatterns: ${snippets.SparqlFilterPattern}[] = [];
6
6
 
@@ -7,7 +7,7 @@ function ${syntheticNamePrefix}validateArray<ItemSchemaT, ItemValueT, Readonly e
7
7
  return ${imports.Left}(new Error(\`value array has length (\${valueArray.length}) less than minCount (\${schema.minCount})\`)) as ${imports.Either}<Error, EitherR>;
8
8
  }
9
9
 
10
- return ${imports.Either}.sequence(valueArray.map(value => validateItem(schema.item(), value))) as ${imports.Either}<Error, EitherR>;
10
+ return ${imports.Either}.sequence(valueArray.map(value => validateItem(schema.itemType, value))) as ${imports.Either}<Error, EitherR>;
11
11
  }
12
12
  }`);
13
13
  //# sourceMappingURL=snippets_validateArray.js.map
@@ -2,6 +2,6 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
2
  export const snippets_validateMaybe = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}validateMaybe`, code `\
3
3
  function ${syntheticNamePrefix}validateMaybe<ItemSchemaT, ItemValueT>(validateItem: ${snippets.ValidationFunction}<ItemSchemaT, ItemValueT>) {
4
4
  return (schema: ${snippets.MaybeSchema}<ItemSchemaT>, valueMaybe: ${imports.Maybe}<ItemValueT>): ${imports.Either}<Error, ${imports.Maybe}<ItemValueT>> =>
5
- valueMaybe.map(value => validateItem(schema.item(), value).map(() => valueMaybe)).orDefault(${imports.Either}.of(valueMaybe));
5
+ valueMaybe.map(value => validateItem(schema.itemType, value).map(() => valueMaybe)).orDefault(${imports.Either}.of(valueMaybe));
6
6
  }`);
7
7
  //# sourceMappingURL=snippets_validateMaybe.js.map
@@ -6,6 +6,6 @@ export function tsComment(comment) {
6
6
  .trim()
7
7
  .split(/\r?\n|\r|\n/g)
8
8
  .map((line) => ` * ${line}`)
9
- .join("\n")}\n */\n`;
9
+ .join("\n")}\n **/\n`;
10
10
  }
11
11
  //# sourceMappingURL=tsComment.js.map