@shaclmate/compiler 4.0.38 → 4.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/ShapesGraphToAstTransformer.js +12 -12
  2. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +24 -24
  3. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +4 -4
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +16 -16
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
  7. package/dist/ast/AbstractCollectionType.d.ts +1 -1
  8. package/dist/ast/AbstractCompoundType.d.ts +1 -1
  9. package/dist/ast/AbstractCompoundType.js +15 -15
  10. package/dist/ast/AbstractContainerType.d.ts +1 -1
  11. package/dist/ast/AbstractContainerType.js +15 -15
  12. package/dist/ast/AbstractLazyObjectType.d.ts +1 -1
  13. package/dist/ast/AbstractTermType.d.ts +1 -1
  14. package/dist/ast/BlankNodeType.d.ts +1 -1
  15. package/dist/ast/BlankNodeType.js +1 -1
  16. package/dist/ast/DefaultValueType.d.ts +1 -1
  17. package/dist/ast/DefaultValueType.js +2 -2
  18. package/dist/ast/IdentifierType.d.ts +1 -1
  19. package/dist/ast/IdentifierType.js +1 -1
  20. package/dist/ast/IntersectionType.d.ts +1 -1
  21. package/dist/ast/IntersectionType.js +3 -3
  22. package/dist/ast/IriType.d.ts +1 -1
  23. package/dist/ast/IriType.js +1 -1
  24. package/dist/ast/LazyObjectOptionType.d.ts +1 -1
  25. package/dist/ast/LazyObjectOptionType.js +1 -1
  26. package/dist/ast/LazyObjectSetType.d.ts +1 -1
  27. package/dist/ast/LazyObjectSetType.js +1 -1
  28. package/dist/ast/LazyObjectType.d.ts +1 -1
  29. package/dist/ast/LazyObjectType.js +1 -1
  30. package/dist/ast/ListType.d.ts +1 -1
  31. package/dist/ast/ListType.js +16 -16
  32. package/dist/ast/LiteralType.d.ts +1 -1
  33. package/dist/ast/LiteralType.js +1 -1
  34. package/dist/ast/ObjectCompoundType.js +3 -3
  35. package/dist/ast/ObjectType.d.ts +1 -1
  36. package/dist/ast/ObjectType.js +16 -16
  37. package/dist/ast/OptionType.d.ts +1 -1
  38. package/dist/ast/OptionType.js +1 -1
  39. package/dist/ast/SetType.d.ts +1 -1
  40. package/dist/ast/SetType.js +1 -1
  41. package/dist/ast/TermType.d.ts +1 -1
  42. package/dist/ast/TermType.js +1 -1
  43. package/dist/ast/Type.js +15 -15
  44. package/dist/ast/UnionType.d.ts +1 -1
  45. package/dist/ast/UnionType.js +3 -3
  46. package/dist/generators/transformAstToLabeledPropertyGraph.js +10 -10
  47. package/dist/generators/ts/AbstractCollectionType.d.ts +2 -6
  48. package/dist/generators/ts/AbstractCollectionType.js +16 -15
  49. package/dist/generators/ts/AbstractContainerType.d.ts +7 -11
  50. package/dist/generators/ts/AbstractContainerType.js +35 -36
  51. package/dist/generators/ts/AbstractDateType.d.ts +4 -4
  52. package/dist/generators/ts/AbstractDateType.js +2 -2
  53. package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
  54. package/dist/generators/ts/AbstractLazyObjectType.d.ts +14 -17
  55. package/dist/generators/ts/AbstractLazyObjectType.js +26 -38
  56. package/dist/generators/ts/AbstractLiteralType.d.ts +1 -5
  57. package/dist/generators/ts/AbstractLiteralType.js +7 -6
  58. package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
  59. package/dist/generators/ts/AbstractNumericType.js +3 -3
  60. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  61. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  62. package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -6
  63. package/dist/generators/ts/AbstractPrimitiveType.js +9 -10
  64. package/dist/generators/ts/AbstractTermType.d.ts +1 -5
  65. package/dist/generators/ts/AbstractTermType.js +3 -17
  66. package/dist/generators/ts/AbstractType.d.ts +22 -15
  67. package/dist/generators/ts/AbstractType.js +18 -8
  68. package/dist/generators/ts/BigDecimalType.d.ts +2 -2
  69. package/dist/generators/ts/BigDecimalType.js +3 -3
  70. package/dist/generators/ts/BigIntType.d.ts +1 -1
  71. package/dist/generators/ts/BigIntType.js +3 -3
  72. package/dist/generators/ts/BlankNodeType.d.ts +4 -4
  73. package/dist/generators/ts/BlankNodeType.js +12 -12
  74. package/dist/generators/ts/BooleanType.d.ts +3 -3
  75. package/dist/generators/ts/BooleanType.js +11 -6
  76. package/dist/generators/ts/DateTimeType.d.ts +1 -1
  77. package/dist/generators/ts/DateTimeType.js +1 -1
  78. package/dist/generators/ts/DateType.d.ts +1 -1
  79. package/dist/generators/ts/DateType.js +1 -1
  80. package/dist/generators/ts/DefaultValueType.d.ts +3 -7
  81. package/dist/generators/ts/DefaultValueType.js +17 -21
  82. package/dist/generators/ts/FloatType.d.ts +1 -1
  83. package/dist/generators/ts/FloatType.js +1 -1
  84. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  85. package/dist/generators/ts/GraphqlSchema.js +4 -4
  86. package/dist/generators/ts/IdentifierType.d.ts +4 -4
  87. package/dist/generators/ts/IdentifierType.js +14 -14
  88. package/dist/generators/ts/IntType.d.ts +1 -1
  89. package/dist/generators/ts/IntType.js +1 -1
  90. package/dist/generators/ts/IriType.d.ts +4 -2
  91. package/dist/generators/ts/IriType.js +27 -22
  92. package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -1
  93. package/dist/generators/ts/LazyObjectOptionType.js +7 -7
  94. package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
  95. package/dist/generators/ts/LazyObjectSetType.js +6 -6
  96. package/dist/generators/ts/LazyObjectType.d.ts +1 -1
  97. package/dist/generators/ts/LazyObjectType.js +5 -5
  98. package/dist/generators/ts/ListType.d.ts +5 -6
  99. package/dist/generators/ts/ListType.js +24 -25
  100. package/dist/generators/ts/LiteralType.d.ts +3 -2
  101. package/dist/generators/ts/LiteralType.js +14 -7
  102. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +24 -24
  103. package/dist/generators/ts/ObjectType.js +350 -0
  104. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  105. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +54 -64
  106. package/dist/generators/ts/OptionType.d.ts +2 -6
  107. package/dist/generators/ts/OptionType.js +12 -18
  108. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -8
  109. package/dist/generators/ts/SetType.d.ts +1 -1
  110. package/dist/generators/ts/SetType.js +1 -1
  111. package/dist/generators/ts/Snippets.d.ts +1 -0
  112. package/dist/generators/ts/Snippets.js +7 -0
  113. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  114. package/dist/generators/ts/StringType.d.ts +3 -3
  115. package/dist/generators/ts/StringType.js +11 -6
  116. package/dist/generators/ts/TermType.d.ts +3 -3
  117. package/dist/generators/ts/TermType.js +13 -13
  118. package/dist/generators/ts/TsGenerator.js +12 -9
  119. package/dist/generators/ts/Type.d.ts +4 -5
  120. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  121. package/dist/generators/ts/TypeFactory.js +79 -80
  122. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +40 -15
  123. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +328 -135
  124. package/dist/generators/ts/ZodGenerator.js +7 -9
  125. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +13 -13
  126. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +11 -14
  127. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +3 -2
  128. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +24 -15
  129. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +3 -6
  130. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +20 -12
  131. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  132. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_createFunctionDeclaration.js → _ObjectType/ObjectType_createFunctionDeclaration.js} +6 -6
  133. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  134. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +5 -5
  135. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  136. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -3
  137. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  138. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +3 -3
  139. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  140. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  141. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  142. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +3 -3
  143. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  144. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js → _ObjectType/ObjectType_fromJsonFunctionDeclaration.js} +4 -4
  145. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  146. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js} +7 -31
  147. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  148. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  149. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  150. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  151. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  152. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  153. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  154. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js → _ObjectType/ObjectType_hashFunctionDeclarations.js} +8 -8
  155. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  156. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_interfaceDeclaration.js → _ObjectType/ObjectType_interfaceDeclaration.js} +5 -5
  157. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  158. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js → _ObjectType/ObjectType_isTypeFunctionDeclaration.js} +3 -3
  159. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  160. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  161. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  162. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +2 -2
  163. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  164. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js → _ObjectType/ObjectType_jsonTypeAliasDeclaration.js} +2 -2
  165. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  166. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
  167. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  168. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  169. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  170. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +14 -0
  171. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  172. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  173. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  174. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  175. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  176. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js → _ObjectType/ObjectType_toJsonFunctionDeclaration.js} +4 -4
  177. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  178. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  179. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  180. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +6 -6
  181. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  182. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  183. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  184. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  185. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +2 -6
  186. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +24 -28
  187. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  188. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/identifierTypeDeclarations.js +4 -2
  189. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +2 -2
  190. package/dist/generators/ts/_snippets/snippets_CollectionSchema.js +1 -1
  191. package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +1 -1
  192. package/dist/generators/ts/_snippets/snippets_IriSchema.js +2 -2
  193. package/dist/generators/ts/_snippets/snippets_MaybeSchema.js +2 -2
  194. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
  195. package/dist/generators/ts/_snippets/snippets_StringSchema.js +2 -2
  196. package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +1 -1
  197. package/dist/generators/ts/_snippets/snippets_convertToIri.js +1 -1
  198. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
  199. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.d.ts +3 -0
  200. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.js +16 -0
  201. package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +1 -1
  202. package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
  203. package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
  204. package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +1 -1
  205. package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +3 -3
  206. package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +1 -1
  207. package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +1 -1
  208. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +1 -1
  209. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +1 -1
  210. package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +1 -1
  211. package/dist/generators/ts/_snippets/snippets_validateArray.js +1 -1
  212. package/dist/generators/ts/_snippets/snippets_validateMaybe.js +1 -1
  213. package/dist/generators/ts/tsComment.js +1 -1
  214. package/dist/input/generated.d.ts +1399 -1468
  215. package/dist/input/generated.js +518 -655
  216. package/package.json +4 -4
  217. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  218. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  219. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  220. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  221. package/dist/generators/ts/NamedObjectType.js +0 -341
  222. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  223. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  224. package/dist/generators/ts/NamedUnionType.js +0 -13
  225. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  226. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  227. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  228. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  229. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  230. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  231. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  232. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  233. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  234. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  235. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  236. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  237. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  238. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  239. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  240. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  241. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  242. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  243. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  244. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  245. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  246. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  247. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  248. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  249. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  250. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  251. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  252. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  253. package/dist/generators/ts/removeUndefined.d.ts +0 -2
  254. package/dist/generators/ts/removeUndefined.js +0 -17
  255. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  256. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
