@shaclmate/shacl-ast 4.0.40 → 4.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/generated.js CHANGED
@@ -4,6 +4,16 @@ import { LiteralFactory } from "@rdfx/literal";
4
4
  import { PropertyPath as RdfxResourcePropertyPath, Resource, ResourceSet, } from "@rdfx/resource";
5
5
  import { NTriplesIdentifier, NTriplesTerm } from "@rdfx/string";
6
6
  import { Either, Left, Maybe, Right } from "purify-ts";
7
+ function $bigIntFromRdfResourceValues(values, options) {
8
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
9
+ ? value.toBigInt(options.schema.in)
10
+ : value.toBigInt()));
11
+ }
12
+ function $booleanFromRdfResourceValues(values, options) {
13
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
14
+ ? value.toBoolean(options.schema.in)
15
+ : value.toBoolean()));
16
+ }
7
17
  /**
8
18
  * Remove undefined values from a record.
9
19
  */
@@ -15,11 +25,6 @@ function $compactRecord(record) {
15
25
  return definedProperties;
16
26
  }, {});
17
27
  }
18
- function $convertToArray(convertToItem, _readonly) {
19
- return (value) => (typeof value === "undefined"
20
- ? Either.of([])
21
- : Either.sequence(value.map(convertToItem)));
22
- }
23
28
  function $convertToIdentifier(value) {
24
29
  switch (typeof value) {
25
30
  case "object":
@@ -56,6 +61,9 @@ function $convertToIri(value) {
56
61
  return Either.of(dataFactory.namedNode(value));
57
62
  }
58
63
  }
64
+ function $convertToList(convertToItem, _readonly) {
65
+ return (value) => Either.sequence(value.map(convertToItem));
66
+ }
59
67
  function $convertToLiteral(value) {
60
68
  if (typeof value === "object") {
61
69
  if (value instanceof Date) {
@@ -80,6 +88,19 @@ function $convertToMaybe(convertToItem) {
80
88
  return convertToItem(value).map(Maybe.of);
81
89
  };
82
90
  }
91
+ function $convertToScalarSet(convertToItem, _readonly) {
92
+ return (value) => {
93
+ if (typeof value === "undefined") {
94
+ return Either.of([]);
95
+ }
96
+ if (Array.isArray(value)) {
97
+ return Either.sequence(value.map(convertToItem));
98
+ }
99
+ return convertToItem(value).map((value) => [
100
+ value,
101
+ ]);
102
+ };
103
+ }
83
104
  function $ensureRdfResourceType(resource, types, options) {
84
105
  return resource
85
106
  .value($RdfVocabularies.rdf.type, options)
@@ -94,27 +115,13 @@ function $ensureRdfResourceType(resource, types, options) {
94
115
  return Left(new Error(`${resource.identifier} has unexpected RDF type (actual: ${actualRdfType}, expected one of ${types})`));
95
116
  });
96
117
  }
97
- function $fromRdfPreferredLanguages(values, preferredLanguages) {
98
- if (!preferredLanguages || preferredLanguages.length === 0) {
99
- return Right(values);
100
- }
101
- // Return all literals for the first preferredLanguage, then all literals for the second preferredLanguage, etc.
102
- // Within a preferredLanguage the literals may be in any order.
103
- const filteredValues = [];
104
- for (const preferredLanguage of preferredLanguages) {
105
- for (const value of values) {
106
- value.toLiteral().ifRight((literal) => {
107
- if (literal.language === preferredLanguage) {
108
- filteredValues.push(value);
109
- }
110
- });
111
- }
112
- }
113
- return Right(Resource.Values.fromArray({
114
- focusResource: values.focusResource,
115
- propertyPath: values.propertyPath,
116
- values: filteredValues,
117
- }));
118
+ function $floatFromRdfResourceValues(values, options) {
119
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
120
+ ? value.toFloat(options.schema.in)
121
+ : value.toFloat()));
122
+ }
123
+ function $identifierFromRdfResourceValues(values, options) {
124
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toIdentifier()));
118
125
  }
119
126
  function $identityConversionFunction(value) {
120
127
  return Either.of(value);
@@ -122,7 +129,37 @@ function $identityConversionFunction(value) {
122
129
  function $identityValidationFunction(_schema, value) {
123
130
  return Either.of(value);
124
131
  }
132
+ function $iriFromRdfResourceValues(values, options) {
133
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
134
+ ? value.toIri(options.schema.in)
135
+ : value.toIri()));
136
+ }
137
+ function $listFromRdfResourceValues(itemFromRdfResourceValues) {
138
+ return (values, options) => values
139
+ .chainMap((value) => value.toList({ graph: options.graph })) // Resource.Values<Resource.Value> to Resource.Values<Resource.Values>;
140
+ .chain((valueLists) => valueLists.chainMap((valueList) => itemFromRdfResourceValues(Resource.Values.fromArray({
141
+ focusResource: options.focusResource,
142
+ propertyPath: options.propertyPath,
143
+ values: valueList.toArray(),
144
+ }), { ...options, schema: options.schema.itemType }))) // Resource.Values<Resource.Values> to Resource.Values<item type arrays>
145
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray())); // Convert inner Resource.Values to arrays
146
+ }
125
147
  const $literalFactory = new LiteralFactory({ dataFactory: dataFactory });
148
+ function $literalFromRdfResourceValues(values, options) {
149
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toLiteral()));
150
+ }
151
+ function $maybeFromRdfResourceValues(itemFromRdfResourceValues) {
152
+ return (values, options) => itemFromRdfResourceValues(values, {
153
+ ...options,
154
+ schema: options.schema.itemType,
155
+ }).map((values) => values.length > 0
156
+ ? values.map((value) => Maybe.of(value))
157
+ : Resource.Values.fromValue({
158
+ focusResource: options.focusResource,
159
+ propertyPath: options.propertyPath,
160
+ value: Maybe.empty(),
161
+ }));
162
+ }
126
163
  function $monkeyPatchObject(obj, methods) {
127
164
  if (methods.toJson &&
128
165
  (!globalThis.Object.prototype.hasOwnProperty.call(obj, "toJSON") ||
@@ -146,50 +183,47 @@ const $parseIdentifier = NTriplesIdentifier.parser(dataFactory);
146
183
  export var $PropertyPath;
147
184
  (function ($PropertyPath) {
148
185
  $PropertyPath.fromRdfResource = RdfxResourcePropertyPath.fromResource;
149
- $PropertyPath.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
186
+ $PropertyPath.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
150
187
  .toResource()
151
- .chain((resource) => $PropertyPath.fromRdfResource(resource, options))));
188
+ .chain((resource) => $PropertyPath.fromRdfResource(resource, options)));
152
189
  $PropertyPath.schema = {};
153
190
  $PropertyPath.toRdfResource = RdfxResourcePropertyPath.toResource;
154
191
  $PropertyPath.$toString = RdfxResourcePropertyPath.toString;
155
192
  })($PropertyPath || ($PropertyPath = {}));
156
193
  var $RdfVocabularies;
157
194
  (function ($RdfVocabularies) {
158
- let rdf;
159
- (function (rdf) {
160
- rdf.first = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first");
161
- rdf.nil = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil");
162
- rdf.rest = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest");
163
- rdf.subject = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject");
164
- rdf.type = dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
165
- })(rdf = $RdfVocabularies.rdf || ($RdfVocabularies.rdf = {}));
166
- let rdfs;
167
- (function (rdfs) {
168
- rdfs.subClassOf = dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf");
169
- })(rdfs = $RdfVocabularies.rdfs || ($RdfVocabularies.rdfs = {}));
170
- let xsd;
171
- (function (xsd) {
172
- xsd.boolean = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean");
173
- xsd.byte = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#byte");
174
- xsd.date = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#date");
175
- xsd.dateTime = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime");
176
- xsd.decimal = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#decimal");
177
- xsd.double = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#double");
178
- xsd.float = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float");
179
- xsd.int = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#int");
180
- xsd.integer = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#integer");
181
- xsd.long = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#long");
182
- xsd.negativeInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#negativeInteger");
183
- xsd.nonNegativeInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
184
- xsd.nonPositiveInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonPositiveInteger");
185
- xsd.positiveInteger = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#positiveInteger");
186
- xsd.short = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#short");
187
- xsd.string = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#string");
188
- xsd.unsignedByte = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedByte");
189
- xsd.unsignedInt = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedInt");
190
- xsd.unsignedLong = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedLong");
191
- xsd.unsignedShort = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort");
192
- })(xsd = $RdfVocabularies.xsd || ($RdfVocabularies.xsd = {}));
195
+ $RdfVocabularies.rdf = {
196
+ first: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),
197
+ nil: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),
198
+ rest: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),
199
+ subject: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject"),
200
+ type: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
201
+ };
202
+ $RdfVocabularies.rdfs = {
203
+ subClassOf: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
204
+ };
205
+ $RdfVocabularies.xsd = {
206
+ boolean: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
207
+ byte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#byte"),
208
+ date: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#date"),
209
+ dateTime: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),
210
+ decimal: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),
211
+ double: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#double"),
212
+ float: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float"),
213
+ int: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#int"),
214
+ integer: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#integer"),
215
+ long: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#long"),
216
+ negativeInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#negativeInteger"),
217
+ nonNegativeInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonNegativeInteger"),
218
+ nonPositiveInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonPositiveInteger"),
219
+ positiveInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#positiveInteger"),
220
+ short: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#short"),
221
+ string: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#string"),
222
+ unsignedByte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedByte"),
223
+ unsignedInt: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedInt"),
224
+ unsignedLong: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedLong"),
225
+ unsignedShort: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort"),
226
+ };
193
227
  })($RdfVocabularies || ($RdfVocabularies = {}));
194
228
  function $sequenceRecord(record) {
195
229
  const result = {};
@@ -202,9 +236,105 @@ function $sequenceRecord(record) {
202
236
  }
203
237
  return Right(result);
204
238
  }
205
- function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }) {
206
- return typeFromRdf(Right(resource.values(propertySchema.path, { graph, unique: true }))).chain((values) => values.head());
239
+ function $setFromRdfResourceValues(itemFromRdfResourceValues) {
240
+ return (values, options) => itemFromRdfResourceValues(values, {
241
+ ...options,
242
+ schema: options.schema.itemType,
243
+ })
244
+ .map((values) => values.toArray())
245
+ .map((valuesArray) => Resource.Values.fromValue({
246
+ focusResource: options.focusResource,
247
+ propertyPath: options.propertyPath,
248
+ value: valuesArray,
249
+ }));
250
+ }
251
+ function $shaclPropertyFromRdf({ focusResource, graph, propertySchema, typeFromRdfResourceValues, ...otherParameters }) {
252
+ return typeFromRdfResourceValues(focusResource.values(propertySchema.path, { graph, unique: true }), {
253
+ ...otherParameters,
254
+ focusResource,
255
+ graph,
256
+ propertyPath: propertySchema.path,
257
+ schema: propertySchema.type,
258
+ }).chain((values) => values.head());
259
+ }
260
+ function $stringFromRdfResourceValues(values, options) {
261
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
262
+ ? value.toString(options.schema.in)
263
+ : value.toString()));
264
+ }
265
+ function $termFromRdfResourceValues(values, options) {
266
+ const { focusResource, propertyPath, schema } = options;
267
+ return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
268
+ if (schema.in &&
269
+ schema.in.length > 0 &&
270
+ !schema.in.some((in_) => in_.equals(term))) {
271
+ return Left(new Resource.MistypedTermValueError({
272
+ actualValue: term,
273
+ expectedValueType: "Term in",
274
+ focusResource,
275
+ propertyPath,
276
+ }));
277
+ }
278
+ if (!schema.types.some((type) => term.termType === type)) {
279
+ return Left(new Resource.MistypedTermValueError({
280
+ actualValue: term,
281
+ expectedValueType: "Term types",
282
+ focusResource,
283
+ propertyPath,
284
+ }));
285
+ }
286
+ return Right(term);
287
+ })));
207
288
  }
