@shaclmate/compiler 4.0.22 → 4.0.23
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/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +1 -0
- package/dist/ast/ObjectType.d.ts +6 -1
- package/dist/ast/ObjectType.js +6 -1
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +1 -0
- package/dist/generators/ts/AbstractLazyObjectType.js +7 -0
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +3 -2
- package/dist/generators/ts/AbstractNamedUnionType.js +23 -9
- package/dist/generators/ts/AbstractTermType.d.ts +1 -0
- package/dist/generators/ts/AbstractTermType.js +3 -0
- package/dist/generators/ts/AbstractType.d.ts +12 -4
- package/dist/generators/ts/AbstractUnionType.d.ts +1 -0
- package/dist/generators/ts/AbstractUnionType.js +10 -0
- package/dist/generators/ts/AnonymousUnionType.d.ts +2 -1
- package/dist/generators/ts/AnonymousUnionType.js +6 -3
- package/dist/generators/ts/DefaultValueType.d.ts +2 -1
- package/dist/generators/ts/DefaultValueType.js +6 -3
- package/dist/generators/ts/ListType.d.ts +1 -0
- package/dist/generators/ts/ListType.js +3 -0
- package/dist/generators/ts/NamedObjectType.d.ts +1 -0
- package/dist/generators/ts/NamedObjectType.js +11 -0
- package/dist/generators/ts/OptionType.d.ts +1 -0
- package/dist/generators/ts/OptionType.js +3 -0
- package/dist/generators/ts/SetType.d.ts +1 -0
- package/dist/generators/ts/SetType.js +3 -0
- package/dist/generators/ts/TypeFactory.js +1 -0
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +13 -5
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.d.ts +2 -1
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.js +9 -6
- package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.d.ts +2 -1
- package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.js +4 -1
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.d.ts +2 -1
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +5 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.js +2 -9
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js +11 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.d.ts +4 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.js +62 -0
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +5 -2
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +24 -9
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +5 -3
- package/dist/generators/ts/_snippets/snippets_compactRecord.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_compactRecord.js +16 -0
- package/dist/generators/ts/_snippets/{parseIri.d.ts → snippets_parseIri.d.ts} +1 -1
- package/dist/generators/ts/_snippets/{parseIri.js → snippets_parseIri.js} +1 -1
- package/dist/generators/ts/imports.d.ts +1 -1
- package/dist/generators/ts/imports.js +1 -1
- package/dist/generators/ts/snippets.d.ts +1 -0
- package/dist/generators/ts/snippets.js +3 -1
- package/dist/input/generated.d.ts +94 -3
- package/dist/input/generated.js +183 -21
- package/package.json +2 -2
package/dist/input/generated.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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 =
|
|
217
|
+
$PropertyPath.$toRdfResource = RdfxResourcePropertyPath.toResource;
|
|
218
|
+
$PropertyPath.$toString = RdfxResourcePropertyPath.toString;
|
|
193
219
|
})($PropertyPath || ($PropertyPath = {}));
|
|
194
220
|
var $RdfVocabularies;
|
|
195
221
|
(function ($RdfVocabularies) {
|
|
@@ -232,6 +258,12 @@ 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) {
|
|
@@ -362,6 +394,16 @@ export var PropertyShape;
|
|
|
362
394
|
else {
|
|
363
395
|
description = parameters.description;
|
|
364
396
|
}
|
|
397
|
+
let display;
|
|
398
|
+
if (typeof parameters.display === "boolean") {
|
|
399
|
+
display = parameters.display;
|
|
400
|
+
}
|
|
401
|
+
else if (parameters.display === undefined) {
|
|
402
|
+
display = false;
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
display = parameters.display;
|
|
406
|
+
}
|
|
365
407
|
let flags;
|
|
366
408
|
if (parameters.flags === undefined) {
|
|
367
409
|
flags = [];
|
|
@@ -834,6 +876,7 @@ export var PropertyShape;
|
|
|
834
876
|
deactivated,
|
|
835
877
|
defaultValue,
|
|
836
878
|
description,
|
|
879
|
+
display,
|
|
837
880
|
flags,
|
|
838
881
|
groups,
|
|
839
882
|
hasValues,
|
|
@@ -904,6 +947,10 @@ export var PropertyShape;
|
|
|
904
947
|
!$filterMaybe($filterString)(filter.description, value.description)) {
|
|
905
948
|
return false;
|
|
906
949
|
}
|
|
950
|
+
if (filter.display !== undefined &&
|
|
951
|
+
!$filterBoolean(filter.display, value.display)) {
|
|
952
|
+
return false;
|
|
953
|
+
}
|
|
907
954
|
if (filter.flags !== undefined &&
|
|
908
955
|
!$filterArray($filterString)(filter.flags, value.flags)) {
|
|
909
956
|
return false;
|
|
@@ -1193,6 +1240,21 @@ export var PropertyShape;
|
|
|
1193
1240
|
value: Maybe.empty(),
|
|
1194
1241
|
})),
|
|
1195
1242
|
}).chain((description) => $shaclPropertyFromRdf({
|
|
1243
|
+
graph: _$options.graph,
|
|
1244
|
+
resource: $resource,
|
|
1245
|
+
propertySchema: PropertyShape.$schema.properties.display,
|
|
1246
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1247
|
+
.map((values) => values.length > 0
|
|
1248
|
+
? values
|
|
1249
|
+
: new Resource.Value({
|
|
1250
|
+
dataFactory: dataFactory,
|
|
1251
|
+
focusResource: $resource,
|
|
1252
|
+
propertyPath: PropertyShape.$schema.properties
|
|
1253
|
+
.display.path,
|
|
1254
|
+
term: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
|
|
1255
|
+
}).toValues())
|
|
1256
|
+
.chain((values) => values.chainMap((value) => value.toBoolean())),
|
|
1257
|
+
}).chain((display) => $shaclPropertyFromRdf({
|
|
1196
1258
|
graph: _$options.graph,
|
|
1197
1259
|
resource: $resource,
|
|
1198
1260
|
propertySchema: PropertyShape.$schema.properties.flags,
|
|
@@ -1215,8 +1277,8 @@ export var PropertyShape;
|
|
|
1215
1277
|
.map((values) => values.toArray())
|
|
1216
1278
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1217
1279
|
focusResource: $resource,
|
|
1218
|
-
propertyPath: PropertyShape.$schema.properties
|
|
1219
|
-
.path,
|
|
1280
|
+
propertyPath: PropertyShape.$schema.properties
|
|
1281
|
+
.groups.path,
|
|
1220
1282
|
value: valuesArray,
|
|
1221
1283
|
})),
|
|
1222
1284
|
}).chain((groups) => $shaclPropertyFromRdf({
|
|
@@ -1257,8 +1319,8 @@ export var PropertyShape;
|
|
|
1257
1319
|
})))
|
|
1258
1320
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1259
1321
|
focusResource: $resource,
|
|
1260
|
-
propertyPath: PropertyShape.$schema
|
|
1261
|
-
.in_.path,
|
|
1322
|
+
propertyPath: PropertyShape.$schema
|
|
1323
|
+
.properties.in_.path,
|
|
1262
1324
|
values: valueList.toArray(),
|
|
1263
1325
|
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1264
1326
|
switch (term.termType) {
|
|
@@ -1282,8 +1344,8 @@ export var PropertyShape;
|
|
|
1282
1344
|
? values.map((value) => Maybe.of(value))
|
|
1283
1345
|
: Resource.Values.fromValue({
|
|
1284
1346
|
focusResource: $resource,
|
|
1285
|
-
propertyPath: PropertyShape.$schema
|
|
1286
|
-
.in_.path,
|
|
1347
|
+
propertyPath: PropertyShape.$schema
|
|
1348
|
+
.properties.in_.path,
|
|
1287
1349
|
value: Maybe.empty(),
|
|
1288
1350
|
})),
|
|
1289
1351
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
@@ -1326,9 +1388,10 @@ export var PropertyShape;
|
|
|
1326
1388
|
})))
|
|
1327
1389
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1328
1390
|
focusResource: $resource,
|
|
1329
|
-
propertyPath: PropertyShape
|
|
1330
|
-
|
|
1331
|
-
.
|
|
1391
|
+
propertyPath: PropertyShape
|
|
1392
|
+
.$schema
|
|
1393
|
+
.properties
|
|
1394
|
+
.languageIn.path,
|
|
1332
1395
|
values: valueList.toArray(),
|
|
1333
1396
|
}))
|
|
1334
1397
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -1369,15 +1432,18 @@ export var PropertyShape;
|
|
|
1369
1432
|
? values.map((value) => Maybe.of(value))
|
|
1370
1433
|
: Resource.Values.fromValue({
|
|
1371
1434
|
focusResource: $resource,
|
|
1372
|
-
propertyPath: PropertyShape
|
|
1435
|
+
propertyPath: PropertyShape
|
|
1436
|
+
.$schema
|
|
1373
1437
|
.properties
|
|
1374
|
-
.maxExclusive
|
|
1438
|
+
.maxExclusive
|
|
1439
|
+
.path,
|
|
1375
1440
|
value: Maybe.empty(),
|
|
1376
1441
|
})),
|
|
1377
1442
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
1378
1443
|
graph: _$options.graph,
|
|
1379
1444
|
resource: $resource,
|
|
1380
|
-
propertySchema: PropertyShape.$schema.properties
|
|
1445
|
+
propertySchema: PropertyShape.$schema.properties
|
|
1446
|
+
.maxInclusive,
|
|
1381
1447
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1382
1448
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1383
1449
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -1395,7 +1461,8 @@ export var PropertyShape;
|
|
|
1395
1461
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
1396
1462
|
graph: _$options.graph,
|
|
1397
1463
|
resource: $resource,
|
|
1398
|
-
propertySchema: PropertyShape.$schema.properties
|
|
1464
|
+
propertySchema: PropertyShape.$schema.properties
|
|
1465
|
+
.maxLength,
|
|
1399
1466
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1400
1467
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
1401
1468
|
.map((values) => values.length > 0
|
|
@@ -1405,13 +1472,15 @@ export var PropertyShape;
|
|
|
1405
1472
|
propertyPath: PropertyShape
|
|
1406
1473
|
.$schema
|
|
1407
1474
|
.properties
|
|
1408
|
-
.maxLength
|
|
1475
|
+
.maxLength
|
|
1476
|
+
.path,
|
|
1409
1477
|
value: Maybe.empty(),
|
|
1410
1478
|
})),
|
|
1411
1479
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
1412
1480
|
graph: _$options.graph,
|
|
1413
1481
|
resource: $resource,
|
|
1414
|
-
propertySchema: PropertyShape.$schema.properties
|
|
1482
|
+
propertySchema: PropertyShape.$schema.properties
|
|
1483
|
+
.minCount,
|
|
1415
1484
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1416
1485
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
1417
1486
|
.map((values) => values.length > 0
|
|
@@ -1470,7 +1539,8 @@ export var PropertyShape;
|
|
|
1470
1539
|
.minLength,
|
|
1471
1540
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1472
1541
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
1473
|
-
.map((values) => values.length >
|
|
1542
|
+
.map((values) => values.length >
|
|
1543
|
+
0
|
|
1474
1544
|
? values.map((value) => Maybe.of(value))
|
|
1475
1545
|
: Resource.Values.fromValue({
|
|
1476
1546
|
focusResource: $resource,
|
|
@@ -1484,7 +1554,8 @@ export var PropertyShape;
|
|
|
1484
1554
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
1485
1555
|
graph: _$options.graph,
|
|
1486
1556
|
resource: $resource,
|
|
1487
|
-
propertySchema: PropertyShape.$schema
|
|
1557
|
+
propertySchema: PropertyShape.$schema
|
|
1558
|
+
.properties
|
|
1488
1559
|
.mutable,
|
|
1489
1560
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1490
1561
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
@@ -1801,6 +1872,7 @@ export var PropertyShape;
|
|
|
1801
1872
|
deactivated,
|
|
1802
1873
|
defaultValue,
|
|
1803
1874
|
description,
|
|
1875
|
+
display,
|
|
1804
1876
|
flags,
|
|
1805
1877
|
groups,
|
|
1806
1878
|
hasValues,
|
|
@@ -1830,7 +1902,7 @@ export var PropertyShape;
|
|
|
1830
1902
|
uniqueLang,
|
|
1831
1903
|
visibility,
|
|
1832
1904
|
xone,
|
|
1833
|
-
}))))))))))))))))))))))))))))))))))))))));
|
|
1905
|
+
})))))))))))))))))))))))))))))))))))))))));
|
|
1834
1906
|
};
|
|
1835
1907
|
PropertyShape.$schema = {
|
|
1836
1908
|
properties: {
|
|
@@ -1904,6 +1976,15 @@ export var PropertyShape;
|
|
|
1904
1976
|
}),
|
|
1905
1977
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
|
|
1906
1978
|
},
|
|
1979
|
+
display: {
|
|
1980
|
+
kind: "Shacl",
|
|
1981
|
+
type: () => ({
|
|
1982
|
+
kind: "DefaultValue",
|
|
1983
|
+
item: () => ({ kind: "Boolean" }),
|
|
1984
|
+
defaultValue: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
|
|
1985
|
+
}),
|
|
1986
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"),
|
|
1987
|
+
},
|
|
1907
1988
|
flags: {
|
|
1908
1989
|
kind: "Shacl",
|
|
1909
1990
|
type: () => ({
|
|
@@ -2210,6 +2291,11 @@ export var PropertyShape;
|
|
|
2210
2291
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"), _propertyShape.description
|
|
2211
2292
|
.toList()
|
|
2212
2293
|
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
2294
|
+
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"), $strictEquals(_propertyShape.display, false).isLeft()
|
|
2295
|
+
? [
|
|
2296
|
+
$literalFactory.boolean(_propertyShape.display, $RdfVocabularies.xsd.boolean),
|
|
2297
|
+
]
|
|
2298
|
+
: [], options?.graph);
|
|
2213
2299
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), _propertyShape.flags.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
|
|
2214
2300
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#group"), _propertyShape.groups.flatMap((item) => [item]), options?.graph);
|
|
2215
2301
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), _propertyShape.hasValues.flatMap((item) => [item]), options?.graph);
|
|
@@ -2365,6 +2451,22 @@ export var PropertyShape;
|
|
|
2365
2451
|
return resource;
|
|
2366
2452
|
}
|
|
2367
2453
|
PropertyShape.$toRdfResource = $toRdfResource;
|
|
2454
|
+
function $propertiesToStrings(_propertyShape) {
|
|
2455
|
+
return $compactRecord({
|
|
2456
|
+
$identifier: _propertyShape.$identifier.toString(),
|
|
2457
|
+
label: _propertyShape.label.map((item) => item.toString()).extract(),
|
|
2458
|
+
name: _propertyShape.name.map((item) => item.toString()).extract(),
|
|
2459
|
+
path: $PropertyPath.$toString(_propertyShape.path),
|
|
2460
|
+
shaclmateName: _propertyShape.shaclmateName
|
|
2461
|
+
.map((item) => item.toString())
|
|
2462
|
+
.extract(),
|
|
2463
|
+
});
|
|
2464
|
+
}
|
|
2465
|
+
PropertyShape.$propertiesToStrings = $propertiesToStrings;
|
|
2466
|
+
function $toString(_propertyShape) {
|
|
2467
|
+
return `PropertyShape(${JSON.stringify($propertiesToStrings((_propertyShape ?? this)))})`;
|
|
2468
|
+
}
|
|
2469
|
+
PropertyShape.$toString = $toString;
|
|
2368
2470
|
})(PropertyShape || (PropertyShape = {}));
|
|
2369
2471
|
export var PropertyGroup;
|
|
2370
2472
|
(function (PropertyGroup) {
|
|
@@ -2566,6 +2668,17 @@ export var PropertyGroup;
|
|
|
2566
2668
|
return resource;
|
|
2567
2669
|
}
|
|
2568
2670
|
PropertyGroup.$toRdfResource = $toRdfResource;
|
|
2671
|
+
function $propertiesToStrings(_propertyGroup) {
|
|
2672
|
+
return $compactRecord({
|
|
2673
|
+
$identifier: _propertyGroup.$identifier.toString(),
|
|
2674
|
+
label: _propertyGroup.label.map((item) => item.toString()).extract(),
|
|
2675
|
+
});
|
|
2676
|
+
}
|
|
2677
|
+
PropertyGroup.$propertiesToStrings = $propertiesToStrings;
|
|
2678
|
+
function $toString(_propertyGroup) {
|
|
2679
|
+
return `PropertyGroup(${JSON.stringify($propertiesToStrings((_propertyGroup ?? this)))})`;
|
|
2680
|
+
}
|
|
2681
|
+
PropertyGroup.$toString = $toString;
|
|
2569
2682
|
})(PropertyGroup || (PropertyGroup = {}));
|
|
2570
2683
|
export var Ontology;
|
|
2571
2684
|
(function (Ontology) {
|
|
@@ -3001,6 +3114,17 @@ export var Ontology;
|
|
|
3001
3114
|
return resource;
|
|
3002
3115
|
}
|
|
3003
3116
|
Ontology.$toRdfResource = $toRdfResource;
|
|
3117
|
+
function $propertiesToStrings(_ontology) {
|
|
3118
|
+
return $compactRecord({
|
|
3119
|
+
$identifier: _ontology.$identifier.toString(),
|
|
3120
|
+
label: _ontology.label.map((item) => item.toString()).extract(),
|
|
3121
|
+
});
|
|
3122
|
+
}
|
|
3123
|
+
Ontology.$propertiesToStrings = $propertiesToStrings;
|
|
3124
|
+
function $toString(_ontology) {
|
|
3125
|
+
return `Ontology(${JSON.stringify($propertiesToStrings((_ontology ?? this)))})`;
|
|
3126
|
+
}
|
|
3127
|
+
Ontology.$toString = $toString;
|
|
3004
3128
|
})(Ontology || (Ontology = {}));
|
|
3005
3129
|
export var NodeShape;
|
|
3006
3130
|
(function (NodeShape) {
|
|
@@ -5548,6 +5672,20 @@ export var NodeShape;
|
|
|
5548
5672
|
return resource;
|
|
5549
5673
|
}
|
|
5550
5674
|
NodeShape.$toRdfResource = $toRdfResource;
|
|
5675
|
+
function $propertiesToStrings(_nodeShape) {
|
|
5676
|
+
return $compactRecord({
|
|
5677
|
+
$identifier: _nodeShape.$identifier.toString(),
|
|
5678
|
+
label: _nodeShape.label.map((item) => item.toString()).extract(),
|
|
5679
|
+
shaclmateName: _nodeShape.shaclmateName
|
|
5680
|
+
.map((item) => item.toString())
|
|
5681
|
+
.extract(),
|
|
5682
|
+
});
|
|
5683
|
+
}
|
|
5684
|
+
NodeShape.$propertiesToStrings = $propertiesToStrings;
|
|
5685
|
+
function $toString(_nodeShape) {
|
|
5686
|
+
return `NodeShape(${JSON.stringify($propertiesToStrings((_nodeShape ?? this)))})`;
|
|
5687
|
+
}
|
|
5688
|
+
NodeShape.$toString = $toString;
|
|
5551
5689
|
})(NodeShape || (NodeShape = {}));
|
|
5552
5690
|
export var Shape;
|
|
5553
5691
|
(function (Shape) {
|
|
@@ -5885,6 +6023,15 @@ export var Shape;
|
|
|
5885
6023
|
}
|
|
5886
6024
|
throw new Error("unable to serialize to RDF");
|
|
5887
6025
|
});
|
|
6026
|
+
Shape.$toString = (value) => {
|
|
6027
|
+
if (NodeShape.isNodeShape(value)) {
|
|
6028
|
+
return NodeShape.$toString(value);
|
|
6029
|
+
}
|
|
6030
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
6031
|
+
return PropertyShape.$toString(value);
|
|
6032
|
+
}
|
|
6033
|
+
throw new Error("unable to serialize to string");
|
|
6034
|
+
};
|
|
5888
6035
|
function isShape(object) {
|
|
5889
6036
|
return (NodeShape.isNodeShape(object) || PropertyShape.isPropertyShape(object));
|
|
5890
6037
|
}
|
|
@@ -6066,6 +6213,21 @@ export var $Object;
|
|
|
6066
6213
|
}
|
|
6067
6214
|
throw new Error("unable to serialize to RDF");
|
|
6068
6215
|
});
|
|
6216
|
+
$Object.$toString = (value) => {
|
|
6217
|
+
if (NodeShape.isNodeShape(value)) {
|
|
6218
|
+
return NodeShape.$toString(value);
|
|
6219
|
+
}
|
|
6220
|
+
if (Ontology.isOntology(value)) {
|
|
6221
|
+
return Ontology.$toString(value);
|
|
6222
|
+
}
|
|
6223
|
+
if (PropertyGroup.isPropertyGroup(value)) {
|
|
6224
|
+
return PropertyGroup.$toString(value);
|
|
6225
|
+
}
|
|
6226
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
6227
|
+
return PropertyShape.$toString(value);
|
|
6228
|
+
}
|
|
6229
|
+
throw new Error("unable to serialize to string");
|
|
6230
|
+
};
|
|
6069
6231
|
})($Object || ($Object = {}));
|
|
6070
6232
|
export class $RdfjsDatasetObjectSet {
|
|
6071
6233
|
$graph;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@shaclmate/shacl-ast": "4.0.
|
|
3
|
+
"@shaclmate/shacl-ast": "4.0.23",
|
|
4
4
|
"@rdfjs/dataset": "~2.0.2",
|
|
5
5
|
"@rdfjs/prefix-map": "~0.1.2",
|
|
6
6
|
"@rdfjs/term-map": "~2.0.2",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
},
|
|
71
71
|
"type": "module",
|
|
72
72
|
"types": "./dist/index.d.ts",
|
|
73
|
-
"version": "4.0.
|
|
73
|
+
"version": "4.0.23"
|
|
74
74
|
}
|