@shaclmate/compiler 4.0.94 → 4.0.95

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 (572) hide show
  1. package/dist/Eithers.d.ts +2 -1
  2. package/dist/Eithers.js +15 -0
  3. package/dist/ShapesGraphToAstTransformer.js +10 -0
  4. package/dist/_ShapesGraphToAstTransformer/ShapeStack.d.ts +2 -2
  5. package/dist/_ShapesGraphToAstTransformer/ShapeStack.js +2 -1
  6. package/dist/_ShapesGraphToAstTransformer/isNodeShape.d.ts +3 -0
  7. package/dist/_ShapesGraphToAstTransformer/isNodeShape.js +4 -0
  8. package/dist/_ShapesGraphToAstTransformer/isPropertyShape.d.ts +3 -0
  9. package/dist/_ShapesGraphToAstTransformer/isPropertyShape.js +4 -0
  10. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +2 -1
  11. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +4 -3
  12. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.d.ts +1 -1
  13. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +7 -3
  14. package/dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts +1 -1
  15. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +1 -1
  16. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.js +34 -16
  17. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
  18. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +3 -2
  19. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
  20. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +3 -3
  21. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.d.ts +1 -1
  22. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.js +86 -65
  23. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.d.ts +1 -1
  24. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
  25. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
  26. package/dist/ast/AbstractCollectionType.d.ts +2 -2
  27. package/dist/ast/AbstractConstruct.d.ts +25 -0
  28. package/dist/ast/AbstractConstruct.js +38 -0
  29. package/dist/ast/AbstractContainerType.d.ts +2 -2
  30. package/dist/ast/AbstractLazyType.d.ts +14 -36
  31. package/dist/ast/AbstractTermType.d.ts +2 -2
  32. package/dist/ast/AbstractType.d.ts +7 -17
  33. package/dist/ast/AbstractType.js +6 -22
  34. package/dist/ast/Ast.d.ts +2 -0
  35. package/dist/ast/DefaultValueType.d.ts +2 -2
  36. package/dist/ast/DiscriminatedUnionType.d.ts +2 -2
  37. package/dist/ast/DiscriminatedUnionType.js +3 -1
  38. package/dist/ast/LiteralType.d.ts +2 -2
  39. package/dist/ast/Operation.d.ts +67 -0
  40. package/dist/ast/Operation.js +32 -0
  41. package/dist/ast/Service.d.ts +17 -0
  42. package/dist/ast/Service.js +17 -0
  43. package/dist/ast/SetType.d.ts +2 -2
  44. package/dist/ast/StructCompoundType.d.ts +1 -1
  45. package/dist/ast/StructCompoundType.js +5 -5
  46. package/dist/ast/StructType.d.ts +64 -32
  47. package/dist/ast/StructType.js +62 -29
  48. package/dist/ast/index.d.ts +2 -0
  49. package/dist/ast/index.js +2 -0
  50. package/dist/generators/transformAstToLabeledPropertyGraph.js +13 -10
  51. package/dist/generators/ts/AbstractCallable.d.ts +20 -0
  52. package/dist/generators/ts/AbstractCallable.js +9 -0
  53. package/dist/generators/ts/AbstractCollectionType.d.ts +7 -9
  54. package/dist/generators/ts/AbstractCollectionType.js +11 -11
  55. package/dist/generators/ts/AbstractCompoundType.d.ts +18 -0
  56. package/dist/generators/ts/AbstractCompoundType.js +33 -0
  57. package/dist/generators/ts/AbstractConstruct.d.ts +31 -0
  58. package/dist/generators/ts/AbstractConstruct.js +31 -0
  59. package/dist/generators/ts/AbstractContainerType.d.ts +7 -4
  60. package/dist/generators/ts/AbstractContainerType.js +5 -2
  61. package/dist/generators/ts/AbstractDateType.d.ts +8 -5
  62. package/dist/generators/ts/AbstractDateType.js +22 -8
  63. package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +43 -45
  64. package/dist/generators/ts/AbstractDiscriminatedUnionType.js +100 -258
  65. package/dist/generators/ts/AbstractIdentifierType.d.ts +8 -3
  66. package/dist/generators/ts/AbstractIdentifierType.js +34 -5
  67. package/dist/generators/ts/AbstractIntersectionType.d.ts +48 -0
  68. package/dist/generators/ts/AbstractIntersectionType.js +80 -0
  69. package/dist/generators/ts/AbstractLazyType.d.ts +28 -17
  70. package/dist/generators/ts/AbstractLazyType.js +61 -23
  71. package/dist/generators/ts/AbstractLiteralType.d.ts +2 -2
  72. package/dist/generators/ts/AbstractLiteralType.js +15 -1
  73. package/dist/generators/ts/AbstractNumericType.d.ts +5 -4
  74. package/dist/generators/ts/AbstractNumericType.js +4 -6
  75. package/dist/generators/ts/AbstractObjectSetType.d.ts +5 -6
  76. package/dist/generators/ts/AbstractObjectSetType.js +10 -13
  77. package/dist/generators/ts/AbstractPrimitiveType.d.ts +7 -7
  78. package/dist/generators/ts/AbstractPrimitiveType.js +18 -36
  79. package/dist/generators/ts/AbstractStructuredType.d.ts +71 -0
  80. package/dist/generators/ts/AbstractStructuredType.js +273 -0
  81. package/dist/generators/ts/AbstractTermType.d.ts +8 -10
  82. package/dist/generators/ts/AbstractTermType.js +6 -18
  83. package/dist/generators/ts/AbstractType.d.ts +54 -78
  84. package/dist/generators/ts/AbstractType.js +25 -29
  85. package/dist/generators/ts/AbstractTypedLiteralType.d.ts +5 -4
  86. package/dist/generators/ts/AbstractTypedLiteralType.js +14 -3
  87. package/dist/generators/ts/BigDecimalType.d.ts +15 -13
  88. package/dist/generators/ts/BigDecimalType.js +13 -29
  89. package/dist/generators/ts/BigIntType.d.ts +10 -8
  90. package/dist/generators/ts/BigIntType.js +26 -51
  91. package/dist/generators/ts/BlankNodeType.d.ts +12 -12
  92. package/dist/generators/ts/BlankNodeType.js +9 -35
  93. package/dist/generators/ts/BooleanType.d.ts +12 -6
  94. package/dist/generators/ts/BooleanType.js +21 -11
  95. package/dist/generators/ts/Callable.d.ts +5 -0
  96. package/dist/generators/ts/Callable.js +2 -0
  97. package/dist/generators/ts/CodeThunk.d.ts +6 -0
  98. package/dist/generators/ts/CodeThunk.js +8 -0
  99. package/dist/generators/ts/DateTimeType.d.ts +7 -4
  100. package/dist/generators/ts/DateTimeType.js +8 -21
  101. package/dist/generators/ts/DateType.d.ts +7 -4
  102. package/dist/generators/ts/DateType.js +8 -21
  103. package/dist/generators/ts/DeclaredCallable.d.ts +23 -0
  104. package/dist/generators/ts/DeclaredCallable.js +59 -0
  105. package/dist/generators/ts/DefaultValueType.d.ts +24 -23
  106. package/dist/generators/ts/DefaultValueType.js +29 -59
  107. package/dist/generators/ts/FloatType.d.ts +7 -2
  108. package/dist/generators/ts/FloatType.js +16 -6
  109. package/dist/generators/ts/GraphqlSchema.js +1 -1
  110. package/dist/generators/ts/IdentifierType.d.ts +13 -13
  111. package/dist/generators/ts/IdentifierType.js +10 -39
  112. package/dist/generators/ts/Imports.d.ts +8 -0
  113. package/dist/generators/ts/Imports.js +15 -7
  114. package/dist/generators/ts/InlineCallable.d.ts +18 -0
  115. package/dist/generators/ts/InlineCallable.js +51 -0
  116. package/dist/generators/ts/IntType.d.ts +6 -1
  117. package/dist/generators/ts/IntType.js +16 -1
  118. package/dist/generators/ts/IriType.d.ts +12 -8
  119. package/dist/generators/ts/IriType.js +56 -43
  120. package/dist/generators/ts/LangStringType.d.ts +12 -7
  121. package/dist/generators/ts/LangStringType.js +37 -20
  122. package/dist/generators/ts/LazyOptionType.d.ts +10 -24
  123. package/dist/generators/ts/LazyOptionType.js +5 -26
  124. package/dist/generators/ts/LazySetType.d.ts +7 -2
  125. package/dist/generators/ts/LazySetType.js +5 -25
  126. package/dist/generators/ts/LazyType.d.ts +7 -2
  127. package/dist/generators/ts/LazyType.js +5 -21
  128. package/dist/generators/ts/ListType.d.ts +12 -7
  129. package/dist/generators/ts/ListType.js +45 -22
  130. package/dist/generators/ts/LiteralType.d.ts +11 -7
  131. package/dist/generators/ts/LiteralType.js +31 -21
  132. package/dist/generators/ts/ObjectDiscriminatedUnionType.d.ts +19 -2
  133. package/dist/generators/ts/ObjectDiscriminatedUnionType.js +105 -41
  134. package/dist/generators/ts/ObjectIntersectionType.d.ts +44 -0
  135. package/dist/generators/ts/ObjectIntersectionType.js +204 -0
  136. package/dist/generators/ts/ObjectSetType.js +0 -1
  137. package/dist/generators/ts/ObjectType.d.ts +78 -49
  138. package/dist/generators/ts/ObjectType.js +235 -362
  139. package/dist/generators/ts/Operation.d.ts +54 -0
  140. package/dist/generators/ts/Operation.js +206 -0
  141. package/dist/generators/ts/OptionType.d.ts +15 -13
  142. package/dist/generators/ts/OptionType.js +43 -33
  143. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +14 -7
  144. package/dist/generators/ts/ReferenceCallable.d.ts +14 -0
  145. package/dist/generators/ts/ReferenceCallable.js +16 -0
  146. package/dist/generators/ts/Service.d.ts +15 -0
  147. package/dist/generators/ts/Service.js +53 -0
  148. package/dist/generators/ts/SetType.d.ts +11 -8
  149. package/dist/generators/ts/SetType.js +35 -35
  150. package/dist/generators/ts/SnippetFactory.d.ts +1 -1
  151. package/dist/generators/ts/Snippets.d.ts +80 -2
  152. package/dist/generators/ts/Snippets.js +622 -74
  153. package/dist/generators/ts/SparqlObjectSetType.js +1 -4
  154. package/dist/generators/ts/StringType.d.ts +10 -5
  155. package/dist/generators/ts/StringType.js +25 -17
  156. package/dist/generators/ts/TermType.d.ts +13 -7
  157. package/dist/generators/ts/TermType.js +61 -71
  158. package/dist/generators/ts/TsFeature.d.ts +4 -1
  159. package/dist/generators/ts/TsFeature.js +51 -0
  160. package/dist/generators/ts/TsGenerator.d.ts +2 -1
  161. package/dist/generators/ts/TsGenerator.js +98 -54
  162. package/dist/generators/ts/Type.d.ts +2 -1
  163. package/dist/generators/ts/TypeFactory.d.ts +10 -7
  164. package/dist/generators/ts/TypeFactory.js +193 -140
  165. package/dist/generators/ts/UberObjectDiscriminatedUnionType.d.ts +6 -2
  166. package/dist/generators/ts/UberObjectDiscriminatedUnionType.js +18 -12
  167. package/dist/generators/ts/ZodGenerator.js +6 -14
  168. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_Discriminant.d.ts +3 -6
  169. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_conversionFunctionExpression.d.ts → AbstractDiscriminatedUnionType_conversionFunction.d.ts} +1 -1
  170. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_conversionFunctionExpression.js → AbstractDiscriminatedUnionType_conversionFunction.js} +2 -2
  171. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_equalsFunctionExpression.d.ts → AbstractDiscriminatedUnionType_equalsFunction.d.ts} +1 -1
  172. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_equalsFunctionExpression.js → AbstractDiscriminatedUnionType_equalsFunction.js} +4 -4
  173. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_filterFunctionExpression.d.ts → AbstractDiscriminatedUnionType_filterFunction.d.ts} +1 -1
  174. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_filterFunctionExpression.js → AbstractDiscriminatedUnionType_filterFunction.js} +7 -8
  175. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_filterTypeExpression.js +1 -2
  176. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.d.ts +5 -0
  177. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +18 -0
  178. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_fromRdfResourceValuesFunction.d.ts} +1 -1
  179. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression.js → AbstractDiscriminatedUnionType_fromRdfResourceValuesFunction.js} +5 -5
  180. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_hashFunctionExpression.d.ts → AbstractDiscriminatedUnionType_hashFunction.d.ts} +1 -1
  181. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_hashFunctionExpression.js → AbstractDiscriminatedUnionType_hashFunction.js} +4 -5
  182. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inferDiscriminant.js +6 -9
  183. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inlineExpression.js +5 -5
  184. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.d.ts +5 -0
  185. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.js +16 -0
  186. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.d.ts +5 -0
  187. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.js +20 -0
  188. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.d.ts} +1 -1
  189. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.js +18 -0
  190. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toStringFunctionExpression.d.ts → AbstractDiscriminatedUnionType_toStringFunction.d.ts} +1 -1
  191. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toStringFunctionExpression.js → AbstractDiscriminatedUnionType_toStringFunction.js} +3 -3
  192. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunction.d.ts} +1 -1
  193. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpression.js → AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunction.js} +4 -4
  194. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression.d.ts → AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.d.ts} +1 -1
  195. package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression.js → AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.js} +4 -4
  196. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_equalsFunction.d.ts +5 -0
  197. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_equalsFunction.js +7 -0
  198. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_filterFunction.d.ts +5 -0
  199. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_filterFunction.js +7 -0
  200. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_hashFunction.d.ts +5 -0
  201. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_hashFunction.js +8 -0
  202. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toLoggableFunction.d.ts +5 -0
  203. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toLoggableFunction.js +14 -0
  204. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toStringFunction.d.ts +5 -0
  205. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toStringFunction.js +17 -0
  206. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlConstructTriplesFunction.d.ts +5 -0
  207. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlConstructTriplesFunction.js +13 -0
  208. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.d.ts +5 -0
  209. package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.js +13 -0
  210. package/dist/generators/ts/_AbstractType/AbstractType_DiscriminatedType.d.ts +9 -0
  211. package/dist/generators/ts/_AbstractType/AbstractType_DiscriminatedType.js +2 -0
  212. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +196 -11
  213. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +411 -17
  214. package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunction.d.ts} +3 -3
  215. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunction.js +12 -0
  216. package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.d.ts} +3 -3
  217. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +32 -0
  218. package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_fromRdfResourceFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_fromRdfResourceFunction.d.ts} +3 -3
  219. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_fromRdfResourceFunction.js +16 -0
  220. package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_graphqlTypeVariableStatement.d.ts → ObjectDiscriminatedUnionType_graphqlTypeExpression.d.ts} +2 -2
  221. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeExpression.js +11 -0
  222. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaExpression.d.ts +4 -0
  223. package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_schemaVariableStatement.js → ObjectDiscriminatedUnionType_schemaExpression.js} +3 -8
  224. package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_toRdfResourceFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_toRdfResourceFunction.d.ts} +3 -3
  225. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunction.js +17 -0
  226. package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_typeGuardFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_typeGuardFunction.d.ts} +4 -3
  227. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunction.js +14 -0
  228. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__fromRdfResourceFunction.d.ts +4 -0
  229. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__fromRdfResourceFunction.js +16 -0
  230. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__toRdfResourceFunction.d.ts +4 -0
  231. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__toRdfResourceFunction.js +18 -0
  232. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunction.d.ts +4 -0
  233. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunction.js +30 -0
  234. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunctionParameters.d.ts +4 -0
  235. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunctionParameters.js +25 -0
  236. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createUnsafeFunction.d.ts +4 -0
  237. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createUnsafeFunction.js +10 -0
  238. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlConstructTriplesFunction.d.ts +4 -0
  239. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlConstructTriplesFunction.js +19 -0
  240. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlWherePatternsFunction.d.ts +4 -0
  241. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlWherePatternsFunction.js +19 -0
  242. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromJsonObjectFunction.d.ts +5 -0
  243. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromJsonObjectFunction.js +15 -0
  244. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceFunction.d.ts +4 -0
  245. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceFunction.js +9 -0
  246. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.d.ts +5 -0
  247. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +8 -0
  248. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toJsonObjectFunction.d.ts +4 -0
  249. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toJsonObjectFunction.js +7 -0
  250. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceFunction.d.ts +4 -0
  251. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceFunction.js +12 -0
  252. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceValuesFunction.d.ts +4 -0
  253. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceValuesFunction.js +5 -0
  254. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_typeGuardFunction.d.ts +5 -0
  255. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_typeGuardFunction.js +18 -0
  256. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +37 -23
  257. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +19 -1
  258. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +15 -15
  259. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +22 -56
  260. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +9 -10
  261. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +40 -49
  262. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +8 -9
  263. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +47 -14
  264. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +10 -10
  265. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +41 -57
  266. package/dist/generators/ts/_ObjectType/ObjectType__fromRdfResourceFunction.d.ts +4 -0
  267. package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionExpression.js → ObjectType__fromRdfResourceFunction.js} +14 -11
  268. package/dist/generators/ts/_ObjectType/ObjectType__toRdfResourceFunction.d.ts +4 -0
  269. package/dist/generators/ts/_ObjectType/ObjectType__toRdfResourceFunction.js +32 -0
  270. package/dist/generators/ts/_ObjectType/ObjectType_conversionFunction.d.ts +5 -0
  271. package/dist/generators/ts/_ObjectType/ObjectType_conversionFunction.js +28 -0
  272. package/dist/generators/ts/_ObjectType/ObjectType_createFunction.d.ts +4 -0
  273. package/dist/generators/ts/_ObjectType/ObjectType_createFunction.js +31 -0
  274. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionParameters.d.ts +3 -0
  275. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionParameters.js +29 -0
  276. package/dist/generators/ts/_ObjectType/ObjectType_createUnsafeFunction.d.ts +4 -0
  277. package/dist/generators/ts/_ObjectType/ObjectType_createUnsafeFunction.js +10 -0
  278. package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionExpression.d.ts → ObjectType_equalsFunction.d.ts} +2 -1
  279. package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionExpression.js → ObjectType_equalsFunction.js} +6 -4
  280. package/dist/generators/ts/_ObjectType/{ObjectType_filterFunctionExpression.d.ts → ObjectType_filterFunction.d.ts} +2 -1
  281. package/dist/generators/ts/_ObjectType/{ObjectType_filterFunctionExpression.js → ObjectType_filterFunction.js} +5 -2
  282. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts → ObjectType_focusSparqlConstructTriplesFunction.d.ts} +3 -3
  283. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionExpression.js → ObjectType_focusSparqlConstructTriplesFunction.js} +11 -4
  284. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts → ObjectType_focusSparqlWherePatternsFunction.d.ts} +3 -3
  285. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionExpression.js → ObjectType_focusSparqlWherePatternsFunction.js} +11 -4
  286. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonObjectFunction.d.ts +5 -0
  287. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonObjectFunction.js +19 -0
  288. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunction.d.ts +4 -0
  289. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunction.js +9 -0
  290. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.d.ts +5 -0
  291. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +8 -0
  292. package/dist/generators/ts/_ObjectType/{ObjectType_hashFunctionExpression.d.ts → ObjectType_hashFunction.d.ts} +2 -1
  293. package/dist/generators/ts/_ObjectType/{ObjectType_hashFunctionExpression.js → ObjectType_hashFunction.js} +10 -14
  294. package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +6 -2
  295. package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.js +1 -2
  296. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunction.d.ts +20 -0
  297. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunction.js +39 -0
  298. package/dist/generators/ts/_ObjectType/{ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → ObjectType_sparqlConstructQueryStringFunction.d.ts} +11 -4
  299. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunction.js +11 -0
  300. package/dist/generators/ts/_ObjectType/ObjectType_toJsonObjectFunction.d.ts +5 -0
  301. package/dist/generators/ts/_ObjectType/ObjectType_toJsonObjectFunction.js +16 -0
  302. package/dist/generators/ts/_ObjectType/ObjectType_toLoggableFunction.d.ts +5 -0
  303. package/dist/generators/ts/_ObjectType/ObjectType_toLoggableFunction.js +11 -0
  304. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunction.d.ts +4 -0
  305. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunction.js +12 -0
  306. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceValuesFunction.d.ts +5 -0
  307. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceValuesFunction.js +8 -0
  308. package/dist/generators/ts/_ObjectType/{ObjectType_toStringFunctionExpression.d.ts → ObjectType_toStringFunction.d.ts} +2 -1
  309. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunction.js +10 -0
  310. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunction.d.ts +4 -0
  311. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunction.js +17 -0
  312. package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunction.d.ts +5 -0
  313. package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunction.js +18 -0
  314. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts → ObjectType_valueSparqlConstructTriplesFunction.d.ts} +1 -1
  315. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunction.js +7 -0
  316. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts → ObjectType_valueSparqlWherePatternsFunction.d.ts} +1 -1
  317. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunction.js +9 -0
  318. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +1 -0
  319. package/dist/generators/ts/_snippets/snippets_DateSchema.js +1 -0
  320. package/dist/generators/ts/_snippets/snippets_FilterFunction.d.ts +3 -0
  321. package/dist/generators/ts/_snippets/snippets_FilterFunction.js +3 -0
  322. package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.d.ts +3 -0
  323. package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.js +21 -0
  324. package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.d.ts +3 -0
  325. package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.js +21 -0
  326. package/dist/generators/ts/_snippets/snippets_HashFunction.js +1 -1
  327. package/dist/generators/ts/_snippets/snippets_Hasher.js +1 -1
  328. package/dist/generators/ts/_snippets/snippets_IdentifierJsonObject.d.ts +3 -0
  329. package/dist/generators/ts/_snippets/snippets_IdentifierJsonObject.js +12 -0
  330. package/dist/generators/ts/_snippets/snippets_LangStringJsonObject.d.ts +3 -0
  331. package/dist/generators/ts/_snippets/snippets_LangStringJsonObject.js +14 -0
  332. package/dist/generators/ts/_snippets/snippets_Lazy.js +8 -1
  333. package/dist/generators/ts/_snippets/snippets_LazyOption.js +17 -1
  334. package/dist/generators/ts/_snippets/snippets_LazySet.js +8 -1
  335. package/dist/generators/ts/_snippets/snippets_LiteralJsonObject.d.ts +3 -0
  336. package/dist/generators/ts/_snippets/snippets_LiteralJsonObject.js +16 -0
  337. package/dist/generators/ts/_snippets/snippets_NumericSchema.js +1 -0
  338. package/dist/generators/ts/_snippets/snippets_ObjectTypeGuardFunction.d.ts +3 -0
  339. package/dist/generators/ts/_snippets/snippets_ObjectTypeGuardFunction.js +4 -0
  340. package/dist/generators/ts/_snippets/snippets_Primitive.d.ts +3 -0
  341. package/dist/generators/ts/_snippets/snippets_Primitive.js +4 -0
  342. package/dist/generators/ts/_snippets/snippets_ProblemDetailsJson.d.ts +3 -0
  343. package/dist/generators/ts/_snippets/snippets_ProblemDetailsJson.js +41 -0
  344. package/dist/generators/ts/_snippets/snippets_PropertyPath.js +11 -6
  345. package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryFunction.d.ts +3 -0
  346. package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryFunction.js +12 -0
  347. package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryStringFunction.d.ts +3 -0
  348. package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryStringFunction.js +13 -0
  349. package/dist/generators/ts/_snippets/snippets_StringSchema.js +1 -0
  350. package/dist/generators/ts/_snippets/snippets_TermJsonObject.d.ts +3 -0
  351. package/dist/generators/ts/_snippets/snippets_TermJsonObject.js +8 -0
  352. package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.d.ts +3 -0
  353. package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.js +3 -0
  354. package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.d.ts +3 -0
  355. package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.js +3 -0
  356. package/dist/generators/ts/_snippets/snippets_ToLoggableFunction.d.ts +3 -0
  357. package/dist/generators/ts/_snippets/snippets_ToLoggableFunction.js +3 -0
  358. package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +1 -1
  359. package/dist/generators/ts/_snippets/snippets_ToStringFunction.d.ts +3 -0
  360. package/dist/generators/ts/_snippets/snippets_ToStringFunction.js +3 -0
  361. package/dist/generators/ts/_snippets/snippets_ToStringRecordFunction.d.ts +3 -0
  362. package/dist/generators/ts/_snippets/snippets_ToStringRecordFunction.js +3 -0
  363. package/dist/generators/ts/_snippets/snippets_TypedLiteralJsonObject.d.ts +3 -0
  364. package/dist/generators/ts/_snippets/snippets_TypedLiteralJsonObject.js +14 -0
  365. package/dist/generators/ts/_snippets/snippets__ToRdfResourceFunction.js +1 -1
  366. package/dist/generators/ts/_snippets/snippets_arrayFromJsonArray.d.ts +3 -0
  367. package/dist/generators/ts/_snippets/snippets_arrayFromJsonArray.js +13 -0
  368. package/dist/generators/ts/_snippets/snippets_arrayToJsonArray.d.ts +3 -0
  369. package/dist/generators/ts/_snippets/snippets_arrayToJsonArray.js +6 -0
  370. package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonObject.d.ts +3 -0
  371. package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonObject.js +5 -0
  372. package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonString.d.ts +3 -0
  373. package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonString.js +5 -0
  374. package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +3 -3
  375. package/dist/generators/ts/_snippets/snippets_bigDecimalLiteral.js +3 -2
  376. package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonObject.d.ts +3 -0
  377. package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonObject.js +6 -0
  378. package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonString.d.ts +3 -0
  379. package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonString.js +5 -0
  380. package/dist/generators/ts/_snippets/snippets_bigIntFromJsonObject.d.ts +3 -0
  381. package/dist/generators/ts/_snippets/snippets_bigIntFromJsonObject.js +9 -0
  382. package/dist/generators/ts/_snippets/snippets_bigIntFromJsonString.d.ts +3 -0
  383. package/dist/generators/ts/_snippets/snippets_bigIntFromJsonString.js +8 -0
  384. package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +2 -2
  385. package/dist/generators/ts/_snippets/snippets_bigIntToJsonObject.d.ts +3 -0
  386. package/dist/generators/ts/_snippets/snippets_bigIntToJsonObject.js +6 -0
  387. package/dist/generators/ts/_snippets/snippets_bigIntToJsonString.d.ts +3 -0
  388. package/dist/generators/ts/_snippets/snippets_bigIntToJsonString.js +5 -0
  389. package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonObject.d.ts +3 -0
  390. package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonObject.js +5 -0
  391. package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonString.d.ts +3 -0
  392. package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonString.js +5 -0
  393. package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +2 -3
  394. package/dist/generators/ts/_snippets/snippets_blankNodeToJsonObject.d.ts +3 -0
  395. package/dist/generators/ts/_snippets/snippets_blankNodeToJsonObject.js +5 -0
  396. package/dist/generators/ts/_snippets/snippets_blankNodeToJsonString.d.ts +3 -0
  397. package/dist/generators/ts/_snippets/snippets_blankNodeToJsonString.js +5 -0
  398. package/dist/generators/ts/_snippets/snippets_booleanFromJsonBoolean.d.ts +3 -0
  399. package/dist/generators/ts/_snippets/snippets_booleanFromJsonBoolean.js +6 -0
  400. package/dist/generators/ts/_snippets/snippets_booleanFromJsonObject.d.ts +3 -0
  401. package/dist/generators/ts/_snippets/snippets_booleanFromJsonObject.js +9 -0
  402. package/dist/generators/ts/_snippets/snippets_constrainPrimitive.d.ts +3 -0
  403. package/dist/generators/ts/_snippets/snippets_constrainPrimitive.js +12 -0
  404. package/dist/generators/ts/_snippets/snippets_convertToLazy.js +2 -13
  405. package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +2 -13
  406. package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +2 -15
  407. package/dist/generators/ts/_snippets/snippets_dateFromJsonObject.d.ts +3 -0
  408. package/dist/generators/ts/_snippets/snippets_dateFromJsonObject.js +5 -0
  409. package/dist/generators/ts/_snippets/snippets_dateFromJsonString.d.ts +3 -0
  410. package/dist/generators/ts/_snippets/snippets_dateFromJsonString.js +5 -0
  411. package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +3 -4
  412. package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +7 -6
  413. package/dist/generators/ts/_snippets/snippets_dateTimeFromJsonObject.d.ts +3 -0
  414. package/dist/generators/ts/_snippets/snippets_dateTimeFromJsonObject.js +5 -0
  415. package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +3 -4
  416. package/dist/generators/ts/_snippets/snippets_dateTimeToJsonString.d.ts +3 -0
  417. package/dist/generators/ts/_snippets/snippets_dateTimeToJsonString.js +5 -0
  418. package/dist/generators/ts/_snippets/snippets_dateToJsonObject.d.ts +3 -0
  419. package/dist/generators/ts/_snippets/snippets_dateToJsonObject.js +6 -0
  420. package/dist/generators/ts/_snippets/snippets_dateToJsonString.d.ts +3 -0
  421. package/dist/generators/ts/_snippets/snippets_dateToJsonString.js +5 -0
  422. package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonObject.d.ts +3 -0
  423. package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonObject.js +9 -0
  424. package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonValue.d.ts +3 -0
  425. package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonValue.js +9 -0
  426. package/dist/generators/ts/_snippets/snippets_errorToProblemDetailsJson.d.ts +3 -0
  427. package/dist/generators/ts/_snippets/snippets_errorToProblemDetailsJson.js +27 -0
  428. package/dist/generators/ts/_snippets/snippets_filterBigDecimal.js +1 -1
  429. package/dist/generators/ts/_snippets/snippets_filterBlankNode.js +1 -3
  430. package/dist/generators/ts/_snippets/snippets_filterBoolean.js +1 -1
  431. package/dist/generators/ts/_snippets/snippets_filterDate.js +1 -1
  432. package/dist/generators/ts/_snippets/snippets_filterIdentifier.js +1 -1
  433. package/dist/generators/ts/_snippets/snippets_filterIri.js +1 -1
  434. package/dist/generators/ts/_snippets/snippets_filterLiteral.js +1 -3
  435. package/dist/generators/ts/_snippets/snippets_filterString.js +1 -1
  436. package/dist/generators/ts/_snippets/snippets_filterTerm.js +17 -17
  437. package/dist/generators/ts/_snippets/snippets_floatFromJsonNumber.d.ts +3 -0
  438. package/dist/generators/ts/_snippets/snippets_floatFromJsonNumber.js +6 -0
  439. package/dist/generators/ts/_snippets/snippets_floatFromJsonObject.d.ts +3 -0
  440. package/dist/generators/ts/_snippets/snippets_floatFromJsonObject.js +9 -0
  441. package/dist/generators/ts/_snippets/snippets_hashArray.js +1 -2
  442. package/dist/generators/ts/_snippets/snippets_hashBigDecimal.js +1 -2
  443. package/dist/generators/ts/_snippets/snippets_hashBoolean.js +1 -2
  444. package/dist/generators/ts/_snippets/snippets_hashDate.js +1 -2
  445. package/dist/generators/ts/_snippets/snippets_hashDateTime.js +1 -2
  446. package/dist/generators/ts/_snippets/snippets_hashMaybe.js +1 -2
  447. package/dist/generators/ts/_snippets/snippets_hashNumeric.js +1 -2
  448. package/dist/generators/ts/_snippets/snippets_hashString.js +1 -2
  449. package/dist/generators/ts/_snippets/snippets_hashTerm.js +1 -2
  450. package/dist/generators/ts/_snippets/snippets_identifierFromJsonObject.d.ts +3 -0
  451. package/dist/generators/ts/_snippets/snippets_identifierFromJsonObject.js +5 -0
  452. package/dist/generators/ts/_snippets/snippets_identifierFromJsonString.d.ts +3 -0
  453. package/dist/generators/ts/_snippets/snippets_identifierFromJsonString.js +5 -0
  454. package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +2 -3
  455. package/dist/generators/ts/_snippets/snippets_identifierToJsonObject.d.ts +3 -0
  456. package/dist/generators/ts/_snippets/snippets_identifierToJsonObject.js +5 -0
  457. package/dist/generators/ts/_snippets/snippets_identifierToJsonString.d.ts +3 -0
  458. package/dist/generators/ts/_snippets/snippets_identifierToJsonString.js +5 -0
  459. package/dist/generators/ts/_snippets/snippets_intFromJsonNumber.d.ts +3 -0
  460. package/dist/generators/ts/_snippets/snippets_intFromJsonNumber.js +6 -0
  461. package/dist/generators/ts/_snippets/snippets_intFromJsonObject.d.ts +3 -0
  462. package/dist/generators/ts/_snippets/snippets_intFromJsonObject.js +9 -0
  463. package/dist/generators/ts/_snippets/snippets_iriFromJsonObject.d.ts +3 -0
  464. package/dist/generators/ts/_snippets/snippets_iriFromJsonObject.js +6 -0
  465. package/dist/generators/ts/_snippets/snippets_iriFromJsonString.d.ts +3 -0
  466. package/dist/generators/ts/_snippets/snippets_iriFromJsonString.js +6 -0
  467. package/dist/generators/ts/_snippets/snippets_iriToJsonObject.d.ts +3 -0
  468. package/dist/generators/ts/_snippets/snippets_iriToJsonObject.js +6 -0
  469. package/dist/generators/ts/_snippets/snippets_iriToJsonString.d.ts +3 -0
  470. package/dist/generators/ts/_snippets/snippets_iriToJsonString.js +6 -0
  471. package/dist/generators/ts/_snippets/snippets_langStringFromJsonObject.d.ts +3 -0
  472. package/dist/generators/ts/_snippets/snippets_langStringFromJsonObject.js +5 -0
  473. package/dist/generators/ts/_snippets/snippets_langStringFromRdfResourceValues.js +2 -3
  474. package/dist/generators/ts/_snippets/snippets_langStringToJsonObject.d.ts +3 -0
  475. package/dist/generators/ts/_snippets/snippets_langStringToJsonObject.js +5 -0
  476. package/dist/generators/ts/_snippets/snippets_listFromJsonObject.d.ts +3 -0
  477. package/dist/generators/ts/_snippets/snippets_listFromJsonObject.js +10 -0
  478. package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +6 -5
  479. package/dist/generators/ts/_snippets/snippets_listToJsonObject.d.ts +3 -0
  480. package/dist/generators/ts/_snippets/snippets_listToJsonObject.js +6 -0
  481. package/dist/generators/ts/_snippets/snippets_literalFromJsonObject.d.ts +3 -0
  482. package/dist/generators/ts/_snippets/snippets_literalFromJsonObject.js +16 -0
  483. package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +2 -3
  484. package/dist/generators/ts/_snippets/snippets_literalToJsonObject.d.ts +3 -0
  485. package/dist/generators/ts/_snippets/snippets_literalToJsonObject.js +15 -0
  486. package/dist/generators/ts/_snippets/snippets_maybeFromJsonObject.d.ts +3 -0
  487. package/dist/generators/ts/_snippets/snippets_maybeFromJsonObject.js +12 -0
  488. package/dist/generators/ts/_snippets/snippets_maybeFromJsonValue.d.ts +3 -0
  489. package/dist/generators/ts/_snippets/snippets_maybeFromJsonValue.js +12 -0
  490. package/dist/generators/ts/_snippets/snippets_maybeToJsonObject.d.ts +3 -0
  491. package/dist/generators/ts/_snippets/snippets_maybeToJsonObject.js +6 -0
  492. package/dist/generators/ts/_snippets/snippets_maybeToJsonValue.d.ts +3 -0
  493. package/dist/generators/ts/_snippets/snippets_maybeToJsonValue.js +6 -0
  494. package/dist/generators/ts/_snippets/snippets_missingResolver.d.ts +3 -0
  495. package/dist/generators/ts/_snippets/snippets_missingResolver.js +3 -0
  496. package/dist/generators/ts/_snippets/snippets_primitiveToJsonObject.d.ts +3 -0
  497. package/dist/generators/ts/_snippets/snippets_primitiveToJsonObject.js +6 -0
  498. package/dist/generators/ts/_snippets/snippets_primitiveToJsonValue.d.ts +3 -0
  499. package/dist/generators/ts/_snippets/snippets_primitiveToJsonValue.js +6 -0
  500. package/dist/generators/ts/_snippets/snippets_sparqlInstancesOfPattern.js +4 -3
  501. package/dist/generators/ts/_snippets/snippets_stringFromJsonObject.d.ts +3 -0
  502. package/dist/generators/ts/_snippets/snippets_stringFromJsonObject.js +9 -0
  503. package/dist/generators/ts/_snippets/snippets_stringFromJsonString.d.ts +3 -0
  504. package/dist/generators/ts/_snippets/snippets_stringFromJsonString.js +6 -0
  505. package/dist/generators/ts/_snippets/snippets_termFromJsonObject.d.ts +3 -0
  506. package/dist/generators/ts/_snippets/snippets_termFromJsonObject.js +31 -0
  507. package/dist/generators/ts/_snippets/snippets_termToJsonObject.d.ts +3 -0
  508. package/dist/generators/ts/_snippets/snippets_termToJsonObject.js +14 -0
  509. package/dist/generators/ts/_snippets/snippets_typedLiteralToJsonObject.d.ts +3 -0
  510. package/dist/generators/ts/_snippets/snippets_typedLiteralToJsonObject.js +5 -0
  511. package/dist/generators/ts/_snippets/snippets_wrap_ToRdfResourceFunction.js +23 -3
  512. package/dist/generators/ts/_snippets/snippets_zValidator.d.ts +3 -0
  513. package/dist/generators/ts/_snippets/snippets_zValidator.js +16 -0
  514. package/dist/generators/ts/rdfjsTermExpression.d.ts +1 -1
  515. package/dist/generators/ts/rdfjsTermExpression.js +5 -54
  516. package/dist/input/ShapesGraph.d.ts +7 -3
  517. package/dist/input/ShapesGraph.js +74 -3
  518. package/dist/input/index.d.ts +3 -1
  519. package/dist/input/index.js +1 -1
  520. package/dist/input/input.shaclmate.d.ts +1494 -240
  521. package/dist/input/input.shaclmate.js +1159 -387
  522. package/dist/input/input.shaclmate.ttl +245 -0
  523. package/package.json +331 -98
  524. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonFunctionExpression.d.ts +0 -5
  525. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonFunctionExpression.js +0 -14
  526. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonSchemaExpression.d.ts +0 -5
  527. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonSchemaExpression.js +0 -32
  528. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonTypeLiteral.d.ts +0 -5
  529. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonTypeLiteral.js +0 -26
  530. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonFunctionExpression.d.ts +0 -5
  531. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonFunctionExpression.js +0 -10
  532. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression.js +0 -30
  533. package/dist/generators/ts/_AbstractType/AbstractType_DiscriminantProperty.d.ts +0 -9
  534. package/dist/generators/ts/_AbstractType/AbstractType_DiscriminantProperty.js +0 -2
  535. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunctionDeclaration.js +0 -13
  536. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunctionDeclaration.js +0 -32
  537. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_fromRdfResourceFunctionDeclaration.js +0 -17
  538. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeVariableStatement.js +0 -16
  539. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_identifierTypeDeclarations.d.ts +0 -4
  540. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_identifierTypeDeclarations.js +0 -14
  541. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaVariableStatement.d.ts +0 -4
  542. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunctionDeclaration.js +0 -15
  543. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunctionDeclaration.js +0 -16
  544. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +0 -4
  545. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +0 -29
  546. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +0 -4
  547. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +0 -12
  548. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +0 -4
  549. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +0 -4
  550. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +0 -10
  551. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +0 -4
  552. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.js +0 -22
  553. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +0 -4
  554. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +0 -5
  555. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +0 -4
  556. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +0 -17
  557. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +0 -10
  558. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +0 -35
  559. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -8
  560. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +0 -4
  561. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +0 -12
  562. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +0 -4
  563. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.js +0 -26
  564. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +0 -7
  565. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +0 -4
  566. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +0 -5
  567. package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunctionExpression.d.ts +0 -5
  568. package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunctionExpression.js +0 -14
  569. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +0 -8
  570. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +0 -10
  571. package/dist/generators/ts/_snippets/snippets_RdfVocabularies.d.ts +0 -3
  572. package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +0 -42