289
+ const $termLikeFromRdfResourceValues = (values, { preferredLanguages, schema: { hasValues, languageIn } }) => {
290
+ let chain = Either.of(values);
291
+ if (hasValues && hasValues.length > 0) {
292
+ chain = chain.chain((values) => Either.sequence(hasValues.map((hasValue) => values.find((value) => value.term.equals(hasValue)))).map(() => values));
293
+ }
294
+ if (languageIn && languageIn.length > 0) {
295
+ chain = chain.chain((values) => values.chainMap((value) => value.toLiteral().chain((literal) => languageIn.includes(literal.language)
296
+ ? Right(value)
297
+ : Left(new Resource.MistypedTermValueError({
298
+ actualValue: literal,
299
+ expectedValueType: "Literal",
300
+ focusResource: value.focusResource,
301
+ propertyPath: value.propertyPath,
302
+ })))));
303
+ }
304
+ if (preferredLanguages && preferredLanguages.length > 0) {
305
+ chain = chain.chain((values) => {
306
+ const literals = [];
307
+ const literalValues = [];
308
+ const nonLiteralValues = [];
309
+ for (const value of values) {
310
+ const term = value.toTerm().unsafeCoerce();
311
+ if (term.termType === "Literal") {
312
+ literals.push(term);
313
+ literalValues.push(value);
314
+ }
315
+ else {
316
+ nonLiteralValues.push(value);
317
+ }
318
+ }
319
+ // Return all literals for the first preferredLanguage, then all literals for the second preferredLanguage, etc.
320
+ // Within a preferredLanguage the literals may be in any order.
321
+ const preferredLanguageLiteralValues = [];
322
+ for (const preferredLanguage of preferredLanguages) {
323
+ for (let literalI = 0; literalI < literals.length; literalI++) {
324
+ if (literals[literalI].language === preferredLanguage) {
325
+ preferredLanguageLiteralValues.push(literalValues[literalI]);
326
+ }
327
+ }
328
+ }
329
+ return Right(Resource.Values.fromArray({
330
+ focusResource: values.focusResource,
331
+ propertyPath: values.propertyPath,
332
+ values: nonLiteralValues.concat(preferredLanguageLiteralValues),
333
+ }));
334
+ });
335
+ }
336
+ return chain;
337
+ };
208
338
  function $validateArray(validateItem, _readonly) {
209
339
  return (schema, valueArray) => {
210
340
  if (schema.minCount !== undefined && valueArray.length < schema.minCount) {
@@ -249,615 +379,391 @@ function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
249
379
  return resource;
250
380
  };
251
381
  }
252
- export var PropertyShape;
253
- (function (PropertyShape) {
254
- function create(parameters) {
255
- return $sequenceRecord({
256
- $identifier: $convertToIdentifierProperty(parameters.$identifier),
257
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
258
- classes: $convertToArray(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
259
- comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
260
- datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
261
- deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
262
- defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
263
- description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
264
- flags: $convertToArray($identityConversionFunction, true)(parameters.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type, value)),
265
- groups: $convertToArray($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
266
- hasValues: $convertToArray($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
267
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
268
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
269
- label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
270
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
271
- maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
272
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
273
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
274
- maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
275
- minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
276
- minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
277
- minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
278
- minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
279
- name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
280
- node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
281
- nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
282
- not: $convertToArray($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
283
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
284
- order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
285
- path: Either.of(parameters.path),
286
- patterns: $convertToArray($identityConversionFunction, true)(parameters.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type, value)),
287
- uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
288
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
289
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyShape" }, { $toString }));
290
- }
291
- PropertyShape.create = create;
382
+ export var NodeShape;
383
+ (function (NodeShape) {
384
+ NodeShape.create = (parameters) => $sequenceRecord({
385
+ $identifier: $convertToIdentifierProperty(parameters?.$identifier),
386
+ and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
387
+ classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
388
+ closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
389
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
390
+ datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
391
+ deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
392
+ flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
393
+ hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
394
+ ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
395
+ in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
396
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
397
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
398
+ languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
399
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
400
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
401
+ maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
402
+ message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
403
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
404
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
405
+ minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
406
+ node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
407
+ nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
408
+ not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
409
+ or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
410
+ pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
411
+ properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
412
+ severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
413
+ subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
414
+ targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
415
+ targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
416
+ targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
417
+ targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
418
+ types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
419
+ xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
420
+ })
421
+ .map((properties) => ({ ...properties, $type: "NodeShape" }))
422
+ .map((object) => $monkeyPatchObject(object, { $toString: NodeShape.$toString }));
292
423
  function createUnsafe(parameters) {
293
- return create(parameters).unsafeCoerce();
424
+ return NodeShape.create(parameters).unsafeCoerce();
294
425
  }
295
- PropertyShape.createUnsafe = createUnsafe;
426
+ NodeShape.createUnsafe = createUnsafe;
427
+ NodeShape._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
428
+ ? $ensureRdfResourceType($resource, [NodeShape.schema.fromRdfType], {
429
+ graph: _$options.graph,
430
+ })
431
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
432
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
433
+ dataFactory: dataFactory,
434
+ focusResource: $resource,
435
+ propertyPath: $RdfVocabularies.rdf.subject,
436
+ term: $resource.identifier,
437
+ }).toValues(), {
438
+ context: _$options.context,
439
+ graph: _$options.graph,
440
+ focusResource: $resource,
441
+ preferredLanguages: _$options.preferredLanguages,
442
+ propertyPath: $RdfVocabularies.rdf.subject,
443
+ schema: NodeShape.schema.properties.$identifier.type,
444
+ }).chain((values) => values.head()),
445
+ and: $shaclPropertyFromRdf({
446
+ context: _$options.context,
447
+ graph: _$options.graph,
448
+ focusResource: $resource,
449
+ ignoreRdfType: true,
450
+ preferredLanguages: _$options.preferredLanguages,
451
+ propertySchema: NodeShape.schema.properties.and,
452
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
453
+ }),
454
+ classes: $shaclPropertyFromRdf({
455
+ context: _$options.context,
456
+ graph: _$options.graph,
457
+ focusResource: $resource,
458
+ ignoreRdfType: true,
459
+ preferredLanguages: _$options.preferredLanguages,
460
+ propertySchema: NodeShape.schema.properties.classes,
461
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
462
+ }),
463
+ closed: $shaclPropertyFromRdf({
464
+ context: _$options.context,
465
+ graph: _$options.graph,
466
+ focusResource: $resource,
467
+ ignoreRdfType: true,
468
+ preferredLanguages: _$options.preferredLanguages,
469
+ propertySchema: NodeShape.schema.properties.closed,
470
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
471
+ }),
472
+ comment: $shaclPropertyFromRdf({
473
+ context: _$options.context,
474
+ graph: _$options.graph,
475
+ focusResource: $resource,
476
+ ignoreRdfType: true,
477
+ preferredLanguages: _$options.preferredLanguages,
478
+ propertySchema: NodeShape.schema.properties.comment,
479
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
480
+ }),
481
+ datatype: $shaclPropertyFromRdf({
482
+ context: _$options.context,
483
+ graph: _$options.graph,
484
+ focusResource: $resource,
485
+ ignoreRdfType: true,
486
+ preferredLanguages: _$options.preferredLanguages,
487
+ propertySchema: NodeShape.schema.properties.datatype,
488
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
489
+ }),
490
+ deactivated: $shaclPropertyFromRdf({
491
+ context: _$options.context,
492
+ graph: _$options.graph,
493
+ focusResource: $resource,
494
+ ignoreRdfType: true,
495
+ preferredLanguages: _$options.preferredLanguages,
496
+ propertySchema: NodeShape.schema.properties.deactivated,
497
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
498
+ }),
499
+ flags: $shaclPropertyFromRdf({
500
+ context: _$options.context,
501
+ graph: _$options.graph,
502
+ focusResource: $resource,
503
+ ignoreRdfType: true,
504
+ preferredLanguages: _$options.preferredLanguages,
505
+ propertySchema: NodeShape.schema.properties.flags,
506
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
507
+ }),
508
+ hasValues: $shaclPropertyFromRdf({
509
+ context: _$options.context,
510
+ graph: _$options.graph,
511
+ focusResource: $resource,
512
+ ignoreRdfType: true,
513
+ preferredLanguages: _$options.preferredLanguages,
514
+ propertySchema: NodeShape.schema.properties.hasValues,
515
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
516
+ }),
517
+ ignoredProperties: $shaclPropertyFromRdf({
518
+ context: _$options.context,
519
+ graph: _$options.graph,
520
+ focusResource: $resource,
521
+ ignoreRdfType: true,
522
+ preferredLanguages: _$options.preferredLanguages,
523
+ propertySchema: NodeShape.schema.properties.ignoredProperties,
524
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($iriFromRdfResourceValues))),
525
+ }),
526
+ in_: $shaclPropertyFromRdf({
527
+ context: _$options.context,
528
+ graph: _$options.graph,
529
+ focusResource: $resource,
530
+ ignoreRdfType: true,
531
+ preferredLanguages: _$options.preferredLanguages,
532
+ propertySchema: NodeShape.schema.properties.in_,
533
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($termFromRdfResourceValues))),
534
+ }),
535
+ isDefinedBy: $shaclPropertyFromRdf({
536
+ context: _$options.context,
537
+ graph: _$options.graph,
538
+ focusResource: $resource,
539
+ ignoreRdfType: true,
540
+ preferredLanguages: _$options.preferredLanguages,
541
+ propertySchema: NodeShape.schema.properties.isDefinedBy,
542
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
543
+ }),
544
+ label: $shaclPropertyFromRdf({
545
+ context: _$options.context,
546
+ graph: _$options.graph,
547
+ focusResource: $resource,
548
+ ignoreRdfType: true,
549
+ preferredLanguages: _$options.preferredLanguages,
550
+ propertySchema: NodeShape.schema.properties.label,
551
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
552
+ }),
553
+ languageIn: $shaclPropertyFromRdf({
554
+ context: _$options.context,
555
+ graph: _$options.graph,
556
+ focusResource: $resource,
557
+ ignoreRdfType: true,
558
+ preferredLanguages: _$options.preferredLanguages,
559
+ propertySchema: NodeShape.schema.properties.languageIn,
560
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($stringFromRdfResourceValues))),
561
+ }),
562
+ maxExclusive: $shaclPropertyFromRdf({
563
+ context: _$options.context,
564
+ graph: _$options.graph,
565
+ focusResource: $resource,
566
+ ignoreRdfType: true,
567
+ preferredLanguages: _$options.preferredLanguages,
568
+ propertySchema: NodeShape.schema.properties.maxExclusive,
569
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
570
+ }),
571
+ maxInclusive: $shaclPropertyFromRdf({
572
+ context: _$options.context,
573
+ graph: _$options.graph,
574
+ focusResource: $resource,
575
+ ignoreRdfType: true,
576
+ preferredLanguages: _$options.preferredLanguages,
577
+ propertySchema: NodeShape.schema.properties.maxInclusive,
578
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
579
+ }),
580
+ maxLength: $shaclPropertyFromRdf({
581
+ context: _$options.context,
582
+ graph: _$options.graph,
583
+ focusResource: $resource,
584
+ ignoreRdfType: true,
585
+ preferredLanguages: _$options.preferredLanguages,
586
+ propertySchema: NodeShape.schema.properties.maxLength,
587
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
588
+ }),
589
+ message: $shaclPropertyFromRdf({
590
+ context: _$options.context,
591
+ graph: _$options.graph,
592
+ focusResource: $resource,
593
+ ignoreRdfType: true,
594
+ preferredLanguages: _$options.preferredLanguages,
595
+ propertySchema: NodeShape.schema.properties.message,
596
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
597
+ }),
598
+ minExclusive: $shaclPropertyFromRdf({
599
+ context: _$options.context,
600
+ graph: _$options.graph,
601
+ focusResource: $resource,
602
+ ignoreRdfType: true,
603
+ preferredLanguages: _$options.preferredLanguages,
604
+ propertySchema: NodeShape.schema.properties.minExclusive,
605
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
606
+ }),
607
+ minInclusive: $shaclPropertyFromRdf({
608
+ context: _$options.context,
609
+ graph: _$options.graph,
610
+ focusResource: $resource,
611
+ ignoreRdfType: true,
612
+ preferredLanguages: _$options.preferredLanguages,
613
+ propertySchema: NodeShape.schema.properties.minInclusive,
614
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
615
+ }),
616
+ minLength: $shaclPropertyFromRdf({
617
+ context: _$options.context,
618
+ graph: _$options.graph,
619
+ focusResource: $resource,
620
+ ignoreRdfType: true,
621
+ preferredLanguages: _$options.preferredLanguages,
622
+ propertySchema: NodeShape.schema.properties.minLength,
623
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
624
+ }),
625
+ node: $shaclPropertyFromRdf({
626
+ context: _$options.context,
627
+ graph: _$options.graph,
628
+ focusResource: $resource,
629
+ ignoreRdfType: true,
630
+ preferredLanguages: _$options.preferredLanguages,
631
+ propertySchema: NodeShape.schema.properties.node,
632
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
633
+ }),
634
+ nodeKind: $shaclPropertyFromRdf({
635
+ context: _$options.context,
636
+ graph: _$options.graph,
637
+ focusResource: $resource,
638
+ ignoreRdfType: true,
639
+ preferredLanguages: _$options.preferredLanguages,
640
+ propertySchema: NodeShape.schema.properties.nodeKind,
641
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
642
+ }),
643
+ not: $shaclPropertyFromRdf({
644
+ context: _$options.context,
645
+ graph: _$options.graph,
646
+ focusResource: $resource,
647
+ ignoreRdfType: true,
648
+ preferredLanguages: _$options.preferredLanguages,
649
+ propertySchema: NodeShape.schema.properties.not,
650
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
651
+ }),
652
+ or: $shaclPropertyFromRdf({
653
+ context: _$options.context,
654
+ graph: _$options.graph,
655
+ focusResource: $resource,
656
+ ignoreRdfType: true,
657
+ preferredLanguages: _$options.preferredLanguages,
658
+ propertySchema: NodeShape.schema.properties.or,
659
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
660
+ }),
661
+ pattern: $shaclPropertyFromRdf({
662
+ context: _$options.context,
663
+ graph: _$options.graph,
664
+ focusResource: $resource,
665
+ ignoreRdfType: true,
666
+ preferredLanguages: _$options.preferredLanguages,
667
+ propertySchema: NodeShape.schema.properties.pattern,
668
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
669
+ }),
670
+ properties: $shaclPropertyFromRdf({
671
+ context: _$options.context,
672
+ graph: _$options.graph,
673
+ focusResource: $resource,
674
+ ignoreRdfType: true,
675
+ preferredLanguages: _$options.preferredLanguages,
676
+ propertySchema: NodeShape.schema.properties.properties,
677
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
678
+ }),
679
+ severity: $shaclPropertyFromRdf({
680
+ context: _$options.context,
681
+ graph: _$options.graph,
682
+ focusResource: $resource,
683
+ ignoreRdfType: true,
684
+ preferredLanguages: _$options.preferredLanguages,
685
+ propertySchema: NodeShape.schema.properties.severity,
686
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
687
+ }),
688
+ subClassOf: $shaclPropertyFromRdf({
689
+ context: _$options.context,
690
+ graph: _$options.graph,
691
+ focusResource: $resource,
692
+ ignoreRdfType: true,
693
+ preferredLanguages: _$options.preferredLanguages,
694
+ propertySchema: NodeShape.schema.properties.subClassOf,
695
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
696
+ }),
697
+ targetClasses: $shaclPropertyFromRdf({
698
+ context: _$options.context,
699
+ graph: _$options.graph,
700
+ focusResource: $resource,
701
+ ignoreRdfType: true,
702
+ preferredLanguages: _$options.preferredLanguages,
703
+ propertySchema: NodeShape.schema.properties.targetClasses,
704
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
705
+ }),
706
+ targetNodes: $shaclPropertyFromRdf({
707
+ context: _$options.context,
708
+ graph: _$options.graph,
709
+ focusResource: $resource,
710
+ ignoreRdfType: true,
711
+ preferredLanguages: _$options.preferredLanguages,
712
+ propertySchema: NodeShape.schema.properties.targetNodes,
713
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
714
+ }),
715
+ targetObjectsOf: $shaclPropertyFromRdf({
716
+ context: _$options.context,
717
+ graph: _$options.graph,
718
+ focusResource: $resource,
719
+ ignoreRdfType: true,
720
+ preferredLanguages: _$options.preferredLanguages,
721
+ propertySchema: NodeShape.schema.properties.targetObjectsOf,
722
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
723
+ }),
724
+ targetSubjectsOf: $shaclPropertyFromRdf({
725
+ context: _$options.context,
726
+ graph: _$options.graph,
727
+ focusResource: $resource,
728
+ ignoreRdfType: true,
729
+ preferredLanguages: _$options.preferredLanguages,
730
+ propertySchema: NodeShape.schema.properties.targetSubjectsOf,
731
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
732
+ }),
733
+ types: $shaclPropertyFromRdf({
734
+ context: _$options.context,
735
+ graph: _$options.graph,
736
+ focusResource: $resource,
737
+ ignoreRdfType: true,
738
+ preferredLanguages: _$options.preferredLanguages,
739
+ propertySchema: NodeShape.schema.properties.types,
740
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
741
+ }),
742
+ xone: $shaclPropertyFromRdf({
743
+ context: _$options.context,
744
+ graph: _$options.graph,
745
+ focusResource: $resource,
746
+ ignoreRdfType: true,
747
+ preferredLanguages: _$options.preferredLanguages,
748
+ propertySchema: NodeShape.schema.properties.xone,
749
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
750
+ }),
751
+ }).chain((properties) => NodeShape.create(properties)));
752
+ NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
753
+ NodeShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
754
+ .toResource()
755
+ .chain((resource) => NodeShape.fromRdfResource(resource, options)));
296
756
  let Identifier;
