@shaclmate/compiler 4.0.22 → 4.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/ShapesGraphToAstTransformer.js +16 -16
  2. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +6 -5
  3. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +1 -1
  4. package/dist/_ShapesGraphToAstTransformer/shapeOntology.js +4 -3
  5. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +12 -11
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +3 -3
  7. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +6 -9
  8. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +11 -12
  9. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
  10. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
  11. package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
  12. package/dist/ast/ListType.d.ts +1 -8
  13. package/dist/ast/ListType.js +1 -6
  14. package/dist/ast/ObjectType.d.ts +7 -9
  15. package/dist/ast/ObjectType.js +7 -8
  16. package/dist/generators/ts/AbstractLazyObjectType.d.ts +1 -0
  17. package/dist/generators/ts/AbstractLazyObjectType.js +7 -0
  18. package/dist/generators/ts/AbstractNamedUnionType.d.ts +3 -2
  19. package/dist/generators/ts/AbstractNamedUnionType.js +23 -9
  20. package/dist/generators/ts/AbstractTermType.d.ts +1 -0
  21. package/dist/generators/ts/AbstractTermType.js +3 -0
  22. package/dist/generators/ts/AbstractType.d.ts +12 -4
  23. package/dist/generators/ts/AbstractUnionType.d.ts +1 -0
  24. package/dist/generators/ts/AbstractUnionType.js +11 -1
  25. package/dist/generators/ts/AnonymousUnionType.d.ts +2 -1
  26. package/dist/generators/ts/AnonymousUnionType.js +6 -3
  27. package/dist/generators/ts/DefaultValueType.d.ts +2 -1
  28. package/dist/generators/ts/DefaultValueType.js +6 -3
  29. package/dist/generators/ts/ListType.d.ts +2 -5
  30. package/dist/generators/ts/ListType.js +11 -27
  31. package/dist/generators/ts/NamedObjectType.d.ts +2 -9
  32. package/dist/generators/ts/NamedObjectType.js +12 -29
  33. package/dist/generators/ts/NamedObjectUnionType.js +1 -1
  34. package/dist/generators/ts/OptionType.d.ts +1 -0
  35. package/dist/generators/ts/OptionType.js +3 -0
  36. package/dist/generators/ts/SetType.d.ts +1 -0
  37. package/dist/generators/ts/SetType.js +3 -0
  38. package/dist/generators/ts/TypeFactory.js +9 -46
  39. package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +23 -15
  40. package/dist/generators/ts/_NamedObjectType/AbstractProperty.js +6 -0
  41. package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.d.ts +3 -4
  42. package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.js +26 -11
  43. package/dist/generators/ts/_NamedObjectType/IdentifierProperty.d.ts +5 -14
  44. package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +34 -201
  45. package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.js +3 -11
  46. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js +10 -9
  47. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js +4 -4
  48. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +1 -1
  49. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +1 -1
  50. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +1 -5
  51. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +5 -10
  52. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js +13 -9
  53. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +1 -1
  54. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js +11 -2
  55. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +2 -2
  56. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js +1 -1
  57. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +1 -1
  58. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js +8 -4
  59. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js +4 -2
  60. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.d.ts +4 -0
  61. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.js +66 -0
  62. package/dist/generators/ts/_NamedObjectType/Property.d.ts +1 -2
  63. package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +6 -5
  64. package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +26 -20
  65. package/dist/generators/ts/_snippets/snippets_LazyObject.js +2 -2
  66. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +2 -2
  67. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +2 -2
  68. package/dist/generators/ts/_snippets/snippets_PropertyPath.js +5 -3
  69. package/dist/generators/ts/_snippets/snippets_compactRecord.d.ts +2 -0
  70. package/dist/generators/ts/_snippets/snippets_compactRecord.js +16 -0
  71. package/dist/generators/ts/_snippets/{parseIri.d.ts → snippets_parseIri.d.ts} +1 -1
  72. package/dist/generators/ts/_snippets/{parseIri.js → snippets_parseIri.js} +1 -1
  73. package/dist/generators/ts/imports.d.ts +1 -3
  74. package/dist/generators/ts/imports.js +1 -3
  75. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +2 -2
  76. package/dist/generators/ts/snippets.d.ts +1 -0
  77. package/dist/generators/ts/snippets.js +3 -1
  78. package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +1 -1
  79. package/dist/input/generated.d.ts +104 -50
  80. package/dist/input/generated.js +284 -171
  81. package/package.json +2 -2
  82. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.d.ts +0 -6
  83. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.js +0 -32
  84. package/dist/enums/IdentifierMintingStrategy.d.ts +0 -9
  85. package/dist/enums/IdentifierMintingStrategy.js +0 -18
  86. package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.d.ts +0 -32
  87. package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.js +0 -89
@@ -1,9 +1,34 @@
1
1
  import datasetFactory from "@rdfjs/dataset";
2
2
  import dataFactory from "@rdfx/data-factory";
3
3
  import { LiteralFactory } from "@rdfx/literal";
4
- import { PropertyPath as RdfjsResourcePropertyPath, Resource, ResourceSet, } from "@rdfx/resource";
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
+ /**
8
+ * Remove undefined values from a record.
9
+ */
10
+ function $compactRecord(record) {
11
+ return Object.entries(record).reduce((definedProperties, [propertyName, propertyValue]) => {
12
+ if (propertyValue !== undefined) {
13
+ definedProperties[propertyName] = propertyValue;
14
+ }
15
+ return definedProperties;
16
+ }, {});
17
+ }
18
+ export var $EqualsResult;
19
+ (function ($EqualsResult) {
20
+ $EqualsResult.Equal = Right(true);
21
+ function fromBooleanEqualsResult(left, right, equalsResult) {
22
+ if (typeof equalsResult !== "boolean") {
23
+ return equalsResult;
24
+ }
25
+ if (equalsResult) {
26
+ return $EqualsResult.Equal;
27
+ }
28
+ return Left({ left, right, type: "boolean" });
29
+ }
30
+ $EqualsResult.fromBooleanEqualsResult = fromBooleanEqualsResult;
31
+ })($EqualsResult || ($EqualsResult = {}));
7
32
  function $filterArray(filterItem) {
8
33
  return (filter, values) => {
9
34
  for (const value of values) {
@@ -184,12 +209,13 @@ export var $PropertyPath;
184
209
  return true;
185
210
  }
186
211
  $PropertyPath.$filter = $filter;
187
- $PropertyPath.$fromRdfResource = RdfjsResourcePropertyPath.fromResource;
212
+ $PropertyPath.$fromRdfResource = RdfxResourcePropertyPath.fromResource;
188
213
  $PropertyPath.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
189
214
  .toResource()
190
215
  .chain((resource) => $PropertyPath.$fromRdfResource(resource, options))));
191
216
  $PropertyPath.$schema = {};
192
- $PropertyPath.$toRdfResource = RdfjsResourcePropertyPath.toResource;
217
+ $PropertyPath.$toRdfResource = RdfxResourcePropertyPath.toResource;
218
+ $PropertyPath.$toString = RdfxResourcePropertyPath.toString;
193
219
  })($PropertyPath || ($PropertyPath = {}));
