@shaclmate/compiler 4.0.41 → 4.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/dist/ShapesGraphToAstTransformer.d.ts +1 -0
  2. package/dist/ShapesGraphToAstTransformer.js +10 -45
  3. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
  4. package/dist/_ShapesGraphToAstTransformer/{transformPropertyShapeToAstObjectTypeProperty.js → transformPropertyShapeToAstStructTypeField.js} +71 -48
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +29 -20
  7. package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.d.ts → transformShapeToAstStructType.d.ts} +2 -2
  8. package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -29
  9. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +2 -1
  10. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
  11. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
  12. package/dist/ast/AbstractCompoundType.d.ts +2 -2
  13. package/dist/ast/AbstractCompoundType.js +4 -4
  14. package/dist/ast/AbstractContainerType.d.ts +2 -2
  15. package/dist/ast/AbstractContainerType.js +4 -4
  16. package/dist/ast/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +10 -10
  17. package/dist/ast/{AbstractLazyObjectType.js → AbstractLazyType.js} +3 -3
  18. package/dist/ast/AbstractType.d.ts +1 -1
  19. package/dist/ast/AbstractType.js +3 -0
  20. package/dist/ast/Ast.d.ts +2 -4
  21. package/dist/ast/DefaultValueType.js +2 -1
  22. package/dist/ast/IntersectionType.d.ts +2 -2
  23. package/dist/ast/IntersectionType.js +3 -3
  24. package/dist/ast/LazyOptionType.d.ts +6 -0
  25. package/dist/ast/LazyOptionType.js +5 -0
  26. package/dist/ast/LazySetType.d.ts +6 -0
  27. package/dist/ast/LazySetType.js +5 -0
  28. package/dist/ast/LazyType.d.ts +5 -0
  29. package/dist/ast/LazyType.js +5 -0
  30. package/dist/ast/ListType.d.ts +2 -2
  31. package/dist/ast/ListType.js +4 -4
  32. package/dist/ast/OptionType.js +2 -1
  33. package/dist/ast/SetType.js +2 -1
  34. package/dist/ast/StructCompoundType.d.ts +12 -0
  35. package/dist/ast/{ObjectCompoundType.js → StructCompoundType.js} +18 -18
  36. package/dist/ast/StructIntersectionType.d.ts +4 -0
  37. package/dist/ast/StructIntersectionType.js +2 -0
  38. package/dist/ast/{ObjectType.d.ts → StructType.d.ts} +28 -27
  39. package/dist/ast/{ObjectType.js → StructType.js} +81 -78
  40. package/dist/ast/StructUnionType.d.ts +4 -0
  41. package/dist/ast/StructUnionType.js +2 -0
  42. package/dist/ast/Type.d.ts +5 -5
  43. package/dist/ast/Type.js +4 -4
  44. package/dist/ast/UnionType.d.ts +2 -2
  45. package/dist/ast/UnionType.js +3 -3
  46. package/dist/ast/index.d.ts +7 -7
  47. package/dist/ast/index.js +7 -7
  48. package/dist/generators/AstJsonGenerator.js +2 -2
  49. package/dist/generators/transformAstToLabeledPropertyGraph.js +8 -8
  50. package/dist/generators/ts/AbstractContainerType.d.ts +1 -1
  51. package/dist/generators/ts/AbstractContainerType.js +6 -6
  52. package/dist/generators/ts/AbstractDateType.d.ts +1 -7
  53. package/dist/generators/ts/AbstractDateType.js +1 -11
  54. package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +7 -7
  55. package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +19 -17
  56. package/dist/generators/ts/AbstractLiteralType.d.ts +2 -5
  57. package/dist/generators/ts/AbstractLiteralType.js +0 -21
  58. package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
  59. package/dist/generators/ts/AbstractNumericType.js +15 -25
  60. package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
  61. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  62. package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -1
  63. package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
  64. package/dist/generators/ts/AbstractTermType.d.ts +6 -21
  65. package/dist/generators/ts/AbstractTermType.js +26 -55
  66. package/dist/generators/ts/AbstractType.d.ts +40 -47
  67. package/dist/generators/ts/AbstractType.js +17 -6
  68. package/dist/generators/ts/BigDecimalType.d.ts +3 -3
  69. package/dist/generators/ts/BigDecimalType.js +3 -8
  70. package/dist/generators/ts/BigIntType.d.ts +2 -2
  71. package/dist/generators/ts/BigIntType.js +7 -4
  72. package/dist/generators/ts/BlankNodeType.d.ts +2 -7
  73. package/dist/generators/ts/BlankNodeType.js +2 -7
  74. package/dist/generators/ts/BooleanType.d.ts +3 -3
  75. package/dist/generators/ts/BooleanType.js +12 -14
  76. package/dist/generators/ts/DateTimeType.d.ts +2 -2
  77. package/dist/generators/ts/DateTimeType.js +14 -4
  78. package/dist/generators/ts/DateType.d.ts +2 -2
  79. package/dist/generators/ts/DateType.js +14 -4
  80. package/dist/generators/ts/DefaultValueType.d.ts +8 -8
  81. package/dist/generators/ts/DefaultValueType.js +10 -12
  82. package/dist/generators/ts/FloatType.d.ts +2 -2
  83. package/dist/generators/ts/FloatType.js +7 -4
  84. package/dist/generators/ts/IdentifierType.d.ts +2 -2
  85. package/dist/generators/ts/IdentifierType.js +2 -7
  86. package/dist/generators/ts/IntType.d.ts +2 -2
  87. package/dist/generators/ts/IntType.js +7 -4
  88. package/dist/generators/ts/IriType.d.ts +2 -2
  89. package/dist/generators/ts/IriType.js +12 -14
  90. package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +12 -11
  91. package/dist/generators/ts/{LazyObjectOptionType.js → LazyOptionType.js} +23 -14
  92. package/dist/generators/ts/LazySetType.d.ts +20 -0
  93. package/dist/generators/ts/{LazyObjectSetType.js → LazySetType.js} +22 -13
  94. package/dist/generators/ts/LazyType.d.ts +19 -0
  95. package/dist/generators/ts/{LazyObjectType.js → LazyType.js} +22 -13
  96. package/dist/generators/ts/ListType.d.ts +1 -1
  97. package/dist/generators/ts/ListType.js +9 -19
  98. package/dist/generators/ts/LiteralType.d.ts +3 -2
  99. package/dist/generators/ts/LiteralType.js +6 -2
  100. package/dist/generators/ts/ObjectType.d.ts +16 -3
  101. package/dist/generators/ts/ObjectType.js +301 -91
  102. package/dist/generators/ts/ObjectUnionType.js +40 -40
  103. package/dist/generators/ts/OptionType.d.ts +2 -2
  104. package/dist/generators/ts/OptionType.js +7 -5
  105. package/dist/generators/ts/SetType.d.ts +3 -3
  106. package/dist/generators/ts/SetType.js +8 -10
  107. package/dist/generators/ts/Snippets.d.ts +26 -8
  108. package/dist/generators/ts/Snippets.js +161 -35
  109. package/dist/generators/ts/StringType.d.ts +4 -3
  110. package/dist/generators/ts/StringType.js +18 -11
  111. package/dist/generators/ts/TermType.d.ts +7 -5
  112. package/dist/generators/ts/TermType.js +28 -9
  113. package/dist/generators/ts/TsGenerator.js +11 -6
  114. package/dist/generators/ts/Type.d.ts +4 -4
  115. package/dist/generators/ts/TypeFactory.d.ts +5 -5
  116. package/dist/generators/ts/TypeFactory.js +79 -58
  117. package/dist/generators/ts/UnionType.d.ts +23 -18
  118. package/dist/generators/ts/UnionType.js +227 -221
  119. package/dist/generators/ts/ZodGenerator.js +15 -7
  120. package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +24 -15
  121. package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
  122. package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +8 -6
  123. package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +11 -24
  124. package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
  125. package/dist/generators/ts/_ObjectType/IdentifierProperty.js +44 -16
  126. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
  127. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
  128. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
  129. package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionDeclaration.js → ObjectType_equalsFunctionExpression.js} +6 -10
  130. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
  131. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
  132. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
  133. package/dist/generators/ts/_ObjectType/{ObjectType_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +6 -8
  134. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
  135. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionExpression.js} +5 -9
  136. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts} +2 -3
  137. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → ObjectType_focusSparqlWherePatternsFunctionExpression.js} +5 -9
  138. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
  139. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
  141. package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionExpression.js} +8 -16
  142. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
  143. package/dist/generators/ts/_ObjectType/{ObjectType_graphqlTypeVariableStatement.js → ObjectType_graphqlTypeExpression.js} +6 -13
  144. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.d.ts +4 -0
  145. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.js +30 -0
  146. package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +4 -0
  147. package/dist/generators/ts/_ObjectType/{identifierTypeDeclarations.js → ObjectType_identifierTypeDeclarations.js} +2 -5
  148. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +3 -3
  149. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +1 -2
  150. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +2 -6
  151. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
  152. package/dist/generators/ts/_ObjectType/{ObjectType_jsonSchemaFunctionDeclaration.js → ObjectType_jsonSchemaExpression.js} +3 -10
  153. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
  154. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
  155. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
  156. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
  157. package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +1 -1
  158. package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +2 -2
  159. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
  160. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +18 -0
  161. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +4 -0
  162. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +18 -0
  163. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -3
  164. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +5 -9
  165. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -3
  166. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +4 -8
  167. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +4 -0
  168. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +14 -0
  169. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +4 -0
  170. package/dist/generators/ts/_ObjectType/{ObjectType_toRdfResourceFunctionDeclaration.js → ObjectType_toRdfResourceFunctionExpression.js} +6 -12
  171. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.d.ts +4 -0
  172. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +7 -0
  173. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +4 -0
  174. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +5 -0
  175. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
  176. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
  177. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts} +2 -3
  178. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
  179. package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +9 -2
  180. package/dist/generators/ts/_ObjectType/ShaclProperty.js +65 -33
  181. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +4 -3
  182. package/dist/generators/ts/_snippets/snippets_DateSchema.js +4 -3
  183. package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
  184. package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +6 -5
  185. package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +2 -1
  186. package/dist/generators/ts/_snippets/snippets_IriSchema.js +1 -0
  187. package/dist/generators/ts/_snippets/snippets_Lazy.d.ts +3 -0
  188. package/dist/generators/ts/_snippets/snippets_Lazy.js +22 -0
  189. package/dist/generators/ts/_snippets/snippets_LazyOption.d.ts +3 -0
  190. package/dist/generators/ts/_snippets/snippets_LazyOption.js +25 -0
  191. package/dist/generators/ts/_snippets/snippets_LazySet.d.ts +3 -0
  192. package/dist/generators/ts/_snippets/snippets_LazySet.js +40 -0
  193. package/dist/generators/ts/_snippets/snippets_LiteralFilter.js +1 -3
  194. package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +1 -0
  195. package/dist/generators/ts/_snippets/snippets_NumericSchema.js +2 -1
  196. package/dist/generators/ts/_snippets/snippets_PropertyPath.js +6 -8
  197. package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +32 -32
  198. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
  199. package/dist/generators/ts/_snippets/snippets_StringSchema.js +5 -3
  200. package/dist/generators/ts/_snippets/snippets_TermFilter.js +3 -3
  201. package/dist/generators/ts/_snippets/snippets_TermSchema.js +4 -2
  202. package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.d.ts +3 -0
  203. package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +6 -0
  204. package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.d.ts +3 -0
  205. package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +6 -0
  206. package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.d.ts +3 -0
  207. package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +6 -0
  208. package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.d.ts +3 -0
  209. package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -0
  210. package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
  211. package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
  212. package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
  213. package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
  214. package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
  215. package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
  216. package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.d.ts +3 -0
  217. package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -0
  218. package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.d.ts +3 -0
  219. package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +6 -0
  220. package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.d.ts +3 -0
  221. package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
  222. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
  223. package/dist/generators/ts/_snippets/snippets_filterNumeric.js +1 -1
  224. package/dist/generators/ts/_snippets/snippets_filterTerm.js +1 -2
  225. package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.d.ts +3 -0
  226. package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.js +6 -0
  227. package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.d.ts +3 -0
  228. package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +6 -0
  229. package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.d.ts +3 -0
  230. package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.js +6 -0
  231. package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts +3 -0
  232. package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js +6 -0
  233. package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.d.ts +3 -0
  234. package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -0
  235. package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.d.ts +3 -0
  236. package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +6 -0
  237. package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.d.ts +3 -0
  238. package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -0
  239. package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.d.ts +3 -0
  240. package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.js +8 -0
  241. package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.d.ts +3 -0
  242. package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.js +8 -0
  243. package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +1 -1
  244. package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.d.ts +3 -0
  245. package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.js +9 -0
  246. package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.js +13 -7
  247. package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.d.ts +3 -0
  248. package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.js +6 -0
  249. package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.js +1 -1
  250. package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.d.ts +3 -0
  251. package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.js +17 -0
  252. package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.d.ts +3 -0
  253. package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.js +60 -0
  254. package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
  255. package/dist/input/generated.d.ts +464 -389
  256. package/dist/input/generated.js +1748 -2294
  257. package/package.json +2 -2
  258. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +0 -9
  259. package/dist/ast/LazyObjectOptionType.d.ts +0 -6
  260. package/dist/ast/LazyObjectOptionType.js +0 -5
  261. package/dist/ast/LazyObjectSetType.d.ts +0 -6
  262. package/dist/ast/LazyObjectSetType.js +0 -5
  263. package/dist/ast/LazyObjectType.d.ts +0 -5
  264. package/dist/ast/LazyObjectType.js +0 -5
  265. package/dist/ast/ObjectCompoundType.d.ts +0 -12
  266. package/dist/ast/ObjectIntersectionType.d.ts +0 -4
  267. package/dist/ast/ObjectIntersectionType.js +0 -2
  268. package/dist/ast/ObjectUnionType.d.ts +0 -4
  269. package/dist/ast/ObjectUnionType.js +0 -2
  270. package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
  271. package/dist/generators/ts/LazyObjectType.d.ts +0 -19
  272. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
  273. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -44
  274. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
  275. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
  276. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -21
  277. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -5
  278. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  279. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +0 -18
  280. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  281. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  282. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  283. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  284. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.js +0 -10
  285. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  286. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +0 -4
  287. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +0 -41
  288. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
  289. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -12
  290. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  291. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  292. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -9
  293. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  294. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -15
  295. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
  296. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -12
  297. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  298. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -20
  299. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  300. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +0 -4
  301. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.js +0 -29
  302. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +0 -11
  303. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +0 -13
  304. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
  305. package/dist/generators/ts/_snippets/snippets_LazyObject.d.ts +0 -3
  306. package/dist/generators/ts/_snippets/snippets_LazyObject.js +0 -22
  307. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.d.ts +0 -3
  308. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +0 -25
  309. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.d.ts +0 -3
  310. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +0 -40
  311. package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +0 -3
  312. package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +0 -15
  313. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +0 -3
  314. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +0 -31
  315. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +0 -3
  316. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +0 -25
  317. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.d.ts +0 -3
  318. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +0 -15
  319. package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.d.ts +0 -3
  320. package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.js +0 -23
@@ -4,6 +4,16 @@ import { LiteralFactory } from "@rdfx/literal";
4
4
  import { PropertyPath as RdfxResourcePropertyPath, Resource, ResourceSet, } from "@rdfx/resource";
5
5
  import { NTriplesIdentifier, NTriplesTerm } from "@rdfx/string";
6
6
  import { Either, Left, Maybe, Right } from "purify-ts";
7
+ function $bigIntFromRdfResourceValues(values, options) {
8
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
9
+ ? value.toBigInt(options.schema.in)
10
+ : value.toBigInt()));
11
+ }
12
+ function $booleanFromRdfResourceValues(values, options) {
13
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
14
+ ? value.toBoolean(options.schema.in)
15
+ : value.toBoolean()));
16
+ }
7
17
  /**
8
18
  * Remove undefined values from a record.
9
19
  */
@@ -99,6 +109,16 @@ function $convertWithDefaultValue(convertToItem, defaultValue) {
99
109
  return convertToItem(value);
100
110
  };
101
111
  }
112
+ function $defaultValueFromRdfResourceValues(itemFromRdfResourceValues) {
113
+ return (values, options) => itemFromRdfResourceValues(values.length > 0
114
+ ? values
115
+ : new Resource.Value({
116
+ dataFactory: dataFactory,
117
+ focusResource: options.focusResource,
118
+ propertyPath: options.propertyPath,
119
+ term: options.schema.defaultValue,
120
+ }).toValues(), { ...options, schema: options.schema.itemType });
121
+ }
102
122
  function $ensureRdfResourceType(resource, types, options) {
103
123
  return resource
104
124
  .value($RdfVocabularies.rdf.type, options)
@@ -127,27 +147,13 @@ export var $EqualsResult;
127
147
  }
128
148
  $EqualsResult.fromBooleanEqualsResult = fromBooleanEqualsResult;
129
149
  })($EqualsResult || ($EqualsResult = {}));
130
- function $fromRdfPreferredLanguages(values, preferredLanguages) {
131
- if (!preferredLanguages || preferredLanguages.length === 0) {
132
- return Right(values);
133
- }
134
- // Return all literals for the first preferredLanguage, then all literals for the second preferredLanguage, etc.
135
- // Within a preferredLanguage the literals may be in any order.
136
- const filteredValues = [];
137
- for (const preferredLanguage of preferredLanguages) {
138
- for (const value of values) {
139
- value.toLiteral().ifRight((literal) => {
140
- if (literal.language === preferredLanguage) {
141
- filteredValues.push(value);
142
- }
143
- });
144
- }
145
- }
146
- return Right(Resource.Values.fromArray({
147
- focusResource: values.focusResource,
148
- propertyPath: values.propertyPath,
149
- values: filteredValues,
150
- }));
150
+ function $floatFromRdfResourceValues(values, options) {
151
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
152
+ ? value.toFloat(options.schema.in)
153
+ : value.toFloat()));
154
+ }
155
+ function $identifierFromRdfResourceValues(values, options) {
156
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toIdentifier()));
151
157
  }
152
158
  function $identityConversionFunction(value) {
153
159
  return Either.of(value);
@@ -155,7 +161,37 @@ function $identityConversionFunction(value) {
155
161
  function $identityValidationFunction(_schema, value) {
156
162
  return Either.of(value);
157
163
  }
164
+ function $iriFromRdfResourceValues(values, options) {
165
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
166
+ ? value.toIri(options.schema.in)
167
+ : value.toIri()));
168
+ }
169
+ function $listFromRdfResourceValues(itemFromRdfResourceValues) {
170
+ return (values, options) => values
171
+ .chainMap((value) => value.toList({ graph: options.graph })) // Resource.Values<Resource.Value> to Resource.Values<Resource.Values>;
172
+ .chain((valueLists) => valueLists.chainMap((valueList) => itemFromRdfResourceValues(Resource.Values.fromArray({
173
+ focusResource: options.focusResource,
174
+ propertyPath: options.propertyPath,
175
+ values: valueList.toArray(),
176
+ }), { ...options, schema: options.schema.itemType }))) // Resource.Values<Resource.Values> to Resource.Values<item type arrays>
177
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray())); // Convert inner Resource.Values to arrays
178
+ }
158
179
  const $literalFactory = new LiteralFactory({ dataFactory: dataFactory });
180
+ function $literalFromRdfResourceValues(values, options) {
181
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toLiteral()));
182
+ }
183
+ function $maybeFromRdfResourceValues(itemFromRdfResourceValues) {
184
+ return (values, options) => itemFromRdfResourceValues(values, {
185
+ ...options,
186
+ schema: options.schema.itemType,
187
+ }).map((values) => values.length > 0
188
+ ? values.map((value) => Maybe.of(value))
189
+ : Resource.Values.fromValue({
190
+ focusResource: options.focusResource,
191
+ propertyPath: options.propertyPath,
192
+ value: Maybe.empty(),
193
+ }));
194
+ }
159
195
  function $monkeyPatchObject(obj, methods) {
160
196
  if (methods.toJson &&
161
197
  (!globalThis.Object.prototype.hasOwnProperty.call(obj, "toJSON") ||
@@ -179,50 +215,47 @@ const $parseIdentifier = NTriplesIdentifier.parser(dataFactory);
179
215
  export var $PropertyPath;
180
216
  (function ($PropertyPath) {
181
217
  $PropertyPath.fromRdfResource = RdfxResourcePropertyPath.fromResource;
182
- $PropertyPath.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
218
+ $PropertyPath.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
183
219
  .toResource()
184
- .chain((resource) => $PropertyPath.fromRdfResource(resource, options))));
220
+ .chain((resource) => $PropertyPath.fromRdfResource(resource, options)));
185
221
  $PropertyPath.schema = {};
186
222
  $PropertyPath.toRdfResource = RdfxResourcePropertyPath.toResource;
187
223
  $PropertyPath.$toString = RdfxResourcePropertyPath.toString;
188
224
  })($PropertyPath || ($PropertyPath = {}));
189
225
  var $RdfVocabularies;
190
226
  (function ($RdfVocabularies) {
191
- let rdf;
192
- (function (rdf) {
193
- rdf.first = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first");
194
- rdf.nil = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil");
195
- rdf.rest = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest");
196
- rdf.subject = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject");
197
- rdf.type = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
198
- })(rdf = $RdfVocabularies.rdf || ($RdfVocabularies.rdf = {}));
199
- let rdfs;
200
- (function (rdfs) {
201
- rdfs.subClassOf = dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf");
202
- })(rdfs = $RdfVocabularies.rdfs || ($RdfVocabularies.rdfs = {}));
203
- let xsd;
204
- (function (xsd) {
205
- xsd.boolean = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean");
206
- xsd.byte = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#byte");
207
- xsd.date = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#date");
208
- xsd.dateTime = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime");
209
- xsd.decimal = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#decimal");
210
- xsd.double = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#double");
211
- xsd.float = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float");
212
- xsd.int = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#int");
213
- xsd.integer = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#integer");
214
- xsd.long = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#long");
215
- xsd.negativeInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#negativeInteger");
216
- xsd.nonNegativeInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
217
- xsd.nonPositiveInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonPositiveInteger");
218
- xsd.positiveInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#positiveInteger");
219
- xsd.short = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#short");
220
- xsd.string = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#string");
221
- xsd.unsignedByte = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedByte");
222
- xsd.unsignedInt = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedInt");
223
- xsd.unsignedLong = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedLong");
224
- xsd.unsignedShort = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort");
225
- })(xsd = $RdfVocabularies.xsd || ($RdfVocabularies.xsd = {}));
227
+ $RdfVocabularies.rdf = {
228
+ first: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),
229
+ nil: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),
230
+ rest: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),
231
+ subject: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject"),
232
+ type: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
233
+ };
234
+ $RdfVocabularies.rdfs = {
235
+ subClassOf: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
236
+ };
237
+ $RdfVocabularies.xsd = {
238
+ boolean: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
239
+ byte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#byte"),
240
+ date: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#date"),
241
+ dateTime: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),
242
+ decimal: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),
243
+ double: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#double"),
244
+ float: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float"),
245
+ int: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#int"),
246
+ integer: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#integer"),
247
+ long: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#long"),
248
+ negativeInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#negativeInteger"),
249
+ nonNegativeInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonNegativeInteger"),
250
+ nonPositiveInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonPositiveInteger"),
251
+ positiveInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#positiveInteger"),
252
+ short: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#short"),
253
+ string: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#string"),
254
+ unsignedByte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedByte"),
255
+ unsignedInt: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedInt"),
256
+ unsignedLong: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedLong"),
257
+ unsignedShort: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort"),
258
+ };
226
259
  })($RdfVocabularies || ($RdfVocabularies = {}));
227
260
  function $sequenceRecord(record) {
228
261
  const result = {};
@@ -235,8 +268,26 @@ function $sequenceRecord(record) {
235
268
  }
236
269
  return Right(result);
237
270
  }