297
757
  (function (Identifier) {
298
758
  Identifier.parse = $parseIdentifier;
299
759
  Identifier.stringify = NTriplesTerm.stringify;
300
- })(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
301
- PropertyShape._fromRdfResource = ($resource, _$options) => {
302
- return (!_$options.ignoreRdfType
303
- ? $ensureRdfResourceType($resource, [PropertyShape.fromRdfType], {
304
- graph: _$options.graph,
305
- })
306
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
307
- $identifier: Right(new Resource.Value({
308
- dataFactory: dataFactory,
309
- focusResource: $resource,
310
- propertyPath: $RdfVocabularies.rdf.subject,
311
- term: $resource.identifier,
312
- }).toValues())
313
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
314
- .chain((values) => values.head()),
315
- and: $shaclPropertyFromRdf({
316
- graph: _$options.graph,
317
- resource: $resource,
318
- propertySchema: PropertyShape.schema.properties.and,
319
- typeFromRdf: (resourceValues) => resourceValues
320
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
321
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
322
- focusResource: $resource,
323
- propertyPath: PropertyShape.schema.properties.and.path,
324
- values: valueList.toArray(),
325
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
326
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
327
- .map((values) => values.length > 0
328
- ? values.map((value) => Maybe.of(value))
329
- : Resource.Values.fromValue({
330
- focusResource: $resource,
331
- propertyPath: PropertyShape.schema.properties.and.path,
332
- value: Maybe.empty(),
333
- })),
334
- }),
335
- classes: $shaclPropertyFromRdf({
336
- graph: _$options.graph,
337
- resource: $resource,
338
- propertySchema: PropertyShape.schema.properties.classes,
339
- typeFromRdf: (resourceValues) => resourceValues
340
- .chain((values) => values.chainMap((value) => value.toIri()))
341
- .map((values) => values.toArray())
342
- .map((valuesArray) => Resource.Values.fromValue({
343
- focusResource: $resource,
344
- propertyPath: PropertyShape.schema.properties.classes.path,
345
- value: valuesArray,
346
- })),
347
- }),
348
- comment: $shaclPropertyFromRdf({
349
- graph: _$options.graph,
350
- resource: $resource,
351
- propertySchema: PropertyShape.schema.properties.comment,
352
- typeFromRdf: (resourceValues) => resourceValues
353
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
354
- .chain((values) => values.chainMap((value) => value.toString()))
355
- .map((values) => values.length > 0
356
- ? values.map((value) => Maybe.of(value))
357
- : Resource.Values.fromValue({
358
- focusResource: $resource,
359
- propertyPath: PropertyShape.schema.properties.comment.path,
360
- value: Maybe.empty(),
361
- })),
362
- }),
363
- datatype: $shaclPropertyFromRdf({
364
- graph: _$options.graph,
365
- resource: $resource,
366
- propertySchema: PropertyShape.schema.properties.datatype,
367
- typeFromRdf: (resourceValues) => resourceValues
368
- .chain((values) => values.chainMap((value) => value.toIri()))
369
- .map((values) => values.length > 0
370
- ? values.map((value) => Maybe.of(value))
371
- : Resource.Values.fromValue({
372
- focusResource: $resource,
373
- propertyPath: PropertyShape.schema.properties.datatype.path,
374
- value: Maybe.empty(),
375
- })),
376
- }),
377
- deactivated: $shaclPropertyFromRdf({
378
- graph: _$options.graph,
379
- resource: $resource,
380
- propertySchema: PropertyShape.schema.properties.deactivated,
381
- typeFromRdf: (resourceValues) => resourceValues
382
- .chain((values) => values.chainMap((value) => value.toBoolean()))
383
- .map((values) => values.length > 0
384
- ? values.map((value) => Maybe.of(value))
385
- : Resource.Values.fromValue({
386
- focusResource: $resource,
387
- propertyPath: PropertyShape.schema.properties.deactivated.path,
388
- value: Maybe.empty(),
389
- })),
390
- }),
391
- defaultValue: $shaclPropertyFromRdf({
392
- graph: _$options.graph,
393
- resource: $resource,
394
- propertySchema: PropertyShape.schema.properties.defaultValue,
395
- typeFromRdf: (resourceValues) => resourceValues
396
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
397
- switch (term.termType) {
398
- case "NamedNode":
399
- case "Literal":
400
- return Either.of(term);
401
- default:
402
- return Left(new Resource.MistypedTermValueError({
403
- actualValue: term,
404
- expectedValueType: "(NamedNode | Literal)",
405
- focusResource: $resource,
406
- propertyPath: PropertyShape.schema.properties.defaultValue.path,
407
- }));
408
- }
409
- })))
410
- .map((values) => values.length > 0
411
- ? values.map((value) => Maybe.of(value))
412
- : Resource.Values.fromValue({
413
- focusResource: $resource,
414
- propertyPath: PropertyShape.schema.properties.defaultValue.path,
415
- value: Maybe.empty(),
416
- })),
417
- }),
418
- description: $shaclPropertyFromRdf({
419
- graph: _$options.graph,
420
- resource: $resource,
421
- propertySchema: PropertyShape.schema.properties.description,
422
- typeFromRdf: (resourceValues) => resourceValues
423
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
424
- .chain((values) => values.chainMap((value) => value.toString()))
425
- .map((values) => values.length > 0
426
- ? values.map((value) => Maybe.of(value))
427
- : Resource.Values.fromValue({
428
- focusResource: $resource,
429
- propertyPath: PropertyShape.schema.properties.description.path,
430
- value: Maybe.empty(),
431
- })),
432
- }),
433
- flags: $shaclPropertyFromRdf({
434
- graph: _$options.graph,
435
- resource: $resource,
436
- propertySchema: PropertyShape.schema.properties.flags,
437
- typeFromRdf: (resourceValues) => resourceValues
438
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
439
- .chain((values) => values.chainMap((value) => value.toString()))
440
- .map((values) => values.toArray())
441
- .map((valuesArray) => Resource.Values.fromValue({
442
- focusResource: $resource,
443
- propertyPath: PropertyShape.schema.properties.flags.path,
444
- value: valuesArray,
445
- })),
446
- }),
447
- groups: $shaclPropertyFromRdf({
448
- graph: _$options.graph,
449
- resource: $resource,
450
- propertySchema: PropertyShape.schema.properties.groups,
451
- typeFromRdf: (resourceValues) => resourceValues
452
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
453
- .map((values) => values.toArray())
454
- .map((valuesArray) => Resource.Values.fromValue({
455
- focusResource: $resource,
456
- propertyPath: PropertyShape.schema.properties.groups.path,
457
- value: valuesArray,
458
- })),
459
- }),
460
- hasValues: $shaclPropertyFromRdf({
461
- graph: _$options.graph,
462
- resource: $resource,
463
- propertySchema: PropertyShape.schema.properties.hasValues,
464
- typeFromRdf: (resourceValues) => resourceValues
465
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
466
- switch (term.termType) {
467
- case "NamedNode":
468
- case "Literal":
469
- return Either.of(term);
470
- default:
471
- return Left(new Resource.MistypedTermValueError({
472
- actualValue: term,
473
- expectedValueType: "(NamedNode | Literal)",
474
- focusResource: $resource,
475
- propertyPath: PropertyShape.schema.properties.hasValues.path,
476
- }));
477
- }
478
- })))
479
- .map((values) => values.toArray())
480
- .map((valuesArray) => Resource.Values.fromValue({
481
- focusResource: $resource,
482
- propertyPath: PropertyShape.schema.properties.hasValues.path,
483
- value: valuesArray,
484
- })),
485
- }),
486
- in_: $shaclPropertyFromRdf({
487
- graph: _$options.graph,
488
- resource: $resource,
489
- propertySchema: PropertyShape.schema.properties.in_,
490
- typeFromRdf: (resourceValues) => resourceValues
491
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
492
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
493
- focusResource: $resource,
494
- propertyPath: PropertyShape.schema.properties.in_.path,
495
- values: valueList.toArray(),
496
- })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
497
- switch (term.termType) {
498
- case "NamedNode":
499
- case "Literal":
500
- return Either.of(term);
501
- default:
502
- return Left(new Resource.MistypedTermValueError({
503
- actualValue: term,
504
- expectedValueType: "(NamedNode | Literal)",
505
- focusResource: $resource,
506
- propertyPath: PropertyShape.schema.properties.in_.path,
507
- }));
508
- }
509
- })))))
510
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
511
- .map((values) => values.length > 0
512
- ? values.map((value) => Maybe.of(value))
513
- : Resource.Values.fromValue({
514
- focusResource: $resource,
515
- propertyPath: PropertyShape.schema.properties.in_.path,
516
- value: Maybe.empty(),
517
- })),
518
- }),
519
- isDefinedBy: $shaclPropertyFromRdf({
520
- graph: _$options.graph,
521
- resource: $resource,
522
- propertySchema: PropertyShape.schema.properties.isDefinedBy,
523
- typeFromRdf: (resourceValues) => resourceValues
524
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
525
- .map((values) => values.length > 0
526
- ? values.map((value) => Maybe.of(value))
527
- : Resource.Values.fromValue({
528
- focusResource: $resource,
529
- propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
530
- value: Maybe.empty(),
531
- })),
532
- }),
533
- label: $shaclPropertyFromRdf({
534
- graph: _$options.graph,
535
- resource: $resource,
536
- propertySchema: PropertyShape.schema.properties.label,
537
- typeFromRdf: (resourceValues) => resourceValues
538
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
539
- .chain((values) => values.chainMap((value) => value.toString()))
540
- .map((values) => values.length > 0
541
- ? values.map((value) => Maybe.of(value))
542
- : Resource.Values.fromValue({
543
- focusResource: $resource,
544
- propertyPath: PropertyShape.schema.properties.label.path,
545
- value: Maybe.empty(),
546
- })),
547
- }),
548
- languageIn: $shaclPropertyFromRdf({
549
- graph: _$options.graph,
550
- resource: $resource,
551
- propertySchema: PropertyShape.schema.properties.languageIn,
552
- typeFromRdf: (resourceValues) => resourceValues
553
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
554
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
555
- focusResource: $resource,
556
- propertyPath: PropertyShape.schema.properties.languageIn.path,
557
- values: valueList.toArray(),
558
- }))
559
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
560
- .chain((values) => values.chainMap((value) => value.toString()))))
561
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
562
- .map((values) => values.length > 0
563
- ? values.map((value) => Maybe.of(value))
564
- : Resource.Values.fromValue({
565
- focusResource: $resource,
566
- propertyPath: PropertyShape.schema.properties.languageIn.path,
567
- value: Maybe.empty(),
568
- })),
569
- }),
570
- maxCount: $shaclPropertyFromRdf({
571
- graph: _$options.graph,
572
- resource: $resource,
573
- propertySchema: PropertyShape.schema.properties.maxCount,
574
- typeFromRdf: (resourceValues) => resourceValues
575
- .chain((values) => values.chainMap((value) => value.toBigInt()))
576
- .map((values) => values.length > 0
577
- ? values.map((value) => Maybe.of(value))
578
- : Resource.Values.fromValue({
579
- focusResource: $resource,
580
- propertyPath: PropertyShape.schema.properties.maxCount.path,
581
- value: Maybe.empty(),
582
- })),
583
- }),
584
- maxExclusive: $shaclPropertyFromRdf({
585
- graph: _$options.graph,
586
- resource: $resource,
587
- propertySchema: PropertyShape.schema.properties.maxExclusive,
588
- typeFromRdf: (resourceValues) => resourceValues
589
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
590
- .chain((values) => values.chainMap((value) => value.toLiteral()))
591
- .map((values) => values.length > 0
592
- ? values.map((value) => Maybe.of(value))
593
- : Resource.Values.fromValue({
594
- focusResource: $resource,
595
- propertyPath: PropertyShape.schema.properties.maxExclusive.path,
596
- value: Maybe.empty(),
597
- })),
598
- }),
599
- maxInclusive: $shaclPropertyFromRdf({
600
- graph: _$options.graph,
601
- resource: $resource,
602
- propertySchema: PropertyShape.schema.properties.maxInclusive,
603
- typeFromRdf: (resourceValues) => resourceValues
604
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
605
- .chain((values) => values.chainMap((value) => value.toLiteral()))
606
- .map((values) => values.length > 0
607
- ? values.map((value) => Maybe.of(value))
608
- : Resource.Values.fromValue({
609
- focusResource: $resource,
610
- propertyPath: PropertyShape.schema.properties.maxInclusive.path,
611
- value: Maybe.empty(),
612
- })),
613
- }),
614
- maxLength: $shaclPropertyFromRdf({
615
- graph: _$options.graph,
616
- resource: $resource,
617
- propertySchema: PropertyShape.schema.properties.maxLength,
618
- typeFromRdf: (resourceValues) => resourceValues
619
- .chain((values) => values.chainMap((value) => value.toBigInt()))
620
- .map((values) => values.length > 0
621
- ? values.map((value) => Maybe.of(value))
622
- : Resource.Values.fromValue({
623
- focusResource: $resource,
624
- propertyPath: PropertyShape.schema.properties.maxLength.path,
625
- value: Maybe.empty(),
626
- })),
627
- }),
628
- minCount: $shaclPropertyFromRdf({
629
- graph: _$options.graph,
630
- resource: $resource,
631
- propertySchema: PropertyShape.schema.properties.minCount,
632
- typeFromRdf: (resourceValues) => resourceValues
633
- .chain((values) => values.chainMap((value) => value.toBigInt()))
634
- .map((values) => values.length > 0
635
- ? values.map((value) => Maybe.of(value))
636
- : Resource.Values.fromValue({
637
- focusResource: $resource,
638
- propertyPath: PropertyShape.schema.properties.minCount.path,
639
- value: Maybe.empty(),
640
- })),
641
- }),
642
- minExclusive: $shaclPropertyFromRdf({
643
- graph: _$options.graph,
644
- resource: $resource,
645
- propertySchema: PropertyShape.schema.properties.minExclusive,
646
- typeFromRdf: (resourceValues) => resourceValues
647
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
648
- .chain((values) => values.chainMap((value) => value.toLiteral()))
649
- .map((values) => values.length > 0
650
- ? values.map((value) => Maybe.of(value))
651
- : Resource.Values.fromValue({
652
- focusResource: $resource,
653
- propertyPath: PropertyShape.schema.properties.minExclusive.path,
654
- value: Maybe.empty(),
655
- })),
656
- }),
657
- minInclusive: $shaclPropertyFromRdf({
658
- graph: _$options.graph,
659
- resource: $resource,
660
- propertySchema: PropertyShape.schema.properties.minInclusive,
661
- typeFromRdf: (resourceValues) => resourceValues
662
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
663
- .chain((values) => values.chainMap((value) => value.toLiteral()))
664
- .map((values) => values.length > 0
665
- ? values.map((value) => Maybe.of(value))
666
- : Resource.Values.fromValue({
667
- focusResource: $resource,
668
- propertyPath: PropertyShape.schema.properties.minInclusive.path,
669
- value: Maybe.empty(),
670
- })),
671
- }),
672
- minLength: $shaclPropertyFromRdf({
673
- graph: _$options.graph,
674
- resource: $resource,
675
- propertySchema: PropertyShape.schema.properties.minLength,
676
- typeFromRdf: (resourceValues) => resourceValues
677
- .chain((values) => values.chainMap((value) => value.toBigInt()))
678
- .map((values) => values.length > 0
679
- ? values.map((value) => Maybe.of(value))
680
- : Resource.Values.fromValue({
681
- focusResource: $resource,
682
- propertyPath: PropertyShape.schema.properties.minLength.path,
683
- value: Maybe.empty(),
684
- })),
685
- }),
686
- name: $shaclPropertyFromRdf({
687
- graph: _$options.graph,
688
- resource: $resource,
689
- propertySchema: PropertyShape.schema.properties.name,
690
- typeFromRdf: (resourceValues) => resourceValues
691
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
692
- .chain((values) => values.chainMap((value) => value.toString()))
693
- .map((values) => values.length > 0
694
- ? values.map((value) => Maybe.of(value))
695
- : Resource.Values.fromValue({
696
- focusResource: $resource,
697
- propertyPath: PropertyShape.schema.properties.name.path,
698
- value: Maybe.empty(),
699
- })),
700
- }),
701
- node: $shaclPropertyFromRdf({
702
- graph: _$options.graph,
703
- resource: $resource,
704
- propertySchema: PropertyShape.schema.properties.node,
705
- typeFromRdf: (resourceValues) => resourceValues
706
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
707
- .map((values) => values.length > 0
708
- ? values.map((value) => Maybe.of(value))
709
- : Resource.Values.fromValue({
710
- focusResource: $resource,
711
- propertyPath: PropertyShape.schema.properties.node.path,
712
- value: Maybe.empty(),
713
- })),
714
- }),
715
- nodeKind: $shaclPropertyFromRdf({
716
- graph: _$options.graph,
717
- resource: $resource,
718
- propertySchema: PropertyShape.schema.properties.nodeKind,
719
- typeFromRdf: (resourceValues) => resourceValues
720
- .chain((values) => values.chainMap((value) => value.toIri([
721
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
722
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
723
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
724
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
725
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
726
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
727
- ])))
728
- .map((values) => values.length > 0
729
- ? values.map((value) => Maybe.of(value))
730
- : Resource.Values.fromValue({
731
- focusResource: $resource,
732
- propertyPath: PropertyShape.schema.properties.nodeKind.path,
733
- value: Maybe.empty(),
734
- })),
735
- }),
736
- not: $shaclPropertyFromRdf({
737
- graph: _$options.graph,
738
- resource: $resource,
739
- propertySchema: PropertyShape.schema.properties.not,
740
- typeFromRdf: (resourceValues) => resourceValues
741
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
742
- .map((values) => values.toArray())
743
- .map((valuesArray) => Resource.Values.fromValue({
744
- focusResource: $resource,
745
- propertyPath: PropertyShape.schema.properties.not.path,
746
- value: valuesArray,
747
- })),
748
- }),
749
- or: $shaclPropertyFromRdf({
750
- graph: _$options.graph,
751
- resource: $resource,
752
- propertySchema: PropertyShape.schema.properties.or,
753
- typeFromRdf: (resourceValues) => resourceValues
754
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
755
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
756
- focusResource: $resource,
757
- propertyPath: PropertyShape.schema.properties.or.path,
758
- values: valueList.toArray(),
759
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
760
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
761
- .map((values) => values.length > 0
762
- ? values.map((value) => Maybe.of(value))
763
- : Resource.Values.fromValue({
764
- focusResource: $resource,
765
- propertyPath: PropertyShape.schema.properties.or.path,
766
- value: Maybe.empty(),
767
- })),
768
- }),
769
- order: $shaclPropertyFromRdf({
770
- graph: _$options.graph,
771
- resource: $resource,
772
- propertySchema: PropertyShape.schema.properties.order,
773
- typeFromRdf: (resourceValues) => resourceValues
774
- .chain((values) => values.chainMap((value) => value.toFloat()))
775
- .map((values) => values.length > 0
776
- ? values.map((value) => Maybe.of(value))
777
- : Resource.Values.fromValue({
778
- focusResource: $resource,
779
- propertyPath: PropertyShape.schema.properties.order.path,
780
- value: Maybe.empty(),
781
- })),
782
- }),
783
- path: $shaclPropertyFromRdf({
784
- graph: _$options.graph,
785
- resource: $resource,
786
- propertySchema: PropertyShape.schema.properties.path,
787
- typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
788
- context: _$options.context,
789
- graph: _$options.graph,
790
- preferredLanguages: _$options.preferredLanguages,
791
- resource: $resource,
792
- ignoreRdfType: true,
793
- propertyPath: PropertyShape.schema.properties.path.path,
794
- }),
795
- }),
796
- patterns: $shaclPropertyFromRdf({
797
- graph: _$options.graph,
798
- resource: $resource,
799
- propertySchema: PropertyShape.schema.properties.patterns,
800
- typeFromRdf: (resourceValues) => resourceValues
801
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
802
- .chain((values) => values.chainMap((value) => value.toString()))
803
- .map((values) => values.toArray())
804
- .map((valuesArray) => Resource.Values.fromValue({
805
- focusResource: $resource,
806
- propertyPath: PropertyShape.schema.properties.patterns.path,
807
- value: valuesArray,
808
- })),
809
- }),
810
- uniqueLang: $shaclPropertyFromRdf({
811
- graph: _$options.graph,
812
- resource: $resource,
813
- propertySchema: PropertyShape.schema.properties.uniqueLang,
814
- typeFromRdf: (resourceValues) => resourceValues
815
- .chain((values) => values.chainMap((value) => value.toBoolean()))
816
- .map((values) => values.length > 0
817
- ? values.map((value) => Maybe.of(value))
818
- : Resource.Values.fromValue({
819
- focusResource: $resource,
820
- propertyPath: PropertyShape.schema.properties.uniqueLang.path,
821
- value: Maybe.empty(),
822
- })),
823
- }),
824
- xone: $shaclPropertyFromRdf({
825
- graph: _$options.graph,
826
- resource: $resource,
827
- propertySchema: PropertyShape.schema.properties.xone,
828
- typeFromRdf: (resourceValues) => resourceValues
829
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
830
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
831
- focusResource: $resource,
832
- propertyPath: PropertyShape.schema.properties.xone.path,
833
- values: valueList.toArray(),
834
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
835
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
836
- .map((values) => values.length > 0
837
- ? values.map((value) => Maybe.of(value))
838
- : Resource.Values.fromValue({
839
- focusResource: $resource,
840
- propertyPath: PropertyShape.schema.properties.xone.path,
841
- value: Maybe.empty(),
842
- })),
843
- }),
844
- }).chain((properties) => create(properties)));
845
- };
846
- PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
847
- PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
848
- .toResource()
849
- .chain((resource) => PropertyShape.fromRdfResource(resource, options))));
850
- PropertyShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
851
- function isPropertyShape(object) {
852
- switch (object.$type) {
853
- case "PropertyShape":
854
- return true;
855
- default:
856
- return false;
857
- }
760
+ })(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
761
+ function isNodeShape(object) {
762
+ return object.$type === "NodeShape";
858
763
  }
859
- PropertyShape.isPropertyShape = isPropertyShape;
860
- PropertyShape.schema = {
764
+ NodeShape.isNodeShape = isNodeShape;
765
+ NodeShape.schema = {
766
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"),
861
767
  properties: {
862
768
  $identifier: {
863
769
  kind: "Identifier",
@@ -879,6 +785,14 @@ export var PropertyShape;
879
785
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
880
786
  type: { kind: "Set", itemType: { kind: "Iri" } },
881
787
  },
788
+ closed: {
789
+ kind: "Shacl",
790
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
791
+ type: {
792
+ kind: "Option",
793
+ itemType: { kind: "Boolean" },
794
+ },
795
+ },
882
796
  comment: {
883
797
  kind: "Shacl",
884
798
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
@@ -900,36 +814,32 @@ export var PropertyShape;
900
814
  itemType: { kind: "Boolean" },
901
815
  },
902
816
  },
903
- defaultValue: {
904
- kind: "Shacl",
905
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
906
- type: { kind: "Option", itemType: { kind: "Term" } },
907
- },
908
- description: {
817
+ flags: {
909
818
  kind: "Shacl",
910
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
819
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
911
820
  type: {
912
821
  kind: "Option",
913
822
  itemType: { kind: "String" },
914
823
  },
915
824
  },
916
- flags: {
917
- kind: "Shacl",
918
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
919
- type: { kind: "Set", itemType: { kind: "String" } },
920
- },
921
- groups: {
825
+ hasValues: {
922
826
  kind: "Shacl",
923
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
827
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
924
828
  type: {
925
829
  kind: "Set",
926
- itemType: { kind: "Identifier" },
830
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
927
831
  },
928
832
  },
929
- hasValues: {
833
+ ignoredProperties: {
930
834
  kind: "Shacl",
931
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
932
- type: { kind: "Set", itemType: { kind: "Term" } },
835
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
836
+ type: {
837
+ kind: "Option",
838
+ itemType: {
839
+ kind: "List",
840
+ itemType: { kind: "Iri" },
841
+ },
842
+ },
933
843
  },
934
844
  in_: {
935
845
  kind: "Shacl",
@@ -938,7 +848,10 @@ export var PropertyShape;
938
848
  kind: "Option",
939
849
  itemType: {
940
850
  kind: "List",
941
- itemType: { kind: "Term" },
851
+ itemType: {
852
+ kind: "Term",
853
+ types: ["NamedNode", "Literal"],
854
+ },
942
855
  },
943
856
  },
944
857
  },
@@ -969,14 +882,6 @@ export var PropertyShape;
969
882
  },
970
883
  },
971
884
  },
972
- maxCount: {
973
- kind: "Shacl",
974
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
975
- type: {
976
- kind: "Option",
977
- itemType: { kind: "BigInt" },
978
- },
979
- },
980
885
  maxExclusive: {
981
886
  kind: "Shacl",
982
887
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
@@ -1001,12 +906,12 @@ export var PropertyShape;
1001
906
  itemType: { kind: "BigInt" },
1002
907
  },
1003
908
  },
1004
- minCount: {
909
+ message: {
1005
910
  kind: "Shacl",
1006
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
911
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
1007
912
  type: {
1008
913
  kind: "Option",
1009
- itemType: { kind: "BigInt" },
914
+ itemType: { kind: "String" },
1010
915
  },
1011
916
  },
1012
917
  minExclusive: {
@@ -1033,14 +938,6 @@ export var PropertyShape;
1033
938
  itemType: { kind: "BigInt" },
1034
939
  },
1035
940
  },
1036
- name: {
1037
- kind: "Shacl",
1038
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
1039
- type: {
1040
- kind: "Option",
1041
- itemType: { kind: "String" },
1042
- },
1043
- },
1044
941
  node: {
1045
942
  kind: "Shacl",
1046
943
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
@@ -1086,31 +983,70 @@ export var PropertyShape;
1086
983
  },
1087
984
  },
1088
985
  },