194
220
  var $RdfVocabularies;
195
221
  (function ($RdfVocabularies) {
@@ -232,21 +258,32 @@ var $RdfVocabularies;
232
258
  function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }) {
233
259
  return typeFromRdf(Right(resource.values(propertySchema.path, { graph, unique: true }))).chain((values) => values.head());
234
260
  }
261
+ /**
262
+ * Compare two values for strict equality (===), returning an $EqualsResult rather than a boolean.
263
+ */
264
+ function $strictEquals(left, right) {
265
+ return $EqualsResult.fromBooleanEqualsResult(left, right, left === right);
266
+ }
235
267
  export var PropertyShape;
236
268
  (function (PropertyShape) {
237
269
  function $create(parameters) {
270
+ const $identifierParameter = parameters.$identifier;
238
271
  let $identifier;
239
- if (typeof parameters.$identifier === "object") {
240
- $identifier = parameters.$identifier;
272
+ if (typeof $identifierParameter === "function") {
273
+ $identifier = $identifierParameter;
241
274
  }
242
- else if (typeof parameters.$identifier === "string") {
243
- $identifier = dataFactory.namedNode(parameters.$identifier);
275
+ else if (typeof $identifierParameter === "object") {
276
+ $identifier = () => $identifierParameter;
244
277
  }
245
- else if (parameters.$identifier === undefined) {
246
- $identifier = dataFactory.blankNode();
278
+ else if (typeof $identifierParameter === "string") {
279
+ $identifier = () => dataFactory.namedNode($identifierParameter);
280
+ }
281
+ else if ($identifierParameter === undefined) {
282
+ const $eagerIdentifier = dataFactory.blankNode();
283
+ $identifier = () => $eagerIdentifier;
247
284
  }
248
285
  else {
249
- $identifier = parameters.$identifier;
286
+ $identifier = $identifierParameter;
250
287
  }
251
288
  const $type = "PropertyShape";
252
289
  let and;
@@ -362,6 +399,16 @@ export var PropertyShape;
362
399
  else {
363
400
  description = parameters.description;
364
401
  }
402
+ let display;
403
+ if (typeof parameters.display === "boolean") {
404
+ display = parameters.display;
405
+ }
406
+ else if (parameters.display === undefined) {
407
+ display = false;
408
+ }
409
+ else {
410
+ display = parameters.display;
411
+ }
365
412
  let flags;
366
413
  if (parameters.flags === undefined) {
367
414
  flags = [];
@@ -834,6 +881,7 @@ export var PropertyShape;
834
881
  deactivated,
835
882
  defaultValue,
836
883
  description,
884
+ display,
837
885
  flags,
838
886
  groups,
839
887
  hasValues,
@@ -873,7 +921,7 @@ export var PropertyShape;
873
921
  })($Identifier = PropertyShape.$Identifier || (PropertyShape.$Identifier = {}));
874
922
  function $filter(filter, value) {
875
923
  if (filter.$identifier !== undefined &&
876
- !$filterIdentifier(filter.$identifier, value.$identifier)) {
924
+ !$filterIdentifier(filter.$identifier, value.$identifier())) {
877
925
  return false;
878
926
  }
879
927
  if (filter.and !== undefined &&
@@ -904,6 +952,10 @@ export var PropertyShape;
904
952
  !$filterMaybe($filterString)(filter.description, value.description)) {
905
953
  return false;
906
954
  }
955
+ if (filter.display !== undefined &&
956
+ !$filterBoolean(filter.display, value.display)) {
957
+ return false;
958
+ }
907
959
  if (filter.flags !== undefined &&
908
960
  !$filterArray($filterString)(filter.flags, value.flags)) {
909
961
  return false;
@@ -1034,7 +1086,7 @@ export var PropertyShape;
1034
1086
  ignoreRdfType,
1035
1087
  objectSet,
1036
1088
  preferredLanguages,
1037
- });
1089
+ }).map($create);
1038
1090
  };
1039
1091
  PropertyShape.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
1040
1092
  .toResource()
@@ -1193,6 +1245,21 @@ export var PropertyShape;
1193
1245
  value: Maybe.empty(),
1194
1246
  })),
1195
1247
  }).chain((description) => $shaclPropertyFromRdf({
1248
+ graph: _$options.graph,
1249
+ resource: $resource,
1250
+ propertySchema: PropertyShape.$schema.properties.display,
1251
+ typeFromRdf: (resourceValues) => resourceValues
1252
+ .map((values) => values.length > 0
1253
+ ? values
1254
+ : new Resource.Value({
1255
+ dataFactory: dataFactory,
1256
+ focusResource: $resource,
1257
+ propertyPath: PropertyShape.$schema.properties
1258
+ .display.path,
1259
+ term: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
1260
+ }).toValues())
1261
+ .chain((values) => values.chainMap((value) => value.toBoolean())),
1262
+ }).chain((display) => $shaclPropertyFromRdf({
1196
1263
  graph: _$options.graph,
1197
1264
  resource: $resource,
1198
1265
  propertySchema: PropertyShape.$schema.properties.flags,
@@ -1215,8 +1282,8 @@ export var PropertyShape;
1215
1282
  .map((values) => values.toArray())
1216
1283
  .map((valuesArray) => Resource.Values.fromValue({
1217
1284
  focusResource: $resource,
1218
- propertyPath: PropertyShape.$schema.properties.groups
1219
- .path,
1285
+ propertyPath: PropertyShape.$schema.properties
1286
+ .groups.path,
1220
1287
  value: valuesArray,
1221
1288
  })),
1222
1289
  }).chain((groups) => $shaclPropertyFromRdf({
@@ -1257,8 +1324,8 @@ export var PropertyShape;
1257
1324
  })))
1258
1325
  .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1259
1326
  focusResource: $resource,
1260
- propertyPath: PropertyShape.$schema.properties
1261
- .in_.path,
1327
+ propertyPath: PropertyShape.$schema
1328
+ .properties.in_.path,
1262
1329
  values: valueList.toArray(),
1263
1330
  })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1264
1331
  switch (term.termType) {
@@ -1282,8 +1349,8 @@ export var PropertyShape;
1282
1349
  ? values.map((value) => Maybe.of(value))
1283
1350
  : Resource.Values.fromValue({
1284
1351
  focusResource: $resource,
1285
- propertyPath: PropertyShape.$schema.properties
1286
- .in_.path,
1352
+ propertyPath: PropertyShape.$schema
1353
+ .properties.in_.path,
1287
1354
  value: Maybe.empty(),
1288
1355
  })),
1289
1356
  }).chain((in_) => $shaclPropertyFromRdf({
@@ -1326,9 +1393,10 @@ export var PropertyShape;
1326
1393
  })))
1327
1394
  .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1328
1395
  focusResource: $resource,