@@ -88,6 +88,20 @@ function $convertWithDefaultValue(convertToItem, defaultValue) {
88
88
  return convertToItem(value);
89
89
  };
90
90
  }
91
+ function $ensureRdfResourceType(resource, types, options) {
92
+ return resource
93
+ .value($RdfVocabularies.rdf.type, options)
94
+ .chain((actualRdfTypeValue) => actualRdfTypeValue.toIri())
95
+ .chain((actualRdfType) => {
96
+ // Check the expected type and its known subtypes
97
+ for (const type of types) {
98
+ if (resource.isInstanceOf(type, options)) {
99
+ return Right(undefined);
100
+ }
101
+ }
102
+ return Left(new Error(`${resource.identifier} has unexpected RDF type (actual: ${actualRdfType}, expected one of ${types})`));
103
+ });
104
+ }
91
105
  export var $EqualsResult;
92
106
  (function ($EqualsResult) {
93
107
  $EqualsResult.Equal = Right(true);
@@ -224,12 +238,12 @@ function $validateArray(validateItem, _readonly) {
224
238
  if (schema.minCount !== undefined && valueArray.length < schema.minCount) {
225
239
  return Left(new Error(`value array has length (${valueArray.length}) less than minCount (${schema.minCount})`));
226
240
  }
227
- return Either.sequence(valueArray.map((value) => validateItem(schema.item(), value)));
241
+ return Either.sequence(valueArray.map((value) => validateItem(schema.itemType, value)));
228
242
  };
229
243
  }
230
244
  function $validateMaybe(validateItem) {
231
245
  return (schema, valueMaybe) => valueMaybe
232
- .map((value) => validateItem(schema.item(), value).map(() => valueMaybe))
246
+ .map((value) => validateItem(schema.itemType, value).map(() => valueMaybe))
233
247
  .orDefault(Either.of(valueMaybe));
234
248
  }
235
249
  function $wrap_FromRdfResourceFunction(_fromRdfResourceFunction) {
@@ -268,42 +282,42 @@ export var PropertyShape;
268
282
  function create(parameters) {
269
283
  return $sequenceRecord({
270
284
  $identifier: $convertToIdentifierProperty(parameters.$identifier),
271
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type(), value)),
272
- classes: $convertToArray(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type(), value)),
273
- comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
274
- datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type(), value)),
275
- deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type(), value)),
276
- defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type(), value)),
277
- description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type(), value)),
285
+ and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
286
+ classes: $convertToArray(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
287
+ comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
288
+ datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
289
+ deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
290
+ defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
291
+ description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
278
292
  display: $convertWithDefaultValue($identityConversionFunction, false)(parameters.display),
279
- flags: $convertToArray($identityConversionFunction, true)(parameters.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type(), value)),
280
- groups: $convertToArray($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type(), value)),
281
- hasValues: $convertToArray($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type(), value)),
282
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type(), value)),
283
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type(), value)),
284
- label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
285
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type(), value)),
286
- maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type(), value)),
287
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type(), value)),
288
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type(), value)),
289
- maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type(), value)),
290
- minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type(), value)),
291
- minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type(), value)),
292
- minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type(), value)),
293
- minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type(), value)),
294
- mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.mutable.type(), value)),
295
- name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type(), value)),
296
- node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type(), value)),
297
- nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type(), value)),
298
- not: $convertToArray($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type(), value)),
299
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type(), value)),
300
- order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type(), value)),
293
+ flags: $convertToArray($identityConversionFunction, true)(parameters.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type, value)),
294
+ groups: $convertToArray($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
295
+ hasValues: $convertToArray($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
296
+ in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
297
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
298
+ label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
299
+ languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
300
+ maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
301
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
302
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
303
+ maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
304
+ minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
305
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
306
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
307
+ minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
308
+ mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.mutable.type, value)),
309
+ name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
310
+ node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
311
+ nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
312
+ not: $convertToArray($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
313
+ or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
314
+ order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
301
315
  path: Either.of(parameters.path),
302
- patterns: $convertToArray($identityConversionFunction, true)(parameters.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type(), value)),
303
- resolve: $convertToMaybe($convertToIdentifier)(parameters.resolve).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.resolve.type(), value)),
304
- shaclmateName: $convertToMaybe($identityConversionFunction)(parameters.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.shaclmateName.type(), value)),
305
- uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type(), value)),
306
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type(), value)),
316
+ patterns: $convertToArray($identityConversionFunction, true)(parameters.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type, value)),
317
+ resolve: $convertToMaybe($convertToIdentifier)(parameters.resolve).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.resolve.type, value)),
318
+ shaclmateName: $convertToMaybe($identityConversionFunction)(parameters.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.shaclmateName.type, value)),
319
+ uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
320
+ xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
307
321
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyShape" }, { $toString }));
308
322
  }
309
323
  PropertyShape.create = create;