1089
- order: {
986
+ pattern: {
1090
987
  kind: "Shacl",
1091
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
1092
- type: { kind: "Option", itemType: { kind: "Float" } },
988
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
989
+ type: {
990
+ kind: "Option",
991
+ itemType: { kind: "String" },
992
+ },
1093
993
  },
1094
- path: {
994
+ properties: {
1095
995
  kind: "Shacl",
1096
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
1097
- get type() {
1098
- return $PropertyPath.schema;
996
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
997
+ type: {
998
+ kind: "Set",
999
+ itemType: { kind: "Identifier" },
1099
1000
  },
1100
1001
  },
1101
- patterns: {
1002
+ severity: {
1102
1003
  kind: "Shacl",
1103
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
1104
- type: { kind: "Set", itemType: { kind: "String" } },
1004
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
1005
+ type: {
1006
+ kind: "Option",
1007
+ itemType: {
1008
+ kind: "Iri",
1009
+ in: [
1010
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
1011
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
1012
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
1013
+ ],
1014
+ },
1015
+ },
1105
1016
  },
1106
- uniqueLang: {
1017
+ subClassOf: {
1107
1018
  kind: "Shacl",
1108
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
1019
+ path: $RdfVocabularies.rdfs.subClassOf,
1020
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1021
+ },
1022
+ targetClasses: {
1023
+ kind: "Shacl",
1024
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
1025
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1026
+ },
1027
+ targetNodes: {
1028
+ kind: "Shacl",
1029
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
1109
1030
  type: {
1110
- kind: "Option",
1111
- itemType: { kind: "Boolean" },
1031
+ kind: "Set",
1032
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
1112
1033
  },
1113
1034
  },
1035
+ targetObjectsOf: {
1036
+ kind: "Shacl",
1037
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
1038
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1039
+ },
1040
+ targetSubjectsOf: {
1041
+ kind: "Shacl",
1042
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
1043
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1044
+ },
1045
+ types: {
1046
+ kind: "Shacl",
1047
+ path: $RdfVocabularies.rdf.type,
1048
+ type: { kind: "Set", itemType: { kind: "Iri" } },
1049
+ },
1114
1050
  xone: {
1115
1051
  kind: "Shacl",
1116
1052
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
@@ -1124,11 +1060,11 @@ export var PropertyShape;
1124
1060
  },
1125
1061
  },
1126
1062
  };
1127
- PropertyShape._toRdfResource = (parameters) => {
1063
+ NodeShape._toRdfResource = (parameters) => {
1128
1064
  if (!parameters.ignoreRdfType) {
1129
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), parameters.graph);
1065
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), parameters.graph);
1130
1066
  }
1131
- parameters.resource.add(PropertyShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
1067
+ parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
1132
1068
  value.length > 0
1133
1069
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1134
1070
  if (itemIndex === 0) {
@@ -1150,24 +1086,48 @@ export var PropertyShape;
1150
1086
  }).listResource.identifier
1151
1087
  : $RdfVocabularies.rdf.nil,
1152
1088
  ]), parameters.graph);
1153
- parameters.resource.add(PropertyShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
1154
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
1089
+ parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
1090
+ parameters.resource.add(NodeShape.schema.properties.closed.path, parameters.object.closed
1091
+ .toList()
1092
+ .flatMap((value) => [
1093
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1094
+ ]), parameters.graph);
1095
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
1155
1096
  .toList()
1156
1097
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1157
- parameters.resource.add(PropertyShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
1158
- parameters.resource.add(PropertyShape.schema.properties.deactivated.path, parameters.object.deactivated
1098
+ parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
1099
+ parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
1159
1100
  .toList()
1160
1101
  .flatMap((value) => [
1161
1102
  $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1162
1103
  ]), parameters.graph);
1163
- parameters.resource.add(PropertyShape.schema.properties.defaultValue.path, parameters.object.defaultValue.toList(), parameters.graph);
1164
- parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
1104
+ parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
1165
1105
  .toList()
1166
1106
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1167
- parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
1168
- parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
1169
- parameters.resource.add(PropertyShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
1170
- parameters.resource.add(PropertyShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
1107
+ parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
1108
+ parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
1109
+ value.length > 0
1110
+ ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1111
+ if (itemIndex === 0) {
1112
+ currentSubListResource = listResource;
1113
+ }
1114
+ else {
1115
+ const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
1116
+ currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
1117
+ currentSubListResource = newSubListResource;
1118
+ }
1119
+ currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
1120
+ if (itemIndex + 1 === list.length) {
1121
+ currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
1122
+ }
1123
+ return { currentSubListResource, listResource };
1124
+ }, {
1125
+ currentSubListResource: null,
1126
+ listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
1127
+ }).listResource.identifier
1128
+ : $RdfVocabularies.rdf.nil,
1129
+ ]), parameters.graph);
1130
+ parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
1171
1131
  value.length > 0
1172
1132
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1173
1133
  if (itemIndex === 0) {
@@ -1189,11 +1149,11 @@ export var PropertyShape;
1189
1149
  }).listResource.identifier
1190
1150
  : $RdfVocabularies.rdf.nil,
1191
1151
  ]), parameters.graph);
1192
- parameters.resource.add(PropertyShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
1193
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
1152
+ parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
1153
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
1194
1154
  .toList()
1195
1155
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1196
- parameters.resource.add(PropertyShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
1156
+ parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
1197
1157
  value.length > 0
1198
1158
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1199
1159
  if (itemIndex === 0) {
@@ -1215,37 +1175,27 @@ export var PropertyShape;
1215
1175
  }).listResource.identifier
1216
1176
  : $RdfVocabularies.rdf.nil,
1217
1177
  ]), parameters.graph);
1218
- parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
1178
+ parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
1179
+ parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
1180
+ parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
1219
1181
  .toList()
1220
1182
  .flatMap((value) => [
1221
1183
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1222
1184
  ]), parameters.graph);
1223
- parameters.resource.add(PropertyShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
1224
- parameters.resource.add(PropertyShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
1225
- parameters.resource.add(PropertyShape.schema.properties.maxLength.path, parameters.object.maxLength
1185
+ parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
1226
1186
  .toList()
1227
- .flatMap((value) => [
1228
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1229
- ]), parameters.graph);
1230
- parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
1231
- .toList()
1232
- .flatMap((value) => [
1233
- $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1234
- ]), parameters.graph);
1235
- parameters.resource.add(PropertyShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
1236
- parameters.resource.add(PropertyShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
1237
- parameters.resource.add(PropertyShape.schema.properties.minLength.path, parameters.object.minLength
1187
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1188
+ parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
1189
+ parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
1190
+ parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
1238
1191
  .toList()
1239
1192
  .flatMap((value) => [
1240
1193
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
1241
1194
  ]), parameters.graph);
1242
- parameters.resource.add(PropertyShape.schema.properties.name.path, parameters.object.name
1243
- .toList()
1244
- .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1245
- parameters.resource.add(PropertyShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
1246
- parameters.resource.add(PropertyShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
1247
- parameters.resource.add(PropertyShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
1248
- parameters.resource.add(PropertyShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
1195
+ parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
1196
+ parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
1197
+ parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
1198
+ parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
1249
1199
  value.length > 0
1250
1200
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1251
1201
  if (itemIndex === 0) {
@@ -1267,26 +1217,18 @@ export var PropertyShape;
1267
1217
  }).listResource.identifier
1268
1218
  : $RdfVocabularies.rdf.nil,
1269
1219
  ]), parameters.graph);
1270
- parameters.resource.add(PropertyShape.schema.properties.order.path, parameters.object.order
1271
- .toList()
1272
- .flatMap((value) => [
1273
- $literalFactory.number(value, $RdfVocabularies.xsd.double),
1274
- ]), parameters.graph);
1275
- parameters.resource.add(PropertyShape.schema.properties.path.path, [
1276
- $PropertyPath.toRdfResource(parameters.object.path, {
1277
- graph: parameters.graph,
1278
- resourceSet: parameters.resourceSet,
1279
- }).identifier,
1280
- ], parameters.graph);
1281
- parameters.resource.add(PropertyShape.schema.properties.patterns.path, parameters.object.patterns.flatMap((item) => [
1282
- $literalFactory.string(item),
1283
- ]), parameters.graph);
1284
- parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
1220
+ parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
1285
1221
  .toList()
1286
- .flatMap((value) => [
1287
- $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
1288
- ]), parameters.graph);
1289
- parameters.resource.add(PropertyShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
1222
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1223
+ parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
1224
+ parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
1225
+ parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
1226
+ parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
1227
+ parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
1228
+ parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
1229
+ parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
1230
+ parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
1231
+ parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
1290
1232
  value.length > 0
1291
1233
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
1292
1234
  if (itemIndex === 0) {
@@ -1310,101 +1252,78 @@ export var PropertyShape;
1310
1252
  ]), parameters.graph);
1311
1253
  return parameters.resource;
1312
1254
  };
1313
- PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
1314
- function _propertiesToStrings(_propertyShape) {
1315
- return $compactRecord({
1316
- $identifier: _propertyShape.$identifier().toString(),
1317
- label: _propertyShape.label.map((item) => item.toString()).extract(),
1318
- name: _propertyShape.name.map((item) => item.toString()).extract(),
1319
- path: $PropertyPath.$toString(_propertyShape.path),
1320
- });
1321
- }
1322
- PropertyShape._propertiesToStrings = _propertiesToStrings;
1323
- function $toString(_propertyShape) {
1324
- return `PropertyShape(${JSON.stringify(_propertiesToStrings(_propertyShape))})`;
1325
- }
1326
- PropertyShape.$toString = $toString;
1327
- })(PropertyShape || (PropertyShape = {}));
1328
- export var PropertyGroup;
1329
- (function (PropertyGroup) {
1330
- function create(parameters) {
1331
- return $sequenceRecord({
1332
- $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1333
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1334
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1335
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyGroup" }, { $toString }));
1336
- }
1337
- PropertyGroup.create = create;
1255
+ NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
1256
+ NodeShape.$toString = (_nodeShape) => `NodeShape(${JSON.stringify(NodeShape.toStringRecord(_nodeShape))})`;
1257
+ NodeShape.toStringRecord = (_nodeShape) => $compactRecord({
1258
+ $identifier: _nodeShape.$identifier().toString(),
1259
+ label: _nodeShape.label.map((item) => item.toString()).extract(),
1260
+ });
1261
+ })(NodeShape || (NodeShape = {}));
1262
+ export var Ontology;
1263
+ (function (Ontology) {
1264
+ Ontology.create = (parameters) => $sequenceRecord({
1265
+ $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1266
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
1267
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
1268
+ })
1269
+ .map((properties) => ({ ...properties, $type: "Ontology" }))
1270
+ .map((object) => $monkeyPatchObject(object, { $toString: Ontology.$toString }));
1338
1271
  function createUnsafe(parameters) {
1339
- return create(parameters).unsafeCoerce();
1272
+ return Ontology.create(parameters).unsafeCoerce();
1340
1273
  }
1341
- PropertyGroup.createUnsafe = createUnsafe;
1274
+ Ontology.createUnsafe = createUnsafe;
1275
+ Ontology._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
1276
+ ? $ensureRdfResourceType($resource, [Ontology.schema.fromRdfType], {
1277
+ graph: _$options.graph,
1278
+ })
1279
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1280
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
1281
+ dataFactory: dataFactory,
1282
+ focusResource: $resource,
1283
+ propertyPath: $RdfVocabularies.rdf.subject,
1284
+ term: $resource.identifier,
1285
+ }).toValues(), {
1286
+ context: _$options.context,
1287
+ graph: _$options.graph,
1288
+ focusResource: $resource,
1289
+ preferredLanguages: _$options.preferredLanguages,
1290
+ propertyPath: $RdfVocabularies.rdf.subject,
1291
+ schema: Ontology.schema.properties.$identifier.type,
1292
+ }).chain((values) => values.head()),
1293
+ comment: $shaclPropertyFromRdf({
1294
+ context: _$options.context,
1295
+ graph: _$options.graph,
1296
+ focusResource: $resource,
1297
+ ignoreRdfType: true,
1298
+ preferredLanguages: _$options.preferredLanguages,
1299
+ propertySchema: Ontology.schema.properties.comment,
1300
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1301
+ }),
1302
+ label: $shaclPropertyFromRdf({
1303
+ context: _$options.context,
1304
+ graph: _$options.graph,
1305
+ focusResource: $resource,
1306
+ ignoreRdfType: true,
1307
+ preferredLanguages: _$options.preferredLanguages,
1308
+ propertySchema: Ontology.schema.properties.label,
1309
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1310
+ }),
1311
+ }).chain((properties) => Ontology.create(properties)));
1312
+ Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
1313
+ Ontology.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
1314
+ .toResource()
1315
+ .chain((resource) => Ontology.fromRdfResource(resource, options)));
1342
1316
  let Identifier;
1343
1317
  (function (Identifier) {
1344
1318
  Identifier.parse = $parseIdentifier;
1345
1319
  Identifier.stringify = NTriplesTerm.stringify;
1346
- })(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
1347
- PropertyGroup._fromRdfResource = ($resource, _$options) => {
1348
- return (!_$options.ignoreRdfType
1349
- ? $ensureRdfResourceType($resource, [PropertyGroup.fromRdfType], {
1350
- graph: _$options.graph,
1351
- })
1352
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1353
- $identifier: Right(new Resource.Value({
1354
- dataFactory: dataFactory,
1355
- focusResource: $resource,
1356
- propertyPath: $RdfVocabularies.rdf.subject,
1357
- term: $resource.identifier,
1358
- }).toValues())
1359
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1360
- .chain((values) => values.head()),
1361
- comment: $shaclPropertyFromRdf({
1362
- graph: _$options.graph,
1363
- resource: $resource,
1364
- propertySchema: PropertyGroup.schema.properties.comment,
1365
- typeFromRdf: (resourceValues) => resourceValues
1366
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1367
- .chain((values) => values.chainMap((value) => value.toString()))
1368
- .map((values) => values.length > 0
1369
- ? values.map((value) => Maybe.of(value))
1370
- : Resource.Values.fromValue({
1371
- focusResource: $resource,
1372
- propertyPath: PropertyShape.schema.properties.comment.path,
1373
- value: Maybe.empty(),
1374
- })),
1375
- }),
1376
- label: $shaclPropertyFromRdf({
1377
- graph: _$options.graph,
1378
- resource: $resource,
1379
- propertySchema: PropertyGroup.schema.properties.label,
1380
- typeFromRdf: (resourceValues) => resourceValues
1381
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1382
- .chain((values) => values.chainMap((value) => value.toString()))
1383
- .map((values) => values.length > 0
1384
- ? values.map((value) => Maybe.of(value))
1385
- : Resource.Values.fromValue({
1386
- focusResource: $resource,
1387
- propertyPath: PropertyShape.schema.properties.label.path,
1388
- value: Maybe.empty(),
1389
- })),
1390
- }),
1391
- }).chain((properties) => create(properties)));
1392
- };
1393
- PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
1394
- PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
1395
- .toResource()
1396
- .chain((resource) => PropertyGroup.fromRdfResource(resource, options))));
1397
- PropertyGroup.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
1398
- function isPropertyGroup(object) {
1399
- switch (object.$type) {
1400
- case "PropertyGroup":
1401
- return true;
1402
- default:
1403
- return false;
1404
- }
1320
+ })(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
1321
+ function isOntology(object) {
1322
+ return object.$type === "Ontology";
1405
1323
  }
1406
- PropertyGroup.isPropertyGroup = isPropertyGroup;
1407
- PropertyGroup.schema = {
1324
+ Ontology.isOntology = isOntology;
1325
+ Ontology.schema = {
1326
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
1408
1327
  properties: {
1409
1328
  $identifier: {
1410
1329
  kind: "Identifier",
@@ -1428,111 +1347,90 @@ export var PropertyGroup;
1428
1347
  },
1429
1348
  },
1430
1349
  };
1431
- PropertyGroup._toRdfResource = (parameters) => {
1350
+ Ontology._toRdfResource = (parameters) => {
1432
1351
  if (!parameters.ignoreRdfType) {
1433
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), parameters.graph);
1352
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), parameters.graph);
1434
1353
  }
1435
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
1354
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
1436
1355
  .toList()
1437
1356
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1438
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
1357
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
1439
1358
  .toList()
1440
1359
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1441
1360
  return parameters.resource;
1442
1361
  };
1443
- PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
1444
- function _propertiesToStrings(_propertyGroup) {
1445
- return $compactRecord({
1446
- $identifier: _propertyGroup.$identifier().toString(),
1447
- label: _propertyGroup.label.map((item) => item.toString()).extract(),
1448
- });
1449
- }
1450
- PropertyGroup._propertiesToStrings = _propertiesToStrings;
1451
- function $toString(_propertyGroup) {
1452
- return `PropertyGroup(${JSON.stringify(_propertiesToStrings(_propertyGroup))})`;
1453
- }
1454
- PropertyGroup.$toString = $toString;
1455
- })(PropertyGroup || (PropertyGroup = {}));
1456
- export var Ontology;
1457
- (function (Ontology) {
1458
- function create(parameters) {
1459
- return $sequenceRecord({
1460
- $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1461
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1462
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1463
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "Ontology" }, { $toString }));
1464
- }
1465
- Ontology.create = create;
1362
+ Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
1363
+ Ontology.$toString = (_ontology) => `Ontology(${JSON.stringify(Ontology.toStringRecord(_ontology))})`;
1364
+ Ontology.toStringRecord = (_ontology) => $compactRecord({
1365
+ $identifier: _ontology.$identifier().toString(),
1366
+ label: _ontology.label.map((item) => item.toString()).extract(),
1367
+ });
1368
+ })(Ontology || (Ontology = {}));
1369
+ export var PropertyGroup;
1370
+ (function (PropertyGroup) {
1371
+ PropertyGroup.create = (parameters) => $sequenceRecord({
1372
+ $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1373
+ comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
1374
+ label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
1375
+ })
1376
+ .map((properties) => ({ ...properties, $type: "PropertyGroup" }))
1377
+ .map((object) => $monkeyPatchObject(object, { $toString: PropertyGroup.$toString }));
1466
1378
  function createUnsafe(parameters) {
1467
- return create(parameters).unsafeCoerce();
1379
+ return PropertyGroup.create(parameters).unsafeCoerce();
1468
1380
  }
1469
- Ontology.createUnsafe = createUnsafe;
1381
+ PropertyGroup.createUnsafe = createUnsafe;
1382
+ PropertyGroup._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
1383
+ ? $ensureRdfResourceType($resource, [PropertyGroup.schema.fromRdfType], {
1384
+ graph: _$options.graph,
1385
+ })
1386
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1387
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
1388
+ dataFactory: dataFactory,
1389
+ focusResource: $resource,
1390
+ propertyPath: $RdfVocabularies.rdf.subject,
1391
+ term: $resource.identifier,
1392
+ }).toValues(), {
1393
+ context: _$options.context,
1394
+ graph: _$options.graph,
1395
+ focusResource: $resource,
1396
+ preferredLanguages: _$options.preferredLanguages,
1397
+ propertyPath: $RdfVocabularies.rdf.subject,
1398
+ schema: PropertyGroup.schema.properties.$identifier.type,
1399
+ }).chain((values) => values.head()),
1400
+ comment: $shaclPropertyFromRdf({
1401
+ context: _$options.context,
1402
+ graph: _$options.graph,
1403
+ focusResource: $resource,
1404
+ ignoreRdfType: true,
1405
+ preferredLanguages: _$options.preferredLanguages,
1406
+ propertySchema: PropertyGroup.schema.properties.comment,
1407
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1408
+ }),
1409
+ label: $shaclPropertyFromRdf({
1410
+ context: _$options.context,
1411
+ graph: _$options.graph,
1412
+ focusResource: $resource,
1413
+ ignoreRdfType: true,
1414
+ preferredLanguages: _$options.preferredLanguages,
1415
+ propertySchema: PropertyGroup.schema.properties.label,
1416
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1417
+ }),
1418
+ }).chain((properties) => PropertyGroup.create(properties)));
1419
+ PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
1420
+ PropertyGroup.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
1421
+ .toResource()
1422
+ .chain((resource) => PropertyGroup.fromRdfResource(resource, options)));
1470
1423
  let Identifier;