1329
- propertyPath: PropertyShape.$schema
1330
- .properties.languageIn
1331
- .path,
1396
+ propertyPath: PropertyShape
1397
+ .$schema
1398
+ .properties
1399
+ .languageIn.path,
1332
1400
  values: valueList.toArray(),
1333
1401
  }))
1334
1402
  .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
@@ -1369,15 +1437,18 @@ export var PropertyShape;
1369
1437
  ? values.map((value) => Maybe.of(value))
1370
1438
  : Resource.Values.fromValue({
1371
1439
  focusResource: $resource,
1372
- propertyPath: PropertyShape.$schema
1440
+ propertyPath: PropertyShape
1441
+ .$schema
1373
1442
  .properties
1374
- .maxExclusive.path,
1443
+ .maxExclusive
1444
+ .path,
1375
1445
  value: Maybe.empty(),
1376
1446
  })),
1377
1447
  }).chain((maxExclusive) => $shaclPropertyFromRdf({
1378
1448
  graph: _$options.graph,
1379
1449
  resource: $resource,
1380
- propertySchema: PropertyShape.$schema.properties.maxInclusive,
1450
+ propertySchema: PropertyShape.$schema.properties
1451
+ .maxInclusive,
1381
1452
  typeFromRdf: (resourceValues) => resourceValues
1382
1453
  .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1383
1454
  .chain((values) => values.chainMap((value) => value.toLiteral()))
@@ -1395,7 +1466,8 @@ export var PropertyShape;
1395
1466
  }).chain((maxInclusive) => $shaclPropertyFromRdf({
1396
1467
  graph: _$options.graph,
1397
1468
  resource: $resource,
1398
- propertySchema: PropertyShape.$schema.properties.maxLength,
1469
+ propertySchema: PropertyShape.$schema.properties
1470
+ .maxLength,
1399
1471
  typeFromRdf: (resourceValues) => resourceValues
1400
1472
  .chain((values) => values.chainMap((value) => value.toInt()))
1401
1473
  .map((values) => values.length > 0
@@ -1405,13 +1477,15 @@ export var PropertyShape;
1405
1477
  propertyPath: PropertyShape
1406
1478
  .$schema
1407
1479
  .properties
1408
- .maxLength.path,
1480
+ .maxLength
1481
+ .path,
1409
1482
  value: Maybe.empty(),
1410
1483
  })),
1411
1484
  }).chain((maxLength) => $shaclPropertyFromRdf({
1412
1485
  graph: _$options.graph,
1413
1486
  resource: $resource,
1414
- propertySchema: PropertyShape.$schema.properties.minCount,
1487
+ propertySchema: PropertyShape.$schema.properties
1488
+ .minCount,
1415
1489
  typeFromRdf: (resourceValues) => resourceValues
1416
1490
  .chain((values) => values.chainMap((value) => value.toInt()))
1417
1491
  .map((values) => values.length > 0
@@ -1470,7 +1544,8 @@ export var PropertyShape;
1470
1544
  .minLength,
1471
1545
  typeFromRdf: (resourceValues) => resourceValues
1472
1546
  .chain((values) => values.chainMap((value) => value.toInt()))
1473
- .map((values) => values.length > 0
1547
+ .map((values) => values.length >
1548
+ 0
1474
1549
  ? values.map((value) => Maybe.of(value))
1475
1550
  : Resource.Values.fromValue({
1476
1551
  focusResource: $resource,
@@ -1484,7 +1559,8 @@ export var PropertyShape;
1484
1559
  }).chain((minLength) => $shaclPropertyFromRdf({
1485
1560
  graph: _$options.graph,
1486
1561
  resource: $resource,
1487
- propertySchema: PropertyShape.$schema.properties
1562
+ propertySchema: PropertyShape.$schema
1563
+ .properties
1488
1564
  .mutable,
1489
1565
  typeFromRdf: (resourceValues) => resourceValues
1490
1566
  .chain((values) => values.chainMap((value) => value.toBoolean()))
@@ -1801,6 +1877,7 @@ export var PropertyShape;
1801
1877
  deactivated,
1802
1878
  defaultValue,
1803
1879
  description,
1880
+ display,
1804
1881
  flags,
1805
1882
  groups,
1806
1883
  hasValues,
@@ -1830,7 +1907,7 @@ export var PropertyShape;
1830
1907
  uniqueLang,
1831
1908
  visibility,
1832
1909
  xone,
1833
- }))))))))))))))))))))))))))))))))))))))));
1910
+ })))))))))))))))))))))))))))))))))))))))));
1834
1911
  };
1835
1912
  PropertyShape.$schema = {
1836
1913
  properties: {
@@ -1904,6 +1981,15 @@ export var PropertyShape;
1904
1981
  }),
1905
1982
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
1906
1983
  },
1984
+ display: {
1985
+ kind: "Shacl",
1986
+ type: () => ({
1987
+ kind: "DefaultValue",
1988
+ item: () => ({ kind: "Boolean" }),
1989
+ defaultValue: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
1990
+ }),
1991
+ path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"),
1992
+ },
1907
1993
  flags: {
1908
1994
  kind: "Shacl",
1909
1995
  type: () => ({
@@ -2170,7 +2256,7 @@ export var PropertyShape;
2170
2256
  dataFactory: dataFactory,
2171
2257
  dataset: datasetFactory.dataset(),
2172
2258
  });
2173
- const resource = resourceSet.resource(_propertyShape.$identifier);
2259
+ const resource = resourceSet.resource(_propertyShape.$identifier());
2174
2260
  if (!options?.ignoreRdfType) {
2175
2261
  resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), options?.graph);
2176
2262
  }
@@ -2181,7 +2267,7 @@ export var PropertyShape;
2181
2267
  currentSubListResource = listResource;
2182
2268
  }
2183
2269
  else {
2184
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
2270
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
2185
2271
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
2186
2272
  currentSubListResource = newSubListResource;
2187
2273
  }
@@ -2192,7 +2278,7 @@ export var PropertyShape;
2192
2278
  return { currentSubListResource, listResource };
2193
2279
  }, {
2194
2280
  currentSubListResource: null,
2195
- listResource: resourceSet.resource(dataFactory.blankNode()),
2281
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
2196
2282
  }).listResource.identifier
2197
2283
  : $RdfVocabularies.rdf.nil,
2198
2284
  ]), options?.graph);
@@ -2210,6 +2296,11 @@ export var PropertyShape;
2210
2296
  resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"), _propertyShape.description
2211
2297
  .toList()
2212
2298
  .flatMap((value) => [$literalFactory.string(value)]), options?.graph);
2299
+ resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"), $strictEquals(_propertyShape.display, false).isLeft()
2300
+ ? [
2301
+ $literalFactory.boolean(_propertyShape.display, $RdfVocabularies.xsd.boolean),
2302
+ ]
2303
+ : [], options?.graph);
2213
2304
  resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), _propertyShape.flags.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
2214
2305
  resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#group"), _propertyShape.groups.flatMap((item) => [item]), options?.graph);
2215
2306
  resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), _propertyShape.hasValues.flatMap((item) => [item]), options?.graph);