238
- function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }) {
239
- return typeFromRdf(Right(resource.values(propertySchema.path, { graph, unique: true }))).chain((values) => values.head());
271
+ function $setFromRdfResourceValues(itemFromRdfResourceValues) {
272
+ return (values, options) => itemFromRdfResourceValues(values, {
273
+ ...options,
274
+ schema: options.schema.itemType,
275
+ })
276
+ .map((values) => values.toArray())
277
+ .map((valuesArray) => Resource.Values.fromValue({
278
+ focusResource: options.focusResource,
279
+ propertyPath: options.propertyPath,
280
+ value: valuesArray,
281
+ }));
282
+ }
283
+ function $shaclPropertyFromRdf({ focusResource, graph, propertySchema, typeFromRdfResourceValues, ...otherParameters }) {
284
+ return typeFromRdfResourceValues(focusResource.values(propertySchema.path, { graph, unique: true }), {
285
+ ...otherParameters,
286
+ focusResource,
287
+ graph,
288
+ propertyPath: propertySchema.path,
289
+ schema: propertySchema.type,
290
+ }).chain((values) => values.head());
240
291
  }
241
292
  /**
242
293
  * Compare two values for strict equality (===), returning an $EqualsResult rather than a boolean.
@@ -244,6 +295,84 @@ function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }
244
295
  function $strictEquals(left, right) {
245
296
  return $EqualsResult.fromBooleanEqualsResult(left, right, left === right);
246
297
  }
298
+ function $stringFromRdfResourceValues(values, options) {
299
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
300
+ ? value.toString(options.schema.in)
301
+ : value.toString()));
302
+ }
303
+ function $termFromRdfResourceValues(values, options) {
304
+ const { focusResource, propertyPath, schema } = options;
305
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
306
+ if (schema.in &&
307
+ schema.in.length > 0 &&
308
+ !schema.in.some((in_) => in_.equals(term))) {
309
+ return Left(new Resource.MistypedTermValueError({
310
+ actualValue: term,
311
+ expectedValueType: "Term in",
312
+ focusResource,
313
+ propertyPath,
314
+ }));
315
+ }
316
+ if (!schema.types.some((type) => term.termType === type)) {
317
+ return Left(new Resource.MistypedTermValueError({
318
+ actualValue: term,
319
+ expectedValueType: "Term types",
320
+ focusResource,
321
+ propertyPath,
322
+ }));
323
+ }
324
+ return Right(term);
325
+ })));
326
+ }
327
+ const $termLikeFromRdfResourceValues = (values, { preferredLanguages, schema: { hasValues, languageIn } }) => {
328
+ let chain = Either.of(values);
329
+ if (hasValues && hasValues.length > 0) {
330
+ chain = chain.chain((values) => Either.sequence(hasValues.map((hasValue) => values.find((value) => value.term.equals(hasValue)))).map(() => values));
331
+ }
332
+ if (languageIn && languageIn.length > 0) {
333
+ chain = chain.chain((values) => values.chainMap((value) => value.toLiteral().chain((literal) => languageIn.includes(literal.language)
334
+ ? Right(value)
335
+ : Left(new Resource.MistypedTermValueError({
336
+ actualValue: literal,
337
+ expectedValueType: "Literal",
338
+ focusResource: value.focusResource,
339
+ propertyPath: value.propertyPath,
340
+ })))));
341
+ }
342
+ if (preferredLanguages && preferredLanguages.length > 0) {
343
+ chain = chain.chain((values) => {
344
+ const literals = [];
345
+ const literalValues = [];
346
+ const nonLiteralValues = [];
347
+ for (const value of values) {
348
+ const term = value.toTerm().unsafeCoerce();
349
+ if (term.termType === "Literal") {
350
+ literals.push(term);
351
+ literalValues.push(value);
352
+ }
353
+ else {
354
+ nonLiteralValues.push(value);
355
+ }
356
+ }
357
+ // Return all literals for the first preferredLanguage, then all literals for the second preferredLanguage, etc.
358
+ // Within a preferredLanguage the literals may be in any order.
359
+ const preferredLanguageLiteralValues = [];
360
+ for (const preferredLanguage of preferredLanguages) {
361
+ for (let literalI = 0; literalI < literals.length; literalI++) {
362
+ if (literals[literalI].language === preferredLanguage) {
363
+ preferredLanguageLiteralValues.push(literalValues[literalI]);
364
+ }
365
+ }
366
+ }
367
+ return Right(Resource.Values.fromArray({
368
+ focusResource: values.focusResource,
369
+ propertyPath: values.propertyPath,
370
+ values: nonLiteralValues.concat(preferredLanguageLiteralValues),
371
+ }));
372
+ });
373
+ }
374
+ return chain;
375
+ };
247
376
  function $validateArray(validateItem, _readonly) {
248
377
  return (schema, valueArray) => {
249
378
  if (schema.minCount !== undefined && valueArray.length < schema.minCount) {
@@ -288,901 +417,471 @@ function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
288
417
  return resource;
289
418
  };
290
419
  }
291
- export var PropertyShape;
292
- (function (PropertyShape) {
293
- function create(parameters) {
294
- return $sequenceRecord({
295
- $identifier: $convertToIdentifierProperty(parameters.$identifier),
296
- and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
297
- classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
298
- comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
299
- datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
300
- deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
301
- defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
302
- description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
303
- disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
304
- display: $convertWithDefaultValue($identityConversionFunction, false)(parameters.display),
305
- equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
306
- flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.flags.type, value)),
307
- groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
308
- hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
309
- in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
310
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
311
- label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
312
- languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
313
- lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
314
- lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
315
- maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
316
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
317
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
318
- maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
319
- message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.message.type, value)),
320
- minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
321
- minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
322
- minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
323
- minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
324
- mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.mutable.type, value)),
325
- name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
326
- node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
327
- nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
328
- not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
329
- or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
330
- order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
331
- path: Either.of(parameters.path),
332
- pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.pattern.type, value)),
333
- qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
334
- qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
335
- qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
336
- qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
337
- resolve: $convertToMaybe($convertToIdentifier)(parameters.resolve).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.resolve.type, value)),
338
- severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.severity.type, value)),
339
- shaclmateName: $convertToMaybe($identityConversionFunction)(parameters.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.shaclmateName.type, value)),
340
- targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetClasses.type, value)),
341
- targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetNodes.type, value)),
342
- targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetObjectsOf.type, value)),
343
- targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetSubjectsOf.type, value)),
344
- uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
345
- xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
346
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyShape" }, { $toString }));
347
- }
348
- PropertyShape.create = create;
420
+ export var NodeShape;
421
+ (function (NodeShape) {
422
+ NodeShape.create = (parameters) => $sequenceRecord({
423
+ $identifier: $convertToIdentifierProperty(parameters?.$identifier),
424
+ and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
425
+ classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
426
+ closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
427
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
428
+ datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
429
+ deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
430
+ discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.discriminantValue.type, value)),
431
+ extern: $convertToMaybe($identityConversionFunction)(parameters?.extern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.extern.type, value)),
432
+ flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
433
+ fromRdfType: $convertToMaybe(($convertToIri))(parameters?.fromRdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.fromRdfType.type, value)),
434
+ hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
435
+ ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
436
+ in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
437
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
438
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
439
+ languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
440
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
441
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
442
+ maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
443
+ message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
444
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
445
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
446
+ minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
447
+ mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
448
+ node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
449
+ nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
450
+ not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
451
+ or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
452
+ pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
453
+ properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
454
+ rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.rdfType.type, value)),
455
+ severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
456
+ shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
457
+ subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
458
+ targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
459
+ targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
460
+ targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
461
+ targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
462
+ toRdfTypes: $convertToScalarSet(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.toRdfTypes.type, value)),
463
+ tsImports: $convertToScalarSet($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.tsImports.type, value)),
464
+ types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
465
+ xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
466
+ })
467
+ .map((properties) => ({ ...properties, $type: "NodeShape" }))
468
+ .map((object) => $monkeyPatchObject(object, { $toString: NodeShape.$toString }));
349
469
  function createUnsafe(parameters) {
350
- return create(parameters).unsafeCoerce();
470
+ return NodeShape.create(parameters).unsafeCoerce();
351
471
  }
352
- PropertyShape.createUnsafe = createUnsafe;
472
+ NodeShape.createUnsafe = createUnsafe;
473
+ NodeShape._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
474
+ ? $ensureRdfResourceType($resource, [NodeShape.schema.fromRdfType], {
475
+ graph: _$options.graph,
476
+ })
477
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
478
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
479
+ dataFactory: dataFactory,
480
+ focusResource: $resource,
481
+ propertyPath: $RdfVocabularies.rdf.subject,
482
+ term: $resource.identifier,
483
+ }).toValues(), {
484
+ context: _$options.context,
485
+ graph: _$options.graph,
486
+ focusResource: $resource,
487
+ preferredLanguages: _$options.preferredLanguages,
488
+ propertyPath: $RdfVocabularies.rdf.subject,
489
+ schema: NodeShape.schema.properties.$identifier.type,
490
+ }).chain((values) => values.head()),
491
+ and: $shaclPropertyFromRdf({
492
+ context: _$options.context,
493
+ graph: _$options.graph,
494
+ focusResource: $resource,
495
+ ignoreRdfType: true,
496
+ preferredLanguages: _$options.preferredLanguages,
497
+ propertySchema: NodeShape.schema.properties.and,
498
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
499
+ }),
500
+ classes: $shaclPropertyFromRdf({
501
+ context: _$options.context,
502
+ graph: _$options.graph,
503
+ focusResource: $resource,
504
+ ignoreRdfType: true,
505
+ preferredLanguages: _$options.preferredLanguages,
506
+ propertySchema: NodeShape.schema.properties.classes,
507
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
508
+ }),
509
+ closed: $shaclPropertyFromRdf({
510
+ context: _$options.context,
511
+ graph: _$options.graph,
512
+ focusResource: $resource,
513
+ ignoreRdfType: true,
514
+ preferredLanguages: _$options.preferredLanguages,
515
+ propertySchema: NodeShape.schema.properties.closed,
516
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
517
+ }),
518
+ comment: $shaclPropertyFromRdf({
519
+ context: _$options.context,
520
+ graph: _$options.graph,
521
+ focusResource: $resource,
522
+ ignoreRdfType: true,
523
+ preferredLanguages: _$options.preferredLanguages,
524
+ propertySchema: NodeShape.schema.properties.comment,
525
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
526
+ }),
527
+ datatype: $shaclPropertyFromRdf({
528
+ context: _$options.context,
529
+ graph: _$options.graph,
530
+ focusResource: $resource,
531
+ ignoreRdfType: true,
532
+ preferredLanguages: _$options.preferredLanguages,
533
+ propertySchema: NodeShape.schema.properties.datatype,
534
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
535
+ }),
536
+ deactivated: $shaclPropertyFromRdf({
537
+ context: _$options.context,
538
+ graph: _$options.graph,
539
+ focusResource: $resource,
540
+ ignoreRdfType: true,
541
+ preferredLanguages: _$options.preferredLanguages,
542
+ propertySchema: NodeShape.schema.properties.deactivated,
543
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
544
+ }),
545
+ discriminantValue: $shaclPropertyFromRdf({
546
+ context: _$options.context,
547
+ graph: _$options.graph,
548
+ focusResource: $resource,
549
+ ignoreRdfType: true,
550
+ preferredLanguages: _$options.preferredLanguages,
551
+ propertySchema: NodeShape.schema.properties.discriminantValue,
552
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
553
+ }),
554
+ extern: $shaclPropertyFromRdf({
555
+ context: _$options.context,
556
+ graph: _$options.graph,
557
+ focusResource: $resource,
558
+ ignoreRdfType: true,
559
+ preferredLanguages: _$options.preferredLanguages,
560
+ propertySchema: NodeShape.schema.properties.extern,
561
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
562
+ }),
563
+ flags: $shaclPropertyFromRdf({
564
+ context: _$options.context,
565
+ graph: _$options.graph,
566
+ focusResource: $resource,
567
+ ignoreRdfType: true,
568
+ preferredLanguages: _$options.preferredLanguages,
569
+ propertySchema: NodeShape.schema.properties.flags,
570
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
571
+ }),
572
+ fromRdfType: $shaclPropertyFromRdf({
573
+ context: _$options.context,
574
+ graph: _$options.graph,
575
+ focusResource: $resource,
576
+ ignoreRdfType: true,
577
+ preferredLanguages: _$options.preferredLanguages,
578
+ propertySchema: NodeShape.schema.properties.fromRdfType,
579
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
580
+ }),
581
+ hasValues: $shaclPropertyFromRdf({
582
+ context: _$options.context,
583
+ graph: _$options.graph,
584
+ focusResource: $resource,
585
+ ignoreRdfType: true,
586
+ preferredLanguages: _$options.preferredLanguages,
587
+ propertySchema: NodeShape.schema.properties.hasValues,
588
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
589
+ }),
590
+ ignoredProperties: $shaclPropertyFromRdf({
591
+ context: _$options.context,
592
+ graph: _$options.graph,
593
+ focusResource: $resource,
594
+ ignoreRdfType: true,
595
+ preferredLanguages: _$options.preferredLanguages,
596
+ propertySchema: NodeShape.schema.properties.ignoredProperties,
597
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($iriFromRdfResourceValues))),
598
+ }),
599
+ in_: $shaclPropertyFromRdf({
600
+ context: _$options.context,
601
+ graph: _$options.graph,
602
+ focusResource: $resource,
603
+ ignoreRdfType: true,
604
+ preferredLanguages: _$options.preferredLanguages,
605
+ propertySchema: NodeShape.schema.properties.in_,
606
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($termFromRdfResourceValues))),
607
+ }),
608
+ isDefinedBy: $shaclPropertyFromRdf({
609
+ context: _$options.context,
610
+ graph: _$options.graph,
611
+ focusResource: $resource,
612
+ ignoreRdfType: true,
613
+ preferredLanguages: _$options.preferredLanguages,
614
+ propertySchema: NodeShape.schema.properties.isDefinedBy,
615
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
616
+ }),
617
+ label: $shaclPropertyFromRdf({
618
+ context: _$options.context,
619
+ graph: _$options.graph,
620
+ focusResource: $resource,
621
+ ignoreRdfType: true,
622
+ preferredLanguages: _$options.preferredLanguages,
623
+ propertySchema: NodeShape.schema.properties.label,
624
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
625
+ }),
626
+ languageIn: $shaclPropertyFromRdf({
627
+ context: _$options.context,
628
+ graph: _$options.graph,
629
+ focusResource: $resource,
630
+ ignoreRdfType: true,
631
+ preferredLanguages: _$options.preferredLanguages,
632
+ propertySchema: NodeShape.schema.properties.languageIn,
633
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($stringFromRdfResourceValues))),
634
+ }),
635
+ maxExclusive: $shaclPropertyFromRdf({
636
+ context: _$options.context,
637
+ graph: _$options.graph,
638
+ focusResource: $resource,
639
+ ignoreRdfType: true,
640
+ preferredLanguages: _$options.preferredLanguages,
641
+ propertySchema: NodeShape.schema.properties.maxExclusive,
642
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
643
+ }),
644
+ maxInclusive: $shaclPropertyFromRdf({
645
+ context: _$options.context,
646
+ graph: _$options.graph,
647
+ focusResource: $resource,
648
+ ignoreRdfType: true,
649
+ preferredLanguages: _$options.preferredLanguages,
650
+ propertySchema: NodeShape.schema.properties.maxInclusive,
651
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
652
+ }),
653
+ maxLength: $shaclPropertyFromRdf({
654
+ context: _$options.context,
655
+ graph: _$options.graph,
656
+ focusResource: $resource,
657
+ ignoreRdfType: true,
658
+ preferredLanguages: _$options.preferredLanguages,
659
+ propertySchema: NodeShape.schema.properties.maxLength,
660
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
661
+ }),
662
+ message: $shaclPropertyFromRdf({
663
+ context: _$options.context,
664
+ graph: _$options.graph,
665
+ focusResource: $resource,
666
+ ignoreRdfType: true,
667
+ preferredLanguages: _$options.preferredLanguages,
668
+ propertySchema: NodeShape.schema.properties.message,
669
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
670
+ }),
671
+ minExclusive: $shaclPropertyFromRdf({
672
+ context: _$options.context,
673
+ graph: _$options.graph,
674
+ focusResource: $resource,
675
+ ignoreRdfType: true,
676
+ preferredLanguages: _$options.preferredLanguages,
677
+ propertySchema: NodeShape.schema.properties.minExclusive,
678
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
679
+ }),
680
+ minInclusive: $shaclPropertyFromRdf({
681
+ context: _$options.context,
682
+ graph: _$options.graph,
683
+ focusResource: $resource,
684
+ ignoreRdfType: true,
685
+ preferredLanguages: _$options.preferredLanguages,
686
+ propertySchema: NodeShape.schema.properties.minInclusive,
687
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
688
+ }),
689
+ minLength: $shaclPropertyFromRdf({
690
+ context: _$options.context,
691
+ graph: _$options.graph,
692
+ focusResource: $resource,
693
+ ignoreRdfType: true,
694
+ preferredLanguages: _$options.preferredLanguages,
695
+ propertySchema: NodeShape.schema.properties.minLength,
696
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
697
+ }),
698
+ mutable: $shaclPropertyFromRdf({
699
+ context: _$options.context,
700
+ graph: _$options.graph,
701
+ focusResource: $resource,
702
+ ignoreRdfType: true,
703
+ preferredLanguages: _$options.preferredLanguages,
704
+ propertySchema: NodeShape.schema.properties.mutable,
705
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
706
+ }),
707
+ node: $shaclPropertyFromRdf({
708
+ context: _$options.context,
709
+ graph: _$options.graph,
710
+ focusResource: $resource,
711
+ ignoreRdfType: true,
712
+ preferredLanguages: _$options.preferredLanguages,
713
+ propertySchema: NodeShape.schema.properties.node,
714
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
715
+ }),
716
+ nodeKind: $shaclPropertyFromRdf({
717
+ context: _$options.context,
718
+ graph: _$options.graph,
719
+ focusResource: $resource,
720
+ ignoreRdfType: true,
721
+ preferredLanguages: _$options.preferredLanguages,
722
+ propertySchema: NodeShape.schema.properties.nodeKind,
723
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
724
+ }),
725
+ not: $shaclPropertyFromRdf({
726
+ context: _$options.context,
727
+ graph: _$options.graph,
728
+ focusResource: $resource,
729
+ ignoreRdfType: true,
730
+ preferredLanguages: _$options.preferredLanguages,
731
+ propertySchema: NodeShape.schema.properties.not,
732
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
733
+ }),
734
+ or: $shaclPropertyFromRdf({
735
+ context: _$options.context,
736
+ graph: _$options.graph,
737
+ focusResource: $resource,
738
+ ignoreRdfType: true,
739
+ preferredLanguages: _$options.preferredLanguages,
740
+ propertySchema: NodeShape.schema.properties.or,
741
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
742
+ }),
743
+ pattern: $shaclPropertyFromRdf({
744
+ context: _$options.context,
745
+ graph: _$options.graph,
746
+ focusResource: $resource,
747
+ ignoreRdfType: true,
748
+ preferredLanguages: _$options.preferredLanguages,
749
+ propertySchema: NodeShape.schema.properties.pattern,
750
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
751
+ }),
752
+ properties: $shaclPropertyFromRdf({
753
+ context: _$options.context,
754
+ graph: _$options.graph,
755
+ focusResource: $resource,
756
+ ignoreRdfType: true,
757
+ preferredLanguages: _$options.preferredLanguages,
758
+ propertySchema: NodeShape.schema.properties.properties,
759
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
760
+ }),
761
+ rdfType: $shaclPropertyFromRdf({
762
+ context: _$options.context,
763
+ graph: _$options.graph,
764
+ focusResource: $resource,
765
+ ignoreRdfType: true,
766
+ preferredLanguages: _$options.preferredLanguages,
767
+ propertySchema: NodeShape.schema.properties.rdfType,
768
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
769
+ }),
770
+ severity: $shaclPropertyFromRdf({
771
+ context: _$options.context,
772
+ graph: _$options.graph,
773
+ focusResource: $resource,
774
+ ignoreRdfType: true,
775
+ preferredLanguages: _$options.preferredLanguages,
776
+ propertySchema: NodeShape.schema.properties.severity,
777
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
778
+ }),
779
+ shaclmateName: $shaclPropertyFromRdf({
780
+ context: _$options.context,
781
+ graph: _$options.graph,
782
+ focusResource: $resource,
783
+ ignoreRdfType: true,
784
+ preferredLanguages: _$options.preferredLanguages,
785
+ propertySchema: NodeShape.schema.properties.shaclmateName,
786
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
787
+ }),
788
+ subClassOf: $shaclPropertyFromRdf({
789
+ context: _$options.context,
790
+ graph: _$options.graph,
791
+ focusResource: $resource,
792
+ ignoreRdfType: true,
793
+ preferredLanguages: _$options.preferredLanguages,
794
+ propertySchema: NodeShape.schema.properties.subClassOf,
795
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
796
+ }),
797
+ targetClasses: $shaclPropertyFromRdf({
798
+ context: _$options.context,
799
+ graph: _$options.graph,
800
+ focusResource: $resource,
801
+ ignoreRdfType: true,
802
+ preferredLanguages: _$options.preferredLanguages,
803
+ propertySchema: NodeShape.schema.properties.targetClasses,
804
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
805
+ }),
806
+ targetNodes: $shaclPropertyFromRdf({
807
+ context: _$options.context,
808
+ graph: _$options.graph,
809
+ focusResource: $resource,
810
+ ignoreRdfType: true,
811
+ preferredLanguages: _$options.preferredLanguages,
812
+ propertySchema: NodeShape.schema.properties.targetNodes,
813
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
814
+ }),
815
+ targetObjectsOf: $shaclPropertyFromRdf({
816
+ context: _$options.context,
817
+ graph: _$options.graph,
818
+ focusResource: $resource,
819
+ ignoreRdfType: true,
820
+ preferredLanguages: _$options.preferredLanguages,
821
+ propertySchema: NodeShape.schema.properties.targetObjectsOf,
822
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
823
+ }),
824
+ targetSubjectsOf: $shaclPropertyFromRdf({
825
+ context: _$options.context,
826
+ graph: _$options.graph,
827
+ focusResource: $resource,
828
+ ignoreRdfType: true,
829
+ preferredLanguages: _$options.preferredLanguages,
830
+ propertySchema: NodeShape.schema.properties.targetSubjectsOf,
831
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
832
+ }),
833
+ toRdfTypes: $shaclPropertyFromRdf({
834
+ context: _$options.context,
835
+ graph: _$options.graph,
836
+ focusResource: $resource,
837
+ ignoreRdfType: true,
838
+ preferredLanguages: _$options.preferredLanguages,
839
+ propertySchema: NodeShape.schema.properties.toRdfTypes,
840
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
841
+ }),
842
+ tsImports: $shaclPropertyFromRdf({
843
+ context: _$options.context,
844
+ graph: _$options.graph,
845
+ focusResource: $resource,
846
+ ignoreRdfType: true,
847
+ preferredLanguages: _$options.preferredLanguages,
848
+ propertySchema: NodeShape.schema.properties.tsImports,
849
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($stringFromRdfResourceValues)),
850
+ }),
851
+ types: $shaclPropertyFromRdf({
852
+ context: _$options.context,
853
+ graph: _$options.graph,
854
+ focusResource: $resource,
855
+ ignoreRdfType: true,
856
+ preferredLanguages: _$options.preferredLanguages,
857
+ propertySchema: NodeShape.schema.properties.types,
858
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
859
+ }),
860
+ xone: $shaclPropertyFromRdf({
861
+ context: _$options.context,
862
+ graph: _$options.graph,
863
+ focusResource: $resource,
864
+ ignoreRdfType: true,
865
+ preferredLanguages: _$options.preferredLanguages,
866
+ propertySchema: NodeShape.schema.properties.xone,
867
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
868
+ }),
869
+ }).chain((properties) => NodeShape.create(properties)));
870
+ NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
871
+ NodeShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
872
+ .toResource()
873
+ .chain((resource) => NodeShape.fromRdfResource(resource, options)));
353
874
  let Identifier;
354
875
  (function (Identifier) {
355
876
  Identifier.parse = $parseIdentifier;
356
877
  Identifier.stringify = NTriplesTerm.stringify;
357
- })(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
358
- PropertyShape._fromRdfResource = ($resource, _$options) => {
359
- return (!_$options.ignoreRdfType
360
- ? $ensureRdfResourceType($resource, [PropertyShape.fromRdfType], {
361
- graph: _$options.graph,
362
- })
363
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
364
- $identifier: Right(new Resource.Value({
365
- dataFactory: dataFactory,
366
- focusResource: $resource,
367
- propertyPath: $RdfVocabularies.rdf.subject,
368
- term: $resource.identifier,
369
- }).toValues())
370
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
371
- .chain((values) => values.head()),
372
- and: $shaclPropertyFromRdf({
373
- graph: _$options.graph,
374
- resource: $resource,
375
- propertySchema: PropertyShape.schema.properties.and,
376
- typeFromRdf: (resourceValues) => resourceValues
377
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
378
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
379
- focusResource: $resource,
380
- propertyPath: PropertyShape.schema.properties.and.path,
381
- values: valueList.toArray(),
382
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
383
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
384
- .map((values) => values.length > 0
385
- ? values.map((value) => Maybe.of(value))
386
- : Resource.Values.fromValue({
387
- focusResource: $resource,
388
- propertyPath: PropertyShape.schema.properties.and.path,
389
- value: Maybe.empty(),
390
- })),
391
- }),
392
- classes: $shaclPropertyFromRdf({
393
- graph: _$options.graph,
394
- resource: $resource,
395
- propertySchema: PropertyShape.schema.properties.classes,
396
- typeFromRdf: (resourceValues) => resourceValues
397
- .chain((values) => values.chainMap((value) => value.toIri()))
398
- .map((values) => values.toArray())
399
- .map((valuesArray) => Resource.Values.fromValue({
400
- focusResource: $resource,
401
- propertyPath: PropertyShape.schema.properties.classes.path,
402
- value: valuesArray,
403
- })),
404
- }),
405
- comment: $shaclPropertyFromRdf({
406
- graph: _$options.graph,
407
- resource: $resource,
408
- propertySchema: PropertyShape.schema.properties.comment,
409
- typeFromRdf: (resourceValues) => resourceValues
410
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
411
- .chain((values) => values.chainMap((value) => value.toString()))
412
- .map((values) => values.length > 0
413
- ? values.map((value) => Maybe.of(value))
414
- : Resource.Values.fromValue({
415
- focusResource: $resource,
416
- propertyPath: PropertyShape.schema.properties.comment.path,
417
- value: Maybe.empty(),
418
- })),
419
- }),
420
- datatype: $shaclPropertyFromRdf({
421
- graph: _$options.graph,
422
- resource: $resource,
423
- propertySchema: PropertyShape.schema.properties.datatype,
424
- typeFromRdf: (resourceValues) => resourceValues
425
- .chain((values) => values.chainMap((value) => value.toIri()))
426
- .map((values) => values.length > 0
427
- ? values.map((value) => Maybe.of(value))
428
- : Resource.Values.fromValue({
429
- focusResource: $resource,
430
- propertyPath: PropertyShape.schema.properties.datatype.path,
431
- value: Maybe.empty(),
432
- })),
433
- }),
434
- deactivated: $shaclPropertyFromRdf({
435
- graph: _$options.graph,
436
- resource: $resource,
437
- propertySchema: PropertyShape.schema.properties.deactivated,
438
- typeFromRdf: (resourceValues) => resourceValues
439
- .chain((values) => values.chainMap((value) => value.toBoolean()))
440
- .map((values) => values.length > 0
441
- ? values.map((value) => Maybe.of(value))
442
- : Resource.Values.fromValue({
443
- focusResource: $resource,
444
- propertyPath: PropertyShape.schema.properties.deactivated.path,
445
- value: Maybe.empty(),
446
- })),
447
- }),
448
- defaultValue: $shaclPropertyFromRdf({
449
- graph: _$options.graph,
450
- resource: $resource,
451
- propertySchema: PropertyShape.schema.properties.defaultValue,
452
- typeFromRdf: (resourceValues) => resourceValues
453
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
454
- switch (term.termType) {
455
- case "NamedNode":
456
- case "Literal":
457
- return Either.of(term);
458
- default:
459
- return Left(new Resource.MistypedTermValueError({
460
- actualValue: term,
461
- expectedValueType: "(NamedNode | Literal)",
462
- focusResource: $resource,
463
- propertyPath: PropertyShape.schema.properties.defaultValue.path,
464
- }));
465
- }
466
- })))
467
- .map((values) => values.length > 0
468
- ? values.map((value) => Maybe.of(value))
469
- : Resource.Values.fromValue({
470
- focusResource: $resource,
471
- propertyPath: PropertyShape.schema.properties.defaultValue.path,
472
- value: Maybe.empty(),
473
- })),
474
- }),
475
- description: $shaclPropertyFromRdf({
476
- graph: _$options.graph,
477
- resource: $resource,
478
- propertySchema: PropertyShape.schema.properties.description,
479
- typeFromRdf: (resourceValues) => resourceValues
480
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
481
- .chain((values) => values.chainMap((value) => value.toString()))
482
- .map((values) => values.length > 0
483
- ? values.map((value) => Maybe.of(value))
484
- : Resource.Values.fromValue({
485
- focusResource: $resource,
486
- propertyPath: PropertyShape.schema.properties.description.path,
487
- value: Maybe.empty(),
488
- })),
489
- }),
490
- disjoint: $shaclPropertyFromRdf({
491
- graph: _$options.graph,
492
- resource: $resource,
493
- propertySchema: PropertyShape.schema.properties.disjoint,
494
- typeFromRdf: (resourceValues) => resourceValues
495
- .chain((values) => values.chainMap((value) => value.toIri()))
496
- .map((values) => values.toArray())
497
- .map((valuesArray) => Resource.Values.fromValue({
498
- focusResource: $resource,
499
- propertyPath: PropertyShape.schema.properties.disjoint.path,
500
- value: valuesArray,
501
- })),
502
- }),
503
- display: $shaclPropertyFromRdf({
504
- graph: _$options.graph,
505
- resource: $resource,
506
- propertySchema: PropertyShape.schema.properties.display,
507
- typeFromRdf: (resourceValues) => resourceValues
508
- .map((values) => values.length > 0
509
- ? values
510
- : new Resource.Value({
511
- dataFactory: dataFactory,
512
- focusResource: $resource,
513
- propertyPath: PropertyShape.schema.properties.display.path,
514
- term: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
515
- }).toValues())
516
- .chain((values) => values.chainMap((value) => value.toBoolean())),
517
- }),
518
- equals: $shaclPropertyFromRdf({
519
- graph: _$options.graph,
520
- resource: $resource,
521
- propertySchema: PropertyShape.schema.properties.equals,
522
- typeFromRdf: (resourceValues) => resourceValues
523
- .chain((values) => values.chainMap((value) => value.toIri()))
524
- .map((values) => values.toArray())
525
- .map((valuesArray) => Resource.Values.fromValue({
526
- focusResource: $resource,
527
- propertyPath: PropertyShape.schema.properties.equals.path,
528
- value: valuesArray,
529
- })),
530
- }),
531
- flags: $shaclPropertyFromRdf({
532
- graph: _$options.graph,
533
- resource: $resource,
534
- propertySchema: PropertyShape.schema.properties.flags,
535
- typeFromRdf: (resourceValues) => resourceValues
536
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
537
- .chain((values) => values.chainMap((value) => value.toString()))
538
- .map((values) => values.length > 0
539
- ? values.map((value) => Maybe.of(value))
540
- : Resource.Values.fromValue({
541
- focusResource: $resource,
542
- propertyPath: PropertyShape.schema.properties.flags.path,
543
- value: Maybe.empty(),
544
- })),
545
- }),
546
- groups: $shaclPropertyFromRdf({
547
- graph: _$options.graph,
548
- resource: $resource,
549
- propertySchema: PropertyShape.schema.properties.groups,
550
- typeFromRdf: (resourceValues) => resourceValues
551
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
552
- .map((values) => values.toArray())
553
- .map((valuesArray) => Resource.Values.fromValue({
554
- focusResource: $resource,
555
- propertyPath: PropertyShape.schema.properties.groups.path,
556
- value: valuesArray,
557
- })),
558
- }),
559
- hasValues: $shaclPropertyFromRdf({
560
- graph: _$options.graph,
561
- resource: $resource,
562
- propertySchema: PropertyShape.schema.properties.hasValues,
563
- typeFromRdf: (resourceValues) => resourceValues
564
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
565
- switch (term.termType) {
566
- case "NamedNode":
567
- case "Literal":
568
- return Either.of(term);
569
- default:
570
- return Left(new Resource.MistypedTermValueError({
571
- actualValue: term,
572
- expectedValueType: "(NamedNode | Literal)",
573
- focusResource: $resource,
574
- propertyPath: PropertyShape.schema.properties.hasValues.path,
575
- }));
576
- }
577
- })))
578
- .map((values) => values.toArray())
579
- .map((valuesArray) => Resource.Values.fromValue({
580
- focusResource: $resource,
581
- propertyPath: PropertyShape.schema.properties.hasValues.path,
582
- value: valuesArray,
583
- })),
584
- }),
585
- in_: $shaclPropertyFromRdf({
586
- graph: _$options.graph,
587
- resource: $resource,
588
- propertySchema: PropertyShape.schema.properties.in_,
589
- typeFromRdf: (resourceValues) => resourceValues
590
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
591
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
592
- focusResource: $resource,
593
- propertyPath: PropertyShape.schema.properties.in_.path,
594
- values: valueList.toArray(),
595
- })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
596
- switch (term.termType) {
597
- case "NamedNode":
598
- case "Literal":
599
- return Either.of(term);
600
- default:
601
- return Left(new Resource.MistypedTermValueError({
602
- actualValue: term,
603
- expectedValueType: "(NamedNode | Literal)",
604
- focusResource: $resource,
605
- propertyPath: PropertyShape.schema.properties.in_.path,
606
- }));
607
- }
608
- })))))
609
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
610
- .map((values) => values.length > 0
611
- ? values.map((value) => Maybe.of(value))
612
- : Resource.Values.fromValue({
613
- focusResource: $resource,
614
- propertyPath: PropertyShape.schema.properties.in_.path,
615
- value: Maybe.empty(),
616
- })),
617
- }),
618
- isDefinedBy: $shaclPropertyFromRdf({
619
- graph: _$options.graph,
620
- resource: $resource,
621
- propertySchema: PropertyShape.schema.properties.isDefinedBy,
622
- typeFromRdf: (resourceValues) => resourceValues
623
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
624
- .map((values) => values.length > 0
625
- ? values.map((value) => Maybe.of(value))
626
- : Resource.Values.fromValue({
627
- focusResource: $resource,
628
- propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
629
- value: Maybe.empty(),
630
- })),
631
- }),
632
- label: $shaclPropertyFromRdf({
633
- graph: _$options.graph,
634
- resource: $resource,
635
- propertySchema: PropertyShape.schema.properties.label,
636
- typeFromRdf: (resourceValues) => resourceValues
637
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
638
- .chain((values) => values.chainMap((value) => value.toString()))
639
- .map((values) => values.length > 0
640
- ? values.map((value) => Maybe.of(value))
641
- : Resource.Values.fromValue({
642
- focusResource: $resource,
643
- propertyPath: PropertyShape.schema.properties.label.path,
644
- value: Maybe.empty(),
645
- })),
646
- }),
647
- languageIn: $shaclPropertyFromRdf({
648
- graph: _$options.graph,
649
- resource: $resource,
650
- propertySchema: PropertyShape.schema.properties.languageIn,
651
- typeFromRdf: (resourceValues) => resourceValues
652
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
653
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
654
- focusResource: $resource,
655
- propertyPath: PropertyShape.schema.properties.languageIn.path,
656
- values: valueList.toArray(),
657
- }))
658
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
659
- .chain((values) => values.chainMap((value) => value.toString()))))
660
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
661
- .map((values) => values.length > 0
662
- ? values.map((value) => Maybe.of(value))
663
- : Resource.Values.fromValue({
664
- focusResource: $resource,
665
- propertyPath: PropertyShape.schema.properties.languageIn.path,
666
- value: Maybe.empty(),
667
- })),
668
- }),
669
- lessThan: $shaclPropertyFromRdf({
670
- graph: _$options.graph,
671
- resource: $resource,
672
- propertySchema: PropertyShape.schema.properties.lessThan,
673
- typeFromRdf: (resourceValues) => resourceValues
674
- .chain((values) => values.chainMap((value) => value.toIri()))
675
- .map((values) => values.toArray())
676
- .map((valuesArray) => Resource.Values.fromValue({
677
- focusResource: $resource,
678
- propertyPath: PropertyShape.schema.properties.lessThan.path,
679
- value: valuesArray,
680
- })),
681
- }),
682
- lessThanOrEquals: $shaclPropertyFromRdf({
683
- graph: _$options.graph,
684
- resource: $resource,
685
- propertySchema: PropertyShape.schema.properties.lessThanOrEquals,
686
- typeFromRdf: (resourceValues) => resourceValues
687
- .chain((values) => values.chainMap((value) => value.toIri()))
688
- .map((values) => values.toArray())
689
- .map((valuesArray) => Resource.Values.fromValue({
690
- focusResource: $resource,
691
- propertyPath: PropertyShape.schema.properties.lessThanOrEquals.path,
692
- value: valuesArray,
693
- })),
694
- }),
695
- maxCount: $shaclPropertyFromRdf({
696
- graph: _$options.graph,
697
- resource: $resource,
698
- propertySchema: PropertyShape.schema.properties.maxCount,
699
- typeFromRdf: (resourceValues) => resourceValues
700
- .chain((values) => values.chainMap((value) => value.toBigInt()))
701
- .map((values) => values.length > 0
702
- ? values.map((value) => Maybe.of(value))
703
- : Resource.Values.fromValue({
704
- focusResource: $resource,
705
- propertyPath: PropertyShape.schema.properties.maxCount.path,
706
- value: Maybe.empty(),
707
- })),
708
- }),
709
- maxExclusive: $shaclPropertyFromRdf({
710
- graph: _$options.graph,
711
- resource: $resource,
712
- propertySchema: PropertyShape.schema.properties.maxExclusive,
713
- typeFromRdf: (resourceValues) => resourceValues
714
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
715
- .chain((values) => values.chainMap((value) => value.toLiteral()))
716
- .map((values) => values.length > 0
717
- ? values.map((value) => Maybe.of(value))
718
- : Resource.Values.fromValue({
719
- focusResource: $resource,
720
- propertyPath: PropertyShape.schema.properties.maxExclusive.path,
721
- value: Maybe.empty(),
722
- })),
723
- }),
724
- maxInclusive: $shaclPropertyFromRdf({
725
- graph: _$options.graph,
726
- resource: $resource,
727
- propertySchema: PropertyShape.schema.properties.maxInclusive,
728
- typeFromRdf: (resourceValues) => resourceValues
729
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
730
- .chain((values) => values.chainMap((value) => value.toLiteral()))
731
- .map((values) => values.length > 0
732
- ? values.map((value) => Maybe.of(value))
733
- : Resource.Values.fromValue({
734
- focusResource: $resource,
735
- propertyPath: PropertyShape.schema.properties.maxInclusive.path,
736
- value: Maybe.empty(),
737
- })),
738
- }),
739
- maxLength: $shaclPropertyFromRdf({
740
- graph: _$options.graph,
741
- resource: $resource,
742
- propertySchema: PropertyShape.schema.properties.maxLength,
743
- typeFromRdf: (resourceValues) => resourceValues
744
- .chain((values) => values.chainMap((value) => value.toBigInt()))
745
- .map((values) => values.length > 0
746
- ? values.map((value) => Maybe.of(value))
747
- : Resource.Values.fromValue({
748
- focusResource: $resource,
749
- propertyPath: PropertyShape.schema.properties.maxLength.path,
750
- value: Maybe.empty(),
751
- })),
752
- }),
753
- message: $shaclPropertyFromRdf({
754
- graph: _$options.graph,
755
- resource: $resource,
756
- propertySchema: PropertyShape.schema.properties.message,
757
- typeFromRdf: (resourceValues) => resourceValues
758
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
759
- .chain((values) => values.chainMap((value) => value.toString()))
760
- .map((values) => values.length > 0
761
- ? values.map((value) => Maybe.of(value))
762
- : Resource.Values.fromValue({
763
- focusResource: $resource,
764
- propertyPath: PropertyShape.schema.properties.message.path,
765
- value: Maybe.empty(),
766
- })),
767
- }),
768
- minCount: $shaclPropertyFromRdf({
769
- graph: _$options.graph,
770
- resource: $resource,
771
- propertySchema: PropertyShape.schema.properties.minCount,
772
- typeFromRdf: (resourceValues) => resourceValues
773
- .chain((values) => values.chainMap((value) => value.toBigInt()))
774
- .map((values) => values.length > 0
775
- ? values.map((value) => Maybe.of(value))
776
- : Resource.Values.fromValue({
777
- focusResource: $resource,
778
- propertyPath: PropertyShape.schema.properties.minCount.path,
779
- value: Maybe.empty(),
780
- })),
781
- }),
782
- minExclusive: $shaclPropertyFromRdf({
783
- graph: _$options.graph,
784
- resource: $resource,
785
- propertySchema: PropertyShape.schema.properties.minExclusive,
786
- typeFromRdf: (resourceValues) => resourceValues
787
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
788
- .chain((values) => values.chainMap((value) => value.toLiteral()))
789
- .map((values) => values.length > 0
790
- ? values.map((value) => Maybe.of(value))
791
- : Resource.Values.fromValue({
792
- focusResource: $resource,
793
- propertyPath: PropertyShape.schema.properties.minExclusive.path,
794
- value: Maybe.empty(),
795
- })),
796
- }),
797
- minInclusive: $shaclPropertyFromRdf({
798
- graph: _$options.graph,
799
- resource: $resource,
800
- propertySchema: PropertyShape.schema.properties.minInclusive,
801
- typeFromRdf: (resourceValues) => resourceValues
802
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
803
- .chain((values) => values.chainMap((value) => value.toLiteral()))
804
- .map((values) => values.length > 0
805
- ? values.map((value) => Maybe.of(value))
806
- : Resource.Values.fromValue({
807
- focusResource: $resource,
808
- propertyPath: PropertyShape.schema.properties.minInclusive.path,
809
- value: Maybe.empty(),
810
- })),
811
- }),
812
- minLength: $shaclPropertyFromRdf({
813
- graph: _$options.graph,
814
- resource: $resource,
815
- propertySchema: PropertyShape.schema.properties.minLength,
816
- typeFromRdf: (resourceValues) => resourceValues
817
- .chain((values) => values.chainMap((value) => value.toBigInt()))
818
- .map((values) => values.length > 0
819
- ? values.map((value) => Maybe.of(value))
820
- : Resource.Values.fromValue({
821
- focusResource: $resource,
822
- propertyPath: PropertyShape.schema.properties.minLength.path,
823
- value: Maybe.empty(),
824
- })),
825
- }),
826
- mutable: $shaclPropertyFromRdf({
827
- graph: _$options.graph,
828
- resource: $resource,
829
- propertySchema: PropertyShape.schema.properties.mutable,
830
- typeFromRdf: (resourceValues) => resourceValues
831
- .chain((values) => values.chainMap((value) => value.toBoolean()))
832
- .map((values) => values.length > 0
833
- ? values.map((value) => Maybe.of(value))
834
- : Resource.Values.fromValue({
835
- focusResource: $resource,
836
- propertyPath: PropertyShape.schema.properties.mutable.path,
837
- value: Maybe.empty(),
838
- })),
839
- }),
840
- name: $shaclPropertyFromRdf({
841
- graph: _$options.graph,
842
- resource: $resource,
843
- propertySchema: PropertyShape.schema.properties.name,
844
- typeFromRdf: (resourceValues) => resourceValues
845
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
846
- .chain((values) => values.chainMap((value) => value.toString()))
847
- .map((values) => values.length > 0
848
- ? values.map((value) => Maybe.of(value))
849
- : Resource.Values.fromValue({
850
- focusResource: $resource,
851
- propertyPath: PropertyShape.schema.properties.name.path,
852
- value: Maybe.empty(),
853
- })),
854
- }),
855
- node: $shaclPropertyFromRdf({
856
- graph: _$options.graph,
857
- resource: $resource,
858
- propertySchema: PropertyShape.schema.properties.node,
859
- typeFromRdf: (resourceValues) => resourceValues
860
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
861
- .map((values) => values.length > 0
862
- ? values.map((value) => Maybe.of(value))
863
- : Resource.Values.fromValue({
864
- focusResource: $resource,
865
- propertyPath: PropertyShape.schema.properties.node.path,
866
- value: Maybe.empty(),
867
- })),
868
- }),
869
- nodeKind: $shaclPropertyFromRdf({
870
- graph: _$options.graph,
871
- resource: $resource,
872
- propertySchema: PropertyShape.schema.properties.nodeKind,
873
- typeFromRdf: (resourceValues) => resourceValues
874
- .chain((values) => values.chainMap((value) => value.toIri([
875
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
876
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
877
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
878
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
879
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
880
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
881
- ])))
882
- .map((values) => values.length > 0
883
- ? values.map((value) => Maybe.of(value))
884
- : Resource.Values.fromValue({
885
- focusResource: $resource,
886
- propertyPath: PropertyShape.schema.properties.nodeKind.path,
887
- value: Maybe.empty(),
888
- })),
889
- }),
890
- not: $shaclPropertyFromRdf({
891
- graph: _$options.graph,
892
- resource: $resource,
893
- propertySchema: PropertyShape.schema.properties.not,
894
- typeFromRdf: (resourceValues) => resourceValues
895
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
896
- .map((values) => values.toArray())
897
- .map((valuesArray) => Resource.Values.fromValue({
898
- focusResource: $resource,
899
- propertyPath: PropertyShape.schema.properties.not.path,
900
- value: valuesArray,
901
- })),
902
- }),
903
- or: $shaclPropertyFromRdf({
904
- graph: _$options.graph,
905
- resource: $resource,
906
- propertySchema: PropertyShape.schema.properties.or,
907
- typeFromRdf: (resourceValues) => resourceValues
908
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
909
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
910
- focusResource: $resource,
911
- propertyPath: PropertyShape.schema.properties.or.path,
912
- values: valueList.toArray(),
913
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
914
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
915
- .map((values) => values.length > 0
916
- ? values.map((value) => Maybe.of(value))
917
- : Resource.Values.fromValue({
918
- focusResource: $resource,
919
- propertyPath: PropertyShape.schema.properties.or.path,
920
- value: Maybe.empty(),
921
- })),
922
- }),
923
- order: $shaclPropertyFromRdf({
924
- graph: _$options.graph,
925
- resource: $resource,
926
- propertySchema: PropertyShape.schema.properties.order,
927
- typeFromRdf: (resourceValues) => resourceValues
928
- .chain((values) => values.chainMap((value) => value.toFloat()))
929
- .map((values) => values.length > 0
930
- ? values.map((value) => Maybe.of(value))
931
- : Resource.Values.fromValue({
932
- focusResource: $resource,
933
- propertyPath: PropertyShape.schema.properties.order.path,
934
- value: Maybe.empty(),
935
- })),
936
- }),
937
- path: $shaclPropertyFromRdf({
938
- graph: _$options.graph,
939
- resource: $resource,
940
- propertySchema: PropertyShape.schema.properties.path,
941
- typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
942
- context: _$options.context,
943
- graph: _$options.graph,
944
- preferredLanguages: _$options.preferredLanguages,
945
- resource: $resource,
946
- ignoreRdfType: true,
947
- propertyPath: PropertyShape.schema.properties.path.path,
948
- }),
949
- }),
950
- pattern: $shaclPropertyFromRdf({
951
- graph: _$options.graph,
952
- resource: $resource,
953
- propertySchema: PropertyShape.schema.properties.pattern,
954
- typeFromRdf: (resourceValues) => resourceValues
955
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
956
- .chain((values) => values.chainMap((value) => value.toString()))
957
- .map((values) => values.length > 0
958
- ? values.map((value) => Maybe.of(value))
959
- : Resource.Values.fromValue({
960
- focusResource: $resource,
961
- propertyPath: PropertyShape.schema.properties.pattern.path,
962
- value: Maybe.empty(),
963
- })),
964
- }),
965
- qualifiedMaxCount: $shaclPropertyFromRdf({
966
- graph: _$options.graph,
967
- resource: $resource,
968
- propertySchema: PropertyShape.schema.properties.qualifiedMaxCount,
969
- typeFromRdf: (resourceValues) => resourceValues
970
- .chain((values) => values.chainMap((value) => value.toBigInt()))
971
- .map((values) => values.length > 0
972
- ? values.map((value) => Maybe.of(value))
973
- : Resource.Values.fromValue({
974
- focusResource: $resource,
975
- propertyPath: PropertyShape.schema.properties.qualifiedMaxCount.path,
976
- value: Maybe.empty(),
977
- })),
978
- }),
979
- qualifiedMinCount: $shaclPropertyFromRdf({
980
- graph: _$options.graph,
981
- resource: $resource,
982
- propertySchema: PropertyShape.schema.properties.qualifiedMinCount,
983
- typeFromRdf: (resourceValues) => resourceValues
984
- .chain((values) => values.chainMap((value) => value.toBigInt()))
985
- .map((values) => values.length > 0
986
- ? values.map((value) => Maybe.of(value))
987
- : Resource.Values.fromValue({
988
- focusResource: $resource,
989
- propertyPath: PropertyShape.schema.properties.qualifiedMinCount.path,
990
- value: Maybe.empty(),
991
- })),
992
- }),
993
- qualifiedValueShape: $shaclPropertyFromRdf({
994
- graph: _$options.graph,
995
- resource: $resource,
996
- propertySchema: PropertyShape.schema.properties.qualifiedValueShape,
997
- typeFromRdf: (resourceValues) => resourceValues
998
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
999
- .map((values) => values.length > 0
1000
- ? values.map((value) => Maybe.of(value))
1001
- : Resource.Values.fromValue({
1002
- focusResource: $resource,
1003
- propertyPath: PropertyShape.schema.properties.qualifiedValueShape
1004
- .path,
1005
- value: Maybe.empty(),
1006
- })),
1007
- }),
1008
- qualifiedValueShapesDisjoint: $shaclPropertyFromRdf({
1009
- graph: _$options.graph,
1010
- resource: $resource,
1011
- propertySchema: PropertyShape.schema.properties.qualifiedValueShapesDisjoint,
1012
- typeFromRdf: (resourceValues) => resourceValues
1013
- .chain((values) => values.chainMap((value) => value.toBoolean()))
1014
- .map((values) => values.length > 0
1015
- ? values.map((value) => Maybe.of(value))
1016
- : Resource.Values.fromValue({
1017
- focusResource: $resource,
1018
- propertyPath: PropertyShape.schema.properties
1019
- .qualifiedValueShapesDisjoint.path,
1020
- value: Maybe.empty(),
1021
- })),
1022
- }),
1023
- resolve: $shaclPropertyFromRdf({
1024
- graph: _$options.graph,
1025
- resource: $resource,
1026
- propertySchema: PropertyShape.schema.properties.resolve,
1027
- typeFromRdf: (resourceValues) => resourceValues
1028
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1029
- .map((values) => values.length > 0
1030
- ? values.map((value) => Maybe.of(value))
1031
- : Resource.Values.fromValue({
1032
- focusResource: $resource,
1033
- propertyPath: PropertyShape.schema.properties.resolve.path,
1034
- value: Maybe.empty(),
1035
- })),
1036
- }),
1037
- severity: $shaclPropertyFromRdf({
1038
- graph: _$options.graph,
1039
- resource: $resource,
1040
- propertySchema: PropertyShape.schema.properties.severity,
1041
- typeFromRdf: (resourceValues) => resourceValues
1042
- .chain((values) => values.chainMap((value) => value.toIri([
1043
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
1044
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
1045
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
1046
- ])))
1047
- .map((values) => values.length > 0
1048
- ? values.map((value) => Maybe.of(value))
1049
- : Resource.Values.fromValue({
1050
- focusResource: $resource,
1051
- propertyPath: PropertyShape.schema.properties.severity.path,
1052
- value: Maybe.empty(),
1053
- })),
1054
- }),
1055
- shaclmateName: $shaclPropertyFromRdf({
1056
- graph: _$options.graph,
1057
- resource: $resource,
1058
- propertySchema: PropertyShape.schema.properties.shaclmateName,
1059
- typeFromRdf: (resourceValues) => resourceValues
1060
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1061
- .chain((values) => values.chainMap((value) => value.toString()))
1062
- .map((values) => values.length > 0
1063
- ? values.map((value) => Maybe.of(value))
1064
- : Resource.Values.fromValue({
1065
- focusResource: $resource,
1066
- propertyPath: PropertyShape.schema.properties.shaclmateName.path,
1067
- value: Maybe.empty(),
1068
- })),
1069
- }),
1070
- targetClasses: $shaclPropertyFromRdf({
1071
- graph: _$options.graph,
1072
- resource: $resource,
1073
- propertySchema: PropertyShape.schema.properties.targetClasses,
1074
- typeFromRdf: (resourceValues) => resourceValues
1075
- .chain((values) => values.chainMap((value) => value.toIri()))
1076
- .map((values) => values.toArray())
1077
- .map((valuesArray) => Resource.Values.fromValue({
1078
- focusResource: $resource,
1079
- propertyPath: PropertyShape.schema.properties.targetClasses.path,
1080
- value: valuesArray,
1081
- })),
1082
- }),
1083
- targetNodes: $shaclPropertyFromRdf({
1084
- graph: _$options.graph,
1085
- resource: $resource,
1086
- propertySchema: PropertyShape.schema.properties.targetNodes,
1087
- typeFromRdf: (resourceValues) => resourceValues
1088
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1089
- switch (term.termType) {
1090
- case "NamedNode":
1091
- case "Literal":
1092
- return Either.of(term);
1093
- default:
1094
- return Left(new Resource.MistypedTermValueError({
1095
- actualValue: term,
1096
- expectedValueType: "(NamedNode | Literal)",
1097
- focusResource: $resource,
1098
- propertyPath: PropertyShape.schema.properties.targetNodes.path,
1099
- }));
1100
- }
1101
- })))
1102
- .map((values) => values.toArray())
1103
- .map((valuesArray) => Resource.Values.fromValue({
1104
- focusResource: $resource,
1105
- propertyPath: PropertyShape.schema.properties.targetNodes.path,
1106
- value: valuesArray,
1107
- })),
1108
- }),
1109
- targetObjectsOf: $shaclPropertyFromRdf({
1110
- graph: _$options.graph,
1111
- resource: $resource,
1112
- propertySchema: PropertyShape.schema.properties.targetObjectsOf,
1113
- typeFromRdf: (resourceValues) => resourceValues
1114
- .chain((values) => values.chainMap((value) => value.toIri()))
1115
- .map((values) => values.toArray())
1116
- .map((valuesArray) => Resource.Values.fromValue({
1117
- focusResource: $resource,
1118
- propertyPath: PropertyShape.schema.properties.targetObjectsOf.path,
1119
- value: valuesArray,
1120
- })),
1121
- }),
1122
- targetSubjectsOf: $shaclPropertyFromRdf({
1123
- graph: _$options.graph,
1124
- resource: $resource,
1125
- propertySchema: PropertyShape.schema.properties.targetSubjectsOf,
1126
- typeFromRdf: (resourceValues) => resourceValues
1127
- .chain((values) => values.chainMap((value) => value.toIri()))
1128
- .map((values) => values.toArray())
1129
- .map((valuesArray) => Resource.Values.fromValue({
1130
- focusResource: $resource,
1131
- propertyPath: PropertyShape.schema.properties.targetSubjectsOf.path,
1132
- value: valuesArray,
1133
- })),
1134
- }),
1135
- uniqueLang: $shaclPropertyFromRdf({
1136
- graph: _$options.graph,
1137
- resource: $resource,
1138
- propertySchema: PropertyShape.schema.properties.uniqueLang,
1139
- typeFromRdf: (resourceValues) => resourceValues
1140
- .chain((values) => values.chainMap((value) => value.toBoolean()))
1141
- .map((values) => values.length > 0
1142
- ? values.map((value) => Maybe.of(value))
1143
- : Resource.Values.fromValue({
1144
- focusResource: $resource,
1145
- propertyPath: PropertyShape.schema.properties.uniqueLang.path,
1146
- value: Maybe.empty(),
1147
- })),
1148
- }),
1149
- xone: $shaclPropertyFromRdf({
1150
- graph: _$options.graph,
1151
- resource: $resource,
1152
- propertySchema: PropertyShape.schema.properties.xone,
1153
- typeFromRdf: (resourceValues) => resourceValues
1154
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1155
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1156
- focusResource: $resource,
1157
- propertyPath: PropertyShape.schema.properties.xone.path,
1158
- values: valueList.toArray(),
1159
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1160
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1161
- .map((values) => values.length > 0
1162
- ? values.map((value) => Maybe.of(value))
1163
- : Resource.Values.fromValue({
1164
- focusResource: $resource,
1165
- propertyPath: PropertyShape.schema.properties.xone.path,
1166
- value: Maybe.empty(),
1167
- })),
1168
- }),
1169
- }).chain((properties) => create(properties)));
1170
- };
1171
- PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
1172
- PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
1173
- .toResource()
1174
- .chain((resource) => PropertyShape.fromRdfResource(resource, options))));
1175
- PropertyShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
1176
- function isPropertyShape(object) {
1177
- switch (object.$type) {
1178
- case "PropertyShape":
1179
- return true;
1180
- default:
1181
- return false;
1182
- }
878
+ })(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
879
+ function isNodeShape(object) {
880
+ return object.$type === "NodeShape";
1183
881
  }
1184
- PropertyShape.isPropertyShape = isPropertyShape;
1185
- PropertyShape.schema = {
882
+ NodeShape.isNodeShape = isNodeShape;
883
+ NodeShape.schema = {
884
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"),
1186
885
  properties: {
1187
886
  $identifier: {
1188
887
  kind: "Identifier",
@@ -1204,6 +903,14 @@ export var PropertyShape;
1204
903
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
1205
904
  type: { kind: "Set", itemType: { kind: "Iri" } },
1206
905
  },
906
+ closed: {
907
+ kind: "Shacl",
908
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
909
+ type: {
910
+ kind: "Option",
911
+ itemType: { kind: "Boolean" },
912
+ },
913
+ },
1207
914
  comment: {
1208
915
  kind: "Shacl",
1209
916
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
@@ -1225,38 +932,22 @@ export var PropertyShape;
1225
932
  itemType: { kind: "Boolean" },
1226
933
  },
1227
934
  },
1228
- defaultValue: {
1229
- kind: "Shacl",
1230
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
1231
- type: { kind: "Option", itemType: { kind: "Term" } },
1232
- },
1233
- description: {
935
+ discriminantValue: {
1234
936
  kind: "Shacl",
1235
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
937
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"),
1236
938
  type: {
1237
939
  kind: "Option",
1238
940
  itemType: { kind: "String" },
1239
941
  },
1240
942
  },
1241
- disjoint: {
1242
- kind: "Shacl",
1243
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#disjoint"),
1244
- type: { kind: "Set", itemType: { kind: "Iri" } },
1245
- },
1246
- display: {
943
+ extern: {
1247
944
  kind: "Shacl",
1248
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"),
945
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#extern"),
1249
946
  type: {
1250
- kind: "DefaultValue",
947
+ kind: "Option",
1251
948
  itemType: { kind: "Boolean" },
1252
- defaultValue: false,
1253
949
  },
1254
950
  },
1255
- equals: {
1256
- kind: "Shacl",
1257
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#equals"),
1258
- type: { kind: "Set", itemType: { kind: "Iri" } },
1259
- },
1260
951
  flags: {
1261
952
  kind: "Shacl",
1262
953
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
@@ -1265,18 +956,29 @@ export var PropertyShape;
1265
956
  itemType: { kind: "String" },
1266
957
  },
1267
958
  },
1268
- groups: {
959
+ fromRdfType: {
1269
960
  kind: "Shacl",
1270
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
961
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#fromRdfType"),
962
+ type: { kind: "Option", itemType: { kind: "Iri" } },
963
+ },
964
+ hasValues: {
965
+ kind: "Shacl",
966
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
1271
967
  type: {
1272
968
  kind: "Set",
1273
- itemType: { kind: "Identifier" },
969
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
1274
970
  },
1275
971
  },
1276
- hasValues: {
972
+ ignoredProperties: {
1277
973
  kind: "Shacl",
1278
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
1279
- type: { kind: "Set", itemType: { kind: "Term" } },
974
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
975
+ type: {
976
+ kind: "Option",
977
+ itemType: {
978
+ kind: "List",
979
+ itemType: { kind: "Iri" },
980
+ },
981
+ },
1280
982
  },
1281
983
  in_: {
1282
984
  kind: "Shacl",
@@ -1285,7 +987,10 @@ export var PropertyShape;
1285
987
  kind: "Option",
1286
988
  itemType: {
1287
989
  kind: "List",
1288
- itemType: { kind: "Term" },
990
+ itemType: {
991
+ kind: "Term",
992
+ types: ["NamedNode", "Literal"],
993
+ },
1289
994
  },
1290
995
  },
1291
996
  },
@@ -1316,24 +1021,6 @@ export var PropertyShape;
1316
1021
  },
1317
1022
  },
1318
1023
  },
1319
- lessThan: {
1320
- kind: "Shacl",
1321
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThan"),
1322
- type: { kind: "Set", itemType: { kind: "Iri" } },
1323
- },
1324
- lessThanOrEquals: {
1325
- kind: "Shacl",
1326
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThanOrEquals"),
1327
- type: { kind: "Set", itemType: { kind: "Iri" } },
1328
- },
1329
- maxCount: {
1330
- kind: "Shacl",
1331
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
1332
- type: {
1333
- kind: "Option",
1334
- itemType: { kind: "BigInt" },
1335
- },
1336
- },
1337
1024
  maxExclusive: {
1338
1025
  kind: "Shacl",
1339
1026
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
@@ -1366,14 +1053,6 @@ export var PropertyShape;
1366
1053
  itemType: { kind: "String" },
1367
1054
  },
1368
1055
  },
1369
- minCount: {
1370
- kind: "Shacl",
1371
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
1372
- type: {
1373
- kind: "Option",
1374
- itemType: { kind: "BigInt" },
1375
- },
1376
- },
1377
1056
  minExclusive: {
1378
1057
  kind: "Shacl",
1379
1058
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
@@ -1406,14 +1085,6 @@ export var PropertyShape;
1406
1085
  itemType: { kind: "Boolean" },
1407
1086
  },
1408
1087
  },
1409
- name: {
1410
- kind: "Shacl",
1411
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
1412
- type: {
1413
- kind: "Option",
1414
- itemType: { kind: "String" },
1415
- },
1416
- },
1417
1088
  node: {
1418
1089
  kind: "Shacl",
1419
1090
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
@@ -1459,18 +1130,6 @@ export var PropertyShape;
1459
1130
  },
1460
1131
  },
1461
1132
  },
1462
- order: {
1463
- kind: "Shacl",
1464
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
1465
- type: { kind: "Option", itemType: { kind: "Float" } },
1466
- },
1467
- path: {
1468
- kind: "Shacl",
1469
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
1470
- get type() {
1471
- return $PropertyPath.schema;
1472
- },
1473
- },
1474
1133
  pattern: {
1475
1134
  kind: "Shacl",
1476
1135
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
@@ -1479,45 +1138,18 @@ export var PropertyShape;
1479
1138
  itemType: { kind: "String" },
1480
1139
  },
1481
1140
  },
1482
- qualifiedMaxCount: {
1483
- kind: "Shacl",
1484
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMaxCount"),
1485
- type: {
1486
- kind: "Option",
1487
- itemType: { kind: "BigInt" },
1488
- },
1489
- },
1490
- qualifiedMinCount: {
1491
- kind: "Shacl",
1492
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMinCount"),
1493
- type: {
1494
- kind: "Option",
1495
- itemType: { kind: "BigInt" },
1496
- },
1497
- },
1498
- qualifiedValueShape: {
1141
+ properties: {
1499
1142
  kind: "Shacl",
1500
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShape"),
1143
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
1501
1144
  type: {
1502
- kind: "Option",
1145
+ kind: "Set",
1503
1146
  itemType: { kind: "Identifier" },
1504
1147
  },
1505
1148
  },
1506
- qualifiedValueShapesDisjoint: {
1507
- kind: "Shacl",
1508
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShapesDisjoint"),
1509
- type: {
1510
- kind: "Option",
1511
- itemType: { kind: "Boolean" },
1512
- },
1513
- },
1514
- resolve: {
1149
+ rdfType: {
1515
1150
  kind: "Shacl",
1516
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#resolve"),
1517
- type: {
1518
- kind: "Option",
1519
- itemType: { kind: "Identifier" },
1520
- },
1151
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#rdfType"),
1152
+ type: { kind: "Option", itemType: { kind: "Iri" } },
1521
1153
  },
1522
1154
  severity: {
1523
1155
  kind: "Shacl",
@@ -1542,6 +1174,11 @@ export var PropertyShape;
1542
1174
  itemType: { kind: "String" },
1543
1175
  },
1544
1176
  },
1177
+ subClassOf: {
1178
+ kind: "Shacl",
1179
+ path: $RdfVocabularies.rdfs.subClassOf,
1180
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1181
+ },
1545
1182
  targetClasses: {
1546
1183
  kind: "Shacl",
1547
1184
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
@@ -1550,7 +1187,10 @@ export var PropertyShape;
1550
1187
  targetNodes: {
1551
1188
  kind: "Shacl",
1552
1189
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
1553
- type: { kind: "Set", itemType: { kind: "Term" } },
1190
+ type: {
1191
+ kind: "Set",
1192
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
1193
+ },
1554
1194
  },
1555
1195
  targetObjectsOf: {
1556
1196
  kind: "Shacl",
@@ -1562,13 +1202,20 @@ export var PropertyShape;
1562
1202
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
1563
1203
  type: { kind: "Set", itemType: { kind: "Iri" } },
1564
1204
  },
1565
- uniqueLang: {
1205
+ toRdfTypes: {
1566
1206
  kind: "Shacl",
1567
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
1568
- type: {
1569
- kind: "Option",
1570
- itemType: { kind: "Boolean" },
1571
- },
1207
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#toRdfType"),
1208
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1209
+ },
1210
+ tsImports: {
1211
+ kind: "Shacl",
1212
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"),
1213
+ type: { kind: "Set", itemType: { kind: "String" } },
1214
+ },
1215
+ types: {
1216
+ kind: "Shacl",
1217
+ path: $RdfVocabularies.rdf.type,
1218
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1572
1219
  },
1573
1220
  xone: {
1574
1221
  kind: "Shacl",
@@ -1583,11 +1230,11 @@ export var PropertyShape;
1583
1230
  },
1584
1231
  },
1585
1232
  };
1586
- PropertyShape._toRdfResource = (parameters) => {
1233
+ NodeShape._toRdfResource = (parameters) => {
1587
1234
  if (!parameters.ignoreRdfType) {
1588
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), parameters.graph);
1235
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), parameters.graph);
1589
1236
  }
1590
- parameters.resource.add(PropertyShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
1237
+ parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
1591
1238
  value.length > 0
1592
1239
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1593
1240
  if (itemIndex === 0) {
@@ -1609,33 +1256,57 @@ export var PropertyShape;
1609
1256
  }).listResource.identifier
1610
1257
  : $RdfVocabularies.rdf.nil,
1611
1258
  ]), parameters.graph);
1612
- parameters.resource.add(PropertyShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
1613
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
1259
+ parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
1260
+ parameters.resource.add(NodeShape.schema.properties.closed.path, parameters.object.closed
1261
+ .toList()
1262
+ .flatMap((value) => [
1263
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1264
+ ]), parameters.graph);
1265
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
1614
1266
  .toList()
1615
1267
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1616
- parameters.resource.add(PropertyShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
1617
- parameters.resource.add(PropertyShape.schema.properties.deactivated.path, parameters.object.deactivated
1268
+ parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
1269
+ parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
1618
1270
  .toList()
1619
1271
  .flatMap((value) => [
1620
1272
  $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1621
1273
  ]), parameters.graph);
1622
- parameters.resource.add(PropertyShape.schema.properties.defaultValue.path, parameters.object.defaultValue.toList(), parameters.graph);
1623
- parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
1274
+ parameters.resource.add(NodeShape.schema.properties.discriminantValue.path, parameters.object.discriminantValue
1624
1275
  .toList()
1625
1276
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1626
- parameters.resource.add(PropertyShape.schema.properties.disjoint.path, parameters.object.disjoint.flatMap((item) => [item]), parameters.graph);
1627
- parameters.resource.add(PropertyShape.schema.properties.display.path, $strictEquals(parameters.object.display, false).isLeft()
1628
- ? [
1629
- $literalFactory.boolean(parameters.object.display, $RdfVocabularies.xsd.boolean),
1630
- ]
1631
- : [], parameters.graph);
1632
- parameters.resource.add(PropertyShape.schema.properties.equals.path, parameters.object.equals.flatMap((item) => [item]), parameters.graph);
1633
- parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags
1277
+ parameters.resource.add(NodeShape.schema.properties.extern.path, parameters.object.extern
1278
+ .toList()
1279
+ .flatMap((value) => [
1280
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1281
+ ]), parameters.graph);
1282
+ parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
1634
1283
  .toList()
1635
1284
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1636
- parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
1637
- parameters.resource.add(PropertyShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
1638
- parameters.resource.add(PropertyShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
1285
+ parameters.resource.add(NodeShape.schema.properties.fromRdfType.path, parameters.object.fromRdfType.toList(), parameters.graph);
1286
+ parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
1287
+ parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
1288
+ value.length > 0
1289
+ ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1290
+ if (itemIndex === 0) {
1291
+ currentSubListResource = listResource;
1292
+ }
1293
+ else {
1294
+ const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
1295
+ currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
1296
+ currentSubListResource = newSubListResource;
1297
+ }
1298
+ currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
1299
+ if (itemIndex + 1 === list.length) {
1300
+ currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
1301
+ }
1302
+ return { currentSubListResource, listResource };
1303
+ }, {
1304
+ currentSubListResource: null,
1305
+ listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
1306
+ }).listResource.identifier
1307
+ : $RdfVocabularies.rdf.nil,
1308
+ ]), parameters.graph);
1309
+ parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
1639
1310
  value.length > 0
1640
1311
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1641
1312
  if (itemIndex === 0) {
@@ -1657,11 +1328,11 @@ export var PropertyShape;
1657
1328
  }).listResource.identifier
1658
1329
  : $RdfVocabularies.rdf.nil,
1659
1330
  ]), parameters.graph);
1660
- parameters.resource.add(PropertyShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
1661
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
1331
+ parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
1332
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
1662
1333
  .toList()
1663
1334
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1664
- parameters.resource.add(PropertyShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
1335
+ parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
1665
1336
  value.length > 0
1666
1337
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1667
1338
  if (itemIndex === 0) {
@@ -1683,47 +1354,32 @@ export var PropertyShape;
1683
1354
  }).listResource.identifier
1684
1355
  : $RdfVocabularies.rdf.nil,
1685
1356
  ]), parameters.graph);
1686
- parameters.resource.add(PropertyShape.schema.properties.lessThan.path, parameters.object.lessThan.flatMap((item) => [item]), parameters.graph);
1687
- parameters.resource.add(PropertyShape.schema.properties.lessThanOrEquals.path, parameters.object.lessThanOrEquals.flatMap((item) => [item]), parameters.graph);
1688
- parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
1689
- .toList()
1690
- .flatMap((value) => [
1691
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1692
- ]), parameters.graph);
1693
- parameters.resource.add(PropertyShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
1694
- parameters.resource.add(PropertyShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
1695
- parameters.resource.add(PropertyShape.schema.properties.maxLength.path, parameters.object.maxLength
1357
+ parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
1358
+ parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
1359
+ parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
1696
1360
  .toList()
1697
1361
  .flatMap((value) => [
1698
1362
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1699
1363
  ]), parameters.graph);
1700
- parameters.resource.add(PropertyShape.schema.properties.message.path, parameters.object.message
1364
+ parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
1701
1365
  .toList()
1702
1366
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1703
- parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
1704
- .toList()
1705
- .flatMap((value) => [
1706
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1707
- ]), parameters.graph);
1708
- parameters.resource.add(PropertyShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
1709
- parameters.resource.add(PropertyShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
1710
- parameters.resource.add(PropertyShape.schema.properties.minLength.path, parameters.object.minLength
1367
+ parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
1368
+ parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
1369
+ parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
1711
1370
  .toList()
1712
1371
  .flatMap((value) => [
1713
1372
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1714
1373
  ]), parameters.graph);
1715
- parameters.resource.add(PropertyShape.schema.properties.mutable.path, parameters.object.mutable
1374
+ parameters.resource.add(NodeShape.schema.properties.mutable.path, parameters.object.mutable
1716
1375
  .toList()
1717
1376
  .flatMap((value) => [
1718
1377
  $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1719
1378
  ]), parameters.graph);
1720
- parameters.resource.add(PropertyShape.schema.properties.name.path, parameters.object.name
1721
- .toList()
1722
- .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1723
- parameters.resource.add(PropertyShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
1724
- parameters.resource.add(PropertyShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
1725
- parameters.resource.add(PropertyShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
1726
- parameters.resource.add(PropertyShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
1379
+ parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
1380
+ parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
1381
+ parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
1382
+ parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
1727
1383
  value.length > 0
1728
1384
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1729
1385
  if (itemIndex === 0) {
@@ -1745,51 +1401,26 @@ export var PropertyShape;
1745
1401
  }).listResource.identifier
1746
1402
  : $RdfVocabularies.rdf.nil,
1747
1403
  ]), parameters.graph);
1748
- parameters.resource.add(PropertyShape.schema.properties.order.path, parameters.object.order
1749
- .toList()
1750
- .flatMap((value) => [
1751
- $literalFactory.number(value, $RdfVocabularies.xsd.double),
1752
- ]), parameters.graph);
1753
- parameters.resource.add(PropertyShape.schema.properties.path.path, [
1754
- $PropertyPath.toRdfResource(parameters.object.path, {
1755
- graph: parameters.graph,
1756
- resourceSet: parameters.resourceSet,
1757
- }).identifier,
1758
- ], parameters.graph);
1759
- parameters.resource.add(PropertyShape.schema.properties.pattern.path, parameters.object.pattern
1404
+ parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
1760
1405
  .toList()
1761
1406
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1762
- parameters.resource.add(PropertyShape.schema.properties.qualifiedMaxCount.path, parameters.object.qualifiedMaxCount
1763
- .toList()
1764
- .flatMap((value) => [
1765
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1766
- ]), parameters.graph);
1767
- parameters.resource.add(PropertyShape.schema.properties.qualifiedMinCount.path, parameters.object.qualifiedMinCount
1768
- .toList()
1769
- .flatMap((value) => [
1770
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1771
- ]), parameters.graph);
1772
- parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShape.path, parameters.object.qualifiedValueShape.toList(), parameters.graph);
1773
- parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.path, parameters.object.qualifiedValueShapesDisjoint
1774
- .toList()
1775
- .flatMap((value) => [
1776
- $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1777
- ]), parameters.graph);
1778
- parameters.resource.add(PropertyShape.schema.properties.resolve.path, parameters.object.resolve.toList(), parameters.graph);
1779
- parameters.resource.add(PropertyShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
1780
- parameters.resource.add(PropertyShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
1407
+ parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
1408
+ parameters.resource.add(NodeShape.schema.properties.rdfType.path, parameters.object.rdfType.toList(), parameters.graph);
1409
+ parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
1410
+ parameters.resource.add(NodeShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
1781
1411
  .toList()
1782
1412
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1783
- parameters.resource.add(PropertyShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
1784
- parameters.resource.add(PropertyShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
1785
- parameters.resource.add(PropertyShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
1786
- parameters.resource.add(PropertyShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
1787
- parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
1788
- .toList()
1789
- .flatMap((value) => [
1790
- $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1413
+ parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
1414
+ parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
1415
+ parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
1416
+ parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
1417
+ parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
1418
+ parameters.resource.add(NodeShape.schema.properties.toRdfTypes.path, parameters.object.toRdfTypes.flatMap((item) => [item]), parameters.graph);
1419
+ parameters.resource.add(NodeShape.schema.properties.tsImports.path, parameters.object.tsImports.flatMap((item) => [
1420
+ $literalFactory.string(item),
1791
1421
  ]), parameters.graph);
1792
- parameters.resource.add(PropertyShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
1422
+ parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
1423
+ parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
1793
1424
  value.length > 0
1794
1425
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1795
1426
  if (itemIndex === 0) {
@@ -1813,104 +1444,81 @@ export var PropertyShape;
1813
1444
  ]), parameters.graph);
1814
1445
  return parameters.resource;
1815
1446
  };
1816
- PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
1817
- function _propertiesToStrings(_propertyShape) {
1818
- return $compactRecord({
1819
- $identifier: _propertyShape.$identifier().toString(),
1820
- label: _propertyShape.label.map((item) => item.toString()).extract(),
1821
- name: _propertyShape.name.map((item) => item.toString()).extract(),
1822
- path: $PropertyPath.$toString(_propertyShape.path),
1823
- shaclmateName: _propertyShape.shaclmateName
1824
- .map((item) => item.toString())
1825
- .extract(),
1826
- });
1827
- }
1828
- PropertyShape._propertiesToStrings = _propertiesToStrings;
1829
- function $toString(_propertyShape) {
1830
- return `PropertyShape(${JSON.stringify(_propertiesToStrings(_propertyShape))})`;
1831
- }
1832
- PropertyShape.$toString = $toString;
1833
- })(PropertyShape || (PropertyShape = {}));
1834
- export var PropertyGroup;
1835
- (function (PropertyGroup) {
1836
- function create(parameters) {
1837
- return $sequenceRecord({
1838
- $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1839
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1840
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1841
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyGroup" }, { $toString }));
1842
- }
1843
- PropertyGroup.create = create;
1447
+ NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
1448
+ NodeShape.$toString = (_nodeShape) => `NodeShape(${JSON.stringify(NodeShape.toStringRecord(_nodeShape))})`;
1449
+ NodeShape.toStringRecord = (_nodeShape) => $compactRecord({
1450
+ $identifier: _nodeShape.$identifier().toString(),
1451
+ label: _nodeShape.label.map((item) => item.toString()).extract(),
1452
+ shaclmateName: _nodeShape.shaclmateName
1453
+ .map((item) => item.toString())
1454
+ .extract(),
1455
+ });
1456
+ })(NodeShape || (NodeShape = {}));
1457
+ export var Ontology;
1458
+ (function (Ontology) {
1459
+ Ontology.create = (parameters) => $sequenceRecord({
1460
+ $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1461
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
1462
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
1463
+ })
1464
+ .map((properties) => ({ ...properties, $type: "Ontology" }))
1465
+ .map((object) => $monkeyPatchObject(object, { $toString: Ontology.$toString }));
1844
1466
  function createUnsafe(parameters) {
1845
- return create(parameters).unsafeCoerce();
1467
+ return Ontology.create(parameters).unsafeCoerce();
1846
1468
  }
1847
- PropertyGroup.createUnsafe = createUnsafe;
1469
+ Ontology.createUnsafe = createUnsafe;
1470
+ Ontology._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
1471
+ ? $ensureRdfResourceType($resource, [Ontology.schema.fromRdfType], {
1472
+ graph: _$options.graph,
1473
+ })
1474
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1475
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
1476
+ dataFactory: dataFactory,
1477
+ focusResource: $resource,
1478
+ propertyPath: $RdfVocabularies.rdf.subject,
1479
+ term: $resource.identifier,
1480
+ }).toValues(), {
1481
+ context: _$options.context,
1482
+ graph: _$options.graph,
1483
+ focusResource: $resource,
1484
+ preferredLanguages: _$options.preferredLanguages,
1485
+ propertyPath: $RdfVocabularies.rdf.subject,
1486
+ schema: Ontology.schema.properties.$identifier.type,
1487
+ }).chain((values) => values.head()),
1488
+ comment: $shaclPropertyFromRdf({
1489
+ context: _$options.context,
1490
+ graph: _$options.graph,
1491
+ focusResource: $resource,
1492
+ ignoreRdfType: true,
1493
+ preferredLanguages: _$options.preferredLanguages,
1494
+ propertySchema: Ontology.schema.properties.comment,
1495
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1496
+ }),
1497
+ label: $shaclPropertyFromRdf({
1498
+ context: _$options.context,
1499
+ graph: _$options.graph,
1500
+ focusResource: $resource,
1501
+ ignoreRdfType: true,
1502
+ preferredLanguages: _$options.preferredLanguages,
1503
+ propertySchema: Ontology.schema.properties.label,
1504
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1505
+ }),
1506
+ }).chain((properties) => Ontology.create(properties)));
1507
+ Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
1508
+ Ontology.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
1509
+ .toResource()
1510
+ .chain((resource) => Ontology.fromRdfResource(resource, options)));
1848
1511
  let Identifier;
1849
1512
  (function (Identifier) {
1850
1513
  Identifier.parse = $parseIdentifier;
1851
1514
  Identifier.stringify = NTriplesTerm.stringify;
1852
- })(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
1853
- PropertyGroup._fromRdfResource = ($resource, _$options) => {
1854
- return (!_$options.ignoreRdfType
1855
- ? $ensureRdfResourceType($resource, [PropertyGroup.fromRdfType], {
1856
- graph: _$options.graph,
1857
- })
1858
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1859
- $identifier: Right(new Resource.Value({
1860
- dataFactory: dataFactory,
1861
- focusResource: $resource,
1862
- propertyPath: $RdfVocabularies.rdf.subject,
1863
- term: $resource.identifier,
1864
- }).toValues())
1865
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1866
- .chain((values) => values.head()),
1867
- comment: $shaclPropertyFromRdf({
1868
- graph: _$options.graph,
1869
- resource: $resource,
1870
- propertySchema: PropertyGroup.schema.properties.comment,
1871
- typeFromRdf: (resourceValues) => resourceValues
1872
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1873
- .chain((values) => values.chainMap((value) => value.toString()))
1874
- .map((values) => values.length > 0
1875
- ? values.map((value) => Maybe.of(value))
1876
- : Resource.Values.fromValue({
1877
- focusResource: $resource,
1878
- propertyPath: PropertyShape.schema.properties.comment.path,
1879
- value: Maybe.empty(),
1880
- })),
1881
- }),
1882
- label: $shaclPropertyFromRdf({
1883
- graph: _$options.graph,
1884
- resource: $resource,
1885
- propertySchema: PropertyGroup.schema.properties.label,
1886
- typeFromRdf: (resourceValues) => resourceValues
1887
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1888
- .chain((values) => values.chainMap((value) => value.toString()))
1889
- .map((values) => values.length > 0
1890
- ? values.map((value) => Maybe.of(value))
1891
- : Resource.Values.fromValue({
1892
- focusResource: $resource,
1893
- propertyPath: PropertyShape.schema.properties.label.path,
1894
- value: Maybe.empty(),
1895
- })),
1896
- }),
1897
- }).chain((properties) => create(properties)));
1898
- };
1899
- PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
1900
- PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
1901
- .toResource()
1902
- .chain((resource) => PropertyGroup.fromRdfResource(resource, options))));
1903
- PropertyGroup.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
1904
- function isPropertyGroup(object) {
1905
- switch (object.$type) {
1906
- case "PropertyGroup":
1907
- return true;
1908
- default:
1909
- return false;
1910
- }
1515
+ })(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
1516
+ function isOntology(object) {
1517
+ return object.$type === "Ontology";
1911
1518
  }
1912
- PropertyGroup.isPropertyGroup = isPropertyGroup;
1913
- PropertyGroup.schema = {
1519
+ Ontology.isOntology = isOntology;
1520
+ Ontology.schema = {
1521
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
1914
1522
  properties: {
1915
1523
  $identifier: {
1916
1524
  kind: "Identifier",
@@ -1934,111 +1542,90 @@ export var PropertyGroup;
1934
1542
  },
1935
1543
  },
1936
1544
  };
1937
- PropertyGroup._toRdfResource = (parameters) => {
1545
+ Ontology._toRdfResource = (parameters) => {
1938
1546
  if (!parameters.ignoreRdfType) {
1939
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), parameters.graph);
1547
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), parameters.graph);
1940
1548
  }
1941
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
1549
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
1942
1550
  .toList()
1943
1551
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1944
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
1552
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
1945
1553
  .toList()
1946
1554
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1947
1555
  return parameters.resource;
1948
1556
  };
1949
- PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
1950
- function _propertiesToStrings(_propertyGroup) {
1951
- return $compactRecord({
1952
- $identifier: _propertyGroup.$identifier().toString(),
1953
- label: _propertyGroup.label.map((item) => item.toString()).extract(),
1954
- });
1955
- }
1956
- PropertyGroup._propertiesToStrings = _propertiesToStrings;
1957
- function $toString(_propertyGroup) {
1958
- return `PropertyGroup(${JSON.stringify(_propertiesToStrings(_propertyGroup))})`;
1959
- }
1960
- PropertyGroup.$toString = $toString;
1961
- })(PropertyGroup || (PropertyGroup = {}));
1962
- export var Ontology;
1963
- (function (Ontology) {
1964
- function create(parameters) {
1965
- return $sequenceRecord({
1966
- $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1967
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1968
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1969
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "Ontology" }, { $toString }));
1970
- }
1971
- Ontology.create = create;
1557
+ Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
1558
+ Ontology.$toString = (_ontology) => `Ontology(${JSON.stringify(Ontology.toStringRecord(_ontology))})`;
1559
+ Ontology.toStringRecord = (_ontology) => $compactRecord({
1560
+ $identifier: _ontology.$identifier().toString(),
1561
+ label: _ontology.label.map((item) => item.toString()).extract(),
1562
+ });
1563
+ })(Ontology || (Ontology = {}));
1564
+ export var PropertyGroup;
1565
+ (function (PropertyGroup) {
1566
+ PropertyGroup.create = (parameters) => $sequenceRecord({
1567
+ $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1568
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
1569
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
1570
+ })
1571
+ .map((properties) => ({ ...properties, $type: "PropertyGroup" }))
1572
+ .map((object) => $monkeyPatchObject(object, { $toString: PropertyGroup.$toString }));
1972
1573
  function createUnsafe(parameters) {
1973
- return create(parameters).unsafeCoerce();
1574
+ return PropertyGroup.create(parameters).unsafeCoerce();
1974
1575
  }
1975
- Ontology.createUnsafe = createUnsafe;
1576
+ PropertyGroup.createUnsafe = createUnsafe;
1577
+ PropertyGroup._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
1578
+ ? $ensureRdfResourceType($resource, [PropertyGroup.schema.fromRdfType], {
1579
+ graph: _$options.graph,
1580
+ })
1581
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1582
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
1583
+ dataFactory: dataFactory,
1584
+ focusResource: $resource,
1585
+ propertyPath: $RdfVocabularies.rdf.subject,
1586
+ term: $resource.identifier,
1587
+ }).toValues(), {
1588
+ context: _$options.context,
1589
+ graph: _$options.graph,
1590
+ focusResource: $resource,
1591
+ preferredLanguages: _$options.preferredLanguages,
1592
+ propertyPath: $RdfVocabularies.rdf.subject,
1593
+ schema: PropertyGroup.schema.properties.$identifier.type,
1594
+ }).chain((values) => values.head()),
1595
+ comment: $shaclPropertyFromRdf({
1596
+ context: _$options.context,
1597
+ graph: _$options.graph,
1598
+ focusResource: $resource,
1599
+ ignoreRdfType: true,
1600
+ preferredLanguages: _$options.preferredLanguages,
1601
+ propertySchema: PropertyGroup.schema.properties.comment,
1602
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1603
+ }),
1604
+ label: $shaclPropertyFromRdf({
1605
+ context: _$options.context,
1606
+ graph: _$options.graph,
1607
+ focusResource: $resource,
1608
+ ignoreRdfType: true,
1609
+ preferredLanguages: _$options.preferredLanguages,
1610
+ propertySchema: PropertyGroup.schema.properties.label,
1611
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1612
+ }),
1613
+ }).chain((properties) => PropertyGroup.create(properties)));
1614
+ PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
1615
+ PropertyGroup.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
1616
+ .toResource()
1617
+ .chain((resource) => PropertyGroup.fromRdfResource(resource, options)));
1976
1618
  let Identifier;
1977
1619
  (function (Identifier) {
1978
1620
  Identifier.parse = $parseIdentifier;
1979
1621
  Identifier.stringify = NTriplesTerm.stringify;
1980
- })(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
1981
- Ontology._fromRdfResource = ($resource, _$options) => {
1982
- return (!_$options.ignoreRdfType
1983
- ? $ensureRdfResourceType($resource, [Ontology.fromRdfType], {
1984
- graph: _$options.graph,
1985
- })
1986
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1987
- $identifier: Right(new Resource.Value({
1988
- dataFactory: dataFactory,
1989
- focusResource: $resource,
1990
- propertyPath: $RdfVocabularies.rdf.subject,
1991
- term: $resource.identifier,
1992
- }).toValues())
1993
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1994
- .chain((values) => values.head()),
1995
- comment: $shaclPropertyFromRdf({
1996
- graph: _$options.graph,
1997
- resource: $resource,
1998
- propertySchema: Ontology.schema.properties.comment,
1999
- typeFromRdf: (resourceValues) => resourceValues
2000
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2001
- .chain((values) => values.chainMap((value) => value.toString()))
2002
- .map((values) => values.length > 0
2003
- ? values.map((value) => Maybe.of(value))
2004
- : Resource.Values.fromValue({
2005
- focusResource: $resource,
2006
- propertyPath: PropertyShape.schema.properties.comment.path,
2007
- value: Maybe.empty(),
2008
- })),
2009
- }),
2010
- label: $shaclPropertyFromRdf({
2011
- graph: _$options.graph,
2012
- resource: $resource,
2013
- propertySchema: Ontology.schema.properties.label,
2014
- typeFromRdf: (resourceValues) => resourceValues
2015
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2016
- .chain((values) => values.chainMap((value) => value.toString()))
2017
- .map((values) => values.length > 0
2018
- ? values.map((value) => Maybe.of(value))
2019
- : Resource.Values.fromValue({
2020
- focusResource: $resource,
2021
- propertyPath: PropertyShape.schema.properties.label.path,
2022
- value: Maybe.empty(),
2023
- })),
2024
- }),
2025
- }).chain((properties) => create(properties)));
2026
- };
2027
- Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
2028
- Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
2029
- .toResource()
2030
- .chain((resource) => Ontology.fromRdfResource(resource, options))));
2031
- Ontology.fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
2032
- function isOntology(object) {
2033
- switch (object.$type) {
2034
- case "Ontology":
2035
- return true;
2036
- default:
2037
- return false;
2038
- }
1622
+ })(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
1623
+ function isPropertyGroup(object) {
1624
+ return object.$type === "PropertyGroup";
2039
1625
  }
2040
- Ontology.isOntology = isOntology;
2041
- Ontology.schema = {
1626
+ PropertyGroup.isPropertyGroup = isPropertyGroup;
1627
+ PropertyGroup.schema = {
1628
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"),
2042
1629
  properties: {
2043
1630
  $identifier: {
2044
1631
  kind: "Identifier",
@@ -2062,797 +1649,580 @@ export var Ontology;
2062
1649
  },
2063
1650
  },
2064
1651
  };
2065
- Ontology._toRdfResource = (parameters) => {
1652
+ PropertyGroup._toRdfResource = (parameters) => {
2066
1653
  if (!parameters.ignoreRdfType) {
2067
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), parameters.graph);
1654
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), parameters.graph);
2068
1655
  }
2069
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
1656
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
2070
1657
  .toList()
2071
1658
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2072
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
1659
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
2073
1660
  .toList()
2074
1661
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2075
1662
  return parameters.resource;
2076
1663
  };
2077
- Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
2078
- function _propertiesToStrings(_ontology) {
2079
- return $compactRecord({
2080
- $identifier: _ontology.$identifier().toString(),
2081
- label: _ontology.label.map((item) => item.toString()).extract(),
2082
- });
2083
- }
2084
- Ontology._propertiesToStrings = _propertiesToStrings;
2085
- function $toString(_ontology) {
2086
- return `Ontology(${JSON.stringify(_propertiesToStrings(_ontology))})`;
2087
- }
2088
- Ontology.$toString = $toString;
2089
- })(Ontology || (Ontology = {}));
2090
- export var NodeShape;
2091
- (function (NodeShape) {
2092
- function create(parameters) {
2093
- return $sequenceRecord({
2094
- $identifier: $convertToIdentifierProperty(parameters?.$identifier),
2095
- and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
2096
- classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
2097
- closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
2098
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
2099
- datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
2100
- deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
2101
- discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.discriminantValue.type, value)),
2102
- extern: $convertToMaybe($identityConversionFunction)(parameters?.extern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.extern.type, value)),
2103
- flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.flags.type, value)),
2104
- fromRdfType: $convertToMaybe(($convertToIri))(parameters?.fromRdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.fromRdfType.type, value)),
2105
- hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
2106
- ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
2107
- in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
2108
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
2109
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
2110
- languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
2111
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
2112
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
2113
- maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
2114
- message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.message.type, value)),
2115
- minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
2116
- minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
2117
- minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
2118
- mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.mutable.type, value)),
2119
- node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
2120
- nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
2121
- not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
2122
- or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
2123
- pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.pattern.type, value)),
2124
- properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
2125
- rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.rdfType.type, value)),
2126
- severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.severity.type, value)),
2127
- shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.shaclmateName.type, value)),
2128
- subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
2129
- targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetClasses.type, value)),
2130
- targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetNodes.type, value)),
2131
- targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetObjectsOf.type, value)),
2132
- targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.targetSubjectsOf.type, value)),
2133
- toRdfTypes: $convertToScalarSet(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.toRdfTypes.type, value)),
2134
- tsImports: $convertToScalarSet($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.tsImports.type, value)),
2135
- types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
2136
- xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
2137
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "NodeShape" }, { $toString }));
2138
- }
2139
- NodeShape.create = create;
1664
+ PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
1665
+ PropertyGroup.$toString = (_propertyGroup) => `PropertyGroup(${JSON.stringify(PropertyGroup.toStringRecord(_propertyGroup))})`;
1666
+ PropertyGroup.toStringRecord = (_propertyGroup) => $compactRecord({
1667
+ $identifier: _propertyGroup.$identifier().toString(),
1668
+ label: _propertyGroup.label.map((item) => item.toString()).extract(),
1669
+ });
1670
+ })(PropertyGroup || (PropertyGroup = {}));
1671
+ export var PropertyShape;
1672
+ (function (PropertyShape) {
1673
+ PropertyShape.create = (parameters) => $sequenceRecord({
1674
+ $identifier: $convertToIdentifierProperty(parameters.$identifier),
1675
+ and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
1676
+ classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
1677
+ comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
1678
+ datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
1679
+ deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
1680
+ defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
1681
+ description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
1682
+ disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
1683
+ display: $convertWithDefaultValue($identityConversionFunction, false)(parameters.display),
1684
+ equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
1685
+ flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
1686
+ groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
1687
+ hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
1688
+ ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters.ignore),
1689
+ in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
1690
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
1691
+ label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
1692
+ languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
1693
+ lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
1694
+ lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
1695
+ maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
1696
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
1697
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
1698
+ maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
1699
+ message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
1700
+ minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
1701
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
1702
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
1703
+ minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
1704
+ mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
1705
+ name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
1706
+ node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
1707
+ nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
1708
+ not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
1709
+ or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
1710
+ order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
1711
+ path: Either.of(parameters.path),
1712
+ pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
1713
+ qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
1714
+ qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
1715
+ qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
1716
+ qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
1717
+ resolve: $convertToMaybe($convertToIdentifier)(parameters.resolve).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.resolve.type, value)),
1718
+ severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
1719
+ shaclmateName: $convertToMaybe($identityConversionFunction)(parameters.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
1720
+ targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
1721
+ targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
1722
+ targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
1723
+ targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
1724
+ uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
1725
+ xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
1726
+ })
1727
+ .map((properties) => ({ ...properties, $type: "PropertyShape" }))
1728
+ .map((object) => $monkeyPatchObject(object, { $toString: PropertyShape.$toString }));
2140
1729
  function createUnsafe(parameters) {
2141
- return create(parameters).unsafeCoerce();
1730
+ return PropertyShape.create(parameters).unsafeCoerce();
2142
1731
  }
2143
- NodeShape.createUnsafe = createUnsafe;
1732
+ PropertyShape.createUnsafe = createUnsafe;
1733
+ PropertyShape._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
1734
+ ? $ensureRdfResourceType($resource, [PropertyShape.schema.fromRdfType], {
1735
+ graph: _$options.graph,
1736
+ })
1737
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1738
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
1739
+ dataFactory: dataFactory,
1740
+ focusResource: $resource,
1741
+ propertyPath: $RdfVocabularies.rdf.subject,
1742
+ term: $resource.identifier,
1743
+ }).toValues(), {
1744
+ context: _$options.context,
1745
+ graph: _$options.graph,
1746
+ focusResource: $resource,
1747
+ preferredLanguages: _$options.preferredLanguages,
1748
+ propertyPath: $RdfVocabularies.rdf.subject,
1749
+ schema: PropertyShape.schema.properties.$identifier.type,
1750
+ }).chain((values) => values.head()),
1751
+ and: $shaclPropertyFromRdf({
1752
+ context: _$options.context,
1753
+ graph: _$options.graph,
1754
+ focusResource: $resource,
1755
+ ignoreRdfType: true,
1756
+ preferredLanguages: _$options.preferredLanguages,
1757
+ propertySchema: PropertyShape.schema.properties.and,
1758
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
1759
+ }),
1760
+ classes: $shaclPropertyFromRdf({
1761
+ context: _$options.context,
1762
+ graph: _$options.graph,
1763
+ focusResource: $resource,
1764
+ ignoreRdfType: true,
1765
+ preferredLanguages: _$options.preferredLanguages,
1766
+ propertySchema: PropertyShape.schema.properties.classes,
1767
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1768
+ }),
1769
+ comment: $shaclPropertyFromRdf({
1770
+ context: _$options.context,
1771
+ graph: _$options.graph,
1772
+ focusResource: $resource,
1773
+ ignoreRdfType: true,
1774
+ preferredLanguages: _$options.preferredLanguages,
1775
+ propertySchema: PropertyShape.schema.properties.comment,
1776
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1777
+ }),
1778
+ datatype: $shaclPropertyFromRdf({
1779
+ context: _$options.context,
1780
+ graph: _$options.graph,
1781
+ focusResource: $resource,
1782
+ ignoreRdfType: true,
1783
+ preferredLanguages: _$options.preferredLanguages,
1784
+ propertySchema: PropertyShape.schema.properties.datatype,
1785
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
1786
+ }),
1787
+ deactivated: $shaclPropertyFromRdf({
1788
+ context: _$options.context,
1789
+ graph: _$options.graph,
1790
+ focusResource: $resource,
1791
+ ignoreRdfType: true,
1792
+ preferredLanguages: _$options.preferredLanguages,
1793
+ propertySchema: PropertyShape.schema.properties.deactivated,
1794
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
1795
+ }),
1796
+ defaultValue: $shaclPropertyFromRdf({
1797
+ context: _$options.context,
1798
+ graph: _$options.graph,
1799
+ focusResource: $resource,
1800
+ ignoreRdfType: true,
1801
+ preferredLanguages: _$options.preferredLanguages,
1802
+ propertySchema: PropertyShape.schema.properties.defaultValue,
1803
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($termFromRdfResourceValues)),
1804
+ }),
1805
+ description: $shaclPropertyFromRdf({
1806
+ context: _$options.context,
1807
+ graph: _$options.graph,
1808
+ focusResource: $resource,
1809
+ ignoreRdfType: true,
1810
+ preferredLanguages: _$options.preferredLanguages,
1811
+ propertySchema: PropertyShape.schema.properties.description,
1812
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1813
+ }),
1814
+ disjoint: $shaclPropertyFromRdf({
1815
+ context: _$options.context,
1816
+ graph: _$options.graph,
1817
+ focusResource: $resource,
1818
+ ignoreRdfType: true,
1819
+ preferredLanguages: _$options.preferredLanguages,
1820
+ propertySchema: PropertyShape.schema.properties.disjoint,
1821
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1822
+ }),
1823
+ display: $shaclPropertyFromRdf({
1824
+ context: _$options.context,
1825
+ graph: _$options.graph,
1826
+ focusResource: $resource,
1827
+ ignoreRdfType: true,
1828
+ preferredLanguages: _$options.preferredLanguages,
1829
+ propertySchema: PropertyShape.schema.properties.display,
1830
+ typeFromRdfResourceValues: $defaultValueFromRdfResourceValues(($booleanFromRdfResourceValues)),
1831
+ }),
1832
+ equals: $shaclPropertyFromRdf({
1833
+ context: _$options.context,
1834
+ graph: _$options.graph,
1835
+ focusResource: $resource,
1836
+ ignoreRdfType: true,
1837
+ preferredLanguages: _$options.preferredLanguages,
1838
+ propertySchema: PropertyShape.schema.properties.equals,
1839
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1840
+ }),
1841
+ flags: $shaclPropertyFromRdf({
1842
+ context: _$options.context,
1843
+ graph: _$options.graph,
1844
+ focusResource: $resource,
1845
+ ignoreRdfType: true,
1846
+ preferredLanguages: _$options.preferredLanguages,
1847
+ propertySchema: PropertyShape.schema.properties.flags,
1848
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1849
+ }),
1850
+ groups: $shaclPropertyFromRdf({
1851
+ context: _$options.context,
1852
+ graph: _$options.graph,
1853
+ focusResource: $resource,
1854
+ ignoreRdfType: true,
1855
+ preferredLanguages: _$options.preferredLanguages,
1856
+ propertySchema: PropertyShape.schema.properties.groups,
1857
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
1858
+ }),
1859
+ hasValues: $shaclPropertyFromRdf({
1860
+ context: _$options.context,
1861
+ graph: _$options.graph,
1862
+ focusResource: $resource,
1863
+ ignoreRdfType: true,
1864
+ preferredLanguages: _$options.preferredLanguages,
1865
+ propertySchema: PropertyShape.schema.properties.hasValues,
1866
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
1867
+ }),
1868
+ ignore: $shaclPropertyFromRdf({
1869
+ context: _$options.context,
1870
+ graph: _$options.graph,
1871
+ focusResource: $resource,
1872
+ ignoreRdfType: true,
1873
+ preferredLanguages: _$options.preferredLanguages,
1874
+ propertySchema: PropertyShape.schema.properties.ignore,
1875
+ typeFromRdfResourceValues: $defaultValueFromRdfResourceValues(($booleanFromRdfResourceValues)),
1876
+ }),
1877
+ in_: $shaclPropertyFromRdf({
1878
+ context: _$options.context,
1879
+ graph: _$options.graph,
1880
+ focusResource: $resource,
1881
+ ignoreRdfType: true,
1882
+ preferredLanguages: _$options.preferredLanguages,
1883
+ propertySchema: PropertyShape.schema.properties.in_,
1884
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($termFromRdfResourceValues))),
1885
+ }),
1886
+ isDefinedBy: $shaclPropertyFromRdf({
1887
+ context: _$options.context,
1888
+ graph: _$options.graph,
1889
+ focusResource: $resource,
1890
+ ignoreRdfType: true,
1891
+ preferredLanguages: _$options.preferredLanguages,
1892
+ propertySchema: PropertyShape.schema.properties.isDefinedBy,
1893
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
1894
+ }),
1895
+ label: $shaclPropertyFromRdf({
1896
+ context: _$options.context,
1897
+ graph: _$options.graph,
1898
+ focusResource: $resource,
1899
+ ignoreRdfType: true,
1900
+ preferredLanguages: _$options.preferredLanguages,
1901
+ propertySchema: PropertyShape.schema.properties.label,
1902
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1903
+ }),
1904
+ languageIn: $shaclPropertyFromRdf({
1905
+ context: _$options.context,
1906
+ graph: _$options.graph,
1907
+ focusResource: $resource,
1908
+ ignoreRdfType: true,
1909
+ preferredLanguages: _$options.preferredLanguages,
1910
+ propertySchema: PropertyShape.schema.properties.languageIn,
1911
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($stringFromRdfResourceValues))),
1912
+ }),
1913
+ lessThan: $shaclPropertyFromRdf({
1914
+ context: _$options.context,
1915
+ graph: _$options.graph,
1916
+ focusResource: $resource,
1917
+ ignoreRdfType: true,
1918
+ preferredLanguages: _$options.preferredLanguages,
1919
+ propertySchema: PropertyShape.schema.properties.lessThan,
1920
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1921
+ }),
1922
+ lessThanOrEquals: $shaclPropertyFromRdf({
1923
+ context: _$options.context,
1924
+ graph: _$options.graph,
1925
+ focusResource: $resource,
1926
+ ignoreRdfType: true,
1927
+ preferredLanguages: _$options.preferredLanguages,
1928
+ propertySchema: PropertyShape.schema.properties.lessThanOrEquals,
1929
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1930
+ }),
1931
+ maxCount: $shaclPropertyFromRdf({
1932
+ context: _$options.context,
1933
+ graph: _$options.graph,
1934
+ focusResource: $resource,
1935
+ ignoreRdfType: true,
1936
+ preferredLanguages: _$options.preferredLanguages,
1937
+ propertySchema: PropertyShape.schema.properties.maxCount,
1938
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1939
+ }),
1940
+ maxExclusive: $shaclPropertyFromRdf({
1941
+ context: _$options.context,
1942
+ graph: _$options.graph,
1943
+ focusResource: $resource,
1944
+ ignoreRdfType: true,
1945
+ preferredLanguages: _$options.preferredLanguages,
1946
+ propertySchema: PropertyShape.schema.properties.maxExclusive,
1947
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
1948
+ }),
1949
+ maxInclusive: $shaclPropertyFromRdf({
1950
+ context: _$options.context,
1951
+ graph: _$options.graph,
1952
+ focusResource: $resource,
1953
+ ignoreRdfType: true,
1954
+ preferredLanguages: _$options.preferredLanguages,
1955
+ propertySchema: PropertyShape.schema.properties.maxInclusive,
1956
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
1957
+ }),
1958
+ maxLength: $shaclPropertyFromRdf({
1959
+ context: _$options.context,
1960
+ graph: _$options.graph,
1961
+ focusResource: $resource,
1962
+ ignoreRdfType: true,
1963
+ preferredLanguages: _$options.preferredLanguages,
1964
+ propertySchema: PropertyShape.schema.properties.maxLength,
1965
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1966
+ }),
1967
+ message: $shaclPropertyFromRdf({
1968
+ context: _$options.context,
1969
+ graph: _$options.graph,
1970
+ focusResource: $resource,
1971
+ ignoreRdfType: true,
1972
+ preferredLanguages: _$options.preferredLanguages,
1973
+ propertySchema: PropertyShape.schema.properties.message,
1974
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1975
+ }),
1976
+ minCount: $shaclPropertyFromRdf({
1977
+ context: _$options.context,
1978
+ graph: _$options.graph,
1979
+ focusResource: $resource,
1980
+ ignoreRdfType: true,
1981
+ preferredLanguages: _$options.preferredLanguages,
1982
+ propertySchema: PropertyShape.schema.properties.minCount,
1983
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1984
+ }),
1985
+ minExclusive: $shaclPropertyFromRdf({
1986
+ context: _$options.context,
1987
+ graph: _$options.graph,
1988
+ focusResource: $resource,
1989
+ ignoreRdfType: true,
1990
+ preferredLanguages: _$options.preferredLanguages,
1991
+ propertySchema: PropertyShape.schema.properties.minExclusive,
1992
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
1993
+ }),
1994
+ minInclusive: $shaclPropertyFromRdf({
1995
+ context: _$options.context,
1996
+ graph: _$options.graph,
1997
+ focusResource: $resource,
1998
+ ignoreRdfType: true,
1999
+ preferredLanguages: _$options.preferredLanguages,
2000
+ propertySchema: PropertyShape.schema.properties.minInclusive,
2001
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
2002
+ }),
2003
+ minLength: $shaclPropertyFromRdf({
2004
+ context: _$options.context,
2005
+ graph: _$options.graph,
2006
+ focusResource: $resource,
2007
+ ignoreRdfType: true,
2008
+ preferredLanguages: _$options.preferredLanguages,
2009
+ propertySchema: PropertyShape.schema.properties.minLength,
2010
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
2011
+ }),
2012
+ mutable: $shaclPropertyFromRdf({
2013
+ context: _$options.context,
2014
+ graph: _$options.graph,
2015
+ focusResource: $resource,
2016
+ ignoreRdfType: true,
2017
+ preferredLanguages: _$options.preferredLanguages,
2018
+ propertySchema: PropertyShape.schema.properties.mutable,
2019
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
2020
+ }),
2021
+ name: $shaclPropertyFromRdf({
2022
+ context: _$options.context,
2023
+ graph: _$options.graph,
2024
+ focusResource: $resource,
2025
+ ignoreRdfType: true,
2026
+ preferredLanguages: _$options.preferredLanguages,
2027
+ propertySchema: PropertyShape.schema.properties.name,
2028
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
2029
+ }),
2030
+ node: $shaclPropertyFromRdf({
2031
+ context: _$options.context,
2032
+ graph: _$options.graph,
2033
+ focusResource: $resource,
2034
+ ignoreRdfType: true,
2035
+ preferredLanguages: _$options.preferredLanguages,
2036
+ propertySchema: PropertyShape.schema.properties.node,
2037
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
2038
+ }),
2039
+ nodeKind: $shaclPropertyFromRdf({
2040
+ context: _$options.context,
2041
+ graph: _$options.graph,
2042
+ focusResource: $resource,
2043
+ ignoreRdfType: true,
2044
+ preferredLanguages: _$options.preferredLanguages,
2045
+ propertySchema: PropertyShape.schema.properties.nodeKind,
2046
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
2047
+ }),
2048
+ not: $shaclPropertyFromRdf({
2049
+ context: _$options.context,
2050
+ graph: _$options.graph,
2051
+ focusResource: $resource,
2052
+ ignoreRdfType: true,
2053
+ preferredLanguages: _$options.preferredLanguages,
2054
+ propertySchema: PropertyShape.schema.properties.not,
2055
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
2056
+ }),
2057
+ or: $shaclPropertyFromRdf({
2058
+ context: _$options.context,
2059
+ graph: _$options.graph,
2060
+ focusResource: $resource,
2061
+ ignoreRdfType: true,
2062
+ preferredLanguages: _$options.preferredLanguages,
2063
+ propertySchema: PropertyShape.schema.properties.or,
2064
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
2065
+ }),
2066
+ order: $shaclPropertyFromRdf({
2067
+ context: _$options.context,
2068
+ graph: _$options.graph,
2069
+ focusResource: $resource,
2070
+ ignoreRdfType: true,
2071
+ preferredLanguages: _$options.preferredLanguages,
2072
+ propertySchema: PropertyShape.schema.properties.order,
2073
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($floatFromRdfResourceValues)),
2074
+ }),
2075
+ path: $shaclPropertyFromRdf({
2076
+ context: _$options.context,
2077
+ graph: _$options.graph,
2078
+ focusResource: $resource,
2079
+ ignoreRdfType: true,
2080
+ preferredLanguages: _$options.preferredLanguages,
2081
+ propertySchema: PropertyShape.schema.properties.path,
2082
+ typeFromRdfResourceValues: $PropertyPath.fromRdfResourceValues,
2083
+ }),
2084
+ pattern: $shaclPropertyFromRdf({
2085
+ context: _$options.context,
2086
+ graph: _$options.graph,
2087
+ focusResource: $resource,
2088
+ ignoreRdfType: true,
2089
+ preferredLanguages: _$options.preferredLanguages,
2090
+ propertySchema: PropertyShape.schema.properties.pattern,
2091
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
2092
+ }),
2093
+ qualifiedMaxCount: $shaclPropertyFromRdf({
2094
+ context: _$options.context,
2095
+ graph: _$options.graph,
2096
+ focusResource: $resource,
2097
+ ignoreRdfType: true,
2098
+ preferredLanguages: _$options.preferredLanguages,
2099
+ propertySchema: PropertyShape.schema.properties.qualifiedMaxCount,
2100
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
2101
+ }),
2102
+ qualifiedMinCount: $shaclPropertyFromRdf({
2103
+ context: _$options.context,
2104
+ graph: _$options.graph,
2105
+ focusResource: $resource,
2106
+ ignoreRdfType: true,
2107
+ preferredLanguages: _$options.preferredLanguages,
2108
+ propertySchema: PropertyShape.schema.properties.qualifiedMinCount,
2109
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
2110
+ }),
2111
+ qualifiedValueShape: $shaclPropertyFromRdf({
2112
+ context: _$options.context,
2113
+ graph: _$options.graph,
2114
+ focusResource: $resource,
2115
+ ignoreRdfType: true,
2116
+ preferredLanguages: _$options.preferredLanguages,
2117
+ propertySchema: PropertyShape.schema.properties.qualifiedValueShape,
2118
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
2119
+ }),
2120
+ qualifiedValueShapesDisjoint: $shaclPropertyFromRdf({
2121
+ context: _$options.context,
2122
+ graph: _$options.graph,
2123
+ focusResource: $resource,
2124
+ ignoreRdfType: true,
2125
+ preferredLanguages: _$options.preferredLanguages,
2126
+ propertySchema: PropertyShape.schema.properties.qualifiedValueShapesDisjoint,
2127
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
2128
+ }),
2129
+ resolve: $shaclPropertyFromRdf({
2130
+ context: _$options.context,
2131
+ graph: _$options.graph,
2132
+ focusResource: $resource,
2133
+ ignoreRdfType: true,
2134
+ preferredLanguages: _$options.preferredLanguages,
2135
+ propertySchema: PropertyShape.schema.properties.resolve,
2136
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
2137
+ }),
2138
+ severity: $shaclPropertyFromRdf({
2139
+ context: _$options.context,
2140
+ graph: _$options.graph,
2141
+ focusResource: $resource,
2142
+ ignoreRdfType: true,
2143
+ preferredLanguages: _$options.preferredLanguages,
2144
+ propertySchema: PropertyShape.schema.properties.severity,
2145
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
2146
+ }),
2147
+ shaclmateName: $shaclPropertyFromRdf({
2148
+ context: _$options.context,
2149
+ graph: _$options.graph,
2150
+ focusResource: $resource,
2151
+ ignoreRdfType: true,
2152
+ preferredLanguages: _$options.preferredLanguages,
2153
+ propertySchema: PropertyShape.schema.properties.shaclmateName,
2154
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
2155
+ }),
2156
+ targetClasses: $shaclPropertyFromRdf({
2157
+ context: _$options.context,
2158
+ graph: _$options.graph,
2159
+ focusResource: $resource,
2160
+ ignoreRdfType: true,
2161
+ preferredLanguages: _$options.preferredLanguages,
2162
+ propertySchema: PropertyShape.schema.properties.targetClasses,
2163
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
2164
+ }),
2165
+ targetNodes: $shaclPropertyFromRdf({
2166
+ context: _$options.context,
2167
+ graph: _$options.graph,
2168
+ focusResource: $resource,
2169
+ ignoreRdfType: true,
2170
+ preferredLanguages: _$options.preferredLanguages,
2171
+ propertySchema: PropertyShape.schema.properties.targetNodes,
2172
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
2173
+ }),
2174
+ targetObjectsOf: $shaclPropertyFromRdf({
2175
+ context: _$options.context,
2176
+ graph: _$options.graph,
2177
+ focusResource: $resource,
2178
+ ignoreRdfType: true,
2179
+ preferredLanguages: _$options.preferredLanguages,
2180
+ propertySchema: PropertyShape.schema.properties.targetObjectsOf,
2181
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
2182
+ }),
2183
+ targetSubjectsOf: $shaclPropertyFromRdf({
2184
+ context: _$options.context,
2185
+ graph: _$options.graph,
2186
+ focusResource: $resource,
2187
+ ignoreRdfType: true,
2188
+ preferredLanguages: _$options.preferredLanguages,
2189
+ propertySchema: PropertyShape.schema.properties.targetSubjectsOf,
2190
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
2191
+ }),
2192
+ uniqueLang: $shaclPropertyFromRdf({
2193
+ context: _$options.context,
2194
+ graph: _$options.graph,
2195
+ focusResource: $resource,
2196
+ ignoreRdfType: true,
2197
+ preferredLanguages: _$options.preferredLanguages,
2198
+ propertySchema: PropertyShape.schema.properties.uniqueLang,
2199
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
2200
+ }),
2201
+ xone: $shaclPropertyFromRdf({
2202
+ context: _$options.context,
2203
+ graph: _$options.graph,
2204
+ focusResource: $resource,
2205
+ ignoreRdfType: true,
2206
+ preferredLanguages: _$options.preferredLanguages,
2207
+ propertySchema: PropertyShape.schema.properties.xone,
2208
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
2209
+ }),
2210
+ }).chain((properties) => PropertyShape.create(properties)));
2211
+ PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
2212
+ PropertyShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
2213
+ .toResource()
2214
+ .chain((resource) => PropertyShape.fromRdfResource(resource, options)));
2144
2215
  let Identifier;
2145
2216
  (function (Identifier) {
2146
2217
  Identifier.parse = $parseIdentifier;
2147
2218
  Identifier.stringify = NTriplesTerm.stringify;
2148
- })(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
2149
- NodeShape._fromRdfResource = ($resource, _$options) => {
2150
- return (!_$options.ignoreRdfType
2151
- ? $ensureRdfResourceType($resource, [NodeShape.fromRdfType], {
2152
- graph: _$options.graph,
2153
- })
2154
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
2155
- $identifier: Right(new Resource.Value({
2156
- dataFactory: dataFactory,
2157
- focusResource: $resource,
2158
- propertyPath: $RdfVocabularies.rdf.subject,
2159
- term: $resource.identifier,
2160
- }).toValues())
2161
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2162
- .chain((values) => values.head()),
2163
- and: $shaclPropertyFromRdf({
2164
- graph: _$options.graph,
2165
- resource: $resource,
2166
- propertySchema: NodeShape.schema.properties.and,
2167
- typeFromRdf: (resourceValues) => resourceValues
2168
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2169
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2170
- focusResource: $resource,
2171
- propertyPath: PropertyShape.schema.properties.and.path,
2172
- values: valueList.toArray(),
2173
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
2174
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2175
- .map((values) => values.length > 0
2176
- ? values.map((value) => Maybe.of(value))
2177
- : Resource.Values.fromValue({
2178
- focusResource: $resource,
2179
- propertyPath: PropertyShape.schema.properties.and.path,
2180
- value: Maybe.empty(),
2181
- })),
2182
- }),
2183
- classes: $shaclPropertyFromRdf({
2184
- graph: _$options.graph,
2185
- resource: $resource,
2186
- propertySchema: NodeShape.schema.properties.classes,
2187
- typeFromRdf: (resourceValues) => resourceValues
2188
- .chain((values) => values.chainMap((value) => value.toIri()))
2189
- .map((values) => values.toArray())
2190
- .map((valuesArray) => Resource.Values.fromValue({
2191
- focusResource: $resource,
2192
- propertyPath: PropertyShape.schema.properties.classes.path,
2193
- value: valuesArray,
2194
- })),
2195
- }),
2196
- closed: $shaclPropertyFromRdf({
2197
- graph: _$options.graph,
2198
- resource: $resource,
2199
- propertySchema: NodeShape.schema.properties.closed,
2200
- typeFromRdf: (resourceValues) => resourceValues
2201
- .chain((values) => values.chainMap((value) => value.toBoolean()))
2202
- .map((values) => values.length > 0
2203
- ? values.map((value) => Maybe.of(value))
2204
- : Resource.Values.fromValue({
2205
- focusResource: $resource,
2206
- propertyPath: NodeShape.schema.properties.closed.path,
2207
- value: Maybe.empty(),
2208
- })),
2209
- }),
2210
- comment: $shaclPropertyFromRdf({
2211
- graph: _$options.graph,
2212
- resource: $resource,
2213
- propertySchema: NodeShape.schema.properties.comment,
2214
- typeFromRdf: (resourceValues) => resourceValues
2215
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2216
- .chain((values) => values.chainMap((value) => value.toString()))
2217
- .map((values) => values.length > 0
2218
- ? values.map((value) => Maybe.of(value))
2219
- : Resource.Values.fromValue({
2220
- focusResource: $resource,
2221
- propertyPath: PropertyShape.schema.properties.comment.path,
2222
- value: Maybe.empty(),
2223
- })),
2224
- }),
2225
- datatype: $shaclPropertyFromRdf({
2226
- graph: _$options.graph,
2227
- resource: $resource,
2228
- propertySchema: NodeShape.schema.properties.datatype,
2229
- typeFromRdf: (resourceValues) => resourceValues
2230
- .chain((values) => values.chainMap((value) => value.toIri()))
2231
- .map((values) => values.length > 0
2232
- ? values.map((value) => Maybe.of(value))
2233
- : Resource.Values.fromValue({
2234
- focusResource: $resource,
2235
- propertyPath: PropertyShape.schema.properties.datatype.path,
2236
- value: Maybe.empty(),
2237
- })),
2238
- }),
2239
- deactivated: $shaclPropertyFromRdf({
2240
- graph: _$options.graph,
2241
- resource: $resource,
2242
- propertySchema: NodeShape.schema.properties.deactivated,
2243
- typeFromRdf: (resourceValues) => resourceValues
2244
- .chain((values) => values.chainMap((value) => value.toBoolean()))
2245
- .map((values) => values.length > 0
2246
- ? values.map((value) => Maybe.of(value))
2247
- : Resource.Values.fromValue({
2248
- focusResource: $resource,
2249
- propertyPath: PropertyShape.schema.properties.deactivated.path,
2250
- value: Maybe.empty(),
2251
- })),
2252
- }),
2253
- discriminantValue: $shaclPropertyFromRdf({
2254
- graph: _$options.graph,
2255
- resource: $resource,
2256
- propertySchema: NodeShape.schema.properties.discriminantValue,
2257
- typeFromRdf: (resourceValues) => resourceValues
2258
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2259
- .chain((values) => values.chainMap((value) => value.toString()))
2260
- .map((values) => values.length > 0
2261
- ? values.map((value) => Maybe.of(value))
2262
- : Resource.Values.fromValue({
2263
- focusResource: $resource,
2264
- propertyPath: NodeShape.schema.properties.discriminantValue.path,
2265
- value: Maybe.empty(),
2266
- })),
2267
- }),
2268
- extern: $shaclPropertyFromRdf({
2269
- graph: _$options.graph,
2270
- resource: $resource,
2271
- propertySchema: NodeShape.schema.properties.extern,
2272
- typeFromRdf: (resourceValues) => resourceValues
2273
- .chain((values) => values.chainMap((value) => value.toBoolean()))
2274
- .map((values) => values.length > 0
2275
- ? values.map((value) => Maybe.of(value))
2276
- : Resource.Values.fromValue({
2277
- focusResource: $resource,
2278
- propertyPath: NodeShape.schema.properties.extern.path,
2279
- value: Maybe.empty(),
2280
- })),
2281
- }),
2282
- flags: $shaclPropertyFromRdf({
2283
- graph: _$options.graph,
2284
- resource: $resource,
2285
- propertySchema: NodeShape.schema.properties.flags,
2286
- typeFromRdf: (resourceValues) => resourceValues
2287
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2288
- .chain((values) => values.chainMap((value) => value.toString()))
2289
- .map((values) => values.length > 0
2290
- ? values.map((value) => Maybe.of(value))
2291
- : Resource.Values.fromValue({
2292
- focusResource: $resource,
2293
- propertyPath: PropertyShape.schema.properties.flags.path,
2294
- value: Maybe.empty(),
2295
- })),
2296
- }),
2297
- fromRdfType: $shaclPropertyFromRdf({
2298
- graph: _$options.graph,
2299
- resource: $resource,
2300
- propertySchema: NodeShape.schema.properties.fromRdfType,
2301
- typeFromRdf: (resourceValues) => resourceValues
2302
- .chain((values) => values.chainMap((value) => value.toIri()))
2303
- .map((values) => values.length > 0
2304
- ? values.map((value) => Maybe.of(value))
2305
- : Resource.Values.fromValue({
2306
- focusResource: $resource,
2307
- propertyPath: NodeShape.schema.properties.fromRdfType.path,
2308
- value: Maybe.empty(),
2309
- })),
2310
- }),
2311
- hasValues: $shaclPropertyFromRdf({
2312
- graph: _$options.graph,
2313
- resource: $resource,
2314
- propertySchema: NodeShape.schema.properties.hasValues,
2315
- typeFromRdf: (resourceValues) => resourceValues
2316
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
2317
- switch (term.termType) {
2318
- case "NamedNode":
2319
- case "Literal":
2320
- return Either.of(term);
2321
- default:
2322
- return Left(new Resource.MistypedTermValueError({
2323
- actualValue: term,
2324
- expectedValueType: "(NamedNode | Literal)",
2325
- focusResource: $resource,
2326
- propertyPath: PropertyShape.schema.properties.hasValues.path,
2327
- }));
2328
- }
2329
- })))
2330
- .map((values) => values.toArray())
2331
- .map((valuesArray) => Resource.Values.fromValue({
2332
- focusResource: $resource,
2333
- propertyPath: PropertyShape.schema.properties.hasValues.path,
2334
- value: valuesArray,
2335
- })),
2336
- }),
2337
- ignoredProperties: $shaclPropertyFromRdf({
2338
- graph: _$options.graph,
2339
- resource: $resource,
2340
- propertySchema: NodeShape.schema.properties.ignoredProperties,
2341
- typeFromRdf: (resourceValues) => resourceValues
2342
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2343
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2344
- focusResource: $resource,
2345
- propertyPath: NodeShape.schema.properties.ignoredProperties.path,
2346
- values: valueList.toArray(),
2347
- })).chain((values) => values.chainMap((value) => value.toIri()))))
2348
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2349
- .map((values) => values.length > 0
2350
- ? values.map((value) => Maybe.of(value))
2351
- : Resource.Values.fromValue({
2352
- focusResource: $resource,
2353
- propertyPath: NodeShape.schema.properties.ignoredProperties.path,
2354
- value: Maybe.empty(),
2355
- })),
2356
- }),
2357
- in_: $shaclPropertyFromRdf({
2358
- graph: _$options.graph,
2359
- resource: $resource,
2360
- propertySchema: NodeShape.schema.properties.in_,
2361
- typeFromRdf: (resourceValues) => resourceValues
2362
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2363
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2364
- focusResource: $resource,
2365
- propertyPath: PropertyShape.schema.properties.in_.path,
2366
- values: valueList.toArray(),
2367
- })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
2368
- switch (term.termType) {
2369
- case "NamedNode":
2370
- case "Literal":
2371
- return Either.of(term);
2372
- default:
2373
- return Left(new Resource.MistypedTermValueError({
2374
- actualValue: term,
2375
- expectedValueType: "(NamedNode | Literal)",
2376
- focusResource: $resource,
2377
- propertyPath: PropertyShape.schema.properties.in_.path,
2378
- }));
2379
- }
2380
- })))))
2381
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2382
- .map((values) => values.length > 0
2383
- ? values.map((value) => Maybe.of(value))
2384
- : Resource.Values.fromValue({
2385
- focusResource: $resource,
2386
- propertyPath: PropertyShape.schema.properties.in_.path,
2387
- value: Maybe.empty(),
2388
- })),
2389
- }),
2390
- isDefinedBy: $shaclPropertyFromRdf({
2391
- graph: _$options.graph,
2392
- resource: $resource,
2393
- propertySchema: NodeShape.schema.properties.isDefinedBy,
2394
- typeFromRdf: (resourceValues) => resourceValues
2395
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2396
- .map((values) => values.length > 0
2397
- ? values.map((value) => Maybe.of(value))
2398
- : Resource.Values.fromValue({
2399
- focusResource: $resource,
2400
- propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
2401
- value: Maybe.empty(),
2402
- })),
2403
- }),
2404
- label: $shaclPropertyFromRdf({
2405
- graph: _$options.graph,
2406
- resource: $resource,
2407
- propertySchema: NodeShape.schema.properties.label,
2408
- typeFromRdf: (resourceValues) => resourceValues
2409
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2410
- .chain((values) => values.chainMap((value) => value.toString()))
2411
- .map((values) => values.length > 0
2412
- ? values.map((value) => Maybe.of(value))
2413
- : Resource.Values.fromValue({
2414
- focusResource: $resource,
2415
- propertyPath: PropertyShape.schema.properties.label.path,
2416
- value: Maybe.empty(),
2417
- })),
2418
- }),
2419
- languageIn: $shaclPropertyFromRdf({
2420
- graph: _$options.graph,
2421
- resource: $resource,
2422
- propertySchema: NodeShape.schema.properties.languageIn,
2423
- typeFromRdf: (resourceValues) => resourceValues
2424
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2425
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2426
- focusResource: $resource,
2427
- propertyPath: PropertyShape.schema.properties.languageIn.path,
2428
- values: valueList.toArray(),
2429
- }))
2430
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2431
- .chain((values) => values.chainMap((value) => value.toString()))))
2432
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2433
- .map((values) => values.length > 0
2434
- ? values.map((value) => Maybe.of(value))
2435
- : Resource.Values.fromValue({
2436
- focusResource: $resource,
2437
- propertyPath: PropertyShape.schema.properties.languageIn.path,
2438
- value: Maybe.empty(),
2439
- })),
2440
- }),
2441
- maxExclusive: $shaclPropertyFromRdf({
2442
- graph: _$options.graph,
2443
- resource: $resource,
2444
- propertySchema: NodeShape.schema.properties.maxExclusive,
2445
- typeFromRdf: (resourceValues) => resourceValues
2446
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2447
- .chain((values) => values.chainMap((value) => value.toLiteral()))
2448
- .map((values) => values.length > 0
2449
- ? values.map((value) => Maybe.of(value))
2450
- : Resource.Values.fromValue({
2451
- focusResource: $resource,
2452
- propertyPath: PropertyShape.schema.properties.maxExclusive.path,
2453
- value: Maybe.empty(),
2454
- })),
2455
- }),
2456
- maxInclusive: $shaclPropertyFromRdf({
2457
- graph: _$options.graph,
2458
- resource: $resource,
2459
- propertySchema: NodeShape.schema.properties.maxInclusive,
2460
- typeFromRdf: (resourceValues) => resourceValues
2461
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2462
- .chain((values) => values.chainMap((value) => value.toLiteral()))
2463
- .map((values) => values.length > 0
2464
- ? values.map((value) => Maybe.of(value))
2465
- : Resource.Values.fromValue({
2466
- focusResource: $resource,
2467
- propertyPath: PropertyShape.schema.properties.maxInclusive.path,
2468
- value: Maybe.empty(),
2469
- })),
2470
- }),
2471
- maxLength: $shaclPropertyFromRdf({
2472
- graph: _$options.graph,
2473
- resource: $resource,
2474
- propertySchema: NodeShape.schema.properties.maxLength,
2475
- typeFromRdf: (resourceValues) => resourceValues
2476
- .chain((values) => values.chainMap((value) => value.toBigInt()))
2477
- .map((values) => values.length > 0
2478
- ? values.map((value) => Maybe.of(value))
2479
- : Resource.Values.fromValue({
2480
- focusResource: $resource,
2481
- propertyPath: PropertyShape.schema.properties.maxLength.path,
2482
- value: Maybe.empty(),
2483
- })),
2484
- }),
2485
- message: $shaclPropertyFromRdf({
2486
- graph: _$options.graph,
2487
- resource: $resource,
2488
- propertySchema: NodeShape.schema.properties.message,
2489
- typeFromRdf: (resourceValues) => resourceValues
2490
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2491
- .chain((values) => values.chainMap((value) => value.toString()))
2492
- .map((values) => values.length > 0
2493
- ? values.map((value) => Maybe.of(value))
2494
- : Resource.Values.fromValue({
2495
- focusResource: $resource,
2496
- propertyPath: PropertyShape.schema.properties.message.path,
2497
- value: Maybe.empty(),
2498
- })),
2499
- }),
2500
- minExclusive: $shaclPropertyFromRdf({
2501
- graph: _$options.graph,
2502
- resource: $resource,
2503
- propertySchema: NodeShape.schema.properties.minExclusive,
2504
- typeFromRdf: (resourceValues) => resourceValues
2505
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2506
- .chain((values) => values.chainMap((value) => value.toLiteral()))
2507
- .map((values) => values.length > 0
2508
- ? values.map((value) => Maybe.of(value))
2509
- : Resource.Values.fromValue({
2510
- focusResource: $resource,
2511
- propertyPath: PropertyShape.schema.properties.minExclusive.path,
2512
- value: Maybe.empty(),
2513
- })),
2514
- }),
2515
- minInclusive: $shaclPropertyFromRdf({
2516
- graph: _$options.graph,
2517
- resource: $resource,
2518
- propertySchema: NodeShape.schema.properties.minInclusive,
2519
- typeFromRdf: (resourceValues) => resourceValues
2520
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2521
- .chain((values) => values.chainMap((value) => value.toLiteral()))
2522
- .map((values) => values.length > 0
2523
- ? values.map((value) => Maybe.of(value))
2524
- : Resource.Values.fromValue({
2525
- focusResource: $resource,
2526
- propertyPath: PropertyShape.schema.properties.minInclusive.path,
2527
- value: Maybe.empty(),
2528
- })),
2529
- }),
2530
- minLength: $shaclPropertyFromRdf({
2531
- graph: _$options.graph,
2532
- resource: $resource,
2533
- propertySchema: NodeShape.schema.properties.minLength,
2534
- typeFromRdf: (resourceValues) => resourceValues
2535
- .chain((values) => values.chainMap((value) => value.toBigInt()))
2536
- .map((values) => values.length > 0
2537
- ? values.map((value) => Maybe.of(value))
2538
- : Resource.Values.fromValue({
2539
- focusResource: $resource,
2540
- propertyPath: PropertyShape.schema.properties.minLength.path,
2541
- value: Maybe.empty(),
2542
- })),
2543
- }),
2544
- mutable: $shaclPropertyFromRdf({
2545
- graph: _$options.graph,
2546
- resource: $resource,
2547
- propertySchema: NodeShape.schema.properties.mutable,
2548
- typeFromRdf: (resourceValues) => resourceValues
2549
- .chain((values) => values.chainMap((value) => value.toBoolean()))
2550
- .map((values) => values.length > 0
2551
- ? values.map((value) => Maybe.of(value))
2552
- : Resource.Values.fromValue({
2553
- focusResource: $resource,
2554
- propertyPath: PropertyShape.schema.properties.mutable.path,
2555
- value: Maybe.empty(),
2556
- })),
2557
- }),
2558
- node: $shaclPropertyFromRdf({
2559
- graph: _$options.graph,
2560
- resource: $resource,
2561
- propertySchema: NodeShape.schema.properties.node,
2562
- typeFromRdf: (resourceValues) => resourceValues
2563
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2564
- .map((values) => values.length > 0
2565
- ? values.map((value) => Maybe.of(value))
2566
- : Resource.Values.fromValue({
2567
- focusResource: $resource,
2568
- propertyPath: PropertyShape.schema.properties.node.path,
2569
- value: Maybe.empty(),
2570
- })),
2571
- }),
2572
- nodeKind: $shaclPropertyFromRdf({
2573
- graph: _$options.graph,
2574
- resource: $resource,
2575
- propertySchema: NodeShape.schema.properties.nodeKind,
2576
- typeFromRdf: (resourceValues) => resourceValues
2577
- .chain((values) => values.chainMap((value) => value.toIri([
2578
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
2579
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
2580
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
2581
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
2582
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
2583
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
2584
- ])))
2585
- .map((values) => values.length > 0
2586
- ? values.map((value) => Maybe.of(value))
2587
- : Resource.Values.fromValue({
2588
- focusResource: $resource,
2589
- propertyPath: PropertyShape.schema.properties.nodeKind.path,
2590
- value: Maybe.empty(),
2591
- })),
2592
- }),
2593
- not: $shaclPropertyFromRdf({
2594
- graph: _$options.graph,
2595
- resource: $resource,
2596
- propertySchema: NodeShape.schema.properties.not,
2597
- typeFromRdf: (resourceValues) => resourceValues
2598
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2599
- .map((values) => values.toArray())
2600
- .map((valuesArray) => Resource.Values.fromValue({
2601
- focusResource: $resource,
2602
- propertyPath: PropertyShape.schema.properties.not.path,
2603
- value: valuesArray,
2604
- })),
2605
- }),
2606
- or: $shaclPropertyFromRdf({
2607
- graph: _$options.graph,
2608
- resource: $resource,
2609
- propertySchema: NodeShape.schema.properties.or,
2610
- typeFromRdf: (resourceValues) => resourceValues
2611
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2612
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2613
- focusResource: $resource,
2614
- propertyPath: PropertyShape.schema.properties.or.path,
2615
- values: valueList.toArray(),
2616
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
2617
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2618
- .map((values) => values.length > 0
2619
- ? values.map((value) => Maybe.of(value))
2620
- : Resource.Values.fromValue({
2621
- focusResource: $resource,
2622
- propertyPath: PropertyShape.schema.properties.or.path,
2623
- value: Maybe.empty(),
2624
- })),
2625
- }),
2626
- pattern: $shaclPropertyFromRdf({
2627
- graph: _$options.graph,
2628
- resource: $resource,
2629
- propertySchema: NodeShape.schema.properties.pattern,
2630
- typeFromRdf: (resourceValues) => resourceValues
2631
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2632
- .chain((values) => values.chainMap((value) => value.toString()))
2633
- .map((values) => values.length > 0
2634
- ? values.map((value) => Maybe.of(value))
2635
- : Resource.Values.fromValue({
2636
- focusResource: $resource,
2637
- propertyPath: PropertyShape.schema.properties.pattern.path,
2638
- value: Maybe.empty(),
2639
- })),
2640
- }),
2641
- properties: $shaclPropertyFromRdf({
2642
- graph: _$options.graph,
2643
- resource: $resource,
2644
- propertySchema: NodeShape.schema.properties.properties,
2645
- typeFromRdf: (resourceValues) => resourceValues
2646
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2647
- .map((values) => values.toArray())
2648
- .map((valuesArray) => Resource.Values.fromValue({
2649
- focusResource: $resource,
2650
- propertyPath: NodeShape.schema.properties.properties.path,
2651
- value: valuesArray,
2652
- })),
2653
- }),
2654
- rdfType: $shaclPropertyFromRdf({
2655
- graph: _$options.graph,
2656
- resource: $resource,
2657
- propertySchema: NodeShape.schema.properties.rdfType,
2658
- typeFromRdf: (resourceValues) => resourceValues
2659
- .chain((values) => values.chainMap((value) => value.toIri()))
2660
- .map((values) => values.length > 0
2661
- ? values.map((value) => Maybe.of(value))
2662
- : Resource.Values.fromValue({
2663
- focusResource: $resource,
2664
- propertyPath: NodeShape.schema.properties.rdfType.path,
2665
- value: Maybe.empty(),
2666
- })),
2667
- }),
2668
- severity: $shaclPropertyFromRdf({
2669
- graph: _$options.graph,
2670
- resource: $resource,
2671
- propertySchema: NodeShape.schema.properties.severity,
2672
- typeFromRdf: (resourceValues) => resourceValues
2673
- .chain((values) => values.chainMap((value) => value.toIri([
2674
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
2675
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
2676
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
2677
- ])))
2678
- .map((values) => values.length > 0
2679
- ? values.map((value) => Maybe.of(value))
2680
- : Resource.Values.fromValue({
2681
- focusResource: $resource,
2682
- propertyPath: PropertyShape.schema.properties.severity.path,
2683
- value: Maybe.empty(),
2684
- })),
2685
- }),
2686
- shaclmateName: $shaclPropertyFromRdf({
2687
- graph: _$options.graph,
2688
- resource: $resource,
2689
- propertySchema: NodeShape.schema.properties.shaclmateName,
2690
- typeFromRdf: (resourceValues) => resourceValues
2691
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2692
- .chain((values) => values.chainMap((value) => value.toString()))
2693
- .map((values) => values.length > 0
2694
- ? values.map((value) => Maybe.of(value))
2695
- : Resource.Values.fromValue({
2696
- focusResource: $resource,
2697
- propertyPath: PropertyShape.schema.properties.shaclmateName.path,
2698
- value: Maybe.empty(),
2699
- })),
2700
- }),
2701
- subClassOf: $shaclPropertyFromRdf({
2702
- graph: _$options.graph,
2703
- resource: $resource,
2704
- propertySchema: NodeShape.schema.properties.subClassOf,
2705
- typeFromRdf: (resourceValues) => resourceValues
2706
- .chain((values) => values.chainMap((value) => value.toIri()))
2707
- .map((values) => values.toArray())
2708
- .map((valuesArray) => Resource.Values.fromValue({
2709
- focusResource: $resource,
2710
- propertyPath: NodeShape.schema.properties.subClassOf.path,
2711
- value: valuesArray,
2712
- })),
2713
- }),
2714
- targetClasses: $shaclPropertyFromRdf({
2715
- graph: _$options.graph,
2716
- resource: $resource,
2717
- propertySchema: NodeShape.schema.properties.targetClasses,
2718
- typeFromRdf: (resourceValues) => resourceValues
2719
- .chain((values) => values.chainMap((value) => value.toIri()))
2720
- .map((values) => values.toArray())
2721
- .map((valuesArray) => Resource.Values.fromValue({
2722
- focusResource: $resource,
2723
- propertyPath: PropertyShape.schema.properties.targetClasses.path,
2724
- value: valuesArray,
2725
- })),
2726
- }),
2727
- targetNodes: $shaclPropertyFromRdf({
2728
- graph: _$options.graph,
2729
- resource: $resource,
2730
- propertySchema: NodeShape.schema.properties.targetNodes,
2731
- typeFromRdf: (resourceValues) => resourceValues
2732
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
2733
- switch (term.termType) {
2734
- case "NamedNode":
2735
- case "Literal":
2736
- return Either.of(term);
2737
- default:
2738
- return Left(new Resource.MistypedTermValueError({
2739
- actualValue: term,
2740
- expectedValueType: "(NamedNode | Literal)",
2741
- focusResource: $resource,
2742
- propertyPath: PropertyShape.schema.properties.targetNodes.path,
2743
- }));
2744
- }
2745
- })))
2746
- .map((values) => values.toArray())
2747
- .map((valuesArray) => Resource.Values.fromValue({
2748
- focusResource: $resource,
2749
- propertyPath: PropertyShape.schema.properties.targetNodes.path,
2750
- value: valuesArray,
2751
- })),
2752
- }),
2753
- targetObjectsOf: $shaclPropertyFromRdf({
2754
- graph: _$options.graph,
2755
- resource: $resource,
2756
- propertySchema: NodeShape.schema.properties.targetObjectsOf,
2757
- typeFromRdf: (resourceValues) => resourceValues
2758
- .chain((values) => values.chainMap((value) => value.toIri()))
2759
- .map((values) => values.toArray())
2760
- .map((valuesArray) => Resource.Values.fromValue({
2761
- focusResource: $resource,
2762
- propertyPath: PropertyShape.schema.properties.targetObjectsOf.path,
2763
- value: valuesArray,
2764
- })),
2765
- }),
2766
- targetSubjectsOf: $shaclPropertyFromRdf({
2767
- graph: _$options.graph,
2768
- resource: $resource,
2769
- propertySchema: NodeShape.schema.properties.targetSubjectsOf,
2770
- typeFromRdf: (resourceValues) => resourceValues
2771
- .chain((values) => values.chainMap((value) => value.toIri()))
2772
- .map((values) => values.toArray())
2773
- .map((valuesArray) => Resource.Values.fromValue({
2774
- focusResource: $resource,
2775
- propertyPath: PropertyShape.schema.properties.targetSubjectsOf.path,
2776
- value: valuesArray,
2777
- })),
2778
- }),
2779
- toRdfTypes: $shaclPropertyFromRdf({
2780
- graph: _$options.graph,
2781
- resource: $resource,
2782
- propertySchema: NodeShape.schema.properties.toRdfTypes,
2783
- typeFromRdf: (resourceValues) => resourceValues
2784
- .chain((values) => values.chainMap((value) => value.toIri()))
2785
- .map((values) => values.toArray())
2786
- .map((valuesArray) => Resource.Values.fromValue({
2787
- focusResource: $resource,
2788
- propertyPath: NodeShape.schema.properties.toRdfTypes.path,
2789
- value: valuesArray,
2790
- })),
2791
- }),
2792
- tsImports: $shaclPropertyFromRdf({
2793
- graph: _$options.graph,
2794
- resource: $resource,
2795
- propertySchema: NodeShape.schema.properties.tsImports,
2796
- typeFromRdf: (resourceValues) => resourceValues
2797
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2798
- .chain((values) => values.chainMap((value) => value.toString()))
2799
- .map((values) => values.toArray())
2800
- .map((valuesArray) => Resource.Values.fromValue({
2801
- focusResource: $resource,
2802
- propertyPath: NodeShape.schema.properties.tsImports.path,
2803
- value: valuesArray,
2804
- })),
2805
- }),
2806
- types: $shaclPropertyFromRdf({
2807
- graph: _$options.graph,
2808
- resource: $resource,
2809
- propertySchema: NodeShape.schema.properties.types,
2810
- typeFromRdf: (resourceValues) => resourceValues
2811
- .chain((values) => values.chainMap((value) => value.toIri()))
2812
- .map((values) => values.toArray())
2813
- .map((valuesArray) => Resource.Values.fromValue({
2814
- focusResource: $resource,
2815
- propertyPath: NodeShape.schema.properties.types.path,
2816
- value: valuesArray,
2817
- })),
2818
- }),
2819
- xone: $shaclPropertyFromRdf({
2820
- graph: _$options.graph,
2821
- resource: $resource,
2822
- propertySchema: NodeShape.schema.properties.xone,
2823
- typeFromRdf: (resourceValues) => resourceValues
2824
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2825
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2826
- focusResource: $resource,
2827
- propertyPath: PropertyShape.schema.properties.xone.path,
2828
- values: valueList.toArray(),
2829
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
2830
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2831
- .map((values) => values.length > 0
2832
- ? values.map((value) => Maybe.of(value))
2833
- : Resource.Values.fromValue({
2834
- focusResource: $resource,
2835
- propertyPath: PropertyShape.schema.properties.xone.path,
2836
- value: Maybe.empty(),
2837
- })),
2838
- }),
2839
- }).chain((properties) => create(properties)));
2840
- };
2841
- NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
2842
- NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
2843
- .toResource()
2844
- .chain((resource) => NodeShape.fromRdfResource(resource, options))));
2845
- NodeShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
2846
- function isNodeShape(object) {
2847
- switch (object.$type) {
2848
- case "NodeShape":
2849
- return true;
2850
- default:
2851
- return false;
2852
- }
2219
+ })(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
2220
+ function isPropertyShape(object) {
2221
+ return object.$type === "PropertyShape";
2853
2222
  }
2854
- NodeShape.isNodeShape = isNodeShape;
2855
- NodeShape.schema = {
2223
+ PropertyShape.isPropertyShape = isPropertyShape;
2224
+ PropertyShape.schema = {
2225
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"),
2856
2226
  properties: {
2857
2227
  $identifier: {
2858
2228
  kind: "Identifier",
@@ -2874,14 +2244,6 @@ export var NodeShape;
2874
2244
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
2875
2245
  type: { kind: "Set", itemType: { kind: "Iri" } },
2876
2246
  },
2877
- closed: {
2878
- kind: "Shacl",
2879
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
2880
- type: {
2881
- kind: "Option",
2882
- itemType: { kind: "Boolean" },
2883
- },
2884
- },
2885
2247
  comment: {
2886
2248
  kind: "Shacl",
2887
2249
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
@@ -2903,22 +2265,41 @@ export var NodeShape;
2903
2265
  itemType: { kind: "Boolean" },
2904
2266
  },
2905
2267
  },
2906
- discriminantValue: {
2268
+ defaultValue: {
2907
2269
  kind: "Shacl",
2908
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"),
2270
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
2909
2271
  type: {
2910
2272
  kind: "Option",
2911
- itemType: { kind: "String" },
2273
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2912
2274
  },
2913
2275
  },
2914
- extern: {
2276
+ description: {
2915
2277
  kind: "Shacl",
2916
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#extern"),
2278
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
2917
2279
  type: {
2918
2280
  kind: "Option",
2281
+ itemType: { kind: "String" },
2282
+ },
2283
+ },
2284
+ disjoint: {
2285
+ kind: "Shacl",
2286
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#disjoint"),
2287
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2288
+ },
2289
+ display: {
2290
+ kind: "Shacl",
2291
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"),
2292
+ type: {
2293
+ kind: "DefaultValue",
2919
2294
  itemType: { kind: "Boolean" },
2295
+ defaultValue: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
2920
2296
  },
2921
2297
  },
2298
+ equals: {
2299
+ kind: "Shacl",
2300
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#equals"),
2301
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2302
+ },
2922
2303
  flags: {
2923
2304
  kind: "Shacl",
2924
2305
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
@@ -2927,25 +2308,29 @@ export var NodeShape;
2927
2308
  itemType: { kind: "String" },
2928
2309
  },
2929
2310
  },
2930
- fromRdfType: {
2311
+ groups: {
2931
2312
  kind: "Shacl",
2932
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#fromRdfType"),
2933
- type: { kind: "Option", itemType: { kind: "Iri" } },
2313
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
2314
+ type: {
2315
+ kind: "Set",
2316
+ itemType: { kind: "Identifier" },
2317
+ },
2934
2318
  },
2935
2319
  hasValues: {
2936
2320
  kind: "Shacl",
2937
2321
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
2938
- type: { kind: "Set", itemType: { kind: "Term" } },
2322
+ type: {
2323
+ kind: "Set",
2324
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2325
+ },
2939
2326
  },
2940
- ignoredProperties: {
2327
+ ignore: {
2941
2328
  kind: "Shacl",
2942
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
2329
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#ignore"),
2943
2330
  type: {
2944
- kind: "Option",
2945
- itemType: {
2946
- kind: "List",
2947
- itemType: { kind: "Iri" },
2948
- },
2331
+ kind: "DefaultValue",
2332
+ itemType: { kind: "Boolean" },
2333
+ defaultValue: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
2949
2334
  },
2950
2335
  },
2951
2336
  in_: {
@@ -2955,7 +2340,10 @@ export var NodeShape;
2955
2340
  kind: "Option",
2956
2341
  itemType: {
2957
2342
  kind: "List",
2958
- itemType: { kind: "Term" },
2343
+ itemType: {
2344
+ kind: "Term",
2345
+ types: ["NamedNode", "Literal"],
2346
+ },
2959
2347
  },
2960
2348
  },
2961
2349
  },
@@ -2986,6 +2374,24 @@ export var NodeShape;
2986
2374
  },
2987
2375
  },
2988
2376
  },
2377
+ lessThan: {
2378
+ kind: "Shacl",
2379
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThan"),
2380
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2381
+ },
2382
+ lessThanOrEquals: {
2383
+ kind: "Shacl",
2384
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThanOrEquals"),
2385
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2386
+ },
2387
+ maxCount: {
2388
+ kind: "Shacl",
2389
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
2390
+ type: {
2391
+ kind: "Option",
2392
+ itemType: { kind: "BigInt" },
2393
+ },
2394
+ },
2989
2395
  maxExclusive: {
2990
2396
  kind: "Shacl",
2991
2397
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
@@ -3018,6 +2424,14 @@ export var NodeShape;
3018
2424
  itemType: { kind: "String" },
3019
2425
  },
3020
2426
  },
2427
+ minCount: {
2428
+ kind: "Shacl",
2429
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
2430
+ type: {
2431
+ kind: "Option",
2432
+ itemType: { kind: "BigInt" },
2433
+ },
2434
+ },
3021
2435
  minExclusive: {
3022
2436
  kind: "Shacl",
3023
2437
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
@@ -3050,6 +2464,14 @@ export var NodeShape;
3050
2464
  itemType: { kind: "Boolean" },
3051
2465
  },
3052
2466
  },
2467
+ name: {
2468
+ kind: "Shacl",
2469
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
2470
+ type: {
2471
+ kind: "Option",
2472
+ itemType: { kind: "String" },
2473
+ },
2474
+ },
3053
2475
  node: {
3054
2476
  kind: "Shacl",
3055
2477
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
@@ -3095,6 +2517,18 @@ export var NodeShape;
3095
2517
  },
3096
2518
  },
3097
2519
  },
2520
+ order: {
2521
+ kind: "Shacl",
2522
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
2523
+ type: { kind: "Option", itemType: { kind: "Float" } },
2524
+ },
2525
+ path: {
2526
+ kind: "Shacl",
2527
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
2528
+ get type() {
2529
+ return $PropertyPath.schema;
2530
+ },
2531
+ },
3098
2532
  pattern: {
3099
2533
  kind: "Shacl",
3100
2534
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
@@ -3103,18 +2537,45 @@ export var NodeShape;
3103
2537
  itemType: { kind: "String" },
3104
2538
  },
3105
2539
  },
3106
- properties: {
2540
+ qualifiedMaxCount: {
3107
2541
  kind: "Shacl",
3108
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
2542
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMaxCount"),
3109
2543
  type: {
3110
- kind: "Set",
2544
+ kind: "Option",
2545
+ itemType: { kind: "BigInt" },
2546
+ },
2547
+ },
2548
+ qualifiedMinCount: {
2549
+ kind: "Shacl",
2550
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMinCount"),
2551
+ type: {
2552
+ kind: "Option",
2553
+ itemType: { kind: "BigInt" },
2554
+ },
2555
+ },
2556
+ qualifiedValueShape: {
2557
+ kind: "Shacl",
2558
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShape"),
2559
+ type: {
2560
+ kind: "Option",
3111
2561
  itemType: { kind: "Identifier" },
3112
2562
  },
3113
2563
  },
3114
- rdfType: {
2564
+ qualifiedValueShapesDisjoint: {
3115
2565
  kind: "Shacl",
3116
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#rdfType"),
3117
- type: { kind: "Option", itemType: { kind: "Iri" } },
2566
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShapesDisjoint"),
2567
+ type: {
2568
+ kind: "Option",
2569
+ itemType: { kind: "Boolean" },
2570
+ },
2571
+ },
2572
+ resolve: {
2573
+ kind: "Shacl",
2574
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#resolve"),
2575
+ type: {
2576
+ kind: "Option",
2577
+ itemType: { kind: "Identifier" },
2578
+ },
3118
2579
  },
3119
2580
  severity: {
3120
2581
  kind: "Shacl",
@@ -3139,11 +2600,6 @@ export var NodeShape;
3139
2600
  itemType: { kind: "String" },
3140
2601
  },
3141
2602
  },
3142
- subClassOf: {
3143
- kind: "Shacl",
3144
- path: $RdfVocabularies.rdfs.subClassOf,
3145
- type: { kind: "Set", itemType: { kind: "Iri" } },
3146
- },
3147
2603
  targetClasses: {
3148
2604
  kind: "Shacl",
3149
2605
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
@@ -3152,7 +2608,10 @@ export var NodeShape;
3152
2608
  targetNodes: {
3153
2609
  kind: "Shacl",
3154
2610
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
3155
- type: { kind: "Set", itemType: { kind: "Term" } },
2611
+ type: {
2612
+ kind: "Set",
2613
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2614
+ },
3156
2615
  },
3157
2616
  targetObjectsOf: {
3158
2617
  kind: "Shacl",
@@ -3164,20 +2623,13 @@ export var NodeShape;
3164
2623
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
3165
2624
  type: { kind: "Set", itemType: { kind: "Iri" } },
3166
2625
  },
3167
- toRdfTypes: {
3168
- kind: "Shacl",
3169
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#toRdfType"),
3170
- type: { kind: "Set", itemType: { kind: "Iri" } },
3171
- },
3172
- tsImports: {
3173
- kind: "Shacl",
3174
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"),
3175
- type: { kind: "Set", itemType: { kind: "String" } },
3176
- },
3177
- types: {
2626
+ uniqueLang: {
3178
2627
  kind: "Shacl",
3179
- path: $RdfVocabularies.rdf.type,
3180
- type: { kind: "Set", itemType: { kind: "Iri" } },
2628
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
2629
+ type: {
2630
+ kind: "Option",
2631
+ itemType: { kind: "Boolean" },
2632
+ },
3181
2633
  },
3182
2634
  xone: {
3183
2635
  kind: "Shacl",
@@ -3192,11 +2644,11 @@ export var NodeShape;
3192
2644
  },
3193
2645
  },
3194
2646
  };
3195
- NodeShape._toRdfResource = (parameters) => {
2647
+ PropertyShape._toRdfResource = (parameters) => {
3196
2648
  if (!parameters.ignoreRdfType) {
3197
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), parameters.graph);
2649
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), parameters.graph);
3198
2650
  }
3199
- parameters.resource.add(PropertyShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
2651
+ parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
3200
2652
  value.length > 0
3201
2653
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
3202
2654
  if (itemIndex === 0) {
@@ -3218,57 +2670,38 @@ export var NodeShape;
3218
2670
  }).listResource.identifier
3219
2671
  : $RdfVocabularies.rdf.nil,
3220
2672
  ]), parameters.graph);
3221
- parameters.resource.add(PropertyShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
3222
- parameters.resource.add(NodeShape.schema.properties.closed.path, parameters.object.closed
3223
- .toList()
3224
- .flatMap((value) => [
3225
- $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
3226
- ]), parameters.graph);
3227
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
2673
+ parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
2674
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
3228
2675
  .toList()
3229
2676
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
3230
- parameters.resource.add(PropertyShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
3231
- parameters.resource.add(PropertyShape.schema.properties.deactivated.path, parameters.object.deactivated
2677
+ parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
2678
+ parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
3232
2679
  .toList()
3233
2680
  .flatMap((value) => [
3234
2681
  $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
3235
2682
  ]), parameters.graph);
3236
- parameters.resource.add(NodeShape.schema.properties.discriminantValue.path, parameters.object.discriminantValue
2683
+ parameters.resource.add(PropertyShape.schema.properties.defaultValue.path, parameters.object.defaultValue.toList(), parameters.graph);
2684
+ parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
3237
2685
  .toList()
3238
2686
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
3239
- parameters.resource.add(NodeShape.schema.properties.extern.path, parameters.object.extern
3240
- .toList()
3241
- .flatMap((value) => [
3242
- $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
3243
- ]), parameters.graph);
3244
- parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags
2687
+ parameters.resource.add(PropertyShape.schema.properties.disjoint.path, parameters.object.disjoint.flatMap((item) => [item]), parameters.graph);
2688
+ parameters.resource.add(PropertyShape.schema.properties.display.path, $strictEquals(parameters.object.display, false).isLeft()
2689
+ ? [
2690
+ $literalFactory.boolean(parameters.object.display, $RdfVocabularies.xsd.boolean),
2691
+ ]
2692
+ : [], parameters.graph);
2693
+ parameters.resource.add(PropertyShape.schema.properties.equals.path, parameters.object.equals.flatMap((item) => [item]), parameters.graph);
2694
+ parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
3245
2695
  .toList()
3246
2696
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
3247
- parameters.resource.add(NodeShape.schema.properties.fromRdfType.path, parameters.object.fromRdfType.toList(), parameters.graph);
3248
- parameters.resource.add(PropertyShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
3249
- parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
3250
- value.length > 0
3251
- ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
3252
- if (itemIndex === 0) {
3253
- currentSubListResource = listResource;
3254
- }
3255
- else {
3256
- const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
3257
- currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
3258
- currentSubListResource = newSubListResource;
3259
- }
3260
- currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
3261
- if (itemIndex + 1 === list.length) {
3262
- currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
3263
- }
3264
- return { currentSubListResource, listResource };
3265
- }, {
3266
- currentSubListResource: null,
3267
- listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
3268
- }).listResource.identifier
3269
- : $RdfVocabularies.rdf.nil,
3270
- ]), parameters.graph);
3271
- parameters.resource.add(PropertyShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
2697
+ parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
2698
+ parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
2699
+ parameters.resource.add(PropertyShape.schema.properties.ignore.path, $strictEquals(parameters.object.ignore, false).isLeft()
2700
+ ? [
2701
+ $literalFactory.boolean(parameters.object.ignore, $RdfVocabularies.xsd.boolean),
2702
+ ]
2703
+ : [], parameters.graph);
2704
+ parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
3272
2705
  value.length > 0
3273
2706
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
3274
2707
  if (itemIndex === 0) {
@@ -3290,11 +2723,11 @@ export var NodeShape;
3290
2723
  }).listResource.identifier
3291
2724
  : $RdfVocabularies.rdf.nil,
3292
2725
  ]), parameters.graph);
3293
- parameters.resource.add(PropertyShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
3294
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
2726
+ parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
2727
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
3295
2728
  .toList()
3296
2729
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
3297
- parameters.resource.add(PropertyShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
2730
+ parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
3298
2731
  value.length > 0
3299
2732
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
3300
2733
  if (itemIndex === 0) {
@@ -3316,32 +2749,47 @@ export var NodeShape;
3316
2749
  }).listResource.identifier
3317
2750
  : $RdfVocabularies.rdf.nil,
3318
2751
  ]), parameters.graph);
3319
- parameters.resource.add(PropertyShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
3320
- parameters.resource.add(PropertyShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
3321
- parameters.resource.add(PropertyShape.schema.properties.maxLength.path, parameters.object.maxLength
2752
+ parameters.resource.add(PropertyShape.schema.properties.lessThan.path, parameters.object.lessThan.flatMap((item) => [item]), parameters.graph);
2753
+ parameters.resource.add(PropertyShape.schema.properties.lessThanOrEquals.path, parameters.object.lessThanOrEquals.flatMap((item) => [item]), parameters.graph);
2754
+ parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
2755
+ .toList()
2756
+ .flatMap((value) => [
2757
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2758
+ ]), parameters.graph);
2759
+ parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
2760
+ parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
2761
+ parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
3322
2762
  .toList()
3323
2763
  .flatMap((value) => [
3324
2764
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
3325
2765
  ]), parameters.graph);
3326
- parameters.resource.add(PropertyShape.schema.properties.message.path, parameters.object.message
2766
+ parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
3327
2767
  .toList()
3328
2768
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
3329
- parameters.resource.add(PropertyShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
3330
- parameters.resource.add(PropertyShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
3331
- parameters.resource.add(PropertyShape.schema.properties.minLength.path, parameters.object.minLength
2769
+ parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
3332
2770
  .toList()
3333
2771
  .flatMap((value) => [
3334
2772
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
3335
2773
  ]), parameters.graph);
3336
- parameters.resource.add(PropertyShape.schema.properties.mutable.path, parameters.object.mutable
2774
+ parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
2775
+ parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
2776
+ parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
2777
+ .toList()
2778
+ .flatMap((value) => [
2779
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2780
+ ]), parameters.graph);
2781
+ parameters.resource.add(NodeShape.schema.properties.mutable.path, parameters.object.mutable
3337
2782
  .toList()
3338
2783
  .flatMap((value) => [
3339
2784
  $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
3340
2785
  ]), parameters.graph);
3341
- parameters.resource.add(PropertyShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
3342
- parameters.resource.add(PropertyShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
3343
- parameters.resource.add(PropertyShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
3344
- parameters.resource.add(PropertyShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
2786
+ parameters.resource.add(PropertyShape.schema.properties.name.path, parameters.object.name
2787
+ .toList()
2788
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2789
+ parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
2790
+ parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
2791
+ parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
2792
+ parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
3345
2793
  value.length > 0
3346
2794
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
3347
2795
  if (itemIndex === 0) {
@@ -3363,26 +2811,51 @@ export var NodeShape;
3363
2811
  }).listResource.identifier
3364
2812
  : $RdfVocabularies.rdf.nil,
3365
2813
  ]), parameters.graph);
3366
- parameters.resource.add(PropertyShape.schema.properties.pattern.path, parameters.object.pattern
2814
+ parameters.resource.add(PropertyShape.schema.properties.order.path, parameters.object.order
2815
+ .toList()
2816
+ .flatMap((value) => [
2817
+ $literalFactory.number(value, $RdfVocabularies.xsd.double),
2818
+ ]), parameters.graph);
2819
+ parameters.resource.add(PropertyShape.schema.properties.path.path, [
2820
+ $PropertyPath.toRdfResource(parameters.object.path, {
2821
+ graph: parameters.graph,
2822
+ resourceSet: parameters.resourceSet,
2823
+ }).identifier,
2824
+ ], parameters.graph);
2825
+ parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
3367
2826
  .toList()
3368
2827
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
3369
- parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
3370
- parameters.resource.add(NodeShape.schema.properties.rdfType.path, parameters.object.rdfType.toList(), parameters.graph);
3371
- parameters.resource.add(PropertyShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
3372
- parameters.resource.add(PropertyShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
2828
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedMaxCount.path, parameters.object.qualifiedMaxCount
2829
+ .toList()
2830
+ .flatMap((value) => [
2831
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2832
+ ]), parameters.graph);
2833
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedMinCount.path, parameters.object.qualifiedMinCount
2834
+ .toList()
2835
+ .flatMap((value) => [
2836
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2837
+ ]), parameters.graph);
2838
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShape.path, parameters.object.qualifiedValueShape.toList(), parameters.graph);
2839
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.path, parameters.object.qualifiedValueShapesDisjoint
2840
+ .toList()
2841
+ .flatMap((value) => [
2842
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
2843
+ ]), parameters.graph);
2844
+ parameters.resource.add(PropertyShape.schema.properties.resolve.path, parameters.object.resolve.toList(), parameters.graph);
2845
+ parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
2846
+ parameters.resource.add(NodeShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
3373
2847
  .toList()
3374
2848
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
3375
- parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
3376
- parameters.resource.add(PropertyShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
3377
- parameters.resource.add(PropertyShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
3378
- parameters.resource.add(PropertyShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
3379
- parameters.resource.add(PropertyShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
3380
- parameters.resource.add(NodeShape.schema.properties.toRdfTypes.path, parameters.object.toRdfTypes.flatMap((item) => [item]), parameters.graph);
3381
- parameters.resource.add(NodeShape.schema.properties.tsImports.path, parameters.object.tsImports.flatMap((item) => [
3382
- $literalFactory.string(item),
2849
+ parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
2850
+ parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
2851
+ parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
2852
+ parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
2853
+ parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
2854
+ .toList()
2855
+ .flatMap((value) => [
2856
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
3383
2857
  ]), parameters.graph);
3384
- parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
3385
- parameters.resource.add(PropertyShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
2858
+ parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
3386
2859
  value.length > 0
3387
2860
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
3388
2861
  if (itemIndex === 0) {
@@ -3406,22 +2879,18 @@ export var NodeShape;
3406
2879
  ]), parameters.graph);
3407
2880
  return parameters.resource;
3408
2881
  };
3409
- NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
3410
- function _propertiesToStrings(_nodeShape) {
3411
- return $compactRecord({
3412
- $identifier: _nodeShape.$identifier().toString(),
3413
- label: _nodeShape.label.map((item) => item.toString()).extract(),
3414
- shaclmateName: _nodeShape.shaclmateName
3415
- .map((item) => item.toString())
3416
- .extract(),
3417
- });
3418
- }
3419
- NodeShape._propertiesToStrings = _propertiesToStrings;
3420
- function $toString(_nodeShape) {
3421
- return `NodeShape(${JSON.stringify(_propertiesToStrings(_nodeShape))})`;
3422
- }
3423
- NodeShape.$toString = $toString;
3424
- })(NodeShape || (NodeShape = {}));
2882
+ PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
2883
+ PropertyShape.$toString = (_propertyShape) => `PropertyShape(${JSON.stringify(PropertyShape.toStringRecord(_propertyShape))})`;
2884
+ PropertyShape.toStringRecord = (_propertyShape) => $compactRecord({
2885
+ $identifier: _propertyShape.$identifier().toString(),
2886
+ label: _propertyShape.label.map((item) => item.toString()).extract(),
2887
+ name: _propertyShape.name.map((item) => item.toString()).extract(),
2888
+ path: $PropertyPath.$toString(_propertyShape.path),
2889
+ shaclmateName: _propertyShape.shaclmateName
2890
+ .map((item) => item.toString())
2891
+ .extract(),
2892
+ });
2893
+ })(PropertyShape || (PropertyShape = {}));
3425
2894
  export var Shape;
3426
2895
  (function (Shape) {
3427
2896
  Shape.$toString = (value) => {
@@ -3440,26 +2909,18 @@ export var Shape;
3440
2909
  ...options,
3441
2910
  ignoreRdfType: false,
3442
2911
  }));
3443
- Shape.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
3444
- const valueAsValues = Right(value.toValues());
2912
+ Shape.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
2913
+ const valueAsValues = value.toValues();
3445
2914
  return NodeShape.fromRdfResourceValues(valueAsValues, {
3446
- context: _options.context,
3447
- graph: _options.graph,
3448
- ignoreRdfType: false,
3449
- preferredLanguages: _options.preferredLanguages,
3450
- propertyPath: _options.propertyPath,
3451
- resource: _options.resource,
2915
+ ...options,
2916
+ schema: options.schema.members["NodeShape"].type,
3452
2917
  })
3453
2918
  .altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
3454
- context: _options.context,
3455
- graph: _options.graph,
3456
- ignoreRdfType: false,
3457
- preferredLanguages: _options.preferredLanguages,
3458
- propertyPath: _options.propertyPath,
3459
- resource: _options.resource,
2919
+ ...options,
2920
+ schema: options.schema.members["PropertyShape"].type,
3460
2921
  }))
3461
2922
  .chain((values) => values.head());
3462
- })));
2923
+ }));
3463
2924
  let Identifier;
3464
2925
  (function (Identifier) {
3465
2926
  Identifier.parse = $parseIdentifier;
@@ -3527,7 +2988,10 @@ export var Shape;
3527
2988
  hasValues: {
3528
2989
  kind: "Shacl",
3529
2990
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
3530
- type: { kind: "Set", itemType: { kind: "Term" } },
2991
+ type: {
2992
+ kind: "Set",
2993
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2994
+ },
3531
2995
  },
3532
2996
  in_: {
3533
2997
  kind: "Shacl",
@@ -3536,7 +3000,10 @@ export var Shape;
3536
3000
  kind: "Option",
3537
3001
  itemType: {
3538
3002
  kind: "List",
3539
- itemType: { kind: "Term" },
3003
+ itemType: {
3004
+ kind: "Term",
3005
+ types: ["NamedNode", "Literal"],
3006
+ },
3540
3007
  },
3541
3008
  },
3542
3009
  },
@@ -3715,7 +3182,10 @@ export var Shape;
3715
3182
  targetNodes: {
3716
3183
  kind: "Shacl",
3717
3184
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
3718
- type: { kind: "Set", itemType: { kind: "Term" } },
3185
+ type: {
3186
+ kind: "Set",
3187
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
3188
+ },
3719
3189
  },
3720
3190
  targetObjectsOf: {
3721
3191
  kind: "Shacl",
@@ -3802,42 +3272,26 @@ export var $Object;
3802
3272
  ...options,
3803
3273
  ignoreRdfType: false,
3804
3274
  }));
3805
- $Object.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
3806
- const valueAsValues = Right(value.toValues());
3275
+ $Object.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
3276
+ const valueAsValues = value.toValues();
3807
3277
  return NodeShape.fromRdfResourceValues(valueAsValues, {
3808
- context: _options.context,
3809
- graph: _options.graph,
3810
- ignoreRdfType: false,
3811
- preferredLanguages: _options.preferredLanguages,
3812
- propertyPath: _options.propertyPath,
3813
- resource: _options.resource,
3278
+ ...options,
3279
+ schema: options.schema.members["NodeShape"].type,
3814
3280
  })
3815
3281
  .altLazy(() => Ontology.fromRdfResourceValues(valueAsValues, {
3816
- context: _options.context,
3817
- graph: _options.graph,
3818
- ignoreRdfType: false,
3819
- preferredLanguages: _options.preferredLanguages,
3820
- propertyPath: _options.propertyPath,
3821
- resource: _options.resource,
3282
+ ...options,
3283
+ schema: options.schema.members["Ontology"].type,
3822
3284
  }))
3823
3285
  .altLazy(() => PropertyGroup.fromRdfResourceValues(valueAsValues, {
3824
- context: _options.context,
3825
- graph: _options.graph,
3826
- ignoreRdfType: false,
3827
- preferredLanguages: _options.preferredLanguages,
3828
- propertyPath: _options.propertyPath,
3829
- resource: _options.resource,
3286
+ ...options,
3287
+ schema: options.schema.members["PropertyGroup"].type,
3830
3288
  }))
3831
3289
  .altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
3832
- context: _options.context,
3833
- graph: _options.graph,
3834
- ignoreRdfType: false,
3835
- preferredLanguages: _options.preferredLanguages,
3836
- propertyPath: _options.propertyPath,
3837
- resource: _options.resource,
3290
+ ...options,
3291
+ schema: options.schema.members["PropertyShape"].type,
3838
3292
  }))
3839
3293
  .chain((values) => values.head());
3840
- })));
3294
+ }));
3841
3295
  let Identifier;
3842
3296
  (function (Identifier) {
3843
3297
  Identifier.parse = $parseIdentifier;