1471
1424
  (function (Identifier) {
1472
1425
  Identifier.parse = $parseIdentifier;
1473
1426
  Identifier.stringify = NTriplesTerm.stringify;
1474
- })(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
1475
- Ontology._fromRdfResource = ($resource, _$options) => {
1476
- return (!_$options.ignoreRdfType
1477
- ? $ensureRdfResourceType($resource, [Ontology.fromRdfType], {
1478
- graph: _$options.graph,
1479
- })
1480
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1481
- $identifier: Right(new Resource.Value({
1482
- dataFactory: dataFactory,
1483
- focusResource: $resource,
1484
- propertyPath: $RdfVocabularies.rdf.subject,
1485
- term: $resource.identifier,
1486
- }).toValues())
1487
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1488
- .chain((values) => values.head()),
1489
- comment: $shaclPropertyFromRdf({
1490
- graph: _$options.graph,
1491
- resource: $resource,
1492
- propertySchema: Ontology.schema.properties.comment,
1493
- typeFromRdf: (resourceValues) => resourceValues
1494
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1495
- .chain((values) => values.chainMap((value) => value.toString()))
1496
- .map((values) => values.length > 0
1497
- ? values.map((value) => Maybe.of(value))
1498
- : Resource.Values.fromValue({
1499
- focusResource: $resource,
1500
- propertyPath: PropertyShape.schema.properties.comment.path,
1501
- value: Maybe.empty(),
1502
- })),
1503
- }),
1504
- label: $shaclPropertyFromRdf({
1505
- graph: _$options.graph,
1506
- resource: $resource,
1507
- propertySchema: Ontology.schema.properties.label,
1508
- typeFromRdf: (resourceValues) => resourceValues
1509
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1510
- .chain((values) => values.chainMap((value) => value.toString()))
1511
- .map((values) => values.length > 0
1512
- ? values.map((value) => Maybe.of(value))
1513
- : Resource.Values.fromValue({
1514
- focusResource: $resource,
1515
- propertyPath: PropertyShape.schema.properties.label.path,
1516
- value: Maybe.empty(),
1517
- })),
1518
- }),
1519
- }).chain((properties) => create(properties)));
1520
- };
1521
- Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
1522
- Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
1523
- .toResource()
1524
- .chain((resource) => Ontology.fromRdfResource(resource, options))));
1525
- Ontology.fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
1526
- function isOntology(object) {
1527
- switch (object.$type) {
1528
- case "Ontology":
1529
- return true;
1530
- default:
1531
- return false;
1532
- }
1427
+ })(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
1428
+ function isPropertyGroup(object) {
1429
+ return object.$type === "PropertyGroup";
1533
1430
  }
1534
- Ontology.isOntology = isOntology;
1535
- Ontology.schema = {
1431
+ PropertyGroup.isPropertyGroup = isPropertyGroup;
1432
+ PropertyGroup.schema = {
1433
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"),
1536
1434
  properties: {
1537
1435
  $identifier: {
1538
1436
  kind: "Identifier",
@@ -1556,600 +1454,530 @@ export var Ontology;
1556
1454
  },
1557
1455
  },
1558
1456
  };
1559
- Ontology._toRdfResource = (parameters) => {
1457
+ PropertyGroup._toRdfResource = (parameters) => {
1560
1458
  if (!parameters.ignoreRdfType) {
1561
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), parameters.graph);
1459
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), parameters.graph);
1562
1460
  }
1563
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
1461
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
1564
1462
  .toList()
1565
1463
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1566
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
1464
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
1567
1465
  .toList()
1568
1466
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
1569
1467
  return parameters.resource;
1570
1468
  };
1571
- Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
1572
- function _propertiesToStrings(_ontology) {
1573
- return $compactRecord({
1574
- $identifier: _ontology.$identifier().toString(),
1575
- label: _ontology.label.map((item) => item.toString()).extract(),
1576
- });
1577
- }
1578
- Ontology._propertiesToStrings = _propertiesToStrings;
1579
- function $toString(_ontology) {
1580
- return `Ontology(${JSON.stringify(_propertiesToStrings(_ontology))})`;
1581
- }
1582
- Ontology.$toString = $toString;
1583
- })(Ontology || (Ontology = {}));
1584
- export var NodeShape;
1585
- (function (NodeShape) {
1586
- function create(parameters) {
1587
- return $sequenceRecord({
1588
- $identifier: $convertToIdentifierProperty(parameters?.$identifier),
1589
- and: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.and.type, value)),
1590
- classes: $convertToArray(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.classes.type, value)),
1591
- closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
1592
- comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
1593
- datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.datatype.type, value)),
1594
- deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.deactivated.type, value)),
1595
- flags: $convertToArray($identityConversionFunction, true)(parameters?.flags).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.flags.type, value)),
1596
- hasValues: $convertToArray($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.hasValues.type, value)),
1597
- ignoredProperties: $convertToMaybe($convertToArray(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
1598
- in_: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.in_.type, value)),
1599
- isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.isDefinedBy.type, value)),
1600
- label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
1601
- languageIn: $convertToMaybe($convertToArray($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.languageIn.type, value)),
1602
- maxCount: $convertToMaybe($identityConversionFunction)(parameters?.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
1603
- maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxExclusive.type, value)),
1604
- maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxInclusive.type, value)),
1605
- maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxLength.type, value)),
1606
- minCount: $convertToMaybe($identityConversionFunction)(parameters?.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
1607
- minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minExclusive.type, value)),
1608
- minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minInclusive.type, value)),
1609
- minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minLength.type, value)),
1610
- node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.node.type, value)),
1611
- nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.nodeKind.type, value)),
1612
- not: $convertToArray($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.not.type, value)),
1613
- or: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.or.type, value)),
1614
- patterns: $convertToArray($identityConversionFunction, true)(parameters?.patterns).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.patterns.type, value)),
1615
- properties: $convertToArray($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
1616
- subClassOf: $convertToArray(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
1617
- types: $convertToArray(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
1618
- xone: $convertToMaybe($convertToArray($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(PropertyShape.schema.properties.xone.type, value)),
1619
- }).map((properties) => $monkeyPatchObject({ ...properties, $type: "NodeShape" }, { $toString }));
1620
- }
1621
- NodeShape.create = create;
1469
+ PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
1470
+ PropertyGroup.$toString = (_propertyGroup) => `PropertyGroup(${JSON.stringify(PropertyGroup.toStringRecord(_propertyGroup))})`;
1471
+ PropertyGroup.toStringRecord = (_propertyGroup) => $compactRecord({
1472
+ $identifier: _propertyGroup.$identifier().toString(),
1473
+ label: _propertyGroup.label.map((item) => item.toString()).extract(),
1474
+ });
1475
+ })(PropertyGroup || (PropertyGroup = {}));
1476
+ export var PropertyShape;
1477
+ (function (PropertyShape) {
1478
+ PropertyShape.create = (parameters) => $sequenceRecord({
1479
+ $identifier: $convertToIdentifierProperty(parameters.$identifier),
1480
+ and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
1481
+ classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
1482
+ comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
1483
+ datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
1484
+ deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
1485
+ defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
1486
+ description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
1487
+ disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
1488
+ equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
1489
+ flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
1490
+ groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
1491
+ hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
1492
+ in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
1493
+ isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
1494
+ label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
1495
+ languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
1496
+ lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
1497
+ lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
1498
+ maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
1499
+ maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
1500
+ maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
1501
+ maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
1502
+ message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
1503
+ minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
1504
+ minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
1505
+ minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
1506
+ minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
1507
+ name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
1508
+ node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
1509
+ nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
1510
+ not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
1511
+ or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
1512
+ order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
1513
+ path: Either.of(parameters.path),
1514
+ pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
1515
+ qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
1516
+ qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
1517
+ qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
1518
+ qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
1519
+ severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
1520
+ targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
1521
+ targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
1522
+ targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
1523
+ targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
1524
+ uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
1525
+ xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
1526
+ })
1527
+ .map((properties) => ({ ...properties, $type: "PropertyShape" }))
1528
+ .map((object) => $monkeyPatchObject(object, { $toString: PropertyShape.$toString }));
1622
1529
  function createUnsafe(parameters) {
1623
- return create(parameters).unsafeCoerce();
1530
+ return PropertyShape.create(parameters).unsafeCoerce();
1624
1531
  }
1625
- NodeShape.createUnsafe = createUnsafe;
1532
+ PropertyShape.createUnsafe = createUnsafe;
1533
+ PropertyShape._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
1534
+ ? $ensureRdfResourceType($resource, [PropertyShape.schema.fromRdfType], {
1535
+ graph: _$options.graph,
1536
+ })
1537
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1538
+ $identifier: $identifierFromRdfResourceValues(new Resource.Value({
1539
+ dataFactory: dataFactory,
1540
+ focusResource: $resource,
1541
+ propertyPath: $RdfVocabularies.rdf.subject,
1542
+ term: $resource.identifier,
1543
+ }).toValues(), {
1544
+ context: _$options.context,
1545
+ graph: _$options.graph,
1546
+ focusResource: $resource,
1547
+ preferredLanguages: _$options.preferredLanguages,
1548
+ propertyPath: $RdfVocabularies.rdf.subject,
1549
+ schema: PropertyShape.schema.properties.$identifier.type,
1550
+ }).chain((values) => values.head()),
1551
+ and: $shaclPropertyFromRdf({
1552
+ context: _$options.context,
1553
+ graph: _$options.graph,
1554
+ focusResource: $resource,
1555
+ ignoreRdfType: true,
1556
+ preferredLanguages: _$options.preferredLanguages,
1557
+ propertySchema: PropertyShape.schema.properties.and,
1558
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
1559
+ }),
1560
+ classes: $shaclPropertyFromRdf({
1561
+ context: _$options.context,
1562
+ graph: _$options.graph,
1563
+ focusResource: $resource,
1564
+ ignoreRdfType: true,
1565
+ preferredLanguages: _$options.preferredLanguages,
1566
+ propertySchema: PropertyShape.schema.properties.classes,
1567
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1568
+ }),
1569
+ comment: $shaclPropertyFromRdf({
1570
+ context: _$options.context,
1571
+ graph: _$options.graph,
1572
+ focusResource: $resource,
1573
+ ignoreRdfType: true,
1574
+ preferredLanguages: _$options.preferredLanguages,
1575
+ propertySchema: PropertyShape.schema.properties.comment,
1576
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1577
+ }),
1578
+ datatype: $shaclPropertyFromRdf({
1579
+ context: _$options.context,
1580
+ graph: _$options.graph,
1581
+ focusResource: $resource,
1582
+ ignoreRdfType: true,
1583
+ preferredLanguages: _$options.preferredLanguages,
1584
+ propertySchema: PropertyShape.schema.properties.datatype,
1585
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
1586
+ }),
1587
+ deactivated: $shaclPropertyFromRdf({
1588
+ context: _$options.context,
1589
+ graph: _$options.graph,
1590
+ focusResource: $resource,
1591
+ ignoreRdfType: true,
1592
+ preferredLanguages: _$options.preferredLanguages,
1593
+ propertySchema: PropertyShape.schema.properties.deactivated,
1594
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
1595
+ }),
1596
+ defaultValue: $shaclPropertyFromRdf({
1597
+ context: _$options.context,
1598
+ graph: _$options.graph,
1599
+ focusResource: $resource,
1600
+ ignoreRdfType: true,
1601
+ preferredLanguages: _$options.preferredLanguages,
1602
+ propertySchema: PropertyShape.schema.properties.defaultValue,
1603
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($termFromRdfResourceValues)),
1604
+ }),
1605
+ description: $shaclPropertyFromRdf({
1606
+ context: _$options.context,
1607
+ graph: _$options.graph,
1608
+ focusResource: $resource,
1609
+ ignoreRdfType: true,
1610
+ preferredLanguages: _$options.preferredLanguages,
1611
+ propertySchema: PropertyShape.schema.properties.description,
1612
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1613
+ }),
1614
+ disjoint: $shaclPropertyFromRdf({
1615
+ context: _$options.context,
1616
+ graph: _$options.graph,
1617
+ focusResource: $resource,
1618
+ ignoreRdfType: true,
1619
+ preferredLanguages: _$options.preferredLanguages,
1620
+ propertySchema: PropertyShape.schema.properties.disjoint,
1621
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1622
+ }),
1623
+ equals: $shaclPropertyFromRdf({
1624
+ context: _$options.context,
1625
+ graph: _$options.graph,
1626
+ focusResource: $resource,
1627
+ ignoreRdfType: true,
1628
+ preferredLanguages: _$options.preferredLanguages,
1629
+ propertySchema: PropertyShape.schema.properties.equals,
1630
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1631
+ }),
1632
+ flags: $shaclPropertyFromRdf({
1633
+ context: _$options.context,
1634
+ graph: _$options.graph,
1635
+ focusResource: $resource,
1636
+ ignoreRdfType: true,
1637
+ preferredLanguages: _$options.preferredLanguages,
1638
+ propertySchema: PropertyShape.schema.properties.flags,
1639
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1640
+ }),
1641
+ groups: $shaclPropertyFromRdf({
1642
+ context: _$options.context,
1643
+ graph: _$options.graph,
1644
+ focusResource: $resource,
1645
+ ignoreRdfType: true,
1646
+ preferredLanguages: _$options.preferredLanguages,
1647
+ propertySchema: PropertyShape.schema.properties.groups,
1648
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
1649
+ }),
1650
+ hasValues: $shaclPropertyFromRdf({
1651
+ context: _$options.context,
1652
+ graph: _$options.graph,
1653
+ focusResource: $resource,
1654
+ ignoreRdfType: true,
1655
+ preferredLanguages: _$options.preferredLanguages,
1656
+ propertySchema: PropertyShape.schema.properties.hasValues,
1657
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
1658
+ }),
1659
+ in_: $shaclPropertyFromRdf({
1660
+ context: _$options.context,
1661
+ graph: _$options.graph,
1662
+ focusResource: $resource,
1663
+ ignoreRdfType: true,
1664
+ preferredLanguages: _$options.preferredLanguages,
1665
+ propertySchema: PropertyShape.schema.properties.in_,
1666
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($termFromRdfResourceValues))),
1667
+ }),
1668
+ isDefinedBy: $shaclPropertyFromRdf({
1669
+ context: _$options.context,
1670
+ graph: _$options.graph,
1671
+ focusResource: $resource,
1672
+ ignoreRdfType: true,
1673
+ preferredLanguages: _$options.preferredLanguages,
1674
+ propertySchema: PropertyShape.schema.properties.isDefinedBy,
1675
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
1676
+ }),
1677
+ label: $shaclPropertyFromRdf({
1678
+ context: _$options.context,
1679
+ graph: _$options.graph,
1680
+ focusResource: $resource,
1681
+ ignoreRdfType: true,
1682
+ preferredLanguages: _$options.preferredLanguages,
1683
+ propertySchema: PropertyShape.schema.properties.label,
1684
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1685
+ }),
1686
+ languageIn: $shaclPropertyFromRdf({
1687
+ context: _$options.context,
1688
+ graph: _$options.graph,
1689
+ focusResource: $resource,
1690
+ ignoreRdfType: true,
1691
+ preferredLanguages: _$options.preferredLanguages,
1692
+ propertySchema: PropertyShape.schema.properties.languageIn,
1693
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($stringFromRdfResourceValues))),
1694
+ }),
1695
+ lessThan: $shaclPropertyFromRdf({
1696
+ context: _$options.context,
1697
+ graph: _$options.graph,
1698
+ focusResource: $resource,
1699
+ ignoreRdfType: true,
1700
+ preferredLanguages: _$options.preferredLanguages,
1701
+ propertySchema: PropertyShape.schema.properties.lessThan,
1702
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1703
+ }),
1704
+ lessThanOrEquals: $shaclPropertyFromRdf({
1705
+ context: _$options.context,
1706
+ graph: _$options.graph,
1707
+ focusResource: $resource,
1708
+ ignoreRdfType: true,
1709
+ preferredLanguages: _$options.preferredLanguages,
1710
+ propertySchema: PropertyShape.schema.properties.lessThanOrEquals,
1711
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1712
+ }),
1713
+ maxCount: $shaclPropertyFromRdf({
1714
+ context: _$options.context,
1715
+ graph: _$options.graph,
1716
+ focusResource: $resource,
1717
+ ignoreRdfType: true,
1718
+ preferredLanguages: _$options.preferredLanguages,
1719
+ propertySchema: PropertyShape.schema.properties.maxCount,
1720
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1721
+ }),
1722
+ maxExclusive: $shaclPropertyFromRdf({
1723
+ context: _$options.context,
1724
+ graph: _$options.graph,
1725
+ focusResource: $resource,
1726
+ ignoreRdfType: true,
1727
+ preferredLanguages: _$options.preferredLanguages,
1728
+ propertySchema: PropertyShape.schema.properties.maxExclusive,
1729
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
1730
+ }),
1731
+ maxInclusive: $shaclPropertyFromRdf({
1732
+ context: _$options.context,
1733
+ graph: _$options.graph,
1734
+ focusResource: $resource,
1735
+ ignoreRdfType: true,
1736
+ preferredLanguages: _$options.preferredLanguages,
1737
+ propertySchema: PropertyShape.schema.properties.maxInclusive,
1738
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
1739
+ }),
1740
+ maxLength: $shaclPropertyFromRdf({
1741
+ context: _$options.context,
1742
+ graph: _$options.graph,
1743
+ focusResource: $resource,
1744
+ ignoreRdfType: true,
1745
+ preferredLanguages: _$options.preferredLanguages,
1746
+ propertySchema: PropertyShape.schema.properties.maxLength,
1747
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1748
+ }),
1749
+ message: $shaclPropertyFromRdf({
1750
+ context: _$options.context,
1751
+ graph: _$options.graph,
1752
+ focusResource: $resource,
1753
+ ignoreRdfType: true,
1754
+ preferredLanguages: _$options.preferredLanguages,
1755
+ propertySchema: PropertyShape.schema.properties.message,
1756
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1757
+ }),
1758
+ minCount: $shaclPropertyFromRdf({
1759
+ context: _$options.context,
1760
+ graph: _$options.graph,
1761
+ focusResource: $resource,
1762
+ ignoreRdfType: true,
1763
+ preferredLanguages: _$options.preferredLanguages,
1764
+ propertySchema: PropertyShape.schema.properties.minCount,
1765
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1766
+ }),
1767
+ minExclusive: $shaclPropertyFromRdf({
1768
+ context: _$options.context,
1769
+ graph: _$options.graph,
1770
+ focusResource: $resource,
1771
+ ignoreRdfType: true,
1772
+ preferredLanguages: _$options.preferredLanguages,
1773
+ propertySchema: PropertyShape.schema.properties.minExclusive,
1774
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
1775
+ }),
1776
+ minInclusive: $shaclPropertyFromRdf({
1777
+ context: _$options.context,
1778
+ graph: _$options.graph,
1779
+ focusResource: $resource,
1780
+ ignoreRdfType: true,
1781
+ preferredLanguages: _$options.preferredLanguages,
1782
+ propertySchema: PropertyShape.schema.properties.minInclusive,
1783
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
1784
+ }),
1785
+ minLength: $shaclPropertyFromRdf({
1786
+ context: _$options.context,
1787
+ graph: _$options.graph,
1788
+ focusResource: $resource,
1789
+ ignoreRdfType: true,
1790
+ preferredLanguages: _$options.preferredLanguages,
1791
+ propertySchema: PropertyShape.schema.properties.minLength,
1792
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1793
+ }),
1794
+ name: $shaclPropertyFromRdf({
1795
+ context: _$options.context,
1796
+ graph: _$options.graph,
1797
+ focusResource: $resource,
1798
+ ignoreRdfType: true,
1799
+ preferredLanguages: _$options.preferredLanguages,
1800
+ propertySchema: PropertyShape.schema.properties.name,
1801
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1802
+ }),
1803
+ node: $shaclPropertyFromRdf({
1804
+ context: _$options.context,
1805
+ graph: _$options.graph,
1806
+ focusResource: $resource,
1807
+ ignoreRdfType: true,
1808
+ preferredLanguages: _$options.preferredLanguages,
1809
+ propertySchema: PropertyShape.schema.properties.node,
1810
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
1811
+ }),
1812
+ nodeKind: $shaclPropertyFromRdf({
1813
+ context: _$options.context,
1814
+ graph: _$options.graph,
1815
+ focusResource: $resource,
1816
+ ignoreRdfType: true,
1817
+ preferredLanguages: _$options.preferredLanguages,
1818
+ propertySchema: PropertyShape.schema.properties.nodeKind,
1819
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
1820
+ }),
1821
+ not: $shaclPropertyFromRdf({
1822
+ context: _$options.context,
1823
+ graph: _$options.graph,
1824
+ focusResource: $resource,
1825
+ ignoreRdfType: true,
1826
+ preferredLanguages: _$options.preferredLanguages,
1827
+ propertySchema: PropertyShape.schema.properties.not,
1828
+ typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
1829
+ }),
1830
+ or: $shaclPropertyFromRdf({
1831
+ context: _$options.context,
1832
+ graph: _$options.graph,
1833
+ focusResource: $resource,
1834
+ ignoreRdfType: true,
1835
+ preferredLanguages: _$options.preferredLanguages,
1836
+ propertySchema: PropertyShape.schema.properties.or,
1837
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
1838
+ }),
1839
+ order: $shaclPropertyFromRdf({
1840
+ context: _$options.context,
1841
+ graph: _$options.graph,
1842
+ focusResource: $resource,
1843
+ ignoreRdfType: true,
1844
+ preferredLanguages: _$options.preferredLanguages,
1845
+ propertySchema: PropertyShape.schema.properties.order,
1846
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($floatFromRdfResourceValues)),
1847
+ }),
1848
+ path: $shaclPropertyFromRdf({
1849
+ context: _$options.context,
1850
+ graph: _$options.graph,
1851
+ focusResource: $resource,
1852
+ ignoreRdfType: true,
1853
+ preferredLanguages: _$options.preferredLanguages,
1854
+ propertySchema: PropertyShape.schema.properties.path,
1855
+ typeFromRdfResourceValues: $PropertyPath.fromRdfResourceValues,
1856
+ }),
1857
+ pattern: $shaclPropertyFromRdf({
1858
+ context: _$options.context,
1859
+ graph: _$options.graph,
1860
+ focusResource: $resource,
1861
+ ignoreRdfType: true,
1862
+ preferredLanguages: _$options.preferredLanguages,
1863
+ propertySchema: PropertyShape.schema.properties.pattern,
1864
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
1865
+ }),
1866
+ qualifiedMaxCount: $shaclPropertyFromRdf({
1867
+ context: _$options.context,
1868
+ graph: _$options.graph,
1869
+ focusResource: $resource,
1870
+ ignoreRdfType: true,
1871
+ preferredLanguages: _$options.preferredLanguages,
1872
+ propertySchema: PropertyShape.schema.properties.qualifiedMaxCount,
1873
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1874
+ }),
1875
+ qualifiedMinCount: $shaclPropertyFromRdf({
1876
+ context: _$options.context,
1877
+ graph: _$options.graph,
1878
+ focusResource: $resource,
1879
+ ignoreRdfType: true,
1880
+ preferredLanguages: _$options.preferredLanguages,
1881
+ propertySchema: PropertyShape.schema.properties.qualifiedMinCount,
1882
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
1883
+ }),
1884
+ qualifiedValueShape: $shaclPropertyFromRdf({
1885
+ context: _$options.context,
1886
+ graph: _$options.graph,
1887
+ focusResource: $resource,
1888
+ ignoreRdfType: true,
1889
+ preferredLanguages: _$options.preferredLanguages,
1890
+ propertySchema: PropertyShape.schema.properties.qualifiedValueShape,
1891
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
1892
+ }),
1893
+ qualifiedValueShapesDisjoint: $shaclPropertyFromRdf({
1894
+ context: _$options.context,
1895
+ graph: _$options.graph,
1896
+ focusResource: $resource,
1897
+ ignoreRdfType: true,
1898
+ preferredLanguages: _$options.preferredLanguages,
1899
+ propertySchema: PropertyShape.schema.properties.qualifiedValueShapesDisjoint,
1900
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
1901
+ }),
1902
+ severity: $shaclPropertyFromRdf({
1903
+ context: _$options.context,
1904
+ graph: _$options.graph,
1905
+ focusResource: $resource,
1906
+ ignoreRdfType: true,
1907
+ preferredLanguages: _$options.preferredLanguages,
1908
+ propertySchema: PropertyShape.schema.properties.severity,
1909
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
1910
+ }),
1911
+ targetClasses: $shaclPropertyFromRdf({
1912
+ context: _$options.context,
1913
+ graph: _$options.graph,
1914
+ focusResource: $resource,
1915
+ ignoreRdfType: true,
1916
+ preferredLanguages: _$options.preferredLanguages,
1917
+ propertySchema: PropertyShape.schema.properties.targetClasses,
1918
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1919
+ }),
1920
+ targetNodes: $shaclPropertyFromRdf({
1921
+ context: _$options.context,
1922
+ graph: _$options.graph,
1923
+ focusResource: $resource,
1924
+ ignoreRdfType: true,
1925
+ preferredLanguages: _$options.preferredLanguages,
1926
+ propertySchema: PropertyShape.schema.properties.targetNodes,
1927
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
1928
+ }),
1929
+ targetObjectsOf: $shaclPropertyFromRdf({
1930
+ context: _$options.context,
1931
+ graph: _$options.graph,
1932
+ focusResource: $resource,
1933
+ ignoreRdfType: true,
1934
+ preferredLanguages: _$options.preferredLanguages,
1935
+ propertySchema: PropertyShape.schema.properties.targetObjectsOf,
1936
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1937
+ }),
1938
+ targetSubjectsOf: $shaclPropertyFromRdf({
1939
+ context: _$options.context,
1940
+ graph: _$options.graph,
1941
+ focusResource: $resource,
1942
+ ignoreRdfType: true,
1943
+ preferredLanguages: _$options.preferredLanguages,
1944
+ propertySchema: PropertyShape.schema.properties.targetSubjectsOf,
1945
+ typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
1946
+ }),
1947
+ uniqueLang: $shaclPropertyFromRdf({
1948
+ context: _$options.context,
1949
+ graph: _$options.graph,
1950
+ focusResource: $resource,
1951
+ ignoreRdfType: true,
1952
+ preferredLanguages: _$options.preferredLanguages,
1953
+ propertySchema: PropertyShape.schema.properties.uniqueLang,
1954
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
1955
+ }),
1956
+ xone: $shaclPropertyFromRdf({
1957
+ context: _$options.context,
1958
+ graph: _$options.graph,
1959
+ focusResource: $resource,
1960
+ ignoreRdfType: true,
1961
+ preferredLanguages: _$options.preferredLanguages,
1962
+ propertySchema: PropertyShape.schema.properties.xone,
1963
+ typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
1964
+ }),
1965
+ }).chain((properties) => PropertyShape.create(properties)));
1966
+ PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
1967
+ PropertyShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
1968
+ .toResource()
1969
+ .chain((resource) => PropertyShape.fromRdfResource(resource, options)));
1626
1970
  let Identifier;