@@ -2220,7 +2311,7 @@ export var PropertyShape;
2220
2311
  currentSubListResource = listResource;
2221
2312
  }
2222
2313
  else {
2223
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
2314
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
2224
2315
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
2225
2316
  currentSubListResource = newSubListResource;
2226
2317
  }
@@ -2231,7 +2322,7 @@ export var PropertyShape;
2231
2322
  return { currentSubListResource, listResource };
2232
2323
  }, {
2233
2324
  currentSubListResource: null,
2234
- listResource: resourceSet.resource(dataFactory.blankNode()),
2325
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
2235
2326
  }).listResource.identifier
2236
2327
  : $RdfVocabularies.rdf.nil,
2237
2328
  ]), options?.graph);
@@ -2246,7 +2337,7 @@ export var PropertyShape;
2246
2337
  currentSubListResource = listResource;
2247
2338
  }
2248
2339
  else {
2249
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
2340
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
2250
2341
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
2251
2342
  currentSubListResource = newSubListResource;
2252
2343
  }
@@ -2257,7 +2348,7 @@ export var PropertyShape;
2257
2348
  return { currentSubListResource, listResource };
2258
2349
  }, {
2259
2350
  currentSubListResource: null,
2260
- listResource: resourceSet.resource(dataFactory.blankNode()),
2351
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
2261
2352
  }).listResource.identifier
2262
2353
  : $RdfVocabularies.rdf.nil,
2263
2354
  ]), options?.graph);
@@ -2303,7 +2394,7 @@ export var PropertyShape;
2303
2394
  currentSubListResource = listResource;
2304
2395
  }
2305
2396
  else {
2306
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
2397
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
2307
2398
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
2308
2399
  currentSubListResource = newSubListResource;
2309
2400
  }
@@ -2314,7 +2405,7 @@ export var PropertyShape;
2314
2405
  return { currentSubListResource, listResource };
2315
2406
  }, {
2316
2407
  currentSubListResource: null,
2317
- listResource: resourceSet.resource(dataFactory.blankNode()),
2408
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
2318
2409
  }).listResource.identifier
2319
2410
  : $RdfVocabularies.rdf.nil,
2320
2411
  ]), options?.graph);
@@ -2347,7 +2438,7 @@ export var PropertyShape;
2347
2438
  currentSubListResource = listResource;
2348
2439
  }
2349
2440
  else {
2350
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
2441
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
2351
2442
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
2352
2443
  currentSubListResource = newSubListResource;
2353
2444
  }
@@ -2358,29 +2449,50 @@ export var PropertyShape;
2358
2449
  return { currentSubListResource, listResource };
2359
2450
  }, {
2360
2451
  currentSubListResource: null,
2361
- listResource: resourceSet.resource(dataFactory.blankNode()),
2452
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
2362
2453
  }).listResource.identifier
2363
2454
  : $RdfVocabularies.rdf.nil,
2364
2455
  ]), options?.graph);
2365
2456
  return resource;
2366
2457
  }
2367
2458
  PropertyShape.$toRdfResource = $toRdfResource;
2459
+ function $propertiesToStrings(_propertyShape) {
2460
+ return $compactRecord({
2461
+ $identifier: _propertyShape.$identifier().toString(),
2462
+ label: _propertyShape.label.map((item) => item.toString()).extract(),
2463
+ name: _propertyShape.name.map((item) => item.toString()).extract(),
2464
+ path: $PropertyPath.$toString(_propertyShape.path),
2465
+ shaclmateName: _propertyShape.shaclmateName
2466
+ .map((item) => item.toString())
2467
+ .extract(),
2468
+ });
2469
+ }
2470
+ PropertyShape.$propertiesToStrings = $propertiesToStrings;
2471
+ function $toString(_propertyShape) {
2472
+ return `PropertyShape(${JSON.stringify($propertiesToStrings((_propertyShape ?? this)))})`;
2473
+ }
2474
+ PropertyShape.$toString = $toString;
2368
2475
  })(PropertyShape || (PropertyShape = {}));
2369
2476
  export var PropertyGroup;
2370
2477
  (function (PropertyGroup) {
2371
2478
  function $create(parameters) {
2479
+ const $identifierParameter = parameters?.$identifier;
2372
2480
  let $identifier;
2373
- if (typeof parameters?.$identifier === "object") {
2374
- $identifier = parameters?.$identifier;
2481
+ if (typeof $identifierParameter === "function") {
2482
+ $identifier = $identifierParameter;
2483
+ }
2484
+ else if (typeof $identifierParameter === "object") {
2485
+ $identifier = () => $identifierParameter;
2375
2486
  }
2376
- else if (typeof parameters?.$identifier === "string") {
2377
- $identifier = dataFactory.namedNode(parameters?.$identifier);
2487
+ else if (typeof $identifierParameter === "string") {
2488
+ $identifier = () => dataFactory.namedNode($identifierParameter);
2378
2489
  }
2379
- else if (parameters?.$identifier === undefined) {
2380
- $identifier = dataFactory.blankNode();
2490
+ else if ($identifierParameter === undefined) {
2491
+ const $eagerIdentifier = dataFactory.blankNode();
2492
+ $identifier = () => $eagerIdentifier;
2381
2493
  }
2382
2494
  else {
2383
- $identifier = parameters?.$identifier;
2495
+ $identifier = $identifierParameter;
2384
2496
  }
2385
2497
  const $type = "PropertyGroup";
2386
2498
  let comment;
@@ -2419,7 +2531,7 @@ export var PropertyGroup;
2419
2531
  })($Identifier = PropertyGroup.$Identifier || (PropertyGroup.$Identifier = {}));
2420
2532
  function $filter(filter, value) {
2421
2533
  if (filter.$identifier !== undefined &&
2422
- !$filterIdentifier(filter.$identifier, value.$identifier)) {
2534
+ !$filterIdentifier(filter.$identifier, value.$identifier())) {
2423
2535
  return false;
2424
2536
  }
2425
2537
  if (filter.comment !== undefined &&
@@ -2444,7 +2556,7 @@ export var PropertyGroup;
2444
2556
  ignoreRdfType,
2445
2557
  objectSet,
2446
2558
  preferredLanguages,
2447
- });
2559
+ }).map($create);
2448
2560
  };
2449
2561
  PropertyGroup.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
2450
2562
  .toResource()
@@ -2553,7 +2665,7 @@ export var PropertyGroup;
2553
2665
  dataFactory: dataFactory,
2554
2666
  dataset: datasetFactory.dataset(),
2555
2667
  });
2556
- const resource = resourceSet.resource(_propertyGroup.$identifier);
2668
+ const resource = resourceSet.resource(_propertyGroup.$identifier());
2557
2669
  if (!options?.ignoreRdfType) {
2558
2670
  resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), options?.graph);
2559
2671
  }
@@ -2566,22 +2678,38 @@ export var PropertyGroup;
2566
2678
  return resource;
2567
2679
  }
2568
2680
  PropertyGroup.$toRdfResource = $toRdfResource;
