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