1627
1971
  (function (Identifier) {
1628
1972
  Identifier.parse = $parseIdentifier;
1629
1973
  Identifier.stringify = NTriplesTerm.stringify;
1630
- })(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
1631
- NodeShape._fromRdfResource = ($resource, _$options) => {
1632
- return (!_$options.ignoreRdfType
1633
- ? $ensureRdfResourceType($resource, [NodeShape.fromRdfType], {
1634
- graph: _$options.graph,
1635
- })
1636
- : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1637
- $identifier: Right(new Resource.Value({
1638
- dataFactory: dataFactory,
1639
- focusResource: $resource,
1640
- propertyPath: $RdfVocabularies.rdf.subject,
1641
- term: $resource.identifier,
1642
- }).toValues())
1643
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1644
- .chain((values) => values.head()),
1645
- and: $shaclPropertyFromRdf({
1646
- graph: _$options.graph,
1647
- resource: $resource,
1648
- propertySchema: NodeShape.schema.properties.and,
1649
- typeFromRdf: (resourceValues) => resourceValues
1650
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1651
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1652
- focusResource: $resource,
1653
- propertyPath: PropertyShape.schema.properties.and.path,
1654
- values: valueList.toArray(),
1655
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1656
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1657
- .map((values) => values.length > 0
1658
- ? values.map((value) => Maybe.of(value))
1659
- : Resource.Values.fromValue({
1660
- focusResource: $resource,
1661
- propertyPath: PropertyShape.schema.properties.and.path,
1662
- value: Maybe.empty(),
1663
- })),
1664
- }),
1665
- classes: $shaclPropertyFromRdf({
1666
- graph: _$options.graph,
1667
- resource: $resource,
1668
- propertySchema: NodeShape.schema.properties.classes,
1669
- typeFromRdf: (resourceValues) => resourceValues
1670
- .chain((values) => values.chainMap((value) => value.toIri()))
1671
- .map((values) => values.toArray())
1672
- .map((valuesArray) => Resource.Values.fromValue({
1673
- focusResource: $resource,
1674
- propertyPath: PropertyShape.schema.properties.classes.path,
1675
- value: valuesArray,
1676
- })),
1677
- }),
1678
- closed: $shaclPropertyFromRdf({
1679
- graph: _$options.graph,
1680
- resource: $resource,
1681
- propertySchema: NodeShape.schema.properties.closed,
1682
- typeFromRdf: (resourceValues) => resourceValues
1683
- .chain((values) => values.chainMap((value) => value.toBoolean()))
1684
- .map((values) => values.length > 0
1685
- ? values.map((value) => Maybe.of(value))
1686
- : Resource.Values.fromValue({
1687
- focusResource: $resource,
1688
- propertyPath: NodeShape.schema.properties.closed.path,
1689
- value: Maybe.empty(),
1690
- })),
1691
- }),
1692
- comment: $shaclPropertyFromRdf({
1693
- graph: _$options.graph,
1694
- resource: $resource,
1695
- propertySchema: NodeShape.schema.properties.comment,
1696
- typeFromRdf: (resourceValues) => resourceValues
1697
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1698
- .chain((values) => values.chainMap((value) => value.toString()))
1699
- .map((values) => values.length > 0
1700
- ? values.map((value) => Maybe.of(value))
1701
- : Resource.Values.fromValue({
1702
- focusResource: $resource,
1703
- propertyPath: PropertyShape.schema.properties.comment.path,
1704
- value: Maybe.empty(),
1705
- })),
1706
- }),
1707
- datatype: $shaclPropertyFromRdf({
1708
- graph: _$options.graph,
1709
- resource: $resource,
1710
- propertySchema: NodeShape.schema.properties.datatype,
1711
- typeFromRdf: (resourceValues) => resourceValues
1712
- .chain((values) => values.chainMap((value) => value.toIri()))
1713
- .map((values) => values.length > 0
1714
- ? values.map((value) => Maybe.of(value))
1715
- : Resource.Values.fromValue({
1716
- focusResource: $resource,
1717
- propertyPath: PropertyShape.schema.properties.datatype.path,
1718
- value: Maybe.empty(),
1719
- })),
1720
- }),
1721
- deactivated: $shaclPropertyFromRdf({
1722
- graph: _$options.graph,
1723
- resource: $resource,
1724
- propertySchema: NodeShape.schema.properties.deactivated,
1725
- typeFromRdf: (resourceValues) => resourceValues
1726
- .chain((values) => values.chainMap((value) => value.toBoolean()))
1727
- .map((values) => values.length > 0
1728
- ? values.map((value) => Maybe.of(value))
1729
- : Resource.Values.fromValue({
1730
- focusResource: $resource,
1731
- propertyPath: PropertyShape.schema.properties.deactivated.path,
1732
- value: Maybe.empty(),
1733
- })),
1734
- }),
1735
- flags: $shaclPropertyFromRdf({
1736
- graph: _$options.graph,
1737
- resource: $resource,
1738
- propertySchema: NodeShape.schema.properties.flags,
1739
- typeFromRdf: (resourceValues) => resourceValues
1740
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1741
- .chain((values) => values.chainMap((value) => value.toString()))
1742
- .map((values) => values.toArray())
1743
- .map((valuesArray) => Resource.Values.fromValue({
1744
- focusResource: $resource,
1745
- propertyPath: PropertyShape.schema.properties.flags.path,
1746
- value: valuesArray,
1747
- })),
1748
- }),
1749
- hasValues: $shaclPropertyFromRdf({
1750
- graph: _$options.graph,
1751
- resource: $resource,
1752
- propertySchema: NodeShape.schema.properties.hasValues,
1753
- typeFromRdf: (resourceValues) => resourceValues
1754
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1755
- switch (term.termType) {
1756
- case "NamedNode":
1757
- case "Literal":
1758
- return Either.of(term);
1759
- default:
1760
- return Left(new Resource.MistypedTermValueError({
1761
- actualValue: term,
1762
- expectedValueType: "(NamedNode | Literal)",
1763
- focusResource: $resource,
1764
- propertyPath: PropertyShape.schema.properties.hasValues.path,
1765
- }));
1766
- }
1767
- })))
1768
- .map((values) => values.toArray())
1769
- .map((valuesArray) => Resource.Values.fromValue({
1770
- focusResource: $resource,
1771
- propertyPath: PropertyShape.schema.properties.hasValues.path,
1772
- value: valuesArray,
1773
- })),
1774
- }),
1775
- ignoredProperties: $shaclPropertyFromRdf({
1776
- graph: _$options.graph,
1777
- resource: $resource,
1778
- propertySchema: NodeShape.schema.properties.ignoredProperties,
1779
- typeFromRdf: (resourceValues) => resourceValues
1780
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1781
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1782
- focusResource: $resource,
1783
- propertyPath: NodeShape.schema.properties.ignoredProperties.path,
1784
- values: valueList.toArray(),
1785
- })).chain((values) => values.chainMap((value) => value.toIri()))))
1786
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1787
- .map((values) => values.length > 0
1788
- ? values.map((value) => Maybe.of(value))
1789
- : Resource.Values.fromValue({
1790
- focusResource: $resource,
1791
- propertyPath: NodeShape.schema.properties.ignoredProperties.path,
1792
- value: Maybe.empty(),
1793
- })),
1794
- }),
1795
- in_: $shaclPropertyFromRdf({
1796
- graph: _$options.graph,
1797
- resource: $resource,
1798
- propertySchema: NodeShape.schema.properties.in_,
1799
- typeFromRdf: (resourceValues) => resourceValues
1800
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1801
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1802
- focusResource: $resource,
1803
- propertyPath: PropertyShape.schema.properties.in_.path,
1804
- values: valueList.toArray(),
1805
- })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1806
- switch (term.termType) {
1807
- case "NamedNode":
1808
- case "Literal":
1809
- return Either.of(term);
1810
- default:
1811
- return Left(new Resource.MistypedTermValueError({
1812
- actualValue: term,
1813
- expectedValueType: "(NamedNode | Literal)",
1814
- focusResource: $resource,
1815
- propertyPath: PropertyShape.schema.properties.in_.path,
1816
- }));
1817
- }
1818
- })))))
1819
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1820
- .map((values) => values.length > 0
1821
- ? values.map((value) => Maybe.of(value))
1822
- : Resource.Values.fromValue({
1823
- focusResource: $resource,
1824
- propertyPath: PropertyShape.schema.properties.in_.path,
1825
- value: Maybe.empty(),
1826
- })),
1827
- }),
1828
- isDefinedBy: $shaclPropertyFromRdf({
1829
- graph: _$options.graph,
1830
- resource: $resource,
1831
- propertySchema: NodeShape.schema.properties.isDefinedBy,
1832
- typeFromRdf: (resourceValues) => resourceValues
1833
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1834
- .map((values) => values.length > 0
1835
- ? values.map((value) => Maybe.of(value))
1836
- : Resource.Values.fromValue({
1837
- focusResource: $resource,
1838
- propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
1839
- value: Maybe.empty(),
1840
- })),
1841
- }),
1842
- label: $shaclPropertyFromRdf({
1843
- graph: _$options.graph,
1844
- resource: $resource,
1845
- propertySchema: NodeShape.schema.properties.label,
1846
- typeFromRdf: (resourceValues) => resourceValues
1847
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1848
- .chain((values) => values.chainMap((value) => value.toString()))
1849
- .map((values) => values.length > 0
1850
- ? values.map((value) => Maybe.of(value))
1851
- : Resource.Values.fromValue({
1852
- focusResource: $resource,
1853
- propertyPath: PropertyShape.schema.properties.label.path,
1854
- value: Maybe.empty(),
1855
- })),
1856
- }),
1857
- languageIn: $shaclPropertyFromRdf({
1858
- graph: _$options.graph,
1859
- resource: $resource,
1860
- propertySchema: NodeShape.schema.properties.languageIn,
1861
- typeFromRdf: (resourceValues) => resourceValues
1862
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1863
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1864
- focusResource: $resource,
1865
- propertyPath: PropertyShape.schema.properties.languageIn.path,
1866
- values: valueList.toArray(),
1867
- }))
1868
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1869
- .chain((values) => values.chainMap((value) => value.toString()))))
1870
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1871
- .map((values) => values.length > 0
1872
- ? values.map((value) => Maybe.of(value))
1873
- : Resource.Values.fromValue({
1874
- focusResource: $resource,
1875
- propertyPath: PropertyShape.schema.properties.languageIn.path,
1876
- value: Maybe.empty(),
1877
- })),
1878
- }),
1879
- maxCount: $shaclPropertyFromRdf({
1880
- graph: _$options.graph,
1881
- resource: $resource,
1882
- propertySchema: NodeShape.schema.properties.maxCount,
1883
- typeFromRdf: (resourceValues) => resourceValues
1884
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1885
- .map((values) => values.length > 0
1886
- ? values.map((value) => Maybe.of(value))
1887
- : Resource.Values.fromValue({
1888
- focusResource: $resource,
1889
- propertyPath: PropertyShape.schema.properties.maxCount.path,
1890
- value: Maybe.empty(),
1891
- })),
1892
- }),
1893
- maxExclusive: $shaclPropertyFromRdf({
1894
- graph: _$options.graph,
1895
- resource: $resource,
1896
- propertySchema: NodeShape.schema.properties.maxExclusive,
1897
- typeFromRdf: (resourceValues) => resourceValues
1898
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1899
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1900
- .map((values) => values.length > 0
1901
- ? values.map((value) => Maybe.of(value))
1902
- : Resource.Values.fromValue({
1903
- focusResource: $resource,
1904
- propertyPath: PropertyShape.schema.properties.maxExclusive.path,
1905
- value: Maybe.empty(),
1906
- })),
1907
- }),
1908
- maxInclusive: $shaclPropertyFromRdf({
1909
- graph: _$options.graph,
1910
- resource: $resource,
1911
- propertySchema: NodeShape.schema.properties.maxInclusive,
1912
- typeFromRdf: (resourceValues) => resourceValues
1913
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1914
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1915
- .map((values) => values.length > 0
1916
- ? values.map((value) => Maybe.of(value))
1917
- : Resource.Values.fromValue({
1918
- focusResource: $resource,
1919
- propertyPath: PropertyShape.schema.properties.maxInclusive.path,
1920
- value: Maybe.empty(),
1921
- })),
1922
- }),
1923
- maxLength: $shaclPropertyFromRdf({
1924
- graph: _$options.graph,
1925
- resource: $resource,
1926
- propertySchema: NodeShape.schema.properties.maxLength,
1927
- typeFromRdf: (resourceValues) => resourceValues
1928
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1929
- .map((values) => values.length > 0
1930
- ? values.map((value) => Maybe.of(value))
1931
- : Resource.Values.fromValue({
1932
- focusResource: $resource,
1933
- propertyPath: PropertyShape.schema.properties.maxLength.path,
1934
- value: Maybe.empty(),
1935
- })),
1936
- }),
1937
- minCount: $shaclPropertyFromRdf({
1938
- graph: _$options.graph,
1939
- resource: $resource,
1940
- propertySchema: NodeShape.schema.properties.minCount,
1941
- typeFromRdf: (resourceValues) => resourceValues
1942
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1943
- .map((values) => values.length > 0
1944
- ? values.map((value) => Maybe.of(value))
1945
- : Resource.Values.fromValue({
1946
- focusResource: $resource,
1947
- propertyPath: PropertyShape.schema.properties.minCount.path,
1948
- value: Maybe.empty(),
1949
- })),
1950
- }),
1951
- minExclusive: $shaclPropertyFromRdf({
1952
- graph: _$options.graph,
1953
- resource: $resource,
1954
- propertySchema: NodeShape.schema.properties.minExclusive,
1955
- typeFromRdf: (resourceValues) => resourceValues
1956
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1957
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1958
- .map((values) => values.length > 0
1959
- ? values.map((value) => Maybe.of(value))
1960
- : Resource.Values.fromValue({
1961
- focusResource: $resource,
1962
- propertyPath: PropertyShape.schema.properties.minExclusive.path,
1963
- value: Maybe.empty(),
1964
- })),
1965
- }),
1966
- minInclusive: $shaclPropertyFromRdf({
1967
- graph: _$options.graph,
1968
- resource: $resource,
1969
- propertySchema: NodeShape.schema.properties.minInclusive,
1970
- typeFromRdf: (resourceValues) => resourceValues
1971
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1972
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1973
- .map((values) => values.length > 0
1974
- ? values.map((value) => Maybe.of(value))
1975
- : Resource.Values.fromValue({
1976
- focusResource: $resource,
1977
- propertyPath: PropertyShape.schema.properties.minInclusive.path,
1978
- value: Maybe.empty(),
1979
- })),
1980
- }),
1981
- minLength: $shaclPropertyFromRdf({
1982
- graph: _$options.graph,
1983
- resource: $resource,
1984
- propertySchema: NodeShape.schema.properties.minLength,
1985
- typeFromRdf: (resourceValues) => resourceValues
1986
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1987
- .map((values) => values.length > 0
1988
- ? values.map((value) => Maybe.of(value))
1989
- : Resource.Values.fromValue({
1990
- focusResource: $resource,
1991
- propertyPath: PropertyShape.schema.properties.minLength.path,
1992
- value: Maybe.empty(),
1993
- })),
1994
- }),
1995
- node: $shaclPropertyFromRdf({
1996
- graph: _$options.graph,
1997
- resource: $resource,
1998
- propertySchema: NodeShape.schema.properties.node,
1999
- typeFromRdf: (resourceValues) => resourceValues
2000
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2001
- .map((values) => values.length > 0
2002
- ? values.map((value) => Maybe.of(value))
2003
- : Resource.Values.fromValue({
2004
- focusResource: $resource,
2005
- propertyPath: PropertyShape.schema.properties.node.path,
2006
- value: Maybe.empty(),
2007
- })),
2008
- }),
2009
- nodeKind: $shaclPropertyFromRdf({
2010
- graph: _$options.graph,
2011
- resource: $resource,
2012
- propertySchema: NodeShape.schema.properties.nodeKind,
2013
- typeFromRdf: (resourceValues) => resourceValues
2014
- .chain((values) => values.chainMap((value) => value.toIri([
2015
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
2016
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
2017
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
2018
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
2019
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
2020
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
2021
- ])))
2022
- .map((values) => values.length > 0
2023
- ? values.map((value) => Maybe.of(value))
2024
- : Resource.Values.fromValue({
2025
- focusResource: $resource,
2026
- propertyPath: PropertyShape.schema.properties.nodeKind.path,
2027
- value: Maybe.empty(),
2028
- })),
2029
- }),
2030
- not: $shaclPropertyFromRdf({
2031
- graph: _$options.graph,
2032
- resource: $resource,
2033
- propertySchema: NodeShape.schema.properties.not,
2034
- typeFromRdf: (resourceValues) => resourceValues
2035
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2036
- .map((values) => values.toArray())
2037
- .map((valuesArray) => Resource.Values.fromValue({
2038
- focusResource: $resource,
2039
- propertyPath: PropertyShape.schema.properties.not.path,
2040
- value: valuesArray,
2041
- })),
2042
- }),
2043
- or: $shaclPropertyFromRdf({
2044
- graph: _$options.graph,
2045
- resource: $resource,
2046
- propertySchema: NodeShape.schema.properties.or,
2047
- typeFromRdf: (resourceValues) => resourceValues
2048
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2049
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2050
- focusResource: $resource,
2051
- propertyPath: PropertyShape.schema.properties.or.path,
2052
- values: valueList.toArray(),
2053
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
2054
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2055
- .map((values) => values.length > 0
2056
- ? values.map((value) => Maybe.of(value))
2057
- : Resource.Values.fromValue({
2058
- focusResource: $resource,
2059
- propertyPath: PropertyShape.schema.properties.or.path,
2060
- value: Maybe.empty(),
2061
- })),
2062
- }),
2063
- patterns: $shaclPropertyFromRdf({
2064
- graph: _$options.graph,
2065
- resource: $resource,
2066
- propertySchema: NodeShape.schema.properties.patterns,
2067
- typeFromRdf: (resourceValues) => resourceValues
2068
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2069
- .chain((values) => values.chainMap((value) => value.toString()))
2070
- .map((values) => values.toArray())
2071
- .map((valuesArray) => Resource.Values.fromValue({
2072
- focusResource: $resource,
2073
- propertyPath: PropertyShape.schema.properties.patterns.path,
2074
- value: valuesArray,
2075
- })),
2076
- }),
2077
- properties: $shaclPropertyFromRdf({
2078
- graph: _$options.graph,
2079
- resource: $resource,
2080
- propertySchema: NodeShape.schema.properties.properties,
2081
- typeFromRdf: (resourceValues) => resourceValues
2082
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2083
- .map((values) => values.toArray())
2084
- .map((valuesArray) => Resource.Values.fromValue({
2085
- focusResource: $resource,
2086
- propertyPath: NodeShape.schema.properties.properties.path,
2087
- value: valuesArray,
2088
- })),
2089
- }),
2090
- subClassOf: $shaclPropertyFromRdf({
2091
- graph: _$options.graph,
2092
- resource: $resource,
2093
- propertySchema: NodeShape.schema.properties.subClassOf,
2094
- typeFromRdf: (resourceValues) => resourceValues
2095
- .chain((values) => values.chainMap((value) => value.toIri()))
2096
- .map((values) => values.toArray())
2097
- .map((valuesArray) => Resource.Values.fromValue({
2098
- focusResource: $resource,
2099
- propertyPath: NodeShape.schema.properties.subClassOf.path,
2100
- value: valuesArray,
2101
- })),
2102
- }),
2103
- types: $shaclPropertyFromRdf({
2104
- graph: _$options.graph,
2105
- resource: $resource,
2106
- propertySchema: NodeShape.schema.properties.types,
2107
- typeFromRdf: (resourceValues) => resourceValues
2108
- .chain((values) => values.chainMap((value) => value.toIri()))
2109
- .map((values) => values.toArray())
2110
- .map((valuesArray) => Resource.Values.fromValue({
2111
- focusResource: $resource,
2112
- propertyPath: NodeShape.schema.properties.types.path,
2113
- value: valuesArray,
2114
- })),
2115
- }),
2116
- xone: $shaclPropertyFromRdf({
2117
- graph: _$options.graph,
2118
- resource: $resource,
2119
- propertySchema: NodeShape.schema.properties.xone,
2120
- typeFromRdf: (resourceValues) => resourceValues
2121
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
2122
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
2123
- focusResource: $resource,
2124
- propertyPath: PropertyShape.schema.properties.xone.path,
2125
- values: valueList.toArray(),
2126
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
2127
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
2128
- .map((values) => values.length > 0
2129
- ? values.map((value) => Maybe.of(value))
2130
- : Resource.Values.fromValue({
2131
- focusResource: $resource,
2132
- propertyPath: PropertyShape.schema.properties.xone.path,
2133
- value: Maybe.empty(),
2134
- })),
2135
- }),
2136
- }).chain((properties) => create(properties)));
2137
- };
2138
- NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
2139
- NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
2140
- .toResource()
2141
- .chain((resource) => NodeShape.fromRdfResource(resource, options))));
2142
- NodeShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
2143
- function isNodeShape(object) {
2144
- switch (object.$type) {
2145
- case "NodeShape":
2146
- return true;
2147
- default:
2148
- return false;
2149
- }
1974
+ })(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
1975
+ function isPropertyShape(object) {
1976
+ return object.$type === "PropertyShape";
2150
1977
  }
2151
- NodeShape.isNodeShape = isNodeShape;
2152
- NodeShape.schema = {
1978
+ PropertyShape.isPropertyShape = isPropertyShape;
1979
+ PropertyShape.schema = {
1980
+ fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"),
2153
1981
  properties: {
2154
1982
  $identifier: {
2155
1983
  kind: "Identifier",
@@ -2171,54 +1999,75 @@ export var NodeShape;
2171
1999
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
2172
2000
  type: { kind: "Set", itemType: { kind: "Iri" } },
2173
2001
  },
2174
- closed: {
2002
+ comment: {
2175
2003
  kind: "Shacl",
2176
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
2004
+ path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
2005
+ type: {
2006
+ kind: "Option",
2007
+ itemType: { kind: "String" },
2008
+ },
2009
+ },
2010
+ datatype: {
2011
+ kind: "Shacl",
2012
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
2013
+ type: { kind: "Option", itemType: { kind: "Iri" } },
2014
+ },
2015
+ deactivated: {
2016
+ kind: "Shacl",
2017
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
2018
+ type: {
2019
+ kind: "Option",
2020
+ itemType: { kind: "Boolean" },
2021
+ },
2022
+ },
2023
+ defaultValue: {
2024
+ kind: "Shacl",
2025
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
2177
2026
  type: {
2178
2027
  kind: "Option",
2179
- itemType: { kind: "Boolean" },
2028
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2180
2029
  },
2181
2030
  },
2182
- comment: {
2031
+ description: {
2183
2032
  kind: "Shacl",
2184
- path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
2033
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
2185
2034
  type: {
2186
2035
  kind: "Option",
2187
2036
  itemType: { kind: "String" },
2188
2037
  },
2189
2038
  },
2190
- datatype: {
2039
+ disjoint: {
2191
2040
  kind: "Shacl",
2192
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
2193
- type: { kind: "Option", itemType: { kind: "Iri" } },
2041
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#disjoint"),
2042
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2194
2043
  },
2195
- deactivated: {
2044
+ equals: {
2196
2045
  kind: "Shacl",
2197
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
2046
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#equals"),
2047
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2048
+ },
2049
+ flags: {
2050
+ kind: "Shacl",
2051
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2198
2052
  type: {
2199
2053
  kind: "Option",
2200
- itemType: { kind: "Boolean" },
2054
+ itemType: { kind: "String" },
2201
2055
  },
2202
2056
  },
2203
- flags: {
2057
+ groups: {
2204
2058
  kind: "Shacl",
2205
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2206
- type: { kind: "Set", itemType: { kind: "String" } },
2059
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
2060
+ type: {
2061
+ kind: "Set",
2062
+ itemType: { kind: "Identifier" },
2063
+ },
2207
2064
  },
2208
2065
  hasValues: {
2209
2066
  kind: "Shacl",
2210
2067
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
2211
- type: { kind: "Set", itemType: { kind: "Term" } },
2212
- },
2213
- ignoredProperties: {
2214
- kind: "Shacl",
2215
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
2216
2068
  type: {
2217
- kind: "Option",
2218
- itemType: {
2219
- kind: "List",
2220
- itemType: { kind: "Iri" },
2221
- },
2069
+ kind: "Set",
2070
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2222
2071
  },
2223
2072
  },
2224
2073
  in_: {
@@ -2228,7 +2077,10 @@ export var NodeShape;
2228
2077
  kind: "Option",
2229
2078
  itemType: {
2230
2079
  kind: "List",
2231
- itemType: { kind: "Term" },
2080
+ itemType: {
2081
+ kind: "Term",
2082
+ types: ["NamedNode", "Literal"],
2083
+ },
2232
2084
  },
2233
2085
  },
2234
2086
  },
@@ -2259,6 +2111,16 @@ export var NodeShape;
2259
2111
  },
2260
2112
  },
2261
2113
  },
2114
+ lessThan: {
2115
+ kind: "Shacl",
2116
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThan"),
2117
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2118
+ },
2119
+ lessThanOrEquals: {
2120
+ kind: "Shacl",
2121
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThanOrEquals"),
2122
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2123
+ },
2262
2124
  maxCount: {
2263
2125
  kind: "Shacl",
2264
2126
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
@@ -2291,6 +2153,14 @@ export var NodeShape;
2291
2153
  itemType: { kind: "BigInt" },
2292
2154
  },
2293
2155
  },
2156
+ message: {
2157
+ kind: "Shacl",
2158
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
2159
+ type: {
2160
+ kind: "Option",
2161
+ itemType: { kind: "String" },
2162
+ },
2163
+ },
2294
2164
  minCount: {
2295
2165
  kind: "Shacl",
2296
2166
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
@@ -2323,6 +2193,14 @@ export var NodeShape;
2323
2193
  itemType: { kind: "BigInt" },
2324
2194
  },
2325
2195
  },
2196
+ name: {
2197
+ kind: "Shacl",
2198
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
2199
+ type: {
2200
+ kind: "Option",
2201
+ itemType: { kind: "String" },
2202
+ },
2203
+ },
2326
2204
  node: {
2327
2205
  kind: "Shacl",
2328
2206
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
@@ -2368,29 +2246,104 @@ export var NodeShape;
2368
2246
  },
2369
2247
  },
2370
2248
  },
2371
- patterns: {
2249
+ order: {
2250
+ kind: "Shacl",
2251
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
2252
+ type: { kind: "Option", itemType: { kind: "Float" } },
2253
+ },
2254
+ path: {
2255
+ kind: "Shacl",
2256
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
2257
+ get type() {
2258
+ return $PropertyPath.schema;
2259
+ },
2260
+ },
2261
+ pattern: {
2372
2262
  kind: "Shacl",
2373
2263
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
2374
- type: { kind: "Set", itemType: { kind: "String" } },
2264
+ type: {
2265
+ kind: "Option",
2266
+ itemType: { kind: "String" },
2267
+ },
2375
2268
  },
2376
- properties: {
2269
+ qualifiedMaxCount: {
2377
2270
  kind: "Shacl",
2378
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
2271
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMaxCount"),
2379
2272
  type: {
2380
- kind: "Set",
2273
+ kind: "Option",
2274
+ itemType: { kind: "BigInt" },
2275
+ },
2276
+ },
2277
+ qualifiedMinCount: {
2278
+ kind: "Shacl",
2279
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMinCount"),
2280
+ type: {
2281
+ kind: "Option",
2282
+ itemType: { kind: "BigInt" },
2283
+ },
2284
+ },
2285
+ qualifiedValueShape: {
2286
+ kind: "Shacl",
2287
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShape"),
2288
+ type: {
2289
+ kind: "Option",
2381
2290
  itemType: { kind: "Identifier" },
2382
2291
  },
2383
2292
  },
2384
- subClassOf: {
2293
+ qualifiedValueShapesDisjoint: {
2385
2294
  kind: "Shacl",
2386
- path: $RdfVocabularies.rdfs.subClassOf,
2295
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShapesDisjoint"),
2296
+ type: {
2297
+ kind: "Option",
2298
+ itemType: { kind: "Boolean" },
2299
+ },
2300
+ },
2301
+ severity: {
2302
+ kind: "Shacl",
2303
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
2304
+ type: {
2305
+ kind: "Option",
2306
+ itemType: {
2307
+ kind: "Iri",
2308
+ in: [
2309
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
2310
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
2311
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
2312
+ ],
2313
+ },
2314
+ },
2315
+ },
2316
+ targetClasses: {
2317
+ kind: "Shacl",
2318
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
2387
2319
  type: { kind: "Set", itemType: { kind: "Iri" } },
2388
2320
  },
2389
- types: {
2321
+ targetNodes: {
2390
2322
  kind: "Shacl",
2391
- path: $RdfVocabularies.rdf.type,
2323
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
2324
+ type: {
2325
+ kind: "Set",
2326
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2327
+ },
2328
+ },
2329
+ targetObjectsOf: {
2330
+ kind: "Shacl",
2331
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
2332
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2333
+ },
2334
+ targetSubjectsOf: {
2335
+ kind: "Shacl",
2336
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
2392
2337
  type: { kind: "Set", itemType: { kind: "Iri" } },
2393
2338
  },
2339
+ uniqueLang: {
2340
+ kind: "Shacl",
2341
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
2342
+ type: {
2343
+ kind: "Option",
2344
+ itemType: { kind: "Boolean" },
2345
+ },
2346
+ },
2394
2347
  xone: {
2395
2348
  kind: "Shacl",
2396
2349
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
@@ -2404,11 +2357,11 @@ export var NodeShape;
2404
2357
  },
2405
2358
  },
2406
2359
  };
2407
- NodeShape._toRdfResource = (parameters) => {
2360
+ PropertyShape._toRdfResource = (parameters) => {
2408
2361
  if (!parameters.ignoreRdfType) {
2409
- parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), parameters.graph);
2362
+ parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), parameters.graph);
2410
2363
  }
2411
- parameters.resource.add(PropertyShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
2364
+ parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
2412
2365
  value.length > 0
2413
2366
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
2414
2367
  if (itemIndex === 0) {
@@ -2430,46 +2383,28 @@ export var NodeShape;
2430
2383
  }).listResource.identifier
2431
2384
  : $RdfVocabularies.rdf.nil,
2432
2385
  ]), parameters.graph);