2681
+ function $propertiesToStrings(_propertyGroup) {
2682
+ return $compactRecord({
2683
+ $identifier: _propertyGroup.$identifier().toString(),
2684
+ label: _propertyGroup.label.map((item) => item.toString()).extract(),
2685
+ });
2686
+ }
2687
+ PropertyGroup.$propertiesToStrings = $propertiesToStrings;
2688
+ function $toString(_propertyGroup) {
2689
+ return `PropertyGroup(${JSON.stringify($propertiesToStrings((_propertyGroup ?? this)))})`;
2690
+ }
2691
+ PropertyGroup.$toString = $toString;
2569
2692
  })(PropertyGroup || (PropertyGroup = {}));
2570
2693
  export var Ontology;
2571
2694
  (function (Ontology) {
2572
2695
  function $create(parameters) {
2696
+ const $identifierParameter = parameters?.$identifier;
2573
2697
  let $identifier;
2574
- if (typeof parameters?.$identifier === "object") {
2575
- $identifier = parameters?.$identifier;
2698
+ if (typeof $identifierParameter === "function") {
2699
+ $identifier = $identifierParameter;
2576
2700
  }
2577
- else if (typeof parameters?.$identifier === "string") {
2578
- $identifier = dataFactory.namedNode(parameters?.$identifier);
2701
+ else if (typeof $identifierParameter === "object") {
2702
+ $identifier = () => $identifierParameter;
2579
2703
  }
2580
- else if (parameters?.$identifier === undefined) {
2581
- $identifier = dataFactory.blankNode();
2704
+ else if (typeof $identifierParameter === "string") {
2705
+ $identifier = () => dataFactory.namedNode($identifierParameter);
2706
+ }
2707
+ else if ($identifierParameter === undefined) {
2708
+ const $eagerIdentifier = dataFactory.blankNode();
2709
+ $identifier = () => $eagerIdentifier;
2582
2710
  }
2583
2711
  else {
2584
- $identifier = parameters?.$identifier;
2712
+ $identifier = $identifierParameter;
2585
2713
  }
2586
2714
  const $type = "Ontology";
2587
2715
  let comment;
@@ -2682,7 +2810,7 @@ export var Ontology;
2682
2810
  })($Identifier = Ontology.$Identifier || (Ontology.$Identifier = {}));
2683
2811
  function $filter(filter, value) {
2684
2812
  if (filter.$identifier !== undefined &&
2685
- !$filterIdentifier(filter.$identifier, value.$identifier)) {
2813
+ !$filterIdentifier(filter.$identifier, value.$identifier())) {
2686
2814
  return false;
2687
2815
  }
2688
2816
  if (filter.comment !== undefined &&
@@ -2723,7 +2851,7 @@ export var Ontology;
2723
2851
  ignoreRdfType,
2724
2852
  objectSet,
2725
2853
  preferredLanguages,
2726
- });
2854
+ }).map($create);
2727
2855
  };
2728
2856
  Ontology.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
2729
2857
  .toResource()
@@ -2984,7 +3112,7 @@ export var Ontology;
2984
3112
  dataFactory: dataFactory,
2985
3113
  dataset: datasetFactory.dataset(),
2986
3114
  });
2987
- const resource = resourceSet.resource(_ontology.$identifier);
3115
+ const resource = resourceSet.resource(_ontology.$identifier());
2988
3116
  if (!options?.ignoreRdfType) {
2989
3117
  resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), options?.graph);
2990
3118
  }
@@ -3001,22 +3129,38 @@ export var Ontology;
3001
3129
  return resource;
3002
3130
  }
3003
3131
  Ontology.$toRdfResource = $toRdfResource;
3132
+ function $propertiesToStrings(_ontology) {
3133
+ return $compactRecord({
3134
+ $identifier: _ontology.$identifier().toString(),
3135
+ label: _ontology.label.map((item) => item.toString()).extract(),
3136
+ });
3137
+ }
3138
+ Ontology.$propertiesToStrings = $propertiesToStrings;
3139
+ function $toString(_ontology) {
3140
+ return `Ontology(${JSON.stringify($propertiesToStrings((_ontology ?? this)))})`;
3141
+ }
3142
+ Ontology.$toString = $toString;
3004
3143
  })(Ontology || (Ontology = {}));
3005
3144
  export var NodeShape;
3006
3145
  (function (NodeShape) {
3007
3146
  function $create(parameters) {
3147
+ const $identifierParameter = parameters?.$identifier;
3008
3148
  let $identifier;
3009
- if (typeof parameters?.$identifier === "object") {
3010
- $identifier = parameters?.$identifier;
3149
+ if (typeof $identifierParameter === "function") {
3150
+ $identifier = $identifierParameter;
3151
+ }
3152
+ else if (typeof $identifierParameter === "object") {
3153
+ $identifier = () => $identifierParameter;
3011
3154
  }
3012
- else if (typeof parameters?.$identifier === "string") {
3013
- $identifier = dataFactory.namedNode(parameters?.$identifier);
3155
+ else if (typeof $identifierParameter === "string") {
3156
+ $identifier = () => dataFactory.namedNode($identifierParameter);
3014
3157
  }
3015
- else if (parameters?.$identifier === undefined) {
3016
- $identifier = dataFactory.blankNode();
3158
+ else if ($identifierParameter === undefined) {
3159
+ const $eagerIdentifier = dataFactory.blankNode();
3160
+ $identifier = () => $eagerIdentifier;
3017
3161
  }
3018
3162
  else {
3019
- $identifier = parameters?.$identifier;
3163
+ $identifier = $identifierParameter;
3020
3164
  }
3021
3165
  const $type = "NodeShape";
3022
3166
  let abstract;
@@ -3190,23 +3334,6 @@ export var NodeShape;
3190
3334
  else {
3191
3335
  hasValues = parameters?.hasValues;
3192
3336
  }
3193
- let identifierMintingStrategy;
3194
- if (Maybe.isMaybe(parameters?.identifierMintingStrategy)) {
3195
- identifierMintingStrategy = parameters?.identifierMintingStrategy;
3196
- }
3197
- else if (typeof parameters?.identifierMintingStrategy === "object") {
3198
- identifierMintingStrategy = Maybe.of(parameters?.identifierMintingStrategy);
3199
- }
3200
- else if (typeof parameters?.identifierMintingStrategy === "string") {
3201
- identifierMintingStrategy = Maybe.of(dataFactory.namedNode(parameters?.identifierMintingStrategy));
3202
- }
3203
- else if (parameters?.identifierMintingStrategy === undefined) {
3204
- identifierMintingStrategy = Maybe.empty();
3205
- }
3206
- else {
3207
- identifierMintingStrategy =
3208
- parameters?.identifierMintingStrategy;
3209
- }
3210
3337
  let ignoredProperties;
3211
3338
  if (Maybe.isMaybe(parameters?.ignoredProperties)) {
3212
3339
  ignoredProperties = parameters?.ignoredProperties;
@@ -3704,7 +3831,6 @@ export var NodeShape;
3704
3831
  flags,
3705
3832
  fromRdfType,
3706
3833
  hasValues,
3707
- identifierMintingStrategy,
3708
3834
  ignoredProperties,
3709
3835
  in_,
3710
3836
  isDefinedBy,
@@ -3745,7 +3871,7 @@ export var NodeShape;
3745
3871
  })($Identifier = NodeShape.$Identifier || (NodeShape.$Identifier = {}));
3746
3872
  function $filter(filter, value) {
3747
3873
  if (filter.$identifier !== undefined &&
3748
- !$filterIdentifier(filter.$identifier, value.$identifier)) {
3874
+ !$filterIdentifier(filter.$identifier, value.$identifier())) {
3749
3875
  return false;
3750
3876
  }
3751
3877
  if (filter.abstract !== undefined &&
@@ -3796,10 +3922,6 @@ export var NodeShape;
3796
3922
  !$filterArray($filterTerm)(filter.hasValues, value.hasValues)) {
3797
3923
  return false;
3798
3924
  }
3799
- if (filter.identifierMintingStrategy !== undefined &&
3800
- !$filterMaybe($filterIri)(filter.identifierMintingStrategy, value.identifierMintingStrategy)) {
3801
- return false;
3802
- }
3803
3925
  if (filter.ignoredProperties !== undefined &&
3804
3926
  !$filterMaybe($filterArray($filterIri))(filter.ignoredProperties, value.ignoredProperties)) {
3805
3927
  return false;
@@ -3934,7 +4056,7 @@ export var NodeShape;
3934
4056
  ignoreRdfType,
3935
4057
  objectSet,
3936
4058
  preferredLanguages,
3937
- });
4059
+ }).map($create);
3938
4060
  };
3939
4061
  NodeShape.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
3940
4062
  .toResource()
@@ -4162,26 +4284,6 @@ export var NodeShape;
4162
4284
  value: valuesArray,
4163
4285
  })),