@@ -318,22 +332,8 @@ export var PropertyShape;
318
332
  })(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
319
333
  PropertyShape._fromRdfResource = ($resource, _$options) => {
320
334
  return (!_$options.ignoreRdfType
321
- ? $resource
322
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
323
- .chain((actualRdfType) => actualRdfType.toIri())
324
- .chain((actualRdfType) => {
325
- // Check the expected type and its known subtypes
326
- switch (actualRdfType.value) {
327
- case "http://www.w3.org/ns/shacl#PropertyShape":
328
- return Right(true);
329
- }
330
- // Check arbitrary rdfs:subClassOf's of the expected type
331
- if ($resource.isInstanceOf(PropertyShape.fromRdfType, {
332
- graph: _$options.graph,
333
- })) {
334
- return Right(true);
335
- }
336
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyShape)`));
335
+ ? $ensureRdfResourceType($resource, [PropertyShape.fromRdfType], {
336
+ graph: _$options.graph,
337
337
  })
338
338
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
339
339
  $identifier: Right(new Resource.Value({
@@ -951,238 +951,217 @@ export var PropertyShape;
951
951
  properties: {
952
952
  $identifier: {
953
953
  kind: "Identifier",
954
- type: () => ({ kind: "Identifier" }),
955
- },
956
- $type: {
957
- kind: "Discriminant",
958
- type: () => ({
959
- kind: "TypeDiscriminant",
960
- ownValues: ["PropertyShape"],
961
- }),
954
+ type: { kind: "Identifier" },
962
955
  },
963
956
  and: {
964
957
  kind: "Shacl",
965
- type: () => ({
966
- kind: "Maybe",
967
- item: () => ({
968
- kind: "List",
969
- item: () => ({ kind: "Identifier" }),
970
- }),
971
- }),
972
958
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
959
+ type: {
960
+ kind: "Option",
961
+ itemType: {
962
+ kind: "List",
963
+ itemType: { kind: "Identifier" },
964
+ },
965
+ },
973
966
  },
974
967
  classes: {
975
968
  kind: "Shacl",
976
- type: () => ({
977
- kind: "Set",
978
- item: () => ({ kind: "Iri" }),
979
- }),
980
969
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
970
+ type: { kind: "Set", itemType: { kind: "Iri" } },
981
971
  },
982
972
  comment: {
983
973
  kind: "Shacl",
984
- type: () => ({
985
- kind: "Maybe",
986
- item: () => ({ kind: "String" }),
987
- }),
988
974
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
975
+ type: {
976
+ kind: "Option",
977
+ itemType: { kind: "String" },
978
+ },
989
979
  },
990
980
  datatype: {
991
981
  kind: "Shacl",
992
- type: () => ({
993
- kind: "Maybe",
994
- item: () => ({ kind: "Iri" }),
995
- }),
996
982
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
983
+ type: { kind: "Option", itemType: { kind: "Iri" } },
997
984
  },
998
985
  deactivated: {
999
986
  kind: "Shacl",
1000
- type: () => ({
1001
- kind: "Maybe",
1002
- item: () => ({ kind: "Boolean" }),
1003
- }),
1004
987
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
988
+ type: {
989
+ kind: "Option",
990
+ itemType: { kind: "Boolean" },
991
+ },
1005
992
  },
1006
993
  defaultValue: {
1007
994
  kind: "Shacl",
1008
- type: () => ({
1009
- kind: "Maybe",
1010
- item: () => ({ kind: "Term" }),
1011
- }),
1012
995
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
996
+ type: { kind: "Option", itemType: { kind: "Term" } },
1013
997
  },
1014
998
  description: {
1015
999
  kind: "Shacl",
1016
- type: () => ({
1017
- kind: "Maybe",
1018
- item: () => ({ kind: "String" }),
1019
- }),
1020
1000
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
1001
+ type: {
1002
+ kind: "Option",
1003
+ itemType: { kind: "String" },
1004
+ },
1021
1005
  },
1022
1006
  display: {
1023
1007
  kind: "Shacl",
1024
- type: () => ({
1008
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"),
1009
+ type: {
1025
1010
  kind: "DefaultValue",
1026
- item: () => ({ kind: "Boolean" }),
1011
+ itemType: { kind: "Boolean" },
1027
1012
  defaultValue: false,
1028
- }),
1029
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"),
1013
+ },
1030
1014
  },
1031
1015
  flags: {
1032
1016
  kind: "Shacl",
1033
- type: () => ({
1034
- kind: "Set",
1035
- item: () => ({ kind: "String" }),
1036
- }),
1037
1017
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
1018
+ type: { kind: "Set", itemType: { kind: "String" } },
1038
1019
  },
1039
1020
  groups: {
1040
1021
  kind: "Shacl",
1041
- type: () => ({
1042
- kind: "Set",
1043
- item: () => ({ kind: "Identifier" }),
1044
- }),
1045
1022
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
1023
+ type: {
1024
+ kind: "Set",
1025
+ itemType: { kind: "Identifier" },
1026
+ },
1046
1027
  },
1047
1028
  hasValues: {
1048
1029
  kind: "Shacl",
1049
- type: () => ({
1050
- kind: "Set",
1051
- item: () => ({ kind: "Term" }),
1052
- }),
1053
1030
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
1031
+ type: { kind: "Set", itemType: { kind: "Term" } },
1054
1032
  },
1055
1033
  in_: {
1056
1034
  kind: "Shacl",
1057
- type: () => ({
1058
- kind: "Maybe",
1059
- item: () => ({
1060
- kind: "List",
1061
- item: () => ({ kind: "Term" }),
1062
- }),
1063
- }),
1064
1035
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
1036
+ type: {
1037
+ kind: "Option",
1038
+ itemType: {
1039
+ kind: "List",
1040
+ itemType: { kind: "Term" },
1041
+ },
1042
+ },
1065
1043
  },
1066
1044
  isDefinedBy: {
1067
1045
  kind: "Shacl",
1068
- type: () => ({
1069
- kind: "Maybe",
1070
- item: () => ({ kind: "Identifier" }),
1071
- }),
1072
1046
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
1047
+ type: {
1048
+ kind: "Option",
1049
+ itemType: { kind: "Identifier" },
1050
+ },
1073
1051
  },
1074
1052
  label: {
1075
1053
  kind: "Shacl",
1076
- type: () => ({
1077
- kind: "Maybe",
1078
- item: () => ({ kind: "String" }),
1079
- }),
1080
1054
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
1055
+ type: {
1056
+ kind: "Option",
1057
+ itemType: { kind: "String" },
1058
+ },
1081
1059
  },
1082
1060
  languageIn: {
1083
1061
  kind: "Shacl",
1084
- type: () => ({
1085
- kind: "Maybe",
1086
- item: () => ({
1087
- kind: "List",
1088
- item: () => ({ kind: "String" }),
1089
- }),
1090
- }),
1091
1062
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
1063
+ type: {
1064
+ kind: "Option",
1065
+ itemType: {
1066
+ kind: "List",
1067
+ itemType: { kind: "String" },
1068
+ },
1069
+ },
1092
1070
  },
1093
1071
  maxCount: {
1094
1072
  kind: "Shacl",
1095
- type: () => ({
1096
- kind: "Maybe",
1097
- item: () => ({ kind: "BigInt" }),
1098
- }),
1099
1073
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
1074
+ type: {
1075
+ kind: "Option",
1076
+ itemType: { kind: "BigInt" },
1077
+ },
1100
1078
  },
1101
1079
  maxExclusive: {
1102
1080
  kind: "Shacl",
1103
- type: () => ({
1104
- kind: "Maybe",
1105
- item: () => ({ kind: "Literal" }),
1106
- }),
1107
1081
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
1082
+ type: {
1083
+ kind: "Option",
1084
+ itemType: { kind: "Literal" },
1085
+ },
1108
1086
  },
1109
1087
  maxInclusive: {
1110
1088
  kind: "Shacl",
1111
- type: () => ({
1112
- kind: "Maybe",
1113
- item: () => ({ kind: "Literal" }),
1114
- }),
1115
1089
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
1090
+ type: {
1091
+ kind: "Option",
1092
+ itemType: { kind: "Literal" },
1093
+ },
1116
1094
  },
1117
1095
  maxLength: {
1118
1096
  kind: "Shacl",
1119
- type: () => ({
1120
- kind: "Maybe",
1121
- item: () => ({ kind: "BigInt" }),
1122
- }),
1123
1097
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
1098
+ type: {
1099
+ kind: "Option",
1100
+ itemType: { kind: "BigInt" },
1101
+ },
1124
1102
  },
1125
1103
  minCount: {
1126
1104
  kind: "Shacl",
1127
- type: () => ({
1128
- kind: "Maybe",
1129
- item: () => ({ kind: "BigInt" }),
1130
- }),
1131
1105
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
1106
+ type: {
1107
+ kind: "Option",
1108
+ itemType: { kind: "BigInt" },
1109
+ },
1132
1110
  },
1133
1111
  minExclusive: {
1134
1112
  kind: "Shacl",
1135
- type: () => ({
1136
- kind: "Maybe",
1137
- item: () => ({ kind: "Literal" }),
1138
- }),
1139
1113
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
1114
+ type: {
1115
+ kind: "Option",
1116
+ itemType: { kind: "Literal" },
1117
+ },
1140
1118
  },
1141
1119
  minInclusive: {
1142
1120
  kind: "Shacl",
1143
- type: () => ({
1144
- kind: "Maybe",
1145
- item: () => ({ kind: "Literal" }),
1146
- }),
1147
1121
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
1122
+ type: {
1123
+ kind: "Option",
1124
+ itemType: { kind: "Literal" },
1125
+ },
1148
1126
  },
1149
1127
  minLength: {
1150
1128
  kind: "Shacl",
1151
- type: () => ({
1152
- kind: "Maybe",
1153
- item: () => ({ kind: "BigInt" }),
1154
- }),
1155
1129
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
1130
+ type: {
1131
+ kind: "Option",
1132
+ itemType: { kind: "BigInt" },
1133
+ },
1156
1134
  },
1157
1135
  mutable: {
1158
1136
  kind: "Shacl",
1159
- type: () => ({
1160
- kind: "Maybe",
1161
- item: () => ({ kind: "Boolean" }),
1162
- }),
1163
1137
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"),
1138
+ type: {
1139
+ kind: "Option",
1140
+ itemType: { kind: "Boolean" },
1141
+ },
1164
1142
  },
1165
1143
  name: {
1166
1144
  kind: "Shacl",
1167
- type: () => ({
1168
- kind: "Maybe",
1169
- item: () => ({ kind: "String" }),
1170
- }),
1171
1145
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
1146
+ type: {
1147
+ kind: "Option",
1148
+ itemType: { kind: "String" },
1149
+ },
1172
1150
  },
1173
1151
  node: {
1174
1152
  kind: "Shacl",
1175
- type: () => ({
1176
- kind: "Maybe",
1177
- item: () => ({ kind: "Identifier" }),
1178
- }),
1179
1153
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
1154
+ type: {
1155
+ kind: "Option",
1156
+ itemType: { kind: "Identifier" },
1157
+ },
1180
1158
  },
1181
1159
  nodeKind: {
1182
1160
  kind: "Shacl",
1183
- type: () => ({
1184
- kind: "Maybe",
1185
- item: () => ({
1161
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
1162
+ type: {
1163
+ kind: "Option",
1164
+ itemType: {
1186
1165
  kind: "Iri",
1187
1166
  in: [
1188
1167
  dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
@@ -1192,84 +1171,79 @@ export var PropertyShape;
1192
1171
  dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
1193
1172
  dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
1194
1173
  ],
1195
- }),
1196
- }),
1197
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
1174
+ },
1175
+ },
1198
1176
  },
1199
1177
  not: {
1200
1178
  kind: "Shacl",
1201
- type: () => ({
1202
- kind: "Set",
1203
- item: () => ({ kind: "Identifier" }),
1204
- }),
1205
1179
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
1180
+ type: {
1181
+ kind: "Set",
1182
+ itemType: { kind: "Identifier" },
1183
+ },
1206
1184
  },
1207
1185
  or: {
1208
1186
  kind: "Shacl",
1209
- type: () => ({
1210
- kind: "Maybe",
1211
- item: () => ({
1212
- kind: "List",
1213
- item: () => ({ kind: "Identifier" }),
1214
- }),
1215
- }),
1216
1187
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
1188
+ type: {
1189
+ kind: "Option",
1190
+ itemType: {
1191
+ kind: "List",
1192
+ itemType: { kind: "Identifier" },
1193
+ },
1194
+ },
1217
1195
  },
1218
1196
  order: {
1219
1197
  kind: "Shacl",
1220
- type: () => ({
1221
- kind: "Maybe",
1222
- item: () => ({ kind: "Float" }),
1223
- }),
1224
1198
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
1199
+ type: { kind: "Option", itemType: { kind: "Float" } },
1225
1200
  },
1226
1201
  path: {
1227
1202
  kind: "Shacl",
1228
- type: () => $PropertyPath.schema,
1229
1203
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
1204
+ get type() {
1205
+ return $PropertyPath.schema;
1206
+ },
1230
1207
  },
1231
1208
  patterns: {
1232
1209
  kind: "Shacl",
1233
- type: () => ({
1234
- kind: "Set",
1235
- item: () => ({ kind: "String" }),
1236
- }),
1237
1210
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
1211
+ type: { kind: "Set", itemType: { kind: "String" } },
1238
1212
  },
1239
1213
  resolve: {
1240
1214
  kind: "Shacl",
1241
- type: () => ({
1242
- kind: "Maybe",
1243
- item: () => ({ kind: "Identifier" }),
1244
- }),
1245
1215
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#resolve"),
1216
+ type: {
1217
+ kind: "Option",
1218
+ itemType: { kind: "Identifier" },
1219
+ },
1246
1220
  },
1247
1221
  shaclmateName: {
1248
1222
  kind: "Shacl",
1249
- type: () => ({
1250
- kind: "Maybe",
1251
- item: () => ({ kind: "String" }),
1252
- }),
1253
1223
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
1224
+ type: {
1225
+ kind: "Option",
1226
+ itemType: { kind: "String" },
1227
+ },
1254
1228
  },
1255
1229
  uniqueLang: {
1256
1230
  kind: "Shacl",
1257
- type: () => ({
1258
- kind: "Maybe",
1259
- item: () => ({ kind: "Boolean" }),
1260
- }),
1261
1231
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
1232
+ type: {
1233
+ kind: "Option",
1234
+ itemType: { kind: "Boolean" },
1235
+ },
1262
1236
  },
1263
1237
  xone: {
1264
1238
  kind: "Shacl",
1265
- type: () => ({
1266
- kind: "Maybe",
1267
- item: () => ({
1268
- kind: "List",
1269
- item: () => ({ kind: "Identifier" }),
1270
- }),
1271
- }),
1272
1239
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
1240
+ type: {
1241
+ kind: "Option",
1242
+ itemType: {
1243
+ kind: "List",
1244
+ itemType: { kind: "Identifier" },
1245
+ },
1246
+ },
1273
1247
  },
1274
1248
  },
1275
1249
  };
@@ -1496,8 +1470,8 @@ export var PropertyGroup;
1496
1470
  function create(parameters) {
1497
1471
  return $sequenceRecord({
1498
1472
  $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1499
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
1500
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
1473
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1474
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1501
1475
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyGroup" }, { $toString }));
1502
1476
  }
1503
1477
  PropertyGroup.create = create;
@@ -1512,22 +1486,8 @@ export var PropertyGroup;
1512
1486
  })(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
1513
1487
  PropertyGroup._fromRdfResource = ($resource, _$options) => {
1514
1488
  return (!_$options.ignoreRdfType
1515
- ? $resource
1516
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
1517
- .chain((actualRdfType) => actualRdfType.toIri())
1518
- .chain((actualRdfType) => {
1519
- // Check the expected type and its known subtypes
1520
- switch (actualRdfType.value) {
1521
- case "http://www.w3.org/ns/shacl#PropertyGroup":
1522
- return Right(true);
1523
- }
1524
- // Check arbitrary rdfs:subClassOf's of the expected type
1525
- if ($resource.isInstanceOf(PropertyGroup.fromRdfType, {
1526
- graph: _$options.graph,
1527
- })) {
1528
- return Right(true);
1529
- }
1530
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyGroup)`));
1489
+ ? $ensureRdfResourceType($resource, [PropertyGroup.fromRdfType], {
1490
+ graph: _$options.graph,
1531
1491
  })
1532
1492
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1533
1493
  $identifier: Right(new Resource.Value({
@@ -1588,30 +1548,23 @@ export var PropertyGroup;
1588
1548
  properties: {
1589
1549
  $identifier: {
1590
1550
  kind: "Identifier",
1591
- type: () => ({ kind: "Identifier" }),
1592
- },
1593
- $type: {
1594
- kind: "Discriminant",
1595
- type: () => ({
1596
- kind: "TypeDiscriminant",
1597
- ownValues: ["PropertyGroup"],
1598
- }),
1551
+ type: { kind: "Identifier" },
1599
1552
  },
1600
1553
  comment: {
1601
1554
  kind: "Shacl",
1602
- type: () => ({
1603
- kind: "Maybe",
1604
- item: () => ({ kind: "String" }),
1605
- }),
1606
1555
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
1556
+ type: {
1557
+ kind: "Option",
1558
+ itemType: { kind: "String" },
1559
+ },
1607
1560
  },
1608
1561
  label: {
1609
1562
  kind: "Shacl",
1610
- type: () => ({
1611
- kind: "Maybe",
1612
- item: () => ({ kind: "String" }),
1613
- }),
1614
1563
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
1564
+ type: {
1565
+ kind: "Option",
1566
+ itemType: { kind: "String" },
1567
+ },
1615
1568
  },
1616
1569
  },
1617
1570
  };
@@ -1645,8 +1598,8 @@ export var Ontology;
1645
1598
  function create(parameters) {
1646
1599
  return $sequenceRecord({
1647
1600
  $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1648
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
1649
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
1601
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1602
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1650
1603
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "Ontology" }, { $toString }));
1651
1604
  }
1652
1605
  Ontology.create = create;
@@ -1661,22 +1614,8 @@ export var Ontology;
1661
1614
  })(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
1662
1615
  Ontology._fromRdfResource = ($resource, _$options) => {
1663
1616
  return (!_$options.ignoreRdfType
1664
- ? $resource
1665
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
1666
- .chain((actualRdfType) => actualRdfType.toIri())
1667
- .chain((actualRdfType) => {
1668
- // Check the expected type and its known subtypes
1669
- switch (actualRdfType.value) {
1670
- case "http://www.w3.org/2002/07/owl#Ontology":
1671
- return Right(true);
1672
- }
1673
- // Check arbitrary rdfs:subClassOf's of the expected type
1674
- if ($resource.isInstanceOf(Ontology.fromRdfType, {
1675
- graph: _$options.graph,
1676
- })) {
1677
- return Right(true);
1678
- }
1679
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/2002/07/owl#Ontology)`));
1617
+ ? $ensureRdfResourceType($resource, [Ontology.fromRdfType], {
1618
+ graph: _$options.graph,
1680
1619
  })
1681
1620
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1682
1621
  $identifier: Right(new Resource.Value({
@@ -1737,30 +1676,23 @@ export var Ontology;
1737
1676
  properties: {
1738
1677
  $identifier: {
1739
1678
  kind: "Identifier",
1740
- type: () => ({ kind: "Identifier" }),
1741
- },
1742
- $type: {
1743
- kind: "Discriminant",
1744
- type: () => ({
1745
- kind: "TypeDiscriminant",
1746
- ownValues: ["Ontology"],
1747
- }),
1679
+ type: { kind: "Identifier" },
1748
1680
  },
1749
1681
  comment: {
1750
1682
  kind: "Shacl",
1751
- type: () => ({
1752
- kind: "Maybe",
1753
- item: () => ({ kind: "String" }),
1754
- }),
1755
1683
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
1684
+ type: {
1685
+ kind: "Option",
1686
+ itemType: { kind: "String" },
1687
+ },
1756
1688
  },
1757
1689
  label: {
1758
1690
  kind: "Shacl",
1759
- type: () => ({
1760
- kind: "Maybe",
1761
- item: () => ({ kind: "String" }),
1762
- }),
1763
1691
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
1692
+ type: {
1693
+ kind: "Option",
1694
+ itemType: { kind: "String" },
1695
+ },
1764
1696
  },
1765
1697
  },
1766
1698
  };
@@ -1794,44 +1726,44 @@ export var NodeShape;
1794
1726
  function create(parameters) {
1795
1727
  return $sequenceRecord({
1796
1728
  $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1797
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type(), value)),
1798
- classes: $convertToArray(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type(), value)),
1799
- closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type(), value)),
1800
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type(), value)),
1801
- datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type(), value)),
1802
- deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type(), value)),
1803
- discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.discriminantValue.type(), value)),
1804
- extern: $convertToMaybe($identityConversionFunction)(parameters?.extern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.extern.type(), value)),
1805
- flags: $convertToArray($identityConversionFunction, true)(parameters?.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type(), value)),
1806
- fromRdfType: $convertToMaybe(($convertToIri))(parameters?.fromRdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.fromRdfType.type(), value)),
1807
- hasValues: $convertToArray($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type(), value)),
1808
- ignoredProperties: $convertToMaybe($convertToArray(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type(), value)),
1809
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type(), value)),
1810
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type(), value)),
1811
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type(), value)),
1812
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type(), value)),
1813
- maxCount: $convertToMaybe($identityConversionFunction)(parameters?.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type(), value)),
1814
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type(), value)),
1815
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type(), value)),
1816
- maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type(), value)),
1817
- minCount: $convertToMaybe($identityConversionFunction)(parameters?.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type(), value)),
1818
- minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type(), value)),
1819
- minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type(), value)),
1820
- minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type(), value)),
1821
- mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.mutable.type(), value)),
1822
- node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type(), value)),
1823
- nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type(), value)),
1824
- not: $convertToArray($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type(), value)),
1825
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type(), value)),
1826
- patterns: $convertToArray($identityConversionFunction, true)(parameters?.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type(), value)),
1827
- properties: $convertToArray($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type(), value)),
1828
- rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.rdfType.type(), value)),
1829
- shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.shaclmateName.type(), value)),
1830
- subClassOf: $convertToArray(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type(), value)),
1831
- toRdfTypes: $convertToArray(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.toRdfTypes.type(), value)),
1832
- tsImports: $convertToArray($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.tsImports.type(), value)),
1833
- types: $convertToArray(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type(), value)),
1834
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type(), value)),
1729
+ and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
1730
+ classes: $convertToArray(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
1731
+ closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
1732
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1733
+ datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
1734
+ deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
1735
+ discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.discriminantValue.type, value)),
1736
+ extern: $convertToMaybe($identityConversionFunction)(parameters?.extern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.extern.type, value)),
1737
+ flags: $convertToArray($identityConversionFunction, true)(parameters?.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type, value)),
1738
+ fromRdfType: $convertToMaybe(($convertToIri))(parameters?.fromRdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.fromRdfType.type, value)),
1739
+ hasValues: $convertToArray($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
1740
+ ignoredProperties: $convertToMaybe($convertToArray(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
1741
+ in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
1742
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
1743
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1744
+ languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
1745
+ maxCount: $convertToMaybe($identityConversionFunction)(parameters?.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
1746
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
1747
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
1748
+ maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
1749
+ minCount: $convertToMaybe($identityConversionFunction)(parameters?.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
1750
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
1751
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
1752
+ minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
1753
+ mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.mutable.type, value)),
1754
+ node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
1755
+ nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
1756
+ not: $convertToArray($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
1757
+ or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
1758
+ patterns: $convertToArray($identityConversionFunction, true)(parameters?.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type, value)),
1759
+ properties: $convertToArray($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
1760
+ rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.rdfType.type, value)),
1761
+ shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.shaclmateName.type, value)),
1762
+ subClassOf: $convertToArray(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
1763
+ toRdfTypes: $convertToArray(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.toRdfTypes.type, value)),
1764
+ tsImports: $convertToArray($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.tsImports.type, value)),
1765
+ types: $convertToArray(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
1766
+ xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
1835
1767
  }).map((properties) => $monkeyPatchObject({ ...properties, $type: "NodeShape" }, { $toString }));