2433
- parameters.resource.add(PropertyShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
2434
- parameters.resource.add(NodeShape.schema.properties.closed.path, parameters.object.closed
2386
+ parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
2387
+ parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
2388
+ .toList()
2389
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2390
+ parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
2391
+ parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
2435
2392
  .toList()
2436
2393
  .flatMap((value) => [
2437
2394
  $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
2438
2395
  ]), parameters.graph);
2439
- parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
2396
+ parameters.resource.add(PropertyShape.schema.properties.defaultValue.path, parameters.object.defaultValue.toList(), parameters.graph);
2397
+ parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
2440
2398
  .toList()
2441
2399
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2442
- parameters.resource.add(PropertyShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
2443
- parameters.resource.add(PropertyShape.schema.properties.deactivated.path, parameters.object.deactivated
2400
+ parameters.resource.add(PropertyShape.schema.properties.disjoint.path, parameters.object.disjoint.flatMap((item) => [item]), parameters.graph);
2401
+ parameters.resource.add(PropertyShape.schema.properties.equals.path, parameters.object.equals.flatMap((item) => [item]), parameters.graph);
2402
+ parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
2444
2403
  .toList()
2445
- .flatMap((value) => [
2446
- $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
2447
- ]), parameters.graph);
2448
- parameters.resource.add(PropertyShape.schema.properties.flags.path, parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
2449
- parameters.resource.add(PropertyShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
2450
- parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
2451
- value.length > 0
2452
- ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
2453
- if (itemIndex === 0) {
2454
- currentSubListResource = listResource;
2455
- }
2456
- else {
2457
- const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
2458
- currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
2459
- currentSubListResource = newSubListResource;
2460
- }
2461
- currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
2462
- if (itemIndex + 1 === list.length) {
2463
- currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
2464
- }
2465
- return { currentSubListResource, listResource };
2466
- }, {
2467
- currentSubListResource: null,
2468
- listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
2469
- }).listResource.identifier
2470
- : $RdfVocabularies.rdf.nil,
2471
- ]), parameters.graph);
2472
- parameters.resource.add(PropertyShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
2404
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2405
+ parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
2406
+ parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
2407
+ parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
2473
2408
  value.length > 0
2474
2409
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
2475
2410
  if (itemIndex === 0) {
@@ -2491,11 +2426,11 @@ export var NodeShape;
2491
2426
  }).listResource.identifier