4164
4286
  }).chain((hasValues) => $shaclPropertyFromRdf({
4165
- graph: _$options.graph,
4166
- resource: $resource,
4167
- propertySchema: NodeShape.$schema.properties
4168
- .identifierMintingStrategy,
4169
- typeFromRdf: (resourceValues) => resourceValues
4170
- .chain((values) => values.chainMap((value) => value.toIri([
4171
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_BlankNode"),
4172
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_SHA256"),
4173
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_UUIDv4"),
4174
- ])))
4175
- .map((values) => values.length > 0
4176
- ? values.map((value) => Maybe.of(value))
4177
- : Resource.Values.fromValue({
4178
- focusResource: $resource,
4179
- propertyPath: NodeShape.$schema.properties
4180
- .identifierMintingStrategy
4181
- .path,
4182
- value: Maybe.empty(),
4183
- })),
4184
- }).chain((identifierMintingStrategy) => $shaclPropertyFromRdf({
4185
4287
  graph: _$options.graph,
4186
4288
  resource: $resource,
4187
4289
  propertySchema: NodeShape.$schema.properties.ignoredProperties,
@@ -4191,8 +4293,7 @@ export var NodeShape;
4191
4293
  })))
4192
4294
  .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4193
4295
  focusResource: $resource,
4194
- propertyPath: NodeShape.$schema
4195
- .properties
4296
+ propertyPath: NodeShape.$schema.properties
4196
4297
  .ignoredProperties.path,
4197
4298
  values: valueList.toArray(),
4198
4299
  })).chain((values) => values.chainMap((value) => value.toIri()))))
@@ -4201,8 +4302,7 @@ export var NodeShape;
4201
4302
  ? values.map((value) => Maybe.of(value))
4202
4303
  : Resource.Values.fromValue({
4203
4304
  focusResource: $resource,
4204
- propertyPath: NodeShape.$schema
4205
- .properties
4305
+ propertyPath: NodeShape.$schema.properties
4206
4306
  .ignoredProperties.path,
4207
4307
  value: Maybe.empty(),
4208
4308
  })),
@@ -4216,10 +4316,8 @@ export var NodeShape;
4216
4316
  })))
4217
4317
  .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4218
4318
  focusResource: $resource,
4219
- propertyPath: PropertyShape
4220
- .$schema
4221
- .properties.in_
4222
- .path,
4319
+ propertyPath: PropertyShape.$schema
4320
+ .properties.in_.path,
4223
4321
  values: valueList.toArray(),
4224
4322
  })).chain((values) => values.chainMap((value) => value
4225
4323
  .toTerm()
@@ -4236,8 +4334,7 @@ export var NodeShape;
4236
4334
  propertyPath: PropertyShape
4237
4335
  .$schema
4238
4336
  .properties
4239
- .in_
4240
- .path,
4337
+ .in_.path,
4241
4338
  }));
4242
4339
  }
4243
4340
  })))))
@@ -4276,8 +4373,7 @@ export var NodeShape;
4276
4373
  ? values.map((value) => Maybe.of(value))
4277
4374
  : Resource.Values.fromValue({
4278
4375
  focusResource: $resource,
4279
- propertyPath: PropertyShape
4280
- .$schema
4376
+ propertyPath: PropertyShape.$schema
4281
4377
  .properties.label
4282
4378
  .path,
4283
4379
  value: Maybe.empty(),
@@ -4309,8 +4405,7 @@ export var NodeShape;
4309
4405
  propertyPath: PropertyShape
4310
4406
  .$schema
4311
4407
  .properties
4312
- .languageIn
4313
- .path,
4408
+ .languageIn.path,
4314
4409
  value: Maybe.empty(),
4315
4410
  })),
4316
4411
  }).chain((languageIn) => $shaclPropertyFromRdf({
@@ -4326,8 +4421,7 @@ export var NodeShape;
4326
4421
  propertyPath: PropertyShape
4327
4422
  .$schema
4328
4423
  .properties
4329
- .maxCount
4330
- .path,
4424
+ .maxCount.path,
4331
4425
  value: Maybe.empty(),
4332
4426
  })),
4333
4427
  }).chain((maxCount) => $shaclPropertyFromRdf({
@@ -4393,8 +4487,7 @@ export var NodeShape;
4393
4487
  .minCount,
4394
4488
  typeFromRdf: (resourceValues) => resourceValues
4395
4489
  .chain((values) => values.chainMap((value) => value.toInt()))
4396
- .map((values) => values.length >
4397
- 0
4490
+ .map((values) => values.length > 0
4398
4491
  ? values.map((value) => Maybe.of(value))
4399
4492
  : Resource.Values.fromValue({
4400
4493
  focusResource: $resource,
@@ -4408,8 +4501,7 @@ export var NodeShape;
4408
4501
  }).chain((minCount) => $shaclPropertyFromRdf({
4409
4502
  graph: _$options.graph,
4410
4503
  resource: $resource,
4411
- propertySchema: NodeShape.$schema
4412
- .properties
4504
+ propertySchema: NodeShape.$schema.properties
4413
4505
  .minExclusive,
4414
4506
  typeFromRdf: (resourceValues) => resourceValues
4415
4507
  .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
@@ -4861,7 +4953,6 @@ export var NodeShape;
4861
4953
  flags,
4862
4954
  fromRdfType,
4863
4955
  hasValues,
4864
- identifierMintingStrategy,
4865
4956
  ignoredProperties,
4866
4957
  in_,
4867
4958
  isDefinedBy,
@@ -4892,7 +4983,7 @@ export var NodeShape;
4892
4983
  tsObjectDeclarationType,
4893
4984
  types,
4894
4985
  xone,
4895
- })))))))))))))))))))))))))))))))))))))))))))))));
4986
+ }))))))))))))))))))))))))))))))))))))))))))))));
4896
4987
  };