1836
1768
  }
1837
1769
  NodeShape.create = create;
@@ -1846,22 +1778,8 @@ export var NodeShape;
1846
1778
  })(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
1847
1779
  NodeShape._fromRdfResource = ($resource, _$options) => {
1848
1780
  return (!_$options.ignoreRdfType
1849
- ? $resource
1850
- .value($RdfVocabularies.rdf.type, { graph: _$options.graph })
1851
- .chain((actualRdfType) => actualRdfType.toIri())
1852
- .chain((actualRdfType) => {
1853
- // Check the expected type and its known subtypes
1854
- switch (actualRdfType.value) {
1855
- case "http://www.w3.org/ns/shacl#NodeShape":
1856
- return Right(true);
1857
- }
1858
- // Check arbitrary rdfs:subClassOf's of the expected type
1859
- if ($resource.isInstanceOf(NodeShape.fromRdfType, {
1860
- graph: _$options.graph,
1861
- })) {
1862
- return Right(true);
1863
- }
1864
- return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#NodeShape)`));
1781
+ ? $ensureRdfResourceType($resource, [NodeShape.fromRdfType], {
1782
+ graph: _$options.graph,
1865
1783
  })
1866
1784
  : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1867
1785
  $identifier: Right(new Resource.Value({
@@ -2496,240 +2414,219 @@ export var NodeShape;
2496
2414
  properties: {
2497
2415
  $identifier: {
2498
2416
  kind: "Identifier",
2499
- type: () => ({ kind: "Identifier" }),
2500
- },
2501
- $type: {
2502
- kind: "Discriminant",
2503
- type: () => ({
2504
- kind: "TypeDiscriminant",
2505
- ownValues: ["NodeShape"],
2506
- }),
2417
+ type: { kind: "Identifier" },
2507
2418
  },
2508
2419
  and: {
2509
2420
  kind: "Shacl",
2510
- type: () => ({
2511
- kind: "Maybe",
2512
- item: () => ({
2513
- kind: "List",
2514
- item: () => ({ kind: "Identifier" }),
2515
- }),
2516
- }),
2517
2421
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
2422
+ type: {
2423
+ kind: "Option",
2424
+ itemType: {
2425
+ kind: "List",
2426
+ itemType: { kind: "Identifier" },
2427
+ },
2428
+ },
2518
2429
  },
2519
2430
  classes: {
2520
2431
  kind: "Shacl",
2521
- type: () => ({
2522
- kind: "Set",
2523
- item: () => ({ kind: "Iri" }),
2524
- }),
2525
2432
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
2433
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2526
2434
  },
2527
2435
  closed: {
2528
2436
  kind: "Shacl",
2529
- type: () => ({
2530
- kind: "Maybe",
2531
- item: () => ({ kind: "Boolean" }),
2532
- }),
2533
2437
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
2438
+ type: {
2439
+ kind: "Option",
2440
+ itemType: { kind: "Boolean" },
2441
+ },
2534
2442
  },
2535
2443
  comment: {
2536
2444
  kind: "Shacl",
2537
- type: () => ({
2538
- kind: "Maybe",
2539
- item: () => ({ kind: "String" }),
2540
- }),
2541
2445
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
2446
+ type: {
2447
+ kind: "Option",
2448
+ itemType: { kind: "String" },
2449
+ },
2542
2450
  },
2543
2451
  datatype: {
2544
2452
  kind: "Shacl",
2545
- type: () => ({
2546
- kind: "Maybe",
2547
- item: () => ({ kind: "Iri" }),
2548
- }),
2549
2453
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
2454
+ type: { kind: "Option", itemType: { kind: "Iri" } },
2550
2455
  },
2551
2456
  deactivated: {
2552
2457
  kind: "Shacl",
2553
- type: () => ({
2554
- kind: "Maybe",
2555
- item: () => ({ kind: "Boolean" }),
2556
- }),
2557
2458
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
2459
+ type: {
2460
+ kind: "Option",
2461
+ itemType: { kind: "Boolean" },
2462
+ },
2558
2463
  },
2559
2464
  discriminantValue: {
2560
2465
  kind: "Shacl",
2561
- type: () => ({
2562
- kind: "Maybe",
2563
- item: () => ({ kind: "String" }),
2564
- }),
2565
2466
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"),
2467
+ type: {
2468
+ kind: "Option",
2469
+ itemType: { kind: "String" },
2470
+ },
2566
2471
  },
2567
2472
  extern: {
2568
2473
  kind: "Shacl",
2569
- type: () => ({
2570
- kind: "Maybe",
2571
- item: () => ({ kind: "Boolean" }),
2572
- }),
2573
2474
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#extern"),
2475
+ type: {
2476
+ kind: "Option",
2477
+ itemType: { kind: "Boolean" },
2478
+ },
2574
2479
  },
2575
2480
  flags: {
2576
2481
  kind: "Shacl",
2577
- type: () => ({
2578
- kind: "Set",
2579
- item: () => ({ kind: "String" }),
2580
- }),
2581
2482
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2483
+ type: { kind: "Set", itemType: { kind: "String" } },
2582
2484
  },
2583
2485
  fromRdfType: {
2584
2486
  kind: "Shacl",
2585
- type: () => ({
2586
- kind: "Maybe",
2587
- item: () => ({ kind: "Iri" }),
2588
- }),
2589
2487
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#fromRdfType"),
2488
+ type: { kind: "Option", itemType: { kind: "Iri" } },
2590
2489
  },
2591
2490
  hasValues: {
2592
2491
  kind: "Shacl",
2593
- type: () => ({
2594
- kind: "Set",
2595
- item: () => ({ kind: "Term" }),
2596
- }),
2597
2492
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
2493
+ type: { kind: "Set", itemType: { kind: "Term" } },
2598
2494
  },
2599
2495
  ignoredProperties: {
2600
2496
  kind: "Shacl",
2601
- type: () => ({
2602
- kind: "Maybe",
2603
- item: () => ({
2604
- kind: "List",
2605
- item: () => ({ kind: "Iri" }),
2606
- }),
2607
- }),
2608
2497
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
2498
+ type: {
2499
+ kind: "Option",
2500
+ itemType: {
2501
+ kind: "List",
2502
+ itemType: { kind: "Iri" },
2503
+ },
2504
+ },
2609
2505
  },
2610
2506
  in_: {
2611
2507
  kind: "Shacl",
2612
- type: () => ({
2613
- kind: "Maybe",
2614
- item: () => ({
2615
- kind: "List",
2616
- item: () => ({ kind: "Term" }),
2617
- }),
2618
- }),
2619
2508
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
2509
+ type: {
2510
+ kind: "Option",
2511
+ itemType: {
2512
+ kind: "List",
2513
+ itemType: { kind: "Term" },
2514
+ },
2515
+ },
2620
2516
  },
2621
2517
  isDefinedBy: {
2622
2518
  kind: "Shacl",
2623
- type: () => ({
2624
- kind: "Maybe",
2625
- item: () => ({ kind: "Identifier" }),
2626
- }),
2627
2519
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
2520
+ type: {
2521
+ kind: "Option",
2522
+ itemType: { kind: "Identifier" },
2523
+ },
2628
2524
  },
2629
2525
  label: {
2630
2526
  kind: "Shacl",
2631
- type: () => ({
2632
- kind: "Maybe",
2633
- item: () => ({ kind: "String" }),
2634
- }),
2635
2527
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
2528
+ type: {
2529
+ kind: "Option",
2530
+ itemType: { kind: "String" },
2531
+ },
2636
2532
  },
2637
2533
  languageIn: {
2638
2534
  kind: "Shacl",
2639
- type: () => ({
2640
- kind: "Maybe",
2641
- item: () => ({
2642
- kind: "List",
2643
- item: () => ({ kind: "String" }),
2644
- }),
2645
- }),
2646
2535
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
2536
+ type: {
2537
+ kind: "Option",
2538
+ itemType: {
2539
+ kind: "List",
2540
+ itemType: { kind: "String" },
2541
+ },
2542
+ },
2647
2543
  },
2648
2544
  maxCount: {
2649
2545
  kind: "Shacl",
2650
- type: () => ({
2651
- kind: "Maybe",
2652
- item: () => ({ kind: "BigInt" }),
2653
- }),
2654
2546
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
2547
+ type: {
2548
+ kind: "Option",
2549
+ itemType: { kind: "BigInt" },
2550
+ },
2655
2551
  },
2656
2552
  maxExclusive: {
2657
2553
  kind: "Shacl",
2658
- type: () => ({
2659
- kind: "Maybe",
2660
- item: () => ({ kind: "Literal" }),
2661
- }),
2662
2554
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
2555
+ type: {
2556
+ kind: "Option",
2557
+ itemType: { kind: "Literal" },
2558
+ },
2663
2559
  },
2664
2560
  maxInclusive: {
2665
2561
  kind: "Shacl",
2666
- type: () => ({
2667
- kind: "Maybe",
2668
- item: () => ({ kind: "Literal" }),
2669
- }),
2670
2562
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
2563
+ type: {
2564
+ kind: "Option",
2565
+ itemType: { kind: "Literal" },
2566
+ },
2671
2567
  },
2672
2568
  maxLength: {
2673
2569
  kind: "Shacl",
2674
- type: () => ({
2675
- kind: "Maybe",
2676
- item: () => ({ kind: "BigInt" }),
2677
- }),
2678
2570
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
2571
+ type: {
2572
+ kind: "Option",
2573
+ itemType: { kind: "BigInt" },
2574
+ },
2679
2575
  },
2680
2576
  minCount: {
2681
2577
  kind: "Shacl",
2682
- type: () => ({
2683
- kind: "Maybe",
2684
- item: () => ({ kind: "BigInt" }),
2685
- }),
2686
2578
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
2579
+ type: {
2580
+ kind: "Option",
2581
+ itemType: { kind: "BigInt" },
2582
+ },
2687
2583
  },
2688
2584
  minExclusive: {
2689
2585
  kind: "Shacl",
2690
- type: () => ({
2691
- kind: "Maybe",
2692
- item: () => ({ kind: "Literal" }),
2693
- }),
2694
2586
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
2587
+ type: {
2588
+ kind: "Option",
2589
+ itemType: { kind: "Literal" },
2590
+ },
2695
2591
  },
2696
2592
  minInclusive: {
2697
2593
  kind: "Shacl",
2698
- type: () => ({
2699
- kind: "Maybe",
2700
- item: () => ({ kind: "Literal" }),
2701
- }),
2702
2594
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
2595
+ type: {
2596
+ kind: "Option",
2597
+ itemType: { kind: "Literal" },
2598
+ },
2703
2599
  },
2704
2600
  minLength: {
2705
2601
  kind: "Shacl",
2706
- type: () => ({
2707
- kind: "Maybe",
2708
- item: () => ({ kind: "BigInt" }),
2709
- }),
2710
2602
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
2603
+ type: {
2604
+ kind: "Option",
2605
+ itemType: { kind: "BigInt" },
2606
+ },
2711
2607
  },
2712
2608
  mutable: {
2713
2609
  kind: "Shacl",
2714
- type: () => ({
2715
- kind: "Maybe",
2716
- item: () => ({ kind: "Boolean" }),
2717
- }),
2718
2610
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"),
2611
+ type: {
2612
+ kind: "Option",
2613
+ itemType: { kind: "Boolean" },
2614
+ },
2719
2615
  },
2720
2616
  node: {
2721
2617
  kind: "Shacl",
2722
- type: () => ({
2723
- kind: "Maybe",
2724
- item: () => ({ kind: "Identifier" }),
2725
- }),
2726
2618
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
2619
+ type: {
2620
+ kind: "Option",
2621
+ itemType: { kind: "Identifier" },
2622
+ },
2727
2623
  },
2728
2624
  nodeKind: {
2729
2625
  kind: "Shacl",
2730
- type: () => ({
2731
- kind: "Maybe",
2732
- item: () => ({
2626
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
2627
+ type: {
2628
+ kind: "Option",
2629
+ itemType: {
2733
2630
  kind: "Iri",
2734
2631
  in: [
2735
2632
  dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
@@ -2739,103 +2636,84 @@ export var NodeShape;
2739
2636
  dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
2740
2637
  dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
2741
2638
  ],
2742
- }),
2743
- }),
2744
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
2639
+ },
2640
+ },
2745
2641
  },
2746
2642
  not: {
2747
2643
  kind: "Shacl",
2748
- type: () => ({
2749
- kind: "Set",
2750
- item: () => ({ kind: "Identifier" }),
2751
- }),
2752
2644
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
2645
+ type: {
2646
+ kind: "Set",
2647
+ itemType: { kind: "Identifier" },
2648
+ },
2753
2649
  },
2754
2650
  or: {
2755
2651
  kind: "Shacl",
2756
- type: () => ({
2757
- kind: "Maybe",
2758
- item: () => ({
2759
- kind: "List",
2760
- item: () => ({ kind: "Identifier" }),
2761
- }),
2762
- }),
2763
2652
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
2653
+ type: {
2654
+ kind: "Option",
2655
+ itemType: {
2656
+ kind: "List",
2657
+ itemType: { kind: "Identifier" },
2658
+ },
2659
+ },
2764
2660
  },
2765
2661
  patterns: {
2766
2662
  kind: "Shacl",
2767
- type: () => ({
2768
- kind: "Set",
2769
- item: () => ({ kind: "String" }),
2770
- }),
2771
2663
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
2664
+ type: { kind: "Set", itemType: { kind: "String" } },
2772
2665
  },
2773
2666
  properties: {
2774
2667
  kind: "Shacl",
2775
- type: () => ({
2776
- kind: "Set",
2777
- item: () => ({ kind: "Identifier" }),
2778
- }),
2779
2668
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
2669
+ type: {
2670
+ kind: "Set",
2671
+ itemType: { kind: "Identifier" },
2672
+ },
2780
2673
  },
2781
2674
  rdfType: {
2782
2675
  kind: "Shacl",
2783
- type: () => ({
2784
- kind: "Maybe",
2785
- item: () => ({ kind: "Iri" }),
2786
- }),
2787
2676
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#rdfType"),
2677
+ type: { kind: "Option", itemType: { kind: "Iri" } },
2788
2678
  },
2789
2679
  shaclmateName: {
2790
2680
  kind: "Shacl",
2791
- type: () => ({
2792
- kind: "Maybe",
2793
- item: () => ({ kind: "String" }),
2794
- }),
2795
2681
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
2682
+ type: {
2683
+ kind: "Option",
2684
+ itemType: { kind: "String" },
2685
+ },
2796
2686
  },
2797
2687
  subClassOf: {
2798
2688
  kind: "Shacl",
2799
- type: () => ({
2800
- kind: "Set",
2801
- item: () => ({ kind: "Iri" }),
2802
- }),
2803
2689
  path: $RdfVocabularies.rdfs.subClassOf,
2690
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2804
2691
  },
2805
2692
  toRdfTypes: {
2806
2693
  kind: "Shacl",
2807
- type: () => ({
2808
- kind: "Set",
2809
- item: () => ({ kind: "Iri" }),
2810
- }),
2811
2694
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#toRdfType"),
2695
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2812
2696
  },
2813
2697
  tsImports: {
2814
2698
  kind: "Shacl",
2815
- type: () => ({
2816
- kind: "Set",
2817
- item: () => ({ kind: "String" }),
2818
- }),
2819
2699
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"),
2700
+ type: { kind: "Set", itemType: { kind: "String" } },
2820
2701
  },
2821
2702
  types: {
2822
2703
  kind: "Shacl",
2823
- type: () => ({
2824
- kind: "Set",
2825
- item: () => ({ kind: "Iri" }),
2826
- }),
2827
2704
  path: $RdfVocabularies.rdf.type,
2705
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2828
2706
  },
2829
2707
  xone: {
2830
2708
  kind: "Shacl",
2831
- type: () => ({
2832
- kind: "Maybe",
2833
- item: () => ({
2834
- kind: "List",
2835
- item: () => ({ kind: "Identifier" }),
2836
- }),
2837
- }),
2838
2709
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
2710
+ type: {
2711
+ kind: "Option",
2712
+ itemType: {
2713
+ kind: "List",
2714
+ itemType: { kind: "Identifier" },
2715
+ },
2716
+ },
2839
2717
  },
2840
2718
  },
2841
2719
  };
@@ -3117,7 +2995,7 @@ export var Shape;
3117
2995
  }
3118
2996
  Shape.isShape = isShape;
3119
2997
  Shape.schema = {
3120
- kind: "NamedObjectUnion",
2998
+ kind: "ObjectUnion",
3121
2999
  members: {
3122
3000
  NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.schema },
3123
3001
  PropertyShape: {
@@ -3128,186 +3006,175 @@ export var Shape;
3128
3006
  properties: {
3129
3007
  and: {
3130
3008
  kind: "Shacl",
3131
- type: () => ({
3132
- kind: "Maybe",
3133
- item: () => ({
3134
- kind: "List",
3135
- item: () => ({ kind: "Identifier" }),
3136
- }),
3137
- }),
3138
3009
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
3010
+ type: {
3011
+ kind: "Option",
3012
+ itemType: {
3013
+ kind: "List",
3014
+ itemType: { kind: "Identifier" },
3015
+ },
3016
+ },
3139
3017
  },
3140
3018
  classes: {
3141
3019
  kind: "Shacl",
3142
- type: () => ({
3143
- kind: "Set",
3144
- item: () => ({ kind: "Iri" }),
3145
- }),
3146
3020
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
3021
+ type: { kind: "Set", itemType: { kind: "Iri" } },
3147
3022
  },
3148
3023
  comment: {
3149
3024
  kind: "Shacl",
3150
- type: () => ({
3151
- kind: "Maybe",
3152
- item: () => ({ kind: "String" }),
3153
- }),
3154
3025
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
3026
+ type: {
3027
+ kind: "Option",
3028
+ itemType: { kind: "String" },
3029
+ },
3155
3030
  },
3156
3031
  datatype: {
3157
3032
  kind: "Shacl",
3158
- type: () => ({
3159
- kind: "Maybe",
3160
- item: () => ({ kind: "Iri" }),
3161
- }),
3162
3033
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
3034
+ type: { kind: "Option", itemType: { kind: "Iri" } },
3163
3035
  },
3164
3036
  deactivated: {
3165
3037
  kind: "Shacl",
3166
- type: () => ({
3167
- kind: "Maybe",
3168
- item: () => ({ kind: "Boolean" }),
3169
- }),
3170
3038
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
3039
+ type: {
3040
+ kind: "Option",
3041
+ itemType: { kind: "Boolean" },
3042
+ },
3171
3043
  },
3172
3044
  flags: {
3173
3045
  kind: "Shacl",
3174
- type: () => ({
3175
- kind: "Set",
3176
- item: () => ({ kind: "String" }),
3177
- }),
3178
3046
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
3047
+ type: { kind: "Set", itemType: { kind: "String" } },
3179
3048
  },
3180
3049
  hasValues: {
3181
3050
  kind: "Shacl",
3182
- type: () => ({
3183
- kind: "Set",
3184
- item: () => ({ kind: "Term" }),
3185
- }),
3186
3051
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
3052
+ type: { kind: "Set", itemType: { kind: "Term" } },
3187
3053
  },
3188
3054
  in_: {
3189
3055
  kind: "Shacl",
3190
- type: () => ({
3191
- kind: "Maybe",
3192
- item: () => ({
3193
- kind: "List",
3194
- item: () => ({ kind: "Term" }),
3195
- }),
3196
- }),
3197
3056
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
3057
+ type: {
3058
+ kind: "Option",
3059
+ itemType: {
3060
+ kind: "List",
3061
+ itemType: { kind: "Term" },
3062
+ },
3063
+ },
3198
3064
  },
3199
3065
  isDefinedBy: {
3200
3066
  kind: "Shacl",
3201
- type: () => ({
3202
- kind: "Maybe",
3203
- item: () => ({ kind: "Identifier" }),
3204
- }),
3205
3067
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
3068
+ type: {
3069
+ kind: "Option",
3070
+ itemType: { kind: "Identifier" },
3071
+ },
3206
3072
  },
3207
3073
  label: {
3208
3074
  kind: "Shacl",
3209
- type: () => ({
3210
- kind: "Maybe",
3211
- item: () => ({ kind: "String" }),
3212
- }),
3213
3075
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
3076
+ type: {
3077
+ kind: "Option",
3078
+ itemType: { kind: "String" },
3079
+ },
3214
3080
  },
3215
3081
  languageIn: {
3216
3082
  kind: "Shacl",
3217
- type: () => ({
3218
- kind: "Maybe",
3219
- item: () => ({
3220
- kind: "List",
3221
- item: () => ({ kind: "String" }),
3222
- }),
3223
- }),
3224
3083
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
3084
+ type: {
3085
+ kind: "Option",
3086
+ itemType: {
3087
+ kind: "List",
3088
+ itemType: { kind: "String" },
3089
+ },
3090
+ },
3225
3091
  },
3226
3092
  maxCount: {
3227
3093
  kind: "Shacl",
3228
- type: () => ({
3229
- kind: "Maybe",
3230
- item: () => ({ kind: "BigInt" }),
3231
- }),
3232
3094
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
3095
+ type: {
3096
+ kind: "Option",
3097
+ itemType: { kind: "BigInt" },
3098
+ },
3233
3099
  },
3234
3100
  maxExclusive: {
3235
3101
  kind: "Shacl",
3236
- type: () => ({
3237
- kind: "Maybe",
3238
- item: () => ({ kind: "Literal" }),
3239
- }),
3240
3102
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
3103
+ type: {
3104
+ kind: "Option",
3105
+ itemType: { kind: "Literal" },
3106
+ },
3241
3107
  },
3242
3108
  maxInclusive: {
3243
3109
  kind: "Shacl",
3244
- type: () => ({
3245
- kind: "Maybe",
3246
- item: () => ({ kind: "Literal" }),
3247
- }),
3248
3110
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
3111
+ type: {
3112
+ kind: "Option",
3113
+ itemType: { kind: "Literal" },
3114
+ },
3249
3115
  },
3250
3116
  maxLength: {
3251
3117
  kind: "Shacl",
3252
- type: () => ({
3253
- kind: "Maybe",
3254
- item: () => ({ kind: "BigInt" }),
3255
- }),
3256
3118
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
3119
+ type: {
3120
+ kind: "Option",
3121
+ itemType: { kind: "BigInt" },
3122
+ },
3257
3123
  },
3258
3124
  minCount: {
3259
3125
  kind: "Shacl",
3260
- type: () => ({
3261
- kind: "Maybe",
3262
- item: () => ({ kind: "BigInt" }),
3263
- }),
3264
3126
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
3127
+ type: {
3128
+ kind: "Option",
3129
+ itemType: { kind: "BigInt" },
3130
+ },
3265
3131
  },
3266
3132
  minExclusive: {
3267
3133
  kind: "Shacl",
3268
- type: () => ({
3269
- kind: "Maybe",
3270
- item: () => ({ kind: "Literal" }),
3271
- }),
3272
3134
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
3135
+ type: {
3136
+ kind: "Option",
3137
+ itemType: { kind: "Literal" },
3138
+ },
3273
3139
  },
3274
3140
  minInclusive: {
3275
3141
  kind: "Shacl",
3276
- type: () => ({
3277
- kind: "Maybe",
3278
- item: () => ({ kind: "Literal" }),
3279
- }),
3280
3142
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
3143
+ type: {
3144
+ kind: "Option",
3145
+ itemType: { kind: "Literal" },
3146
+ },
3281
3147
  },
3282
3148
  minLength: {
3283
3149
  kind: "Shacl",
3284
- type: () => ({
3285
- kind: "Maybe",
3286
- item: () => ({ kind: "BigInt" }),
3287
- }),
3288
3150
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
3151
+ type: {
3152
+ kind: "Option",
3153
+ itemType: { kind: "BigInt" },
3154
+ },
3289
3155
  },
3290
3156
  mutable: {
3291
3157
  kind: "Shacl",
3292
- type: () => ({
3293
- kind: "Maybe",
3294
- item: () => ({ kind: "Boolean" }),
3295
- }),
3296
3158
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"),
3159
+ type: {
3160
+ kind: "Option",
3161
+ itemType: { kind: "Boolean" },
3162
+ },
3297
3163
  },
3298
3164
  node: {
3299
3165
  kind: "Shacl",
3300
- type: () => ({
3301
- kind: "Maybe",
3302
- item: () => ({ kind: "Identifier" }),
3303
- }),
3304
3166
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
3167
+ type: {
3168
+ kind: "Option",
3169
+ itemType: { kind: "Identifier" },
3170
+ },
3305
3171
  },
3306
3172
  nodeKind: {
3307
3173
  kind: "Shacl",
3308
- type: () => ({
3309
- kind: "Maybe",
3310
- item: () => ({
3174
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
3175
+ type: {
3176
+ kind: "Option",
3177
+ itemType: {
3311
3178
  kind: "Iri",
3312
3179
  in: [
3313
3180
  dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
@@ -3317,55 +3184,51 @@ export var Shape;
3317
3184
  dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
3318
3185
  dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
3319
3186
  ],
3320
- }),
3321
- }),
3322
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
3187
+ },
3188
+ },
3323
3189
  },
3324
3190
  not: {
3325
3191
  kind: "Shacl",
3326
- type: () => ({
3327
- kind: "Set",
3328
- item: () => ({ kind: "Identifier" }),
3329
- }),
3330
3192
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
3193
+ type: {
3194
+ kind: "Set",
3195
+ itemType: { kind: "Identifier" },
3196
+ },
3331
3197
  },
3332
3198
  or: {
3333
3199
  kind: "Shacl",
3334
- type: () => ({
3335
- kind: "Maybe",
3336
- item: () => ({
3337
- kind: "List",
3338
- item: () => ({ kind: "Identifier" }),
3339
- }),
3340
- }),
3341
3200
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
3201
+ type: {
3202
+ kind: "Option",
3203
+ itemType: {
3204
+ kind: "List",
3205
+ itemType: { kind: "Identifier" },
3206
+ },
3207
+ },
3342
3208
  },
3343
3209
  patterns: {
3344
3210
  kind: "Shacl",
3345
- type: () => ({
3346
- kind: "Set",
3347
- item: () => ({ kind: "String" }),
3348
- }),
3349
3211
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
3212
+ type: { kind: "Set", itemType: { kind: "String" } },
3350
3213
  },
3351
3214
  shaclmateName: {
3352
3215
  kind: "Shacl",
3353
- type: () => ({
3354
- kind: "Maybe",
3355
- item: () => ({ kind: "String" }),
3356
- }),
3357
3216
  path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
3217
+ type: {
3218
+ kind: "Option",
3219
+ itemType: { kind: "String" },
3220
+ },
3358
3221
  },
3359
3222
  xone: {
3360
3223
  kind: "Shacl",
3361
- type: () => ({
3362
- kind: "Maybe",
3363
- item: () => ({
3364
- kind: "List",
3365
- item: () => ({ kind: "Identifier" }),
3366
- }),
3367
- }),
3368
3224
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
3225
+ type: {
3226
+ kind: "Option",
3227
+ itemType: {
3228
+ kind: "List",
3229
+ itemType: { kind: "Identifier" },
3230
+ },
3231
+ },
3369
3232
  },
3370
3233
  },
3371
3234
  };
@@ -3473,7 +3336,7 @@ export var $Object;
3473
3336
  Identifier.stringify = NTriplesTerm.stringify;
3474
3337
  })(Identifier = $Object.Identifier || ($Object.Identifier = {}));
3475
3338
  $Object.schema = {
3476
- kind: "NamedObjectUnion",
3339
+ kind: "ObjectUnion",
3477
3340
  members: {
3478
3341
  NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.schema },
3479
3342
  Ontology: { discriminantValues: ["Ontology"], type: Ontology.schema },
@@ -3489,19 +3352,19 @@ export var $Object;
3489
3352
  properties: {
3490
3353
  comment: {
3491
3354
  kind: "Shacl",
3492
- type: () => ({
3493
- kind: "Maybe",
3494
- item: () => ({ kind: "String" }),
3495
- }),
3496
3355
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
3356
+ type: {
3357
+ kind: "Option",
3358
+ itemType: { kind: "String" },
3359
+ },
3497
3360
  },
3498
3361
  label: {
3499
3362
  kind: "Shacl",
3500
- type: () => ({
3501
- kind: "Maybe",
3502
- item: () => ({ kind: "String" }),
3503
- }),
3504
3363
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
3364
+ type: {
3365
+ kind: "Option",
3366
+ itemType: { kind: "String" },
3367
+ },
3505
3368
  },
3506
3369
  },
3507
3370
  };