@shaclmate/compiler 4.0.41 → 4.0.43

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