4897
4988
  NodeShape.$schema = {
4898
4989
  properties: {
@@ -5006,21 +5097,6 @@ export var NodeShape;
5006
5097
  }),
5007
5098
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
5008
5099
  },
5009
- identifierMintingStrategy: {
5010
- kind: "Shacl",
5011
- type: () => ({
5012
- kind: "Maybe",
5013
- item: () => ({
5014
- kind: "Iri",
5015
- in: [
5016
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_BlankNode"),
5017
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_SHA256"),
5018
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_UUIDv4"),
5019
- ],
5020
- }),
5021
- }),
5022
- path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#identifierMintingStrategy"),
5023
- },
5024
5100
  ignoredProperties: {
5025
5101
  kind: "Shacl",
5026
5102
  type: () => ({
@@ -5328,7 +5404,7 @@ export var NodeShape;
5328
5404
  dataFactory: dataFactory,
5329
5405
  dataset: datasetFactory.dataset(),
5330
5406
  });
5331
- const resource = resourceSet.resource(_nodeShape.$identifier);
5407
+ const resource = resourceSet.resource(_nodeShape.$identifier());
5332
5408
  if (!options?.ignoreRdfType) {
5333
5409
  resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), options?.graph);
5334
5410
  }
@@ -5344,7 +5420,7 @@ export var NodeShape;
5344
5420
  currentSubListResource = listResource;
5345
5421
  }
5346
5422
  else {
5347
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
5423
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
5348
5424
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
5349
5425
  currentSubListResource = newSubListResource;
5350
5426
  }
@@ -5355,7 +5431,7 @@ export var NodeShape;
5355
5431
  return { currentSubListResource, listResource };
5356
5432
  }, {
5357
5433
  currentSubListResource: null,
5358
- listResource: resourceSet.resource(dataFactory.blankNode()),
5434
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
5359
5435
  }).listResource.identifier
5360
5436
  : $RdfVocabularies.rdf.nil,
5361
5437
  ]), options?.graph);
@@ -5385,7 +5461,6 @@ export var NodeShape;
5385
5461
  resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), _nodeShape.flags.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
5386
5462
  resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#fromRdfType"), _nodeShape.fromRdfType.toList(), options?.graph);
5387
5463
  resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), _nodeShape.hasValues.flatMap((item) => [item]), options?.graph);
5388
- resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#identifierMintingStrategy"), _nodeShape.identifierMintingStrategy.toList(), options?.graph);
5389
5464
  resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"), _nodeShape.ignoredProperties.toList().flatMap((value) => [
5390
5465
  value.length > 0
5391
5466
  ? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
@@ -5393,7 +5468,7 @@ export var NodeShape;
5393
5468
  currentSubListResource = listResource;
5394
5469
  }
5395
5470
  else {
5396
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
5471
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
5397
5472
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
5398
5473
  currentSubListResource = newSubListResource;
5399
5474
  }
@@ -5404,7 +5479,7 @@ export var NodeShape;
5404
5479
  return { currentSubListResource, listResource };
5405
5480
  }, {
5406
5481
  currentSubListResource: null,
5407
- listResource: resourceSet.resource(dataFactory.blankNode()),
5482
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
5408
5483
  }).listResource.identifier
5409
5484
  : $RdfVocabularies.rdf.nil,
5410
5485
  ]), options?.graph);
@@ -5415,7 +5490,7 @@ export var NodeShape;
5415
5490
  currentSubListResource = listResource;
5416
5491
  }
5417
5492
  else {
5418
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
5493
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
5419
5494
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
5420
5495
  currentSubListResource = newSubListResource;
5421
5496
  }
@@ -5426,7 +5501,7 @@ export var NodeShape;
5426
5501
  return { currentSubListResource, listResource };
5427
5502
  }, {
5428
5503
  currentSubListResource: null,
5429
- listResource: resourceSet.resource(dataFactory.blankNode()),
5504
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
5430
5505
  }).listResource.identifier
5431
5506
  : $RdfVocabularies.rdf.nil,
5432
5507
  ]), options?.graph);
@@ -5441,7 +5516,7 @@ export var NodeShape;
5441
5516
  currentSubListResource = listResource;
5442
5517
  }
5443
5518
  else {
5444
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
5519
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
5445
5520
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
5446
5521
  currentSubListResource = newSubListResource;
5447
5522
  }
@@ -5452,7 +5527,7 @@ export var NodeShape;
5452
5527
  return { currentSubListResource, listResource };
5453
5528
  }, {
5454
5529
  currentSubListResource: null,
5455
- listResource: resourceSet.resource(dataFactory.blankNode()),
5530
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
5456
5531
  }).listResource.identifier
5457
5532
  : $RdfVocabularies.rdf.nil,
5458
5533
  ]), options?.graph);
@@ -5495,7 +5570,7 @@ export var NodeShape;
5495
5570
  currentSubListResource = listResource;
5496
5571
  }
5497
5572
  else {
5498
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
5573
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
5499
5574
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
5500
5575
  currentSubListResource = newSubListResource;
5501
5576
  }
@@ -5506,7 +5581,7 @@ export var NodeShape;
5506
5581
  return { currentSubListResource, listResource };
5507
5582
  }, {
5508
5583
  currentSubListResource: null,
5509
- listResource: resourceSet.resource(dataFactory.blankNode()),
5584
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
5510
5585
  }).listResource.identifier
5511
5586
  : $RdfVocabularies.rdf.nil,
5512
5587
  ]), options?.graph);
@@ -5530,7 +5605,7 @@ export var NodeShape;
5530
5605
  currentSubListResource = listResource;
5531
5606
  }
5532
5607
  else {
5533
- const newSubListResource = resourceSet.resource(dataFactory.blankNode());
5608
+ const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
5534
5609
  currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, options?.graph);
5535
5610
  currentSubListResource = newSubListResource;
5536
5611
  }
@@ -5541,19 +5616,33 @@ export var NodeShape;
5541
5616
  return { currentSubListResource, listResource };
5542
5617
  }, {
5543
5618
  currentSubListResource: null,
5544
- listResource: resourceSet.resource(dataFactory.blankNode()),
5619
+ listResource: resourceSet.resource((() => dataFactory.blankNode())()),
5545
5620
  }).listResource.identifier
5546
5621
  : $RdfVocabularies.rdf.nil,