package/dist/Eithers.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import type { Either } from "purify-ts";
1
+ import { Either } from "purify-ts";
2
2
  export declare namespace Eithers {
3
+ function chainMap<OldT, NewT>(oldValues: readonly OldT[], callback: (value: OldT, index: number) => Either<Error, NewT>): Either<Error, readonly NewT[]>;
3
4
  function chain2<R1, R2>(either1: Either<Error, R1>, either2: Either<Error, R2>): Either<Error, [R1, R2]>;
4
5
  function chain3<R1, R2, R3>(either1: Either<Error, R1>, either2: Either<Error, R2>, either3: Either<Error, R3>): Either<Error, [R1, R2, R3]>;
5
6
  function chain4<R1, R2, R3, R4>(either1: Either<Error, R1>, either2: Either<Error, R2>, either3: Either<Error, R3>, either4: Either<Error, R4>): Either<Error, [R1, R2, R3, R4]>;
package/dist/Eithers.js CHANGED
@@ -1,5 +1,20 @@
1
+ import { Either } from "purify-ts";
1
2
  export var Eithers;
2
3
  (function (Eithers) {
4
+ function chainMap(oldValues, callback) {
5
+ const newValues = [];
6
+ let valueI = 0;
7
+ for (const oldValue of oldValues) {
8
+ const callbackResult = callback(oldValue, valueI);
9
+ if (callbackResult.isLeft()) {
10
+ return callbackResult;
11
+ }
12
+ newValues.push(callbackResult.extract());
13
+ valueI++;
14
+ }
15
+ return Either.of(newValues);
16
+ }
17
+ Eithers.chainMap = chainMap;
3
18
  function chain2(either1, either2) {
4
19
  return either1.chain((r1) => either2.map((r2) => [r1, r2]));
5
20
  }
@@ -1,6 +1,7 @@
1
1
  import { TermMap } from "@rdfx/collection";
2
2
  import { Either } from "purify-ts";
3
3
  import { ShapeStack } from "./_ShapesGraphToAstTransformer/ShapeStack.js";
4
+ // import { transformService } from "./_ShapesGraphToAstTransformer/transformService.js";
4
5
  import { transformShapeToAstType } from "./_ShapesGraphToAstTransformer/transformShapeToAstType.js";
5
6
  export class ShapesGraphToAstTransformer {
6
7
  // Members are protected so they're accessible to functions in other files
@@ -30,6 +31,14 @@ export class ShapesGraphToAstTransformer {
30
31
  astNamedTypes.push(nodeShapeAstType);
31
32
  });
32
33
  }
34
+ const astServices = [];
35
+ // for (const inputService of this.shapesGraph.services) {
36
+ // const astServiceEither = transformService.call(this, inputService);
37
+ // if (astServiceEither.isLeft()) {
38
+ // return astServiceEither;
39
+ // }
40
+ // astServices.push(astServiceEither.extract() as ast.Service);
41
+ // }
33
42
  return Either.of({
34
43
  lazyTypesCount: [...this.cachedAstTypesByShapeIdentifier.values()].reduce((acc, astType) => {
35
44
  switch (astType.kind) {
@@ -42,6 +51,7 @@ export class ShapesGraphToAstTransformer {
42
51
  }
43
52
  }, 0),
44
53
  namedTypes: astNamedTypes.concat(this.syntheticAstStructTypes),
54
+ services: astServices,
45
55
  });
46
56
  }
47
57
  }
@@ -9,7 +9,7 @@ export declare class ShapeStack {
9
9
  readonly in_: readonly (Literal | NamedNode)[];
10
10
  };
11
11
  get defaultValue(): Maybe<Literal | NamedNode>;
12
- pop(shape: input.Shape): this;
13
- push(shape: input.Shape): this;
12
+ pop(shape: input.UndiscriminatedShape): this;
13
+ push(shape: input.UndiscriminatedShape): this;
14
14
  }