2492
2427
  : $RdfVocabularies.rdf.nil,
2493
2428
  ]), parameters.graph);
2494
- parameters.resource.add(PropertyShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
2495
- parameters.resource.add(PropertyShape.schema.properties.label.path, parameters.object.label
2429
+ parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
2430
+ parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
2496
2431
  .toList()
2497
2432
  .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2498
- parameters.resource.add(PropertyShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
2433
+ parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
2499
2434
  value.length > 0
2500
2435
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
2501
2436
  if (itemIndex === 0) {
@@ -2517,34 +2452,42 @@ export var NodeShape;
2517
2452
  }).listResource.identifier
2518
2453
  : $RdfVocabularies.rdf.nil,
2519
2454
  ]), parameters.graph);
2455
+ parameters.resource.add(PropertyShape.schema.properties.lessThan.path, parameters.object.lessThan.flatMap((item) => [item]), parameters.graph);
2456
+ parameters.resource.add(PropertyShape.schema.properties.lessThanOrEquals.path, parameters.object.lessThanOrEquals.flatMap((item) => [item]), parameters.graph);
2520
2457
  parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
2521
2458
  .toList()
2522
2459
  .flatMap((value) => [
2523
2460
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2524
2461
  ]), parameters.graph);
2525
- parameters.resource.add(PropertyShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
2526
- parameters.resource.add(PropertyShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
2527
- parameters.resource.add(PropertyShape.schema.properties.maxLength.path, parameters.object.maxLength
2462
+ parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
2463
+ parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
2464
+ parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
2528
2465
  .toList()
2529
2466
  .flatMap((value) => [
2530
2467
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2531
2468
  ]), parameters.graph);
2469
+ parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
2470
+ .toList()
2471
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2532
2472
  parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
2533
2473
  .toList()
2534
2474
  .flatMap((value) => [
2535
2475
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2536
2476
  ]), parameters.graph);
2537
- parameters.resource.add(PropertyShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
2538
- parameters.resource.add(PropertyShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
2539
- parameters.resource.add(PropertyShape.schema.properties.minLength.path, parameters.object.minLength
2477
+ parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
2478
+ parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
2479
+ parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
2540
2480
  .toList()
2541
2481
  .flatMap((value) => [
2542
2482
  $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2543
2483
  ]), parameters.graph);
2544
- parameters.resource.add(PropertyShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
2545
- parameters.resource.add(PropertyShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
2546
- parameters.resource.add(PropertyShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
2547
- parameters.resource.add(PropertyShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
2484
+ parameters.resource.add(PropertyShape.schema.properties.name.path, parameters.object.name
2485
+ .toList()
2486
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2487
+ parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
2488
+ parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
2489
+ parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
2490
+ parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
2548
2491
  value.length > 0
2549
2492
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
2550
2493
  if (itemIndex === 0) {
@@ -2566,13 +2509,47 @@ export var NodeShape;
2566
2509
  }).listResource.identifier
2567
2510
  : $RdfVocabularies.rdf.nil,
2568
2511
  ]), parameters.graph);
2569
- parameters.resource.add(PropertyShape.schema.properties.patterns.path, parameters.object.patterns.flatMap((item) => [
2570
- $literalFactory.string(item),
2512
+ parameters.resource.add(PropertyShape.schema.properties.order.path, parameters.object.order
2513
+ .toList()
2514
+ .flatMap((value) => [
2515
+ $literalFactory.number(value, $RdfVocabularies.xsd.double),
2571
2516
  ]), parameters.graph);
2572
- parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
2573
- parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
2574
- parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
2575
- parameters.resource.add(PropertyShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
2517
+ parameters.resource.add(PropertyShape.schema.properties.path.path, [
2518
+ $PropertyPath.toRdfResource(parameters.object.path, {
2519
+ graph: parameters.graph,
2520
+ resourceSet: parameters.resourceSet,
2521
+ }).identifier,
2522
+ ], parameters.graph);
2523
+ parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
2524
+ .toList()
2525
+ .flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
2526
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedMaxCount.path, parameters.object.qualifiedMaxCount
2527
+ .toList()
2528
+ .flatMap((value) => [
2529
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2530
+ ]), parameters.graph);
2531
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedMinCount.path, parameters.object.qualifiedMinCount
2532
+ .toList()
2533
+ .flatMap((value) => [
2534
+ $literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
2535
+ ]), parameters.graph);
2536
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShape.path, parameters.object.qualifiedValueShape.toList(), parameters.graph);
2537
+ parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.path, parameters.object.qualifiedValueShapesDisjoint
2538
+ .toList()
2539
+ .flatMap((value) => [
2540
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
2541
+ ]), parameters.graph);
2542
+ parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
2543
+ parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
2544
+ parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
2545
+ parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
2546
+ parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
2547
+ parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
2548
+ .toList()
2549
+ .flatMap((value) => [
2550
+ $literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
2551
+ ]), parameters.graph);
2552
+ parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
2576
2553
  value.length > 0
2577
2554
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
2578
2555
  if (itemIndex === 0) {
@@ -2596,19 +2573,15 @@ export var NodeShape;
2596
2573
  ]), parameters.graph);
2597
2574
  return parameters.resource;
2598
2575
  };
2599
- NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
2600
- function _propertiesToStrings(_nodeShape) {
2601
- return $compactRecord({
2602
- $identifier: _nodeShape.$identifier().toString(),
2603
- label: _nodeShape.label.map((item) => item.toString()).extract(),
2604
- });
2605
- }
2606
- NodeShape._propertiesToStrings = _propertiesToStrings;
2607
- function $toString(_nodeShape) {
2608
- return `NodeShape(${JSON.stringify(_propertiesToStrings(_nodeShape))})`;
2609
- }
2610
- NodeShape.$toString = $toString;
2611
- })(NodeShape || (NodeShape = {}));
2576
+ PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
2577
+ PropertyShape.$toString = (_propertyShape) => `PropertyShape(${JSON.stringify(PropertyShape.toStringRecord(_propertyShape))})`;
2578
+ PropertyShape.toStringRecord = (_propertyShape) => $compactRecord({
2579
+ $identifier: _propertyShape.$identifier().toString(),
2580
+ label: _propertyShape.label.map((item) => item.toString()).extract(),
2581
+ name: _propertyShape.name.map((item) => item.toString()).extract(),
2582
+ path: $PropertyPath.$toString(_propertyShape.path),
2583
+ });
2584
+ })(PropertyShape || (PropertyShape = {}));
2612
2585
  export var Shape;
2613
2586
  (function (Shape) {
2614
2587
  Shape.$toString = (value) => {
@@ -2627,26 +2600,18 @@ export var Shape;
2627
2600
  ...options,
2628
2601
  ignoreRdfType: false,
2629
2602
  }));
2630
- Shape.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
2631
- const valueAsValues = Right(value.toValues());
2603
+ Shape.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
2604
+ const valueAsValues = value.toValues();
2632
2605
  return NodeShape.fromRdfResourceValues(valueAsValues, {
2633
- context: _options.context,
2634
- graph: _options.graph,
2635
- ignoreRdfType: false,
2636
- preferredLanguages: _options.preferredLanguages,
2637
- propertyPath: _options.propertyPath,
2638
- resource: _options.resource,
2606
+ ...options,
2607
+ schema: options.schema.members["NodeShape"].type,
2639
2608
  })
2640
2609
  .altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
2641
- context: _options.context,
2642
- graph: _options.graph,
2643
- ignoreRdfType: false,
2644
- preferredLanguages: _options.preferredLanguages,
2645
- propertyPath: _options.propertyPath,
2646
- resource: _options.resource,
2610
+ ...options,
2611
+ schema: options.schema.members["PropertyShape"].type,
2647
2612
  }))
2648
2613
  .chain((values) => values.head());
2649
- })));
2614
+ }));
2650
2615
  let Identifier;
2651
2616
  (function (Identifier) {
2652
2617
  Identifier.parse = $parseIdentifier;
@@ -2706,12 +2671,18 @@ export var Shape;
2706
2671
  flags: {
2707
2672
  kind: "Shacl",
2708
2673
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
2709
- type: { kind: "Set", itemType: { kind: "String" } },
2674
+ type: {
2675
+ kind: "Option",
2676
+ itemType: { kind: "String" },
2677
+ },
2710
2678
  },
2711
2679
  hasValues: {
2712
2680
  kind: "Shacl",
2713
2681
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
2714
- type: { kind: "Set", itemType: { kind: "Term" } },
2682
+ type: {
2683
+ kind: "Set",
2684
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2685
+ },
2715
2686
  },
2716
2687
  in_: {
2717
2688
  kind: "Shacl",
@@ -2720,7 +2691,10 @@ export var Shape;
2720
2691
  kind: "Option",
2721
2692
  itemType: {
2722
2693
  kind: "List",
2723
- itemType: { kind: "Term" },
2694
+ itemType: {
2695
+ kind: "Term",
2696
+ types: ["NamedNode", "Literal"],
2697
+ },
2724
2698
  },
2725
2699
  },
2726
2700
  },
@@ -2751,14 +2725,6 @@ export var Shape;
2751
2725
  },
2752
2726
  },
2753
2727
  },
2754
- maxCount: {
2755
- kind: "Shacl",
2756
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
2757
- type: {
2758
- kind: "Option",
2759
- itemType: { kind: "BigInt" },
2760
- },
2761
- },
2762
2728
  maxExclusive: {
2763
2729
  kind: "Shacl",
2764
2730
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
@@ -2783,12 +2749,12 @@ export var Shape;
2783
2749
  itemType: { kind: "BigInt" },
2784
2750
  },
2785
2751
  },
2786
- minCount: {
2752
+ message: {
2787
2753
  kind: "Shacl",
2788
- path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
2754
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
2789
2755
  type: {
2790
2756
  kind: "Option",
2791
- itemType: { kind: "BigInt" },
2757
+ itemType: { kind: "String" },
2792
2758
  },
2793
2759
  },
2794
2760
  minExclusive: {
@@ -2860,10 +2826,51 @@ export var Shape;
2860
2826
  },
2861
2827
  },
2862
2828
  },
2863
- patterns: {
2829
+ pattern: {
2864
2830
  kind: "Shacl",
2865
2831
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
2866
- type: { kind: "Set", itemType: { kind: "String" } },
2832
+ type: {
2833
+ kind: "Option",
2834
+ itemType: { kind: "String" },
2835
+ },
2836
+ },
2837
+ severity: {
2838
+ kind: "Shacl",
2839
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
2840
+ type: {
2841
+ kind: "Option",
2842
+ itemType: {
2843
+ kind: "Iri",
2844
+ in: [
2845
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
2846
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
2847
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
2848
+ ],
2849
+ },
2850
+ },
2851
+ },
2852
+ targetClasses: {
2853
+ kind: "Shacl",
2854
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
2855
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2856
+ },
2857
+ targetNodes: {
2858
+ kind: "Shacl",
2859
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
2860
+ type: {
2861
+ kind: "Set",
2862
+ itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
2863
+ },
2864
+ },
2865
+ targetObjectsOf: {
2866
+ kind: "Shacl",
2867
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
2868
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2869
+ },
2870
+ targetSubjectsOf: {
2871
+ kind: "Shacl",
2872
+ path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
2873
+ type: { kind: "Set", itemType: { kind: "Iri" } },
2867
2874
  },
2868
2875
  xone: {
2869
2876
  kind: "Shacl",
@@ -2940,42 +2947,26 @@ export var $Object;
2940
2947
  ...options,
2941
2948
  ignoreRdfType: false,
2942
2949
  }));
2943
- $Object.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
2944
- const valueAsValues = Right(value.toValues());
2950
+ $Object.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
2951
+ const valueAsValues = value.toValues();
2945
2952
  return NodeShape.fromRdfResourceValues(valueAsValues, {
2946
- context: _options.context,
2947
- graph: _options.graph,
2948
- ignoreRdfType: false,
2949
- preferredLanguages: _options.preferredLanguages,
2950
- propertyPath: _options.propertyPath,
2951
- resource: _options.resource,
2953
+ ...options,
2954
+ schema: options.schema.members["NodeShape"].type,
2952
2955
  })
2953
2956
  .altLazy(() => Ontology.fromRdfResourceValues(valueAsValues, {
2954
- context: _options.context,
2955
- graph: _options.graph,
2956
- ignoreRdfType: false,
2957
- preferredLanguages: _options.preferredLanguages,
2958
- propertyPath: _options.propertyPath,
2959
- resource: _options.resource,
2957
+ ...options,
2958
+ schema: options.schema.members["Ontology"].type,
2960
2959
  }))
2961
2960
  .altLazy(() => PropertyGroup.fromRdfResourceValues(valueAsValues, {
2962
- context: _options.context,
2963
- graph: _options.graph,
2964
- ignoreRdfType: false,
2965
- preferredLanguages: _options.preferredLanguages,
2966
- propertyPath: _options.propertyPath,
2967
- resource: _options.resource,
2961
+ ...options,
2962
+ schema: options.schema.members["PropertyGroup"].type,
2968
2963
  }))
2969
2964
  .altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
2970
- context: _options.context,
2971
- graph: _options.graph,
2972
- ignoreRdfType: false,
2973
- preferredLanguages: _options.preferredLanguages,
2974
- propertyPath: _options.propertyPath,
2975
- resource: _options.resource,
2965
+ ...options,
2966
+ schema: options.schema.members["PropertyShape"].type,
2976
2967
  }))
2977
2968
  .chain((values) => values.head());
2978
- })));
2969
+ }));
2979
2970
  let Identifier;
2980
2971
  (function (Identifier) {
2981
2972
  Identifier.parse = $parseIdentifier;