5547
5622
  ]), options?.graph);
5548
5623
  return resource;
5549
5624
  }
5550
5625
  NodeShape.$toRdfResource = $toRdfResource;
5626
+ function $propertiesToStrings(_nodeShape) {
5627
+ return $compactRecord({
5628
+ $identifier: _nodeShape.$identifier().toString(),
5629
+ label: _nodeShape.label.map((item) => item.toString()).extract(),
5630
+ shaclmateName: _nodeShape.shaclmateName
5631
+ .map((item) => item.toString())
5632
+ .extract(),
5633
+ });
5634
+ }
5635
+ NodeShape.$propertiesToStrings = $propertiesToStrings;
5636
+ function $toString(_nodeShape) {
5637
+ return `NodeShape(${JSON.stringify($propertiesToStrings((_nodeShape ?? this)))})`;
5638
+ }
5639
+ NodeShape.$toString = $toString;
5551
5640
  })(NodeShape || (NodeShape = {}));
5552
5641
  export var Shape;
5553
5642
  (function (Shape) {
5554
5643
  Shape.$filter = (filter, value) => {
5555
5644
  if (filter.$identifier !== undefined &&
5556
- !$filterIdentifier(filter.$identifier, value.$identifier)) {
5645
+ !$filterIdentifier(filter.$identifier, value.$identifier())) {
5557
5646
  return false;
5558
5647
  }
5559
5648
  if (filter.on?.["NodeShape"] !== undefined &&
@@ -5885,6 +5974,15 @@ export var Shape;
5885
5974
  }
5886
5975
  throw new Error("unable to serialize to RDF");
5887
5976
  });
5977
+ Shape.$toString = (value) => {
5978
+ if (NodeShape.isNodeShape(value)) {
5979
+ return NodeShape.$toString(value);
5980
+ }
5981
+ if (PropertyShape.isPropertyShape(value)) {
5982
+ return PropertyShape.$toString(value);
5983
+ }
5984
+ throw new Error("unable to serialize to string");
5985
+ };
5888
5986
  function isShape(object) {
5889
5987
  return (NodeShape.isNodeShape(object) || PropertyShape.isPropertyShape(object));
5890
5988
  }
@@ -5894,7 +5992,7 @@ export var $Object;
5894
5992
  (function ($Object) {
5895
5993
  $Object.$filter = (filter, value) => {
5896
5994
  if (filter.$identifier !== undefined &&
5897
- !$filterIdentifier(filter.$identifier, value.$identifier)) {
5995
+ !$filterIdentifier(filter.$identifier, value.$identifier())) {
5898
5996
  return false;
5899
5997
  }
5900
5998
  if (filter.on?.["NodeShape"] !== undefined &&
@@ -6066,6 +6164,21 @@ export var $Object;
6066
6164
  }
6067
6165
  throw new Error("unable to serialize to RDF");
6068
6166
  });
6167
+ $Object.$toString = (value) => {
6168
+ if (NodeShape.isNodeShape(value)) {
6169
+ return NodeShape.$toString(value);
6170
+ }
6171
+ if (Ontology.isOntology(value)) {
6172
+ return Ontology.$toString(value);
6173
+ }
6174
+ if (PropertyGroup.isPropertyGroup(value)) {
6175
+ return PropertyGroup.$toString(value);
6176
+ }
6177
+ if (PropertyShape.isPropertyShape(value)) {
6178
+ return PropertyShape.$toString(value);
6179
+ }
6180
+ throw new Error("unable to serialize to string");
6181
+ };
6069
6182
  })($Object || ($Object = {}));
6070
6183
  export class $RdfjsDatasetObjectSet {
6071
6184
  $graph;
@@ -6105,7 +6218,7 @@ export class $RdfjsDatasetObjectSet {
6105
6218
  return this.nodeShapeIdentifiersSync(query);
6106
6219
  }
6107
6220
  nodeShapeIdentifiersSync(query) {
6108
- return this.nodeShapesSync(query).map((objects) => objects.map((object) => object.$identifier));
6221
+ return this.nodeShapesSync(query).map((objects) => objects.map((object) => object.$identifier()));
6109
6222
  }
6110
6223
  async nodeShapes(query) {
6111
6224
  return this.nodeShapesSync(query);
@@ -6136,7 +6249,7 @@ export class $RdfjsDatasetObjectSet {
6136
6249
  return this.ontologyIdentifiersSync(query);
6137
6250
  }
6138
6251
  ontologyIdentifiersSync(query) {
6139
- return this.ontologiesSync(query).map((objects) => objects.map((object) => object.$identifier));
6252
+ return this.ontologiesSync(query).map((objects) => objects.map((object) => object.$identifier()));
6140
6253
  }
6141
6254
  async ontologies(query) {
6142
6255
  return this.ontologiesSync(query);
@@ -6167,7 +6280,7 @@ export class $RdfjsDatasetObjectSet {
6167
6280
  return this.propertyGroupIdentifiersSync(query);
6168
6281
  }
6169
6282
  propertyGroupIdentifiersSync(query) {
6170
- return this.propertyGroupsSync(query).map((objects) => objects.map((object) => object.$identifier));
6283
+ return this.propertyGroupsSync(query).map((objects) => objects.map((object) => object.$identifier()));
6171
6284
  }
6172
6285
  async propertyGroups(query) {
6173
6286
  return this.propertyGroupsSync(query);
@@ -6198,7 +6311,7 @@ export class $RdfjsDatasetObjectSet {
6198
6311
  return this.propertyShapeIdentifiersSync(query);
6199
6312
  }
6200
6313
  propertyShapeIdentifiersSync(query) {
6201
- return this.propertyShapesSync(query).map((objects) => objects.map((object) => object.$identifier));
6314
+ return this.propertyShapesSync(query).map((objects) => objects.map((object) => object.$identifier()));
6202
6315
  }
6203
6316
  async propertyShapes(query) {
6204
6317
  return this.propertyShapesSync(query);
@@ -6229,7 +6342,7 @@ export class $RdfjsDatasetObjectSet {
6229
6342
  return this.shapeIdentifiersSync(query);
6230
6343
  }
6231
6344
  shapeIdentifiersSync(query) {
6232
- return this.shapesSync(query).map((objects) => objects.map((object) => object.$identifier));
6345
+ return this.shapesSync(query).map((objects) => objects.map((object) => object.$identifier()));
6233
6346
  }
6234
6347
  async shapes(query) {
6235
6348
  return this.shapesSync(query);
@@ -6267,7 +6380,7 @@ export class $RdfjsDatasetObjectSet {
6267
6380
  return this.objectIdentifiersSync(query);
6268
6381
  }
6269
6382
  objectIdentifiersSync(query) {
6270
- return this.objectsSync(query).map((objects) => objects.map((object) => object.$identifier));
6383
+ return this.objectsSync(query).map((objects) => objects.map((object) => object.$identifier()));
6271
6384
  }
6272
6385
  async objects(query) {
6273
6386
  return this.objectsSync(query);