15
15
  //# sourceMappingURL=ShapeStack.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { invariant } from "ts-invariant";
3
+ import { isPropertyShape } from "./isPropertyShape.js";
3
4
  export class ShapeStack {
4
5
  stack = [];
5
6
  constructor() {
@@ -27,7 +28,7 @@ export class ShapeStack {
27
28
  constraints;
28
29
  get defaultValue() {
29
30
  for (const shape of this.stack.toReversed()) {
30
- if (shape.$type !== "PropertyShape") {
31
+ if (!isPropertyShape(shape)) {
31
32
  continue;
32
33
  }
33
34
  if (shape.defaultValue.isJust()) {
@@ -0,0 +1,3 @@
1
+ import type * as input from "../input/index.js";
2
+ export declare function isNodeShape(shape: input.UndiscriminatedShape): shape is input.NodeShape;
3
+ //# sourceMappingURL=isNodeShape.d.ts.map
@@ -0,0 +1,4 @@
1
+ export function isNodeShape(shape) {
2
+ return !("path" in shape);
3
+ }
4
+ //# sourceMappingURL=isNodeShape.js.map
@@ -0,0 +1,3 @@
1
+ import type * as input from "../input/index.js";
2
+ export declare function isPropertyShape(shape: input.UndiscriminatedShape): shape is input.PropertyShape;
3
+ //# sourceMappingURL=isPropertyShape.d.ts.map
@@ -0,0 +1,4 @@
1
+ export function isPropertyShape(shape) {
2
+ return "path" in shape;
3
+ }
4
+ //# sourceMappingURL=isPropertyShape.js.map
@@ -1,4 +1,5 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import type * as input from "../input/index.js";
3
- export declare function shapeAstTypeName(shape: input.Shape): Maybe<string>;
3
+ import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
4
+ export declare function shapeAstTypeName(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape): Maybe<string>;
4
5
  //# sourceMappingURL=shapeAstTypeName.d.ts.map
@@ -1,7 +1,8 @@
1
- import { Curie } from "@shaclmate/shacl-ast";
1
+ import { Curie } from "@rdfx/curie";
2
2
  import { Maybe } from "purify-ts";
3
+ import { isNodeShape } from "./isNodeShape.js";
3
4
  export function shapeAstTypeName(shape) {
4
- if (shape.$type !== "NodeShape") {
5
+ if (!isNodeShape(shape)) {
5
6
  return Maybe.empty();
6
7
  }
7
8
  const shapeIdentifier = shape.$identifier();
@@ -14,7 +15,7 @@ export function shapeAstTypeName(shape) {
14
15
  }
15
16
  // CURIE shape identifier
16
17
  if (shapeIdentifier instanceof Curie) {
17
- if (shapeIdentifier.hasUniqueReference) {
18
+ if (this.shapesGraph.uniqueCurieReferences.has(shapeIdentifier.reference)) {
18
19
  return Maybe.of(shapeIdentifier.reference);
19
20
  }
20
21
  return Maybe.of(`${shapeIdentifier.prefix}_${shapeIdentifier.reference}`);
@@ -2,7 +2,7 @@ import { NodeKind } from "@shaclmate/shacl-ast";
2
2
  import { Either } from "purify-ts";
3
3
  import type * as input from "../input/index.js";
4
4
  import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
5
- export declare function shapeNodeKinds(this: ShapesGraphToAstTransformer, shape: input.Shape, options?: {
5
+ export declare function shapeNodeKinds(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, options?: {
6
6
  defaultNodeShapeNodeKinds: ReadonlySet<NodeKind>;
7
7
  defaultPropertyShapeNodeKinds?: ReadonlySet<NodeKind>;
8
8
  }): Either<Error, ReadonlySet<NodeKind>>;
@@ -1,6 +1,9 @@
1
1
  import { NodeKind } from "@shaclmate/shacl-ast";
2
2
  import { Either, Left, Maybe } from "purify-ts";
3
+ import { invariant } from "ts-invariant";
3
4
  import { defaultNodeShapeNodeKinds } from "./defaultNodeShapeNodeKinds.js";
5
+ import { isNodeShape } from "./isNodeShape.js";
6
+ import { isPropertyShape } from "./isPropertyShape.js";
4
7
  const defaultPropertyShapeNodeKinds = new Set([
5
8
  "BlankNode",
6
9
  "IRI",
@@ -31,7 +34,7 @@ export function shapeNodeKinds(shape, options) {
31
34
  [
32
35
  "sh:defaultValue",
33
36
  {
34
- includeNodeKinds: shape.$type === "PropertyShape"
37
+ includeNodeKinds: isPropertyShape(shape)
35
38
  ? shape.defaultValue
36
39
  .map((value) => NodeKind.fromTermType(value.termType))
37
40
  .toList()
@@ -103,7 +106,7 @@ export function shapeNodeKinds(shape, options) {
103
106
  [
104
107
  "shaclmate:resolve",
105
108
  {
106
- includeNodeKinds: (shape.$type === "PropertyShape"
109
+ includeNodeKinds: (isPropertyShape(shape)
107
110
  ? shape.resolve
108
111
  : Maybe.empty())
109
112
  .chain((resolve) => this.shapesGraph.nodeShape(resolve).toMaybe())
@@ -160,9 +163,10 @@ export function shapeNodeKinds(shape, options) {
160
163
  if (constraintNodeKinds.size > 0) {
161
164
  return Either.of(constraintNodeKinds);
162
165
  }
163
- if (shape.$type === "NodeShape") {
166
+ if (isNodeShape(shape)) {
164
167
  return Either.of(options?.defaultNodeShapeNodeKinds ?? defaultNodeShapeNodeKinds);
165
168
  }
169
+ invariant(isPropertyShape(shape));
166
170
  if (shape.path.termType === "InversePath") {
167
171
  // Inverse paths can only have blank nodes and IRIs as values, because the value is the subject of a triple.
168
172
  return Either.of(new Set(["BlankNode", "IRI"]));
@@ -1,5 +1,5 @@
1
1
  import { Either, Maybe } from "purify-ts";
2
2
  import type * as input from "../input/index.js";
3
3
  import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
4
- export declare function shapeOntology(this: ShapesGraphToAstTransformer, shape: input.Shape): Either<Error, Maybe<input.Ontology>>;
4
+ export declare function shapeOntology(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape): Either<Error, Maybe<input.Ontology>>;
5
5
  //# sourceMappingURL=shapeOntology.d.ts.map
@@ -13,5 +13,5 @@ import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer
13
13
  export declare function transformPropertyShapeToAstStructTypeField(this: ShapesGraphToAstTransformer, { propertyShape, structType, }: {
14
14
  propertyShape: input.PropertyShape;
15
15
  structType: ast.StructType;
16
- }): Either<Error, Maybe<ast.StructType.Field>>;
16
+ }): Either<Error, Maybe<ast.StructType.ShaclField>>;
17
17
  //# sourceMappingURL=transformPropertyShapeToAstStructTypeField.d.ts.map
@@ -1,5 +1,5 @@
1
+ import { Curie } from "@rdfx/curie";
1
2
  import dataFactory from "@rdfx/data-factory";
2
- import { Curie } from "@shaclmate/shacl-ast";
3
3
  import { sh } from "@tpluscode/rdf-ns-builders";
4
4
  import { Either, Left, Maybe } from "purify-ts";
5
5
  import { invariant } from "ts-invariant";
@@ -48,11 +48,23 @@ function fieldName(propertyShape, structType) {
48
48
  }
49
49
  throw new Error(`${propertyShape}: unable to infer name`);
50
50
  }
51
+ function propertyCardinality(propertyShape) {
52
+ let maxCount = propertyShape.maxCount.orDefault(BigInt(Number.MAX_SAFE_INTEGER));
53
+ let minCount = propertyShape.minCount.orDefault(0n);
54
+ if (minCount < 0n) {
55
+ minCount = 0n;
56
+ }
57
+ if (propertyShape.hasValues.length > minCount) {
58
+ minCount = BigInt(propertyShape.hasValues.length);
59
+ }
60
+ if (maxCount < minCount) {
61
+ maxCount = minCount;
62
+ }
63
+ return { maxCount, minCount };
64
+ }
51
65
  function synthesizePartialAstStructType({ identifierType, }) {
52
66
  let syntheticName;
53
67
  switch (identifierType.kind) {
54
- case "BlankNode":
55
- throw new Error("should never happen");
56
68
  case "Identifier":
57
69
  syntheticName = "DefaultPartial";
58
70
  break;
@@ -77,6 +89,10 @@ function synthesizePartialAstStructType({ identifierType, }) {
77
89
  toRdfTypes: [],
78
90
  tsImports: [],
79
91
  });
92
+ partialAstStructType.addField(new ast.StructType.IdentifierField({
93
+ structType: partialAstStructType,
94
+ type: identifierType,
95
+ }));
80
96
  this.syntheticAstStructTypes.push(partialAstStructType);
81
97
  return partialAstStructType;
82
98
  }
@@ -89,17 +105,7 @@ function transformPropertyShapeToAstType(propertyShape, shapeStack) {
89
105
  return transformShapeToAstType
90
106
  .call(this, propertyShape, shapeStack)
91
107
  .chain((propertyShapeAstType) => {
92
- let maxCount = propertyShape.maxCount.orDefault(BigInt(Number.MAX_SAFE_INTEGER));
93
- let minCount = propertyShape.minCount.orDefault(0n);
94
- if (minCount < 0n) {
95
- minCount = 0n;
96
- }
97
- if (propertyShape.hasValues.length > minCount) {
98
- minCount = BigInt(propertyShape.hasValues.length);
99
- }
100
- if (maxCount < minCount) {
101
- maxCount = minCount;
102
- }
108
+ const { maxCount, minCount } = propertyCardinality(propertyShape);
103
109
  if (propertyShapeAstType.kind === "DefaultValue") {
104
110
  if (minCount > 0n) {
105
111
  return Left(new Error(`${propertyShape}: has sh:minCount > 0 and sh:defaultValue`));
@@ -197,7 +203,6 @@ export function transformPropertyShapeToAstStructTypeField({ propertyShape, stru
197
203
  }
198
204
  let astPartialItemType;
199
205
  switch (astItemType.kind) {
200
- case "BlankNode":
201
206
  case "Identifier":
202
207
  case "Iri":
203
208
  astPartialItemType = synthesizePartialAstStructType.call(this, {
@@ -216,6 +221,18 @@ export function transformPropertyShapeToAstStructTypeField({ propertyShape, stru
216
221
  default:
217
222
  return Left(new Error(`${propertyShape} has a resolve with an incompatible partial type ${astItemType.kind}`));
218
223
  }
224
+ const astPartialItemIdentifierType = astPartialItemType.kind === "Struct"
225
+ ? astPartialItemType.identifierType
226
+ : ast.StructCompoundType.identifierType(astPartialItemType);
227
+ const astResolveItemIdentifierType = astResolveItemType.kind === "Struct"
228
+ ? astResolveItemType.identifierType
229
+ : ast.StructCompoundType.identifierType(astResolveItemType);
230
+ if (astPartialItemIdentifierType.kind !== astResolveItemIdentifierType.kind) {
231
+ return Left(new Error(`${propertyShape} has a resolve with a different identifier type (${astResolveItemIdentifierType.kind}) than the partial's identifier type (${astPartialItemIdentifierType.kind})`));
232
+ }
233
+ if (astPartialItemIdentifierType.kind === "BlankNode") {
234
+ return Left(new Error(`${propertyShape} has a ${astPartialItemIdentifierType.kind} identifier type, which is incompatible with shaclmate:resolve`));
235
+ }
219
236
  const astAbstractTypeProperties = {
220
237
  comment: Maybe.empty(),
221
238
  label: Maybe.empty(),
@@ -268,11 +285,12 @@ export function transformPropertyShapeToAstStructTypeField({ propertyShape, stru
268
285
  astType.nodeKinds.has("Literal")) {
269
286
  return Left(new Error(`${propertyShape}: property shapes with inverse paths can only have blank node or IRI node kinds`));
270
287
  }
271
- return Either.of(Maybe.of(new ast.StructType.Field({
288
+ return Either.of(Maybe.of(new ast.StructType.ShaclField({
272
289
  comment: propertyShape.comment,
273
290
  description: propertyShape.description,
274
291
  display: propertyShape.display,
275
292
  label: propertyShape.label,
293
+ minCount: propertyCardinality(propertyShape).minCount,
276
294
  mutable: propertyShape.mutable.orDefault(false),
277
295
  name: fieldName.call(this, propertyShape, structType),
278
296
  order: propertyShape.order.orDefault(0),
@@ -6,5 +6,5 @@ import type { ShapeStack } from "./ShapeStack.js";
6
6
  /**
7
7
  * Try to convert a shape to a compound type (intersection or union) using some heuristics.
8
8
  */
9
- export declare function transformShapeToAstCompoundType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
9
+ export declare function transformShapeToAstCompoundType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
10
10
  //# sourceMappingURL=transformShapeToAstCompoundType.d.ts.map
@@ -2,6 +2,7 @@ import { Either, Left, Maybe } from "purify-ts";
2
2
  import { invariant } from "ts-invariant";
3
3
  import * as ast from "../ast/index.js";
4
4
  import { Eithers } from "../Eithers.js";
5
+ import { isNodeShape } from "./isNodeShape.js";
5
6
  import { shapeAstTypeName } from "./shapeAstTypeName.js";
6
7
  import { transformShapeToAstType } from "./transformShapeToAstType.js";
7
8
  /**
@@ -37,7 +38,7 @@ export function transformShapeToAstCompoundType(shape, shapeStack) {
37
38
  : ast.DiscriminatedUnionType)({
38
39
  comment: shape.comment,
39
40
  label: shape.label,
40
- name: shapeAstTypeName(shape),
41
+ name: shapeAstTypeName.call(this, shape),
41
42
  shapeIdentifier: shape.$identifier(),
42
43
  synthetic: false,
43
44
  });
@@ -62,7 +63,7 @@ export function transformShapeToAstCompoundType(shape, shapeStack) {
62
63
  }
63
64
  let memberDiscriminantValue;
64
65
  if (compoundTypeKind === "DiscriminatedUnion") {
65
- if (memberShape.$type === "NodeShape") {
66
+ if (isNodeShape(memberShape)) {
66
67
  memberDiscriminantValue =
67
68
  memberShape.discriminantValue.extract();
68
69
  }
@@ -7,5 +7,5 @@ import type { ShapeStack } from "./ShapeStack.js";
7
7
  * Is an ast.StructType actually the shape of an RDF list?
8
8
  * If so, return the type of its rdf:first.
9
9
  */
10
- export declare function transformShapeToAstListType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, Maybe<ast.ListType>>;
10
+ export declare function transformShapeToAstListType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, Maybe<ast.ListType>>;
11
11
  //# sourceMappingURL=transformShapeToAstListType.d.ts.map
@@ -4,6 +4,7 @@ import { Either, Left, Maybe } from "purify-ts";
4
4
  import * as ast from "../ast/index.js";
5
5
  import { Eithers } from "../Eithers.js";
6
6
  import { defaultNodeShapeNodeKinds } from "./defaultNodeShapeNodeKinds.js";
7
+ import { isNodeShape } from "./isNodeShape.js";
7
8
  import { shapeNodeKinds } from "./shapeNodeKinds.js";
8
9
  import { transformPropertyShapeToAstStructTypeField } from "./transformPropertyShapeToAstStructTypeField.js";
9
10
  const listPropertiesStructType = new ast.StructType({
@@ -37,7 +38,7 @@ const empty = Either.of(Maybe.empty());
37
38
  export function transformShapeToAstListType(shape, shapeStack) {
38
39
  shapeStack.push(shape);
39
40
  try {
40
- if (shape.$type !== "NodeShape") {
41
+ if (!isNodeShape(shape)) {
41
42
  return empty;
42
43
  }
43
44
  const nodeShape = shape;
@@ -67,8 +68,7 @@ export function transformShapeToAstListType(shape, shapeStack) {
67
68
  shape.hasValues[0].equals(rdf.nil)) {
68
69
  emptyListShape = shape;
69
70
  }
70
- else if (shape.$type === "NodeShape" &&
71
- shape.properties.length >= 2) {
71
+ else if (isNodeShape(shape) && shape.properties.length >= 2) {
72
72
  nonEmptyListShape = shape;
73
73
  }
74
74
  }
@@ -3,5 +3,5 @@ import * as ast from "../ast/index.js";
3
3
  import type * as input from "../input/index.js";
4
4
  import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
5
5
  import type { ShapeStack } from "./ShapeStack.js";
6
- export declare function transformShapeToAstStructType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
6
+ export declare function transformShapeToAstStructType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
7
7
  //# sourceMappingURL=transformShapeToAstStructType.d.ts.map
@@ -4,40 +4,78 @@ import { invariant } from "ts-invariant";
4
4
  import * as ast from "../ast/index.js";
5
5
  import { Eithers } from "../Eithers.js";
6
6
  import { defaultNodeShapeNodeKinds } from "./defaultNodeShapeNodeKinds.js";
7
+ import { isNodeShape } from "./isNodeShape.js";
7
8
  import { shapeAstTypeName } from "./shapeAstTypeName.js";
8
9
  import { shapeNodeKinds } from "./shapeNodeKinds.js";
9
10
  import { transformPropertyShapeToAstStructTypeField } from "./transformPropertyShapeToAstStructTypeField.js";
10
11
  import { transformShapeToAstType } from "./transformShapeToAstType.js";
11
12
  function isStructTypeFieldRequired(field) {
12
- switch (field.type.kind) {
13
- case "DefaultValue":
14
- return false;
15
- case "LazyOption":
16
- return false;
17
- case "LazySet":
18
- return field.type.partialType.minCount > 0n;
19
- case "Option":
20
- return false;
21
- case "Set":
22
- return field.type.minCount > 0;
23
- case "DiscriminatedUnion":
24
- return field.type.members.every((member) => isStructTypeFieldRequired({ type: member.type }));
25
- case "BlankNode":
13
+ switch (field.kind) {
26
14
  case "Identifier":
27
- case "Iri":
28
- case "Lazy":
29
- case "List":
30
- case "Literal":
31
- case "Struct":
32
- case "Term":
33
- return true;
34
- case "Intersection":
35
- throw new Error("unsupported");
15
+ return field.type.kind === "Iri";
16
+ case "Shacl": {
17
+ switch (field.type.kind) {
18
+ case "DiscriminatedUnion":
19
+ return field.type.members.every((member) => isStructTypeFieldRequired({ kind: "Shacl", type: member.type }));
20
+ case "DefaultValue":
21
+ return false;
22
+ case "Intersection":
23
+ return field.type.members.every((member) => isStructTypeFieldRequired({ kind: "Shacl", type: member.type }));
24
+ case "LazyOption":
25
+ return false;
26
+ case "LazySet":
27
+ return field.type.partialType.minCount > 0n;
28
+ case "Option":
29
+ return false;
30
+ case "Set":
31
+ return field.type.minCount > 0;
32
+ case "BlankNode":
33
+ case "Identifier":
34
+ case "Iri":
35
+ case "Lazy":
36
+ case "List":
37
+ case "Literal":
38
+ case "Struct":
39
+ case "Term":
40
+ return true;
41
+ default:
42
+ field.type;
43
+ throw new Error("should never reach this point");
44
+ }
45
+ }
36
46
  default:
37
- field.type;
47
+ field.kind;
38
48
  throw new Error("should never reach this point");
39
49
  }
40
50
  }
51
+ function transformNodeShapeNodeKindsToAstIdentifierType(nodeKinds, nodeShape) {
52
+ const identifierTypeProperties = {
53
+ comment: Maybe.empty(),
54
+ label: Maybe.empty(),
55
+ name: Maybe.empty(),
56
+ shapeIdentifier: nodeShape.$identifier(),
57
+ };
58
+ if (nodeKinds.size === 2) {
59
+ invariant(nodeShape.in_.isNothing());
60
+ return new ast.IdentifierType(identifierTypeProperties);
61
+ }
62
+ const nodeKind = [...nodeKinds][0];
63
+ switch (nodeKind) {
64
+ case "BlankNode":
65
+ invariant(nodeShape.in_.isNothing());
66
+ return new ast.BlankNodeType(identifierTypeProperties);
67
+ case "IRI":
68
+ return new ast.IriType({
69
+ ...identifierTypeProperties,
70
+ hasValues: [],
71
+ in_: nodeShape.in_
72
+ .orDefault([])
73
+ .filter((_) => _.termType === "NamedNode"),
74
+ });
75
+ default:
76
+ throw new Error("should never happen");
77
+ }
78
+ }
41
79
  export function transformShapeToAstStructType(shape, shapeStack) {
42
80
  shapeStack.push(shape);
43
81
  try {
@@ -48,7 +86,7 @@ export function transformShapeToAstStructType(shape, shapeStack) {
48
86
  .chain((nodeShape) => transformShapeToAstType.call(this, nodeShape, shapeStack))
49
87
  .map(Maybe.of);
50
88
  }
51
- if (shape.$type !== "NodeShape") {
89
+ if (!isNodeShape(shape)) {
52
90
  return Either.of(Maybe.empty());
53
91
  }
54
92
  const nodeShape = shape;
@@ -88,37 +126,7 @@ export function transformShapeToAstStructType(shape, shapeStack) {
88
126
  if (nodeKinds.has("Literal")) {
89
127
  return Left(new Error(`${nodeShape} should not have a nodeKind "Literal"`));
90
128
  }
91
- let identifierType;
92
- const identifierTypeProperties = {
93
- comment: Maybe.empty(),
94
- label: Maybe.empty(),
95
- name: Maybe.empty(),
96
- shapeIdentifier: nodeShape.$identifier(),
97
- };
98
- if (nodeKinds.size === 2) {
99
- invariant(nodeShape.in_.isNothing());
100
- identifierType = new ast.IdentifierType(identifierTypeProperties);
101
- }
102
- else {
103
- switch ([...nodeKinds][0]) {
104
- case "BlankNode":
105
- invariant(nodeShape.in_.isNothing());
106
- identifierType = new ast.BlankNodeType(identifierTypeProperties);
107
- break;
108
- case "IRI":
109
- identifierType = new ast.IriType({
110
- ...identifierTypeProperties,
111
- hasValues: [],
112
- in_: nodeShape.in_
113
- .orDefault([])
114
- .filter((_) => _.termType === "NamedNode"),
115
- });
116
- break;
117
- default:
118
- throw new Error("should never happen");
119
- }
120
- }
121
- invariant(identifierType);
129
+ const identifierType = transformNodeShapeNodeKindsToAstIdentifierType.call(this, nodeKinds, nodeShape);
122
130
  // Put a placeholder in the cache to deal with cyclic references
123
131
  // Remove the placeholder if the transformation fails.
124
132
  // If this node shape's properties (directly or indirectly) refer to the node shape itself,
@@ -127,30 +135,43 @@ export function transformShapeToAstStructType(shape, shapeStack) {
127
135
  comment: nodeShape.comment,
128
136
  extern: nodeShape.extern.orDefault(false),
129
137
  fromRdfType,
130
- label: nodeShape.label,
131
138
  identifierType,
132
- name: shapeAstTypeName(nodeShape),
139
+ label: nodeShape.label,
140
+ name: shapeAstTypeName.call(this, nodeShape),
133
141
  shapeIdentifier: nodeShape.$identifier(),
134
142
  synthetic: false,
135
143
  toRdfTypes,
136
144
  tsImports: nodeShape.tsImports,
137
145
  });
146
+ if (identifierType.kind !== "BlankNode") {
147
+ structType.addField(new ast.StructType.IdentifierField({
148
+ structType,
149
+ type: identifierType,
150
+ }));
151
+ }
138
152
  this.cachedAstTypesByShapeIdentifier.set(nodeShape.$identifier(), structType);
139
153
  return (() => {
140
- // Populate properties
154
+ // Populate fields
155
+ const fieldNames = new Set();
141
156
  for (const propertyShape of propertyShapes) {
142
- const fieldEither = transformPropertyShapeToAstStructTypeField.call(this, {
157
+ const fieldEither = transformPropertyShapeToAstStructTypeField
158
+ .call(this, {
143
159
  propertyShape,
144
160
  structType,
161
+ })
162
+ .chain((fieldMaybe) => {
163
+ const field = fieldMaybe.extract();
164
+ if (field) {
165
+ if (fieldNames.has(field.name)) {
166
+ return Left(new Error(`${nodeShape} has duplicate property name: ${field.name}`));
167
+ }
168
+ structType.addField(field);
169
+ }
170
+ return Either.of(undefined);
145
171
  });
146
172
  if (fieldEither.isLeft()) {
147
173
  return fieldEither;
148
174
  }
149
- fieldEither.ifRight((property) => {
150
- property.ifJust((property) => {
151
- structType.addFields(property);
152
- });
153
- });
154
175
  }
155
176
  if (!structType.extern &&
156
177
  structType.fromRdfType.isNothing() &&
@@ -7,6 +7,6 @@ type AstTermType = ast.BlankNodeType | ast.DefaultValueType<ast.IdentifierType |
7
7
  /**
8
8
  * Try to convert a shape to an AST TermType using some heuristics.
9
9
  */
10
- export declare function transformShapeToAstTermType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, AstTermType>;
10
+ export declare function transformShapeToAstTermType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, AstTermType>;
11
11
  export {};
12
12
  //# sourceMappingURL=transformShapeToAstTermType.d.ts.map
@@ -14,7 +14,7 @@ export function transformShapeToAstTermType(shape, shapeStack) {
14
14
  const in_ = shapeStack.constraints.in_;
15
15
  const astAbstractTypeProperties = {
16
16
  comment: Maybe.empty(),
17
- name: shapeAstTypeName(shape),
17
+ name: shapeAstTypeName.call(this, shape),
18
18
  label: Maybe.empty(),
19
19
  shapeIdentifier: shape.$identifier(),
20
20
  };
@@ -7,5 +7,5 @@ import type { ShapeStack } from "./ShapeStack.js";
7
7
  * Try to transform a shape to an AST type using some heuristics. All shape -> AST type transformation calls should go through this function,
8
8
  * not the other transformShapeToAst*Type functions directly.
9
9
  */
10
- export declare function transformShapeToAstType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, ast.Type>;
10
+ export declare function transformShapeToAstType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, ast.Type>;
11
11
  //# sourceMappingURL=transformShapeToAstType.d.ts.map
@@ -15,12 +15,12 @@ export declare abstract class AbstractCollectionType<ItemTypeT extends AbstractC
15
15
  toJSON(): {
16
16
  mutable: boolean | undefined;
17
17
  itemType: any;
18
- comment: string | undefined;
19
18
  kind: string;
20
- label: string | undefined;
21
19
  name: string | undefined;
22
20
  recursive: boolean | undefined;
23
21
  shapeIdentifier: import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>;
22
+ comment: string | undefined;
23
+ label: string | undefined;
24
24
  };
25
25
  }
26
26
  export declare namespace AbstractCollectionType {