@shaclmate/compiler 4.0.7 → 4.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/dist/Compiler.d.ts +1 -4
  2. package/dist/Compiler.js +1 -5
  3. package/dist/ShapesGraphToAstTransformer.d.ts +2 -11
  4. package/dist/ShapesGraphToAstTransformer.js +25 -27
  5. package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.d.ts +3 -0
  6. package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.js +5 -0
  7. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +4 -0
  8. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +27 -0
  9. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +74 -19
  10. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
  11. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +45 -91
  12. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +11 -0
  13. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +146 -0
  14. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +7 -0
  15. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +182 -0
  16. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +9 -7
  17. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +3 -5
  18. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +33 -10
  19. package/dist/ast/AbstractCompoundType.d.ts +26 -8
  20. package/dist/ast/AbstractCompoundType.js +84 -16
  21. package/dist/ast/AbstractContainerType.d.ts +2 -4
  22. package/dist/ast/AbstractContainerType.js +3 -4
  23. package/dist/ast/AbstractLazyObjectType.d.ts +1 -0
  24. package/dist/ast/AbstractLazyObjectType.js +3 -0
  25. package/dist/ast/AbstractTermType.d.ts +1 -0
  26. package/dist/ast/AbstractTermType.js +1 -0
  27. package/dist/ast/AbstractType.d.ts +16 -1
  28. package/dist/ast/AbstractType.js +11 -1
  29. package/dist/ast/Ast.d.ts +4 -4
  30. package/dist/ast/BlankNodeType.d.ts +1 -1
  31. package/dist/ast/DefaultValueType.d.ts +1 -2
  32. package/dist/ast/DefaultValueType.js +2 -0
  33. package/dist/ast/IdentifierType.d.ts +1 -1
  34. package/dist/ast/IntersectionType.d.ts +7 -2
  35. package/dist/ast/IntersectionType.js +8 -0
  36. package/dist/ast/ListType.d.ts +2 -9
  37. package/dist/ast/ListType.js +1 -9
  38. package/dist/ast/LiteralType.d.ts +1 -0
  39. package/dist/ast/LiteralType.js +26 -0
  40. package/dist/ast/ObjectCompoundType.d.ts +12 -0
  41. package/dist/ast/ObjectCompoundType.js +88 -0
  42. package/dist/ast/ObjectIntersectionType.d.ts +3 -7
  43. package/dist/ast/ObjectIntersectionType.js +1 -7
  44. package/dist/ast/ObjectType.d.ts +14 -31
  45. package/dist/ast/ObjectType.js +41 -73
  46. package/dist/ast/ObjectUnionType.d.ts +3 -7
  47. package/dist/ast/ObjectUnionType.js +1 -7
  48. package/dist/ast/OptionType.d.ts +1 -2
  49. package/dist/ast/OptionType.js +2 -0
  50. package/dist/ast/SetType.d.ts +1 -2
  51. package/dist/ast/SetType.js +2 -0
  52. package/dist/ast/Type.d.ts +1 -4
  53. package/dist/ast/Type.js +0 -6
  54. package/dist/ast/UnionType.d.ts +11 -6
  55. package/dist/ast/UnionType.js +6 -4
  56. package/dist/ast/index.d.ts +1 -2
  57. package/dist/ast/index.js +1 -2
  58. package/dist/generators/json/AstJsonGenerator.js +16 -14
  59. package/dist/generators/ts/AbstractCollectionType.js +8 -10
  60. package/dist/generators/ts/AbstractContainerType.d.ts +8 -3
  61. package/dist/generators/ts/AbstractContainerType.js +9 -2
  62. package/dist/generators/ts/AbstractDateType.d.ts +2 -2
  63. package/dist/generators/ts/AbstractDateType.js +2 -2
  64. package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
  65. package/dist/generators/ts/AbstractIdentifierType.js +1 -1
  66. package/dist/generators/ts/AbstractLazyObjectType.d.ts +11 -8
  67. package/dist/generators/ts/AbstractLazyObjectType.js +19 -14
  68. package/dist/generators/ts/AbstractNamedUnionType.d.ts +33 -0
  69. package/dist/generators/ts/AbstractNamedUnionType.js +193 -0
  70. package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
  71. package/dist/generators/ts/AbstractNumericType.js +3 -3
  72. package/dist/generators/ts/AbstractTermType.d.ts +7 -4
  73. package/dist/generators/ts/AbstractTermType.js +7 -4
  74. package/dist/generators/ts/AbstractType.d.ts +29 -14
  75. package/dist/generators/ts/AbstractUnionType.d.ts +80 -0
  76. package/dist/generators/ts/AbstractUnionType.js +514 -0
  77. package/dist/generators/ts/AnonymousUnionType.d.ts +26 -0
  78. package/dist/generators/ts/AnonymousUnionType.js +56 -0
  79. package/dist/generators/ts/BigDecimalType.d.ts +3 -3
  80. package/dist/generators/ts/BigDecimalType.js +3 -3
  81. package/dist/generators/ts/BlankNodeType.d.ts +1 -1
  82. package/dist/generators/ts/BlankNodeType.js +1 -1
  83. package/dist/generators/ts/BooleanType.d.ts +2 -2
  84. package/dist/generators/ts/BooleanType.js +2 -2
  85. package/dist/generators/ts/DefaultValueType.d.ts +4 -4
  86. package/dist/generators/ts/DefaultValueType.js +14 -13
  87. package/dist/generators/ts/IdentifierType.d.ts +1 -1
  88. package/dist/generators/ts/IdentifierType.js +1 -1
  89. package/dist/generators/ts/IriType.d.ts +1 -1
  90. package/dist/generators/ts/IriType.js +1 -1
  91. package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
  92. package/dist/generators/ts/LazyObjectOptionType.js +9 -9
  93. package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
  94. package/dist/generators/ts/LazyObjectSetType.js +7 -7
  95. package/dist/generators/ts/LazyObjectType.d.ts +1 -1
  96. package/dist/generators/ts/LazyObjectType.js +7 -8
  97. package/dist/generators/ts/ListType.d.ts +8 -7
  98. package/dist/generators/ts/ListType.js +14 -13
  99. package/dist/generators/ts/LiteralType.d.ts +1 -1
  100. package/dist/generators/ts/LiteralType.js +2 -2
  101. package/dist/generators/ts/NamedObjectUnionType.d.ts +35 -0
  102. package/dist/generators/ts/NamedObjectUnionType.js +221 -0
  103. package/dist/generators/ts/NamedUnionType.d.ts +11 -0
  104. package/dist/generators/ts/NamedUnionType.js +13 -0
  105. package/dist/generators/ts/ObjectType.d.ts +34 -25
  106. package/dist/generators/ts/ObjectType.js +62 -52
  107. package/dist/generators/ts/OptionType.d.ts +4 -4
  108. package/dist/generators/ts/OptionType.js +10 -10
  109. package/dist/generators/ts/SetType.d.ts +4 -4
  110. package/dist/generators/ts/SetType.js +13 -11
  111. package/dist/generators/ts/StringType.d.ts +2 -2
  112. package/dist/generators/ts/StringType.js +2 -2
  113. package/dist/generators/ts/TermType.d.ts +1 -1
  114. package/dist/generators/ts/TermType.js +2 -2
  115. package/dist/generators/ts/TsGenerator.js +23 -15
  116. package/dist/generators/ts/Type.d.ts +4 -3
  117. package/dist/generators/ts/TypeFactory.d.ts +7 -5
  118. package/dist/generators/ts/TypeFactory.js +117 -90
  119. package/dist/generators/ts/ZodGenerator.js +6 -6
  120. package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +3 -3
  121. package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.d.ts → DiscriminantProperty.d.ts} +14 -14
  122. package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.js → DiscriminantProperty.js} +10 -10
  123. package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.d.ts +2 -2
  124. package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.js +2 -2
  125. package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +2 -2
  126. package/dist/generators/ts/_ObjectType/IdentifierProperty.js +7 -4
  127. package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.js +8 -8
  128. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  129. package/dist/generators/ts/_ObjectType/{ObjectType_sparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +6 -5
  130. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  131. package/dist/generators/ts/_ObjectType/{ObjectType_sparqlWherePatternsFunctionDeclarations.js → ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -5
  132. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  133. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +20 -0
  134. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  135. package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionDeclaration.js} +6 -7
  136. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  137. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +20 -0
  138. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +2 -2
  139. package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.d.ts +5 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.js +19 -0
  141. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
  142. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js +38 -0
  143. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
  144. package/dist/generators/ts/_ObjectType/{ObjectType_propertiesFromRdfFunctionDeclaration.js → ObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +16 -15
  145. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +1 -2
  146. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +2 -2
  147. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
  148. package/dist/generators/ts/_ObjectType/{ObjectType_toRdfFunctionOrMethodDeclaration.js → ObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +10 -8
  149. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  150. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +13 -0
  151. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  152. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +15 -0
  153. package/dist/generators/ts/_ObjectType/Property.d.ts +2 -2
  154. package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +2 -2
  155. package/dist/generators/ts/_ObjectType/ShaclProperty.js +6 -6
  156. package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.d.ts +2 -0
  157. package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.js +12 -0
  158. package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.d.ts +2 -0
  159. package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.js +14 -0
  160. package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.d.ts +2 -0
  161. package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.js +15 -0
  162. package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.d.ts +2 -0
  163. package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +17 -0
  164. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.d.ts +2 -0
  165. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.js +15 -0
  166. package/dist/generators/ts/_snippets/snippets_PropertyPath.d.ts +5 -0
  167. package/dist/generators/ts/_snippets/snippets_PropertyPath.js +35 -0
  168. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +2 -2
  169. package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.d.ts +2 -0
  170. package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +7 -0
  171. package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.d.ts +2 -0
  172. package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +16 -0
  173. package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.d.ts +2 -0
  174. package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.js +13 -0
  175. package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.d.ts +2 -0
  176. package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.js +16 -0
  177. package/dist/generators/ts/_snippets/snippets_bigDecimalSparqlWherePatterns.js +2 -2
  178. package/dist/generators/ts/_snippets/snippets_blankNodeSparqlWherePatterns.js +2 -2
  179. package/dist/generators/ts/_snippets/snippets_booleanEquals.js +1 -1
  180. package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +2 -2
  181. package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +2 -2
  182. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +2 -2
  183. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +1 -1
  184. package/dist/generators/ts/_snippets/snippets_identifierSparqlWherePatterns.js +2 -2
  185. package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +2 -2
  186. package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
  187. package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
  188. package/dist/generators/ts/_snippets/snippets_literalSparqlWherePatterns.js +2 -2
  189. package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +2 -2
  190. package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +2 -2
  191. package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +2 -3
  192. package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +2 -2
  193. package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +2 -2
  194. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +4 -3
  195. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +4 -3
  196. package/dist/generators/ts/_snippets/snippets_sparqlPropertyPath.js +3 -2
  197. package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +2 -2
  198. package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
  199. package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +2 -2
  200. package/dist/generators/ts/graphqlSchemaVariableStatement.js +4 -4
  201. package/dist/generators/ts/imports.d.ts +1 -1
  202. package/dist/generators/ts/imports.js +1 -1
  203. package/dist/generators/ts/objectSetDeclarations.d.ts +3 -3
  204. package/dist/generators/ts/objectSetDeclarations.js +15 -15
  205. package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +3 -3
  206. package/dist/generators/ts/objectSetInterfaceDeclaration.js +2 -2
  207. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +3 -3
  208. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +16 -17
  209. package/dist/generators/ts/snippets.d.ts +10 -6
  210. package/dist/generators/ts/snippets.js +20 -12
  211. package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +3 -3
  212. package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +7 -8
  213. package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -2
  214. package/dist/generators/ts/synthesizeUberObjectUnionType.js +9 -4
  215. package/dist/input/NodeShape.d.ts +5 -6
  216. package/dist/input/NodeShape.js +19 -22
  217. package/dist/input/Ontology.d.ts +4 -4
  218. package/dist/input/Ontology.js +10 -10
  219. package/dist/input/PropertyShape.d.ts +4 -4
  220. package/dist/input/PropertyShape.js +10 -10
  221. package/dist/input/ShapesGraph.d.ts +3 -2
  222. package/dist/input/ShapesGraph.js +13 -8
  223. package/dist/input/generated.d.ts +2551 -2040
  224. package/dist/input/generated.js +2806 -2346
  225. package/package.json +3 -5
  226. package/dist/_ShapesGraphToAstTransformer/CurieFactory.d.ts +0 -16
  227. package/dist/_ShapesGraphToAstTransformer/CurieFactory.js +0 -45
  228. package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.d.ts +0 -3
  229. package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.js +0 -2
  230. package/dist/_ShapesGraphToAstTransformer/index.d.ts +0 -6
  231. package/dist/_ShapesGraphToAstTransformer/index.js +0 -6
  232. package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.d.ts +0 -5
  233. package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.js +0 -9
  234. package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.d.ts +0 -11
  235. package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.js +0 -338
  236. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.d.ts +0 -12
  237. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.js +0 -31
  238. package/dist/ast/AbstractObjectCompoundType.d.ts +0 -45
  239. package/dist/ast/AbstractObjectCompoundType.js +0 -180
  240. package/dist/ast/Curie.d.ts +0 -21
  241. package/dist/ast/Curie.js +0 -29
  242. package/dist/ast/PlaceholderType.d.ts +0 -15
  243. package/dist/ast/PlaceholderType.js +0 -19
  244. package/dist/generators/codeName.d.ts +0 -6
  245. package/dist/generators/codeName.js +0 -66
  246. package/dist/generators/ts/AbstractDeclaredType.d.ts +0 -23
  247. package/dist/generators/ts/AbstractDeclaredType.js +0 -17
  248. package/dist/generators/ts/ObjectUnionType.d.ts +0 -65
  249. package/dist/generators/ts/ObjectUnionType.js +0 -257
  250. package/dist/generators/ts/UnionType.d.ts +0 -40
  251. package/dist/generators/ts/UnionType.js +0 -527
  252. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.d.ts +0 -4
  253. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.js +0 -66
  254. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfFunctionDeclaration.d.ts +0 -5
  255. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.d.ts +0 -5
  256. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  257. package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts +0 -5
  258. package/dist/generators/ts/_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.d.ts +0 -5
  259. package/dist/generators/ts/_ObjectUnionType/MemberType.d.ts +0 -34
  260. package/dist/generators/ts/_ObjectUnionType/MemberType.js +0 -105
  261. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.d.ts +0 -5
  262. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.js +0 -29
  263. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.d.ts +0 -4
  264. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.js +0 -19
  265. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.d.ts +0 -4
  266. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.js +0 -10
  267. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.d.ts +0 -5
  268. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.js +0 -19
  269. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.d.ts +0 -5
  270. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.js +0 -20
  271. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.d.ts +0 -5
  272. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.js +0 -18
  273. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.d.ts +0 -5
  274. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.js +0 -28
  275. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.d.ts +0 -4
  276. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.js +0 -9
  277. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.d.ts +0 -5
  278. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.js +0 -13
  279. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.d.ts +0 -5
  280. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.js +0 -10
  281. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
  282. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js +0 -14
  283. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.d.ts +0 -4
  284. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.js +0 -37
  285. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  286. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js +0 -15
  287. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  288. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.js +0 -35
  289. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.d.ts +0 -5
  290. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.js +0 -26
  291. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.d.ts +0 -5
  292. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.js +0 -43
  293. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.d.ts +0 -4
  294. package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.js +0 -10
  295. package/dist/generators/ts/_snippets/snippets_FromRdfOptions.d.ts +0 -2
  296. package/dist/generators/ts/_snippets/snippets_FromRdfOptions.js +0 -5
  297. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.d.ts +0 -2
  298. package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.js +0 -5
  299. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.d.ts +0 -2
  300. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.js +0 -6
  301. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.d.ts +0 -2
  302. package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.js +0 -12
  303. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.d.ts +0 -2
  304. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.js +0 -6
  305. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.d.ts +0 -2
  306. package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.js +0 -15
@@ -14,6 +14,9 @@ export class AbstractContainerType extends AbstractType {
14
14
  super(superParameters);
15
15
  this.itemType = itemType;
16
16
  }
17
+ get recursive() {
18
+ return this.itemType.recursive;
19
+ }
17
20
  equals(other) {
18
21
  if (!super.equals(other)) {
19
22
  return false;
@@ -36,9 +39,7 @@ export class AbstractContainerType extends AbstractType {
36
39
  case "IriType":
37
40
  case "ListType":
38
41
  case "LiteralType":
39
- case "ObjectIntersectionType":
40
42
  case "ObjectType":
41
- case "ObjectUnionType":
42
43
  case "TermType":
43
44
  case "UnionType":
44
45
  return true;
@@ -49,8 +50,6 @@ export class AbstractContainerType extends AbstractType {
49
50
  case "OptionType":
50
51
  case "SetType":
51
52
  return false;
52
- case "PlaceholderType":
53
- throw new Error("should never happen");
54
53
  }
55
54
  }
56
55
  AbstractContainerType.isItemType = isItemType;
@@ -14,6 +14,7 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
14
14
  partialType: PartialTypeT;
15
15
  resolveType: ResolveTypeT;
16
16
  } & ConstructorParameters<typeof AbstractType>[0]);
17
+ get recursive(): boolean;
17
18
  equals(other: AbstractLazyObjectType<PartialTypeT, ResolveTypeT>): boolean;
18
19
  toString(): string;
19
20
  }
@@ -11,6 +11,9 @@ export class AbstractLazyObjectType extends AbstractType {
11
11
  this.partialType = partialType;
12
12
  this.resolveType = resolveType;
13
13
  }
14
+ get recursive() {
15
+ return this.partialType.recursive;
16
+ }
14
17
  equals(other) {
15
18
  if (!super.equals(other)) {
16
19
  return false;
@@ -14,6 +14,7 @@ export declare abstract class AbstractTermType<ConstantTermT extends Literal | N
14
14
  readonly in_: readonly ConstantTermT[];
15
15
  abstract readonly kind: "BlankNodeType" | "IdentifierType" | "IriType" | "LiteralType" | "TermType";
16
16
  abstract readonly nodeKinds: ReadonlySet<NodeKind>;
17
+ readonly recursive = false;
17
18
  constructor({ hasValues, in_, ...superParameters }: {
18
19
  hasValues: readonly ConstantTermT[];
19
20
  in_: readonly ConstantTermT[];
@@ -11,6 +11,7 @@ import { arrayEquals, setEquals, strictEquals, termEquals } from "./equals.js";
11
11
  export class AbstractTermType extends AbstractType {
12
12
  hasValues;
13
13
  in_;
14
+ recursive = false;
14
15
  constructor({ hasValues, in_, ...superParameters }) {
15
16
  super(superParameters);
16
17
  this.hasValues = hasValues;
@@ -1,3 +1,4 @@
1
+ import type { BlankNode, NamedNode } from "@rdfjs/types";
1
2
  import { Maybe } from "purify-ts";
2
3
  /**
3
4
  * Abstract base class for Types.
@@ -11,9 +12,23 @@ export declare abstract class AbstractType {
11
12
  * Human-readable label from rdfs:label.
12
13
  */
13
14
  readonly label: Maybe<string>;
14
- constructor({ comment, label, }: {
15
+ /**
16
+ * Name of this type, from shaclmate:name or sh:name.
17
+ */
18
+ readonly name: Maybe<string>;
19
+ /**
20
+ * Does this type directly or indirectly reference itself?
21
+ */
22
+ abstract readonly recursive: boolean;
23
+ /**
24
+ * Identifier of the shape this type was derived from.
25
+ */
26
+ readonly shapeIdentifier: BlankNode | NamedNode;
27
+ constructor({ comment, label, name, shapeIdentifier, }: {
15
28
  comment: Maybe<string>;
16
29
  label: Maybe<string>;
30
+ name: Maybe<string>;
31
+ shapeIdentifier: BlankNode | NamedNode;
17
32
  });
18
33
  equals(other: AbstractType): boolean;
19
34
  abstract toString(): string;
@@ -12,9 +12,19 @@ export class AbstractType {
12
12
  * Human-readable label from rdfs:label.
13
13
  */
14
14
  label = Maybe.empty();
15
- constructor({ comment, label, }) {
15
+ /**
16
+ * Name of this type, from shaclmate:name or sh:name.
17
+ */
18
+ name;
19
+ /**
20
+ * Identifier of the shape this type was derived from.
21
+ */
22
+ shapeIdentifier;
23
+ constructor({ comment, label, name, shapeIdentifier, }) {
16
24
  this.comment = comment;
17
25
  this.label = label;
26
+ this.name = name;
27
+ this.shapeIdentifier = shapeIdentifier;
18
28
  }
19
29
  equals(other) {
20
30
  if (!maybeEquals(strictEquals)(this.comment, other.comment)) {
package/dist/ast/Ast.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
1
+ import type { IntersectionType } from "./IntersectionType.js";
2
2
  import type { ObjectType } from "./ObjectType.js";
3
- import type { ObjectUnionType } from "./ObjectUnionType.js";
3
+ import type { UnionType } from "./UnionType.js";
4
4
  export interface Ast {
5
- readonly objectIntersectionTypes: readonly ObjectIntersectionType[];
5
+ readonly namedIntersectionTypes: readonly IntersectionType[];
6
+ readonly namedUnionTypes: readonly UnionType[];
6
7
  readonly objectTypes: readonly ObjectType[];
7
- readonly objectUnionTypes: readonly ObjectUnionType[];
8
8
  }
9
9
  //# sourceMappingURL=Ast.d.ts.map
@@ -6,6 +6,6 @@ import { AbstractTermType } from "./AbstractTermType.js";
6
6
  export declare class BlankNodeType extends AbstractTermType<NamedNode, BlankNode> {
7
7
  readonly kind = "BlankNodeType";
8
8
  readonly nodeKinds: ReadonlySet<"BlankNode">;
9
- constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label">);
9
+ constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label" | "name" | "shapeIdentifier">);
10
10
  }
11
11
  //# sourceMappingURL=BlankNodeType.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import type { Literal, NamedNode } from "@rdfjs/types";
2
2
  import { AbstractContainerType } from "./AbstractContainerType.js";
3
3
  import type { BlankNodeType } from "./BlankNodeType.js";
4
- import type { PlaceholderType } from "./PlaceholderType.js";
5
4
  import type { Type } from "./Type.js";
6
5
  /**
7
6
  * A type with an sh:defaultValue.
@@ -20,7 +19,7 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
20
19
  equals(other: DefaultValueType<ItemTypeT>): boolean;
21
20
  }
22
21
  export declare namespace DefaultValueType {
23
- type ItemType = Exclude<AbstractContainerType.ItemType, BlankNodeType | PlaceholderType>;
22
+ type ItemType = Exclude<AbstractContainerType.ItemType, BlankNodeType>;
24
23
  function isItemType(type: Type): type is ItemType;
25
24
  }
26
25
  //# sourceMappingURL=DefaultValueType.d.ts.map
@@ -16,6 +16,8 @@ export class DefaultValueType extends AbstractContainerType {
16
16
  comment: itemType.comment,
17
17
  itemType,
18
18
  label: itemType.label,
19
+ name: itemType.name,
20
+ shapeIdentifier: itemType.shapeIdentifier,
19
21
  });
20
22
  this.defaultValue = defaultValue;
21
23
  }
@@ -7,6 +7,6 @@ import { AbstractTermType } from "./AbstractTermType.js";
7
7
  export declare class IdentifierType extends AbstractTermType<NamedNode, BlankNode | NamedNode> {
8
8
  readonly kind = "IdentifierType";
9
9
  readonly nodeKinds: ReadonlySet<IdentifierNodeKind>;
10
- constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label">);
10
+ constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label" | "name" | "shapeIdentifier">);
11
11
  }
12
12
  //# sourceMappingURL=IdentifierType.d.ts.map
@@ -1,9 +1,14 @@
1
1
  import { AbstractCompoundType } from "./AbstractCompoundType.js";
2
- import type { Type } from "./Type.js";
2
+ import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
3
3
  /**
4
4
  * A conjunction ("and") of types, corresponding to an sh:and.
5
5
  */
6
- export declare class IntersectionType extends AbstractCompoundType<Type> {
6
+ export declare class IntersectionType<MemberTypeT extends IntersectionType.MemberType = IntersectionType.MemberType> extends AbstractCompoundType<AbstractCompoundType.Member<MemberTypeT>, MemberTypeT> {
7
7
  readonly kind = "IntersectionType";
8
+ isObjectIntersectionType(): this is ObjectIntersectionType;
9
+ }
10
+ export declare namespace IntersectionType {
11
+ type MemberType = AbstractCompoundType.MemberType;
12
+ const isMemberType: typeof AbstractCompoundType.isMemberType;
8
13
  }
9
14
  //# sourceMappingURL=IntersectionType.d.ts.map
@@ -4,5 +4,13 @@ import { AbstractCompoundType } from "./AbstractCompoundType.js";
4
4
  */
5
5
  export class IntersectionType extends AbstractCompoundType {
6
6
  kind = "IntersectionType";
7
+ isObjectIntersectionType() {
8
+ return this.members.every((member) => member.type.kind === "ObjectType" ||
9
+ (member.type.kind === "IntersectionType" &&
10
+ member.type.isObjectIntersectionType()));
11
+ }
7
12
  }
13
+ (function (IntersectionType) {
14
+ IntersectionType.isMemberType = AbstractCompoundType.isMemberType;
15
+ })(IntersectionType || (IntersectionType = {}));
8
16
  //# sourceMappingURL=IntersectionType.js.map
@@ -8,10 +8,7 @@ import type { IdentifierType } from "./IdentifierType.js";
8
8
  import type { IntersectionType } from "./IntersectionType.js";
9
9
  import type { IriType } from "./IriType.js";
10
10
  import type { LiteralType } from "./LiteralType.js";
11
- import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
12
11
  import type { ObjectType } from "./ObjectType.js";
13
- import type { ObjectUnionType } from "./ObjectUnionType.js";
14
- import type { PlaceholderType } from "./PlaceholderType.js";
15
12
  import type { TermType } from "./TermType.js";
16
13
  import type { Type } from "./Type.js";
17
14
  import type { UnionType } from "./UnionType.js";
@@ -32,10 +29,6 @@ export declare class ListType<ItemTypeT extends ListType.ItemType = ListType.Ite
32
29
  * Strategy for minting new list and sub-list identifiers.
33
30
  */
34
31
  readonly identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
35
- /**
36
- * Identifier of the node shape this type was derived from.
37
- */
38
- readonly shapeIdentifier: BlankNode | NamedNode;
39
32
  /**
40
33
  * rdf:type's that will be added to this object when it's serialized toRdf.
41
34
  *
@@ -43,7 +36,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType = ListType.Ite
43
36
  * class targets).
44
37
  */
45
38
  readonly toRdfTypes: readonly NamedNode[];
46
- constructor({ identifierMintingStrategy, identifierNodeKind, shapeIdentifier, toRdfTypes, ...superParameters }: {
39
+ constructor({ identifierMintingStrategy, identifierNodeKind, toRdfTypes, ...superParameters }: {
47
40
  identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
48
41
  identifierNodeKind: IdentifierNodeKind;
49
42
  shapeIdentifier: BlankNode | NamedNode;
@@ -52,7 +45,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType = ListType.Ite
52
45
  equals(other: ListType<ItemTypeT>): boolean;
53
46
  }
54
47
  export declare namespace ListType {
55
- type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | LiteralType | ObjectIntersectionType | ObjectType | ObjectUnionType | PlaceholderType | TermType | UnionType;
48
+ type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | LiteralType | ObjectType | TermType | UnionType;
56
49
  function isItemType(type: Type): type is ItemType;
57
50
  }
58
51
  //# sourceMappingURL=ListType.d.ts.map
@@ -16,10 +16,6 @@ export class ListType extends AbstractCollectionType {
16
16
  * Strategy for minting new list and sub-list identifiers.
17
17
  */
18
18
  identifierMintingStrategy;
19
- /**
20
- * Identifier of the node shape this type was derived from.
21
- */
22
- shapeIdentifier;
23
19
  /**
24
20
  * rdf:type's that will be added to this object when it's serialized toRdf.
25
21
  *
@@ -27,11 +23,10 @@ export class ListType extends AbstractCollectionType {
27
23
  * class targets).
28
24
  */
29
25
  toRdfTypes;
30
- constructor({ identifierMintingStrategy, identifierNodeKind, shapeIdentifier, toRdfTypes, ...superParameters }) {
26
+ constructor({ identifierMintingStrategy, identifierNodeKind, toRdfTypes, ...superParameters }) {
31
27
  super(superParameters);
32
28
  this.identifierMintingStrategy = identifierMintingStrategy;
33
29
  this.identifierNodeKind = identifierNodeKind;
34
- this.shapeIdentifier = shapeIdentifier;
35
30
  this.toRdfTypes = toRdfTypes;
36
31
  }
37
32
  equals(other) {
@@ -47,10 +42,7 @@ export class ListType extends AbstractCollectionType {
47
42
  case "IntersectionType":
48
43
  case "IriType":
49
44
  case "LiteralType":
50
- case "ObjectIntersectionType":
51
45
  case "ObjectType":
52
- case "ObjectUnionType":
53
- case "PlaceholderType":
54
46
  case "TermType":
55
47
  case "UnionType":
56
48
  return true;
@@ -18,6 +18,7 @@ export declare class LiteralType extends AbstractTermType<Literal, Literal> {
18
18
  minExclusive: Maybe<Literal>;
19
19
  minInclusive: Maybe<Literal>;
20
20
  } & Omit<ConstructorParameters<typeof AbstractTermType<Literal, Literal>>[0], "nodeKinds">);
21
+ equals(other: AbstractTermType<Literal, Literal>): boolean;
21
22
  toString(): string;
22
23
  }
23
24
  //# sourceMappingURL=LiteralType.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { AbstractTermType } from "./AbstractTermType.js";
2
+ import { arrayEquals, maybeEquals, strictEquals, termEquals, } from "./equals.js";
2
3
  export class LiteralType extends AbstractTermType {
3
4
  datatype;
4
5
  kind = "LiteralType";
@@ -17,6 +18,31 @@ export class LiteralType extends AbstractTermType {
17
18
  this.minExclusive = minExclusive;
18
19
  this.minInclusive = minInclusive;
19
20
  }
21
+ equals(other) {
22
+ if (!super.equals(other)) {
23
+ return false;
24
+ }
25
+ const otherLiteralType = other;
26
+ if (!maybeEquals(termEquals)(this.datatype, otherLiteralType.datatype)) {
27
+ return false;
28
+ }
29
+ if (!arrayEquals(strictEquals)(this.languageIn, otherLiteralType.languageIn)) {
30
+ return false;
31
+ }
32
+ if (!maybeEquals(termEquals)(this.maxExclusive, otherLiteralType.maxExclusive)) {
33
+ return false;
34
+ }
35
+ if (!maybeEquals(termEquals)(this.maxInclusive, otherLiteralType.maxInclusive)) {
36
+ return false;
37
+ }
38
+ if (!maybeEquals(termEquals)(this.minExclusive, otherLiteralType.minExclusive)) {
39
+ return false;
40
+ }
41
+ if (!maybeEquals(termEquals)(this.minInclusive, otherLiteralType.minInclusive)) {
42
+ return false;
43
+ }
44
+ return true;
45
+ }
20
46
  toString() {
21
47
  return `${this.kind}()`;
22
48
  }
@@ -0,0 +1,12 @@
1
+ import { BlankNodeType } from "./BlankNodeType.js";
2
+ import { IdentifierType } from "./IdentifierType.js";
3
+ import { IriType } from "./IriType.js";
4
+ import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
5
+ import type { ObjectType } from "./ObjectType.js";
6
+ import type { ObjectUnionType } from "./ObjectUnionType.js";
7
+ export type ObjectCompoundType = ObjectIntersectionType | ObjectUnionType;
8
+ export declare namespace ObjectCompoundType {
9
+ function identifierType(objectCompoundType: ObjectCompoundType): BlankNodeType | IdentifierType | IriType;
10
+ function memberObjectTypes(objectCompoundType: ObjectCompoundType): readonly ObjectType[];
11
+ }
12
+ //# sourceMappingURL=ObjectCompoundType.d.ts.map
@@ -0,0 +1,88 @@
1
+ import TermSet from "@rdfjs/term-set";
2
+ import { Maybe } from "purify-ts";
3
+ import { Resource } from "rdfjs-resource";
4
+ import { invariant } from "ts-invariant";
5
+ import { BlankNodeType } from "./BlankNodeType.js";
6
+ import { IdentifierType } from "./IdentifierType.js";
7
+ import { IriType } from "./IriType.js";
8
+ export var ObjectCompoundType;
9
+ (function (ObjectCompoundType) {
10
+ function identifierType(objectCompoundType) {
11
+ const memberIdentifierTypeNodeKinds = new Set();
12
+ const memberIdentifierTypesIn = new TermSet();
13
+ for (const memberType of memberObjectTypes(objectCompoundType)) {
14
+ for (const nodeKind of memberType.identifierType.nodeKinds) {
15
+ memberIdentifierTypeNodeKinds.add(nodeKind);
16
+ }
17
+ for (const in_ of memberType.identifierType.in_) {
18
+ memberIdentifierTypesIn.add(in_);
19
+ }
20
+ }
21
+ invariant(memberIdentifierTypeNodeKinds.size > 0);
22
+ if (memberIdentifierTypeNodeKinds.size === 2) {
23
+ return new IdentifierType({
24
+ comment: Maybe.empty(),
25
+ label: Maybe.empty(),
26
+ name: Maybe.empty(),
27
+ shapeIdentifier: objectCompoundType.shapeIdentifier,
28
+ });
29
+ }
30
+ const memberIdentifierTypeNodeKind = [...memberIdentifierTypeNodeKinds][0];
31
+ switch (memberIdentifierTypeNodeKind) {
32
+ case "BlankNode":
33
+ return new BlankNodeType({
34
+ comment: Maybe.empty(),
35
+ label: Maybe.empty(),
36
+ name: Maybe.empty(),
37
+ shapeIdentifier: objectCompoundType.shapeIdentifier,
38
+ });
39
+ case "IRI":
40
+ return new IriType({
41
+ comment: Maybe.empty(),
42
+ hasValues: [],
43
+ in_: [...memberIdentifierTypesIn],
44
+ label: Maybe.empty(),
45
+ name: Maybe.empty(),
46
+ shapeIdentifier: objectCompoundType.shapeIdentifier,
47
+ });
48
+ default:
49
+ memberIdentifierTypeNodeKind;
50
+ throw new Error("should never reach here");
51
+ }
52
+ }
53
+ ObjectCompoundType.identifierType = identifierType;
54
+ function memberObjectTypes(objectCompoundType) {
55
+ const memberObjectTypes_ = [];
56
+ for (const member of objectCompoundType.members) {
57
+ switch (member.type.kind) {
58
+ case "ObjectType":
59
+ memberObjectTypes_.push(member.type);
60
+ break;
61
+ case "IntersectionType":
62
+ case "UnionType": {
63
+ invariant(member.type.kind === objectCompoundType.kind);
64
+ memberObjectTypes_.push(...memberObjectTypes(member.type));
65
+ break;
66
+ }
67
+ }
68
+ }
69
+ invariant(memberObjectTypes_.length >= objectCompoundType.members.length, "object compound type has no member ObjectType's");
70
+ // Member object types must have distinct RDF types or no RDF types at all.
71
+ const fromRdfTypes = new TermSet();
72
+ let expectUniqueFromRdfTypesCount = 0;
73
+ for (const memberObjectType of memberObjectTypes_) {
74
+ if (memberObjectType.extern) {
75
+ continue;
76
+ }
77
+ expectUniqueFromRdfTypesCount++;
78
+ memberObjectType.fromRdfType.ifJust((fromRdfType) => fromRdfTypes.add(fromRdfType));
79
+ }
80
+ if (fromRdfTypes.size > 0 &&
81
+ fromRdfTypes.size !== expectUniqueFromRdfTypesCount) {
82
+ throw new Error(`one or more ${objectCompoundType} members ([${memberObjectTypes_.map((memberType) => memberType.toString()).join(", ")}]) lack distinguishing fromRdfType's ({${[...fromRdfTypes].map((fromRdfType) => Resource.Identifier.toString(fromRdfType)).join(", ")}})`);
83
+ }
84
+ return memberObjectTypes_;
85
+ }
86
+ ObjectCompoundType.memberObjectTypes = memberObjectTypes;
87
+ })(ObjectCompoundType || (ObjectCompoundType = {}));
88
+ //# sourceMappingURL=ObjectCompoundType.js.map
@@ -1,8 +1,4 @@
1
- import { AbstractObjectCompoundType } from "./AbstractObjectCompoundType.js";
2
- /**
3
- * A conjunction/intersection of object types, corresponding to an sh:and on a node shape.
4
- */
5
- export declare class ObjectIntersectionType extends AbstractObjectCompoundType<ObjectIntersectionType> {
6
- readonly kind = "ObjectIntersectionType";
7
- }
1
+ import type { IntersectionType } from "./IntersectionType.js";
2
+ import type { ObjectType } from "./ObjectType.js";
3
+ export type ObjectIntersectionType = IntersectionType<IntersectionType<ObjectType> | ObjectType>;
8
4
  //# sourceMappingURL=ObjectIntersectionType.d.ts.map
@@ -1,8 +1,2 @@
1
- import { AbstractObjectCompoundType } from "./AbstractObjectCompoundType.js";
2
- /**
3
- * A conjunction/intersection of object types, corresponding to an sh:and on a node shape.
4
- */
5
- export class ObjectIntersectionType extends AbstractObjectCompoundType {
6
- kind = "ObjectIntersectionType";
7
- }
1
+ export {};
8
2
  //# sourceMappingURL=ObjectIntersectionType.js.map
@@ -7,7 +7,6 @@ import type { TsFeature } from "../enums/TsFeature.js";
7
7
  import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
8
8
  import { AbstractType } from "./AbstractType.js";
9
9
  import type { BlankNodeType } from "./BlankNodeType.js";
10
- import type { Curie } from "./Curie.js";
11
10
  import type { IdentifierType } from "./IdentifierType.js";
12
11
  import type { IriType } from "./IriType.js";
13
12
  import { Type } from "./Type.js";
@@ -19,12 +18,6 @@ export declare class ObjectType extends AbstractType {
19
18
  * Defaults to false.
20
19
  */
21
20
  readonly abstract: boolean;
22
- /**
23
- * Should generated code derived from this ObjectType be visible outside its module?
24
- *
25
- * Defaults to true.
26
- */
27
- readonly export: boolean;
28
21
  /**
29
22
  * If true, the code for this ObjectType is defined externally and should not be generated.
30
23
  *
@@ -50,14 +43,6 @@ export declare class ObjectType extends AbstractType {
50
43
  * Type discriminant.
51
44
  */
52
45
  readonly kind = "ObjectType";
53
- /**
54
- * Name of this type, from shaclmate:name.
55
- */
56
- readonly name: Maybe<string>;
57
- /**
58
- * Identifier of the shape this ObjectType was derived from.
59
- */
60
- readonly shapeIdentifier: BlankNode | NamedNode;
61
46
  /**
62
47
  * Was this type synthesized or did it come from SHACL?
63
48
  */
@@ -86,31 +71,29 @@ export declare class ObjectType extends AbstractType {
86
71
  * Whether to generate a TypeScript class or interface for this type.
87
72
  */
88
73
  readonly tsObjectDeclarationType: TsObjectDeclarationType;
89
- constructor({ abstract, export_, extern, fromRdfType, identifierMintingStrategy, identifierType, name, shapeIdentifier, synthetic, toRdfTypes, tsFeatures, tsImports, tsObjectDeclarationType, ...superParameters }: {
74
+ constructor({ abstract, extern, fromRdfType, identifierMintingStrategy, identifierType, synthetic, toRdfTypes, tsFeatures, tsImports, tsObjectDeclarationType, ...superParameters }: {
90
75
  abstract: boolean;
91
- export_: boolean;
92
76
  extern: boolean;
93
77
  fromRdfType: Maybe<NamedNode>;
94
78
  identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
95
79
  identifierType: BlankNodeType | IdentifierType | IriType;
96
- name: Maybe<string>;
97
- shapeIdentifier: BlankNode | Curie | NamedNode;
98
80
  synthetic: boolean;
99
81
  toRdfTypes: readonly NamedNode[];
100
82
  tsFeatures: ReadonlySet<TsFeature>;
101
83
  tsImports: readonly string[];
102
84
  tsObjectDeclarationType: TsObjectDeclarationType;
103
85
  } & ConstructorParameters<typeof AbstractType>[0]);
104
- addAncestorObjectTypes(...ancestorObjectTypes: readonly ObjectType[]): void;
105
- addChildObjectTypes(...childObjectTypes: readonly ObjectType[]): void;
106
- addDescendantObjectTypes(...descendantObjectTypes: readonly ObjectType[]): void;
107
- addParentObjectTypes(...parentObjectTypes: readonly ObjectType[]): void;
108
- addProperties(...properties: readonly ObjectType.Property[]): void;
109
86
  get ancestorObjectTypes(): readonly ObjectType[];
110
87
  get childObjectTypes(): readonly ObjectType[];
111
88
  get descendantObjectTypes(): readonly ObjectType[];
112
89
  get parentObjectTypes(): readonly ObjectType[];
113
90
  get properties(): readonly ObjectType.Property[];
91
+ get recursive(): boolean;
92
+ addAncestorObjectTypes(...ancestorObjectTypes: readonly ObjectType[]): void;
93
+ addChildObjectTypes(...childObjectTypes: readonly ObjectType[]): void;
94
+ addDescendantObjectTypes(...descendantObjectTypes: readonly ObjectType[]): void;
95
+ addParentObjectTypes(...parentObjectTypes: readonly ObjectType[]): void;
96
+ addProperties(...properties: readonly ObjectType.Property[]): void;
114
97
  equals(other: ObjectType): boolean;
115
98
  sortProperties(): void;
116
99
  toString(): string;
@@ -135,13 +118,13 @@ export declare namespace ObjectType {
135
118
  */
136
119
  readonly mutable: boolean;
137
120
  /**
138
- * Object type this property belongs to.
121
+ * Name of this property, derived from sh:name or shaclmate:name.
139
122
  */
140
- readonly objectType: ObjectType;
123
+ readonly name: string;
141
124
  /**
142
- * Name of this property, derived from sh:name or shaclmate:name.
125
+ * Object type this property belongs to.
143
126
  */
144
- readonly name: Maybe<string>;
127
+ readonly objectType: ObjectType;
145
128
  /**
146
129
  * Relative order of this property, derived from sh:order.
147
130
  */
@@ -149,7 +132,7 @@ export declare namespace ObjectType {
149
132
  /**
150
133
  * SHACL property path (https://www.w3.org/TR/shacl/#property-paths)
151
134
  */
152
- readonly path: Curie | PropertyPath;
135
+ readonly path: PropertyPath;
153
136
  /**
154
137
  * Identifier of the property shape.
155
138
  */
@@ -167,10 +150,10 @@ export declare namespace ObjectType {
167
150
  description: Maybe<string>;
168
151
  label: Maybe<string>;
169
152
  mutable: boolean;
170
- name: Maybe<string>;
153
+ name: string;
171
154
  objectType: ObjectType;
172
155
  order: number;
173
- path: Curie | PropertyPath;
156
+ path: PropertyPath;
174
157
  shapeIdentifier: BlankNode | NamedNode;
175
158
  type: Type;
176
159
  visibility: PropertyVisibility;