@shaclmate/compiler 4.0.30 → 4.0.31
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/generators/ts/AbstractTermType.js +2 -1
- package/dist/generators/ts/AbstractType.d.ts +1 -0
- package/dist/generators/ts/AbstractUnionType.d.ts +3 -0
- package/dist/generators/ts/AbstractUnionType.js +20 -9
- package/dist/generators/ts/ListType.js +1 -1
- package/dist/generators/ts/NamedObjectType.js +2 -3
- package/dist/generators/ts/NamedObjectUnionType.js +2 -2
- package/dist/generators/ts/Snippets.d.ts +4 -1
- package/dist/generators/ts/Snippets.js +28 -7
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +3 -3
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.d.ts +2 -2
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.js +15 -21
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.d.ts +1 -1
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +22 -3
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +83 -7
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js +14 -20
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js +3 -3
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +1 -1
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +4 -4
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +8 -2
- package/dist/generators/ts/_snippets/snippets__FromRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets__FromRdfResourceFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets__ToRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets__ToRdfResourceFunction.js +12 -0
- package/dist/generators/ts/_snippets/snippets_wrap_FromRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_wrap_FromRdfResourceFunction.js +10 -0
- package/dist/generators/ts/_snippets/snippets_wrap_ToRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_wrap_ToRdfResourceFunction.js +14 -0
- package/dist/input/generated.d.ts +34 -116
- package/dist/input/generated.js +385 -437
- package/package.json +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js +0 -38
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js +0 -98
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.js +0 -13
package/dist/input/generated.js
CHANGED
|
@@ -264,6 +264,41 @@ function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }
|
|
|
264
264
|
function $strictEquals(left, right) {
|
|
265
265
|
return $EqualsResult.fromBooleanEqualsResult(left, right, left === right);
|
|
266
266
|
}
|
|
267
|
+
function $wrap_FromRdfResourceFunction(_fromRdfResourceFunction) {
|
|
268
|
+
return (resource, options) => {
|
|
269
|
+
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
270
|
+
if (!objectSet) {
|
|
271
|
+
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
272
|
+
}
|
|
273
|
+
return _fromRdfResourceFunction(resource, {
|
|
274
|
+
context,
|
|
275
|
+
graph,
|
|
276
|
+
ignoreRdfType,
|
|
277
|
+
objectSet,
|
|
278
|
+
preferredLanguages,
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
|
|
283
|
+
return (object, options) => {
|
|
284
|
+
let { graph, ignoreRdfType = false, resourceSet } = options ?? {};
|
|
285
|
+
if (!resourceSet) {
|
|
286
|
+
resourceSet = new ResourceSet({
|
|
287
|
+
dataFactory: dataFactory,
|
|
288
|
+
dataset: datasetFactory.dataset(),
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
const resource = resourceSet.resource(object.$identifier());
|
|
292
|
+
_toRdfResourceFunction({
|
|
293
|
+
graph,
|
|
294
|
+
ignoreRdfType,
|
|
295
|
+
object,
|
|
296
|
+
resource,
|
|
297
|
+
resourceSet,
|
|
298
|
+
});
|
|
299
|
+
return resource;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
267
302
|
export var PropertyShape;
|
|
268
303
|
(function (PropertyShape) {
|
|
269
304
|
function create(parameters) {
|
|
@@ -1069,33 +1104,7 @@ export var PropertyShape;
|
|
|
1069
1104
|
return true;
|
|
1070
1105
|
}
|
|
1071
1106
|
PropertyShape.filter = filter;
|
|
1072
|
-
PropertyShape.
|
|
1073
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
1074
|
-
if (!objectSet) {
|
|
1075
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
1076
|
-
}
|
|
1077
|
-
return PropertyShape.propertiesFromRdfResource(resource, {
|
|
1078
|
-
context,
|
|
1079
|
-
graph,
|
|
1080
|
-
ignoreRdfType,
|
|
1081
|
-
objectSet,
|
|
1082
|
-
preferredLanguages,
|
|
1083
|
-
}).map(create);
|
|
1084
|
-
};
|
|
1085
|
-
PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
1086
|
-
.toResource()
|
|
1087
|
-
.chain((resource) => PropertyShape.fromRdfResource(resource, options))));
|
|
1088
|
-
PropertyShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
|
|
1089
|
-
function isPropertyShape(object) {
|
|
1090
|
-
switch (object.$type) {
|
|
1091
|
-
case "PropertyShape":
|
|
1092
|
-
return true;
|
|
1093
|
-
default:
|
|
1094
|
-
return false;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
PropertyShape.isPropertyShape = isPropertyShape;
|
|
1098
|
-
PropertyShape.propertiesFromRdfResource = ($resource, _$options) => {
|
|
1107
|
+
PropertyShape._fromRdfResource = ($resource, _$options) => {
|
|
1099
1108
|
return (!_$options.ignoreRdfType
|
|
1100
1109
|
? $resource
|
|
1101
1110
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -1122,7 +1131,7 @@ export var PropertyShape;
|
|
|
1122
1131
|
}).toValues())
|
|
1123
1132
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1124
1133
|
.chain((values) => values.head())
|
|
1125
|
-
.chain(($identifier) =>
|
|
1134
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
1126
1135
|
graph: _$options.graph,
|
|
1127
1136
|
resource: $resource,
|
|
1128
1137
|
propertySchema: PropertyShape.schema.properties.and,
|
|
@@ -1218,8 +1227,8 @@ export var PropertyShape;
|
|
|
1218
1227
|
? values.map((value) => Maybe.of(value))
|
|
1219
1228
|
: Resource.Values.fromValue({
|
|
1220
1229
|
focusResource: $resource,
|
|
1221
|
-
propertyPath: PropertyShape.schema.properties
|
|
1222
|
-
.
|
|
1230
|
+
propertyPath: PropertyShape.schema.properties.defaultValue
|
|
1231
|
+
.path,
|
|
1223
1232
|
value: Maybe.empty(),
|
|
1224
1233
|
})),
|
|
1225
1234
|
}).chain((defaultValue) => $shaclPropertyFromRdf({
|
|
@@ -1247,8 +1256,8 @@ export var PropertyShape;
|
|
|
1247
1256
|
: new Resource.Value({
|
|
1248
1257
|
dataFactory: dataFactory,
|
|
1249
1258
|
focusResource: $resource,
|
|
1250
|
-
propertyPath: PropertyShape.schema.properties
|
|
1251
|
-
.
|
|
1259
|
+
propertyPath: PropertyShape.schema.properties.display
|
|
1260
|
+
.path,
|
|
1252
1261
|
term: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
|
|
1253
1262
|
}).toValues())
|
|
1254
1263
|
.chain((values) => values.chainMap((value) => value.toBoolean())),
|
|
@@ -1317,8 +1326,8 @@ export var PropertyShape;
|
|
|
1317
1326
|
})))
|
|
1318
1327
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1319
1328
|
focusResource: $resource,
|
|
1320
|
-
propertyPath: PropertyShape.schema
|
|
1321
|
-
.
|
|
1329
|
+
propertyPath: PropertyShape.schema.properties
|
|
1330
|
+
.in_.path,
|
|
1322
1331
|
values: valueList.toArray(),
|
|
1323
1332
|
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1324
1333
|
switch (term.termType) {
|
|
@@ -1330,8 +1339,7 @@ export var PropertyShape;
|
|
|
1330
1339
|
actualValue: term,
|
|
1331
1340
|
expectedValueType: "(NamedNode | Literal)",
|
|
1332
1341
|
focusResource: $resource,
|
|
1333
|
-
propertyPath: PropertyShape
|
|
1334
|
-
.schema
|
|
1342
|
+
propertyPath: PropertyShape.schema
|
|
1335
1343
|
.properties.in_
|
|
1336
1344
|
.path,
|
|
1337
1345
|
}));
|
|
@@ -1342,8 +1350,8 @@ export var PropertyShape;
|
|
|
1342
1350
|
? values.map((value) => Maybe.of(value))
|
|
1343
1351
|
: Resource.Values.fromValue({
|
|
1344
1352
|
focusResource: $resource,
|
|
1345
|
-
propertyPath: PropertyShape.schema
|
|
1346
|
-
.
|
|
1353
|
+
propertyPath: PropertyShape.schema.properties
|
|
1354
|
+
.in_.path,
|
|
1347
1355
|
value: Maybe.empty(),
|
|
1348
1356
|
})),
|
|
1349
1357
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
@@ -1387,8 +1395,8 @@ export var PropertyShape;
|
|
|
1387
1395
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1388
1396
|
focusResource: $resource,
|
|
1389
1397
|
propertyPath: PropertyShape.schema
|
|
1390
|
-
.properties
|
|
1391
|
-
.
|
|
1398
|
+
.properties.languageIn
|
|
1399
|
+
.path,
|
|
1392
1400
|
values: valueList.toArray(),
|
|
1393
1401
|
}))
|
|
1394
1402
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -1431,15 +1439,13 @@ export var PropertyShape;
|
|
|
1431
1439
|
focusResource: $resource,
|
|
1432
1440
|
propertyPath: PropertyShape.schema
|
|
1433
1441
|
.properties
|
|
1434
|
-
.maxExclusive
|
|
1435
|
-
.path,
|
|
1442
|
+
.maxExclusive.path,
|
|
1436
1443
|
value: Maybe.empty(),
|
|
1437
1444
|
})),
|
|
1438
1445
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
1439
1446
|
graph: _$options.graph,
|
|
1440
1447
|
resource: $resource,
|
|
1441
|
-
propertySchema: PropertyShape.schema.properties
|
|
1442
|
-
.maxInclusive,
|
|
1448
|
+
propertySchema: PropertyShape.schema.properties.maxInclusive,
|
|
1443
1449
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1444
1450
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1445
1451
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -1447,8 +1453,7 @@ export var PropertyShape;
|
|
|
1447
1453
|
? values.map((value) => Maybe.of(value))
|
|
1448
1454
|
: Resource.Values.fromValue({
|
|
1449
1455
|
focusResource: $resource,
|
|
1450
|
-
propertyPath: PropertyShape
|
|
1451
|
-
.schema
|
|
1456
|
+
propertyPath: PropertyShape.schema
|
|
1452
1457
|
.properties
|
|
1453
1458
|
.maxInclusive
|
|
1454
1459
|
.path,
|
|
@@ -1467,15 +1472,13 @@ export var PropertyShape;
|
|
|
1467
1472
|
propertyPath: PropertyShape
|
|
1468
1473
|
.schema
|
|
1469
1474
|
.properties
|
|
1470
|
-
.maxLength
|
|
1471
|
-
.path,
|
|
1475
|
+
.maxLength.path,
|
|
1472
1476
|
value: Maybe.empty(),
|
|
1473
1477
|
})),
|
|
1474
1478
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
1475
1479
|
graph: _$options.graph,
|
|
1476
1480
|
resource: $resource,
|
|
1477
|
-
propertySchema: PropertyShape.schema.properties
|
|
1478
|
-
.minCount,
|
|
1481
|
+
propertySchema: PropertyShape.schema.properties.minCount,
|
|
1479
1482
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1480
1483
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1481
1484
|
.map((values) => values.length > 0
|
|
@@ -1534,8 +1537,7 @@ export var PropertyShape;
|
|
|
1534
1537
|
.minLength,
|
|
1535
1538
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1536
1539
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1537
|
-
.map((values) => values.length >
|
|
1538
|
-
0
|
|
1540
|
+
.map((values) => values.length > 0
|
|
1539
1541
|
? values.map((value) => Maybe.of(value))
|
|
1540
1542
|
: Resource.Values.fromValue({
|
|
1541
1543
|
focusResource: $resource,
|
|
@@ -1549,8 +1551,7 @@ export var PropertyShape;
|
|
|
1549
1551
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
1550
1552
|
graph: _$options.graph,
|
|
1551
1553
|
resource: $resource,
|
|
1552
|
-
propertySchema: PropertyShape.schema
|
|
1553
|
-
.properties
|
|
1554
|
+
propertySchema: PropertyShape.schema.properties
|
|
1554
1555
|
.mutable,
|
|
1555
1556
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1556
1557
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
@@ -1835,9 +1836,8 @@ export var PropertyShape;
|
|
|
1835
1836
|
.path,
|
|
1836
1837
|
value: Maybe.empty(),
|
|
1837
1838
|
})),
|
|
1838
|
-
}).map((xone) => ({
|
|
1839
|
+
}).map((xone) => create({
|
|
1839
1840
|
$identifier,
|
|
1840
|
-
$type,
|
|
1841
1841
|
and,
|
|
1842
1842
|
classes,
|
|
1843
1843
|
comment,
|
|
@@ -1874,8 +1874,22 @@ export var PropertyShape;
|
|
|
1874
1874
|
shaclmateName,
|
|
1875
1875
|
uniqueLang,
|
|
1876
1876
|
xone,
|
|
1877
|
-
})))))))))))))))))))))))))))))))))))))))
|
|
1877
|
+
})))))))))))))))))))))))))))))))))))))));
|
|
1878
1878
|
};
|
|
1879
|
+
PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
|
|
1880
|
+
PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
1881
|
+
.toResource()
|
|
1882
|
+
.chain((resource) => PropertyShape.fromRdfResource(resource, options))));
|
|
1883
|
+
PropertyShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
|
|
1884
|
+
function isPropertyShape(object) {
|
|
1885
|
+
switch (object.$type) {
|
|
1886
|
+
case "PropertyShape":
|
|
1887
|
+
return true;
|
|
1888
|
+
default:
|
|
1889
|
+
return false;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
PropertyShape.isPropertyShape = isPropertyShape;
|
|
1879
1893
|
PropertyShape.schema = {
|
|
1880
1894
|
properties: {
|
|
1881
1895
|
$identifier: {
|
|
@@ -2202,212 +2216,208 @@ export var PropertyShape;
|
|
|
2202
2216
|
},
|
|
2203
2217
|
},
|
|
2204
2218
|
};
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
dataFactory: dataFactory,
|
|
2209
|
-
dataset: datasetFactory.dataset(),
|
|
2210
|
-
});
|
|
2211
|
-
const resource = resourceSet.resource(_propertyShape.$identifier());
|
|
2212
|
-
if (!options?.ignoreRdfType) {
|
|
2213
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), options?.graph);
|
|
2219
|
+
PropertyShape._toRdfResource = (parameters) => {
|
|
2220
|
+
if (!parameters.ignoreRdfType) {
|
|
2221
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), parameters.graph);
|
|
2214
2222
|
}
|
|
2215
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
|
|
2223
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"), parameters.object.and.toList().flatMap((value) => [
|
|
2216
2224
|
value.length > 0
|
|
2217
2225
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2218
2226
|
if (itemIndex === 0) {
|
|
2219
2227
|
currentSubListResource = listResource;
|
|
2220
2228
|
}
|
|
2221
2229
|
else {
|
|
2222
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2223
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2230
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2231
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2224
2232
|
currentSubListResource = newSubListResource;
|
|
2225
2233
|
}
|
|
2226
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2234
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2227
2235
|
if (itemIndex + 1 === list.length) {
|
|
2228
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2236
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2229
2237
|
}
|
|
2230
2238
|
return { currentSubListResource, listResource };
|
|
2231
2239
|
}, {
|
|
2232
2240
|
currentSubListResource: null,
|
|
2233
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2241
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2234
2242
|
}).listResource.identifier
|
|
2235
2243
|
: $RdfVocabularies.rdf.nil,
|
|
2236
|
-
]),
|
|
2237
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
2238
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
2244
|
+
]), parameters.graph);
|
|
2245
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"), parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
2246
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
2239
2247
|
.toList()
|
|
2240
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2241
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
|
|
2242
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
|
|
2248
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2249
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"), parameters.object.datatype.toList(), parameters.graph);
|
|
2250
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"), parameters.object.deactivated
|
|
2243
2251
|
.toList()
|
|
2244
2252
|
.flatMap((value) => [
|
|
2245
2253
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2246
|
-
]),
|
|
2247
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
|
|
2248
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
|
|
2254
|
+
]), parameters.graph);
|
|
2255
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"), parameters.object.defaultValue.toList(), parameters.graph);
|
|
2256
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"), parameters.object.description
|
|
2249
2257
|
.toList()
|
|
2250
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2251
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"), $strictEquals(
|
|
2258
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2259
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"), $strictEquals(parameters.object.display, false).isLeft()
|
|
2252
2260
|
? [
|
|
2253
|
-
$literalFactory.boolean(
|
|
2261
|
+
$literalFactory.boolean(parameters.object.display, $RdfVocabularies.xsd.boolean),
|
|
2254
2262
|
]
|
|
2255
|
-
: [],
|
|
2256
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
|
|
2257
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
|
|
2258
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
|
|
2259
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
|
|
2263
|
+
: [], parameters.graph);
|
|
2264
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
|
|
2265
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#group"), parameters.object.groups.flatMap((item) => [item]), parameters.graph);
|
|
2266
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
2267
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"), parameters.object.in_.toList().flatMap((value) => [
|
|
2260
2268
|
value.length > 0
|
|
2261
2269
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2262
2270
|
if (itemIndex === 0) {
|
|
2263
2271
|
currentSubListResource = listResource;
|
|
2264
2272
|
}
|
|
2265
2273
|
else {
|
|
2266
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2267
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2274
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2275
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2268
2276
|
currentSubListResource = newSubListResource;
|
|
2269
2277
|
}
|
|
2270
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2278
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2271
2279
|
if (itemIndex + 1 === list.length) {
|
|
2272
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2280
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2273
2281
|
}
|
|
2274
2282
|
return { currentSubListResource, listResource };
|
|
2275
2283
|
}, {
|
|
2276
2284
|
currentSubListResource: null,
|
|
2277
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2285
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2278
2286
|
}).listResource.identifier
|
|
2279
2287
|
: $RdfVocabularies.rdf.nil,
|
|
2280
|
-
]),
|
|
2281
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
2282
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
2288
|
+
]), parameters.graph);
|
|
2289
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"), parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
2290
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
2283
2291
|
.toList()
|
|
2284
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2285
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
|
|
2292
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2293
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"), parameters.object.languageIn.toList().flatMap((value) => [
|
|
2286
2294
|
value.length > 0
|
|
2287
2295
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2288
2296
|
if (itemIndex === 0) {
|
|
2289
2297
|
currentSubListResource = listResource;
|
|
2290
2298
|
}
|
|
2291
2299
|
else {
|
|
2292
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2293
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2300
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2301
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2294
2302
|
currentSubListResource = newSubListResource;
|
|
2295
2303
|
}
|
|
2296
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)],
|
|
2304
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
2297
2305
|
if (itemIndex + 1 === list.length) {
|
|
2298
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2306
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2299
2307
|
}
|
|
2300
2308
|
return { currentSubListResource, listResource };
|
|
2301
2309
|
}, {
|
|
2302
2310
|
currentSubListResource: null,
|
|
2303
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2311
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2304
2312
|
}).listResource.identifier
|
|
2305
2313
|
: $RdfVocabularies.rdf.nil,
|
|
2306
|
-
]),
|
|
2307
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
|
|
2314
|
+
]), parameters.graph);
|
|
2315
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"), parameters.object.maxCount
|
|
2308
2316
|
.toList()
|
|
2309
2317
|
.flatMap((value) => [
|
|
2310
2318
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2311
|
-
]),
|
|
2312
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
|
|
2313
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
|
|
2314
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
|
|
2319
|
+
]), parameters.graph);
|
|
2320
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"), parameters.object.maxExclusive.toList(), parameters.graph);
|
|
2321
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"), parameters.object.maxInclusive.toList(), parameters.graph);
|
|
2322
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"), parameters.object.maxLength
|
|
2315
2323
|
.toList()
|
|
2316
2324
|
.flatMap((value) => [
|
|
2317
2325
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2318
|
-
]),
|
|
2319
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
|
|
2326
|
+
]), parameters.graph);
|
|
2327
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"), parameters.object.minCount
|
|
2320
2328
|
.toList()
|
|
2321
2329
|
.flatMap((value) => [
|
|
2322
2330
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2323
|
-
]),
|
|
2324
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
|
|
2325
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
|
|
2326
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
|
|
2331
|
+
]), parameters.graph);
|
|
2332
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"), parameters.object.minExclusive.toList(), parameters.graph);
|
|
2333
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"), parameters.object.minInclusive.toList(), parameters.graph);
|
|
2334
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"), parameters.object.minLength
|
|
2327
2335
|
.toList()
|
|
2328
2336
|
.flatMap((value) => [
|
|
2329
2337
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2330
|
-
]),
|
|
2331
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"),
|
|
2338
|
+
]), parameters.graph);
|
|
2339
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"), parameters.object.mutable
|
|
2332
2340
|
.toList()
|
|
2333
2341
|
.flatMap((value) => [
|
|
2334
2342
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2335
|
-
]),
|
|
2336
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
|
|
2343
|
+
]), parameters.graph);
|
|
2344
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#name"), parameters.object.name
|
|
2337
2345
|
.toList()
|
|
2338
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2339
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
2340
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
|
|
2341
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
|
|
2342
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
|
|
2346
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2347
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"), parameters.object.node.toList(), parameters.graph);
|
|
2348
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"), parameters.object.nodeKind.toList(), parameters.graph);
|
|
2349
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"), parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
2350
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"), parameters.object.or.toList().flatMap((value) => [
|
|
2343
2351
|
value.length > 0
|
|
2344
2352
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2345
2353
|
if (itemIndex === 0) {
|
|
2346
2354
|
currentSubListResource = listResource;
|
|
2347
2355
|
}
|
|
2348
2356
|
else {
|
|
2349
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2350
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2357
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2358
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2351
2359
|
currentSubListResource = newSubListResource;
|
|
2352
2360
|
}
|
|
2353
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2361
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2354
2362
|
if (itemIndex + 1 === list.length) {
|
|
2355
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2363
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2356
2364
|
}
|
|
2357
2365
|
return { currentSubListResource, listResource };
|
|
2358
2366
|
}, {
|
|
2359
2367
|
currentSubListResource: null,
|
|
2360
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2368
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2361
2369
|
}).listResource.identifier
|
|
2362
2370
|
: $RdfVocabularies.rdf.nil,
|
|
2363
|
-
]),
|
|
2364
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
|
|
2371
|
+
]), parameters.graph);
|
|
2372
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#order"), parameters.object.order
|
|
2365
2373
|
.toList()
|
|
2366
2374
|
.flatMap((value) => [
|
|
2367
2375
|
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
2368
|
-
]),
|
|
2369
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#path"), [
|
|
2370
|
-
$PropertyPath.toRdfResource(
|
|
2371
|
-
graph:
|
|
2372
|
-
resourceSet: resourceSet,
|
|
2376
|
+
]), parameters.graph);
|
|
2377
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#path"), [
|
|
2378
|
+
$PropertyPath.toRdfResource(parameters.object.path, {
|
|
2379
|
+
graph: parameters.graph,
|
|
2380
|
+
resourceSet: parameters.resourceSet,
|
|
2373
2381
|
}).identifier,
|
|
2374
|
-
],
|
|
2375
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
2376
|
-
|
|
2377
|
-
|
|
2382
|
+
], parameters.graph);
|
|
2383
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"), parameters.object.patterns.flatMap((item) => [
|
|
2384
|
+
$literalFactory.string(item),
|
|
2385
|
+
]), parameters.graph);
|
|
2386
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#resolve"), parameters.object.resolve.toList(), parameters.graph);
|
|
2387
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"), parameters.object.shaclmateName
|
|
2378
2388
|
.toList()
|
|
2379
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2380
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
|
|
2389
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2390
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"), parameters.object.uniqueLang
|
|
2381
2391
|
.toList()
|
|
2382
2392
|
.flatMap((value) => [
|
|
2383
2393
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2384
|
-
]),
|
|
2385
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
2394
|
+
]), parameters.graph);
|
|
2395
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"), parameters.object.xone.toList().flatMap((value) => [
|
|
2386
2396
|
value.length > 0
|
|
2387
2397
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2388
2398
|
if (itemIndex === 0) {
|
|
2389
2399
|
currentSubListResource = listResource;
|
|
2390
2400
|
}
|
|
2391
2401
|
else {
|
|
2392
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2393
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2402
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2403
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2394
2404
|
currentSubListResource = newSubListResource;
|
|
2395
2405
|
}
|
|
2396
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2406
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2397
2407
|
if (itemIndex + 1 === list.length) {
|
|
2398
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2408
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2399
2409
|
}
|
|
2400
2410
|
return { currentSubListResource, listResource };
|
|
2401
2411
|
}, {
|
|
2402
2412
|
currentSubListResource: null,
|
|
2403
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2413
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2404
2414
|
}).listResource.identifier
|
|
2405
2415
|
: $RdfVocabularies.rdf.nil,
|
|
2406
|
-
]),
|
|
2407
|
-
return resource;
|
|
2408
|
-
}
|
|
2409
|
-
PropertyShape.toRdfResource =
|
|
2410
|
-
function
|
|
2416
|
+
]), parameters.graph);
|
|
2417
|
+
return parameters.resource;
|
|
2418
|
+
};
|
|
2419
|
+
PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
|
|
2420
|
+
function _propertiesToStrings(_propertyShape) {
|
|
2411
2421
|
return $compactRecord({
|
|
2412
2422
|
$identifier: _propertyShape.$identifier().toString(),
|
|
2413
2423
|
label: _propertyShape.label.map((item) => item.toString()).extract(),
|
|
@@ -2418,9 +2428,9 @@ export var PropertyShape;
|
|
|
2418
2428
|
.extract(),
|
|
2419
2429
|
});
|
|
2420
2430
|
}
|
|
2421
|
-
PropertyShape.
|
|
2431
|
+
PropertyShape._propertiesToStrings = _propertiesToStrings;
|
|
2422
2432
|
function $toString(_propertyShape) {
|
|
2423
|
-
return `PropertyShape(${JSON.stringify(
|
|
2433
|
+
return `PropertyShape(${JSON.stringify(_propertiesToStrings((_propertyShape ?? this)))})`;
|
|
2424
2434
|
}
|
|
2425
2435
|
PropertyShape.$toString = $toString;
|
|
2426
2436
|
})(PropertyShape || (PropertyShape = {}));
|
|
@@ -2496,33 +2506,7 @@ export var PropertyGroup;
|
|
|
2496
2506
|
return true;
|
|
2497
2507
|
}
|
|
2498
2508
|
PropertyGroup.filter = filter;
|
|
2499
|
-
PropertyGroup.
|
|
2500
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2501
|
-
if (!objectSet) {
|
|
2502
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
2503
|
-
}
|
|
2504
|
-
return PropertyGroup.propertiesFromRdfResource(resource, {
|
|
2505
|
-
context,
|
|
2506
|
-
graph,
|
|
2507
|
-
ignoreRdfType,
|
|
2508
|
-
objectSet,
|
|
2509
|
-
preferredLanguages,
|
|
2510
|
-
}).map(create);
|
|
2511
|
-
};
|
|
2512
|
-
PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2513
|
-
.toResource()
|
|
2514
|
-
.chain((resource) => PropertyGroup.fromRdfResource(resource, options))));
|
|
2515
|
-
PropertyGroup.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
|
|
2516
|
-
function isPropertyGroup(object) {
|
|
2517
|
-
switch (object.$type) {
|
|
2518
|
-
case "PropertyGroup":
|
|
2519
|
-
return true;
|
|
2520
|
-
default:
|
|
2521
|
-
return false;
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2524
|
-
PropertyGroup.isPropertyGroup = isPropertyGroup;
|
|
2525
|
-
PropertyGroup.propertiesFromRdfResource = ($resource, _$options) => {
|
|
2509
|
+
PropertyGroup._fromRdfResource = ($resource, _$options) => {
|
|
2526
2510
|
return (!_$options.ignoreRdfType
|
|
2527
2511
|
? $resource
|
|
2528
2512
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -2549,7 +2533,7 @@ export var PropertyGroup;
|
|
|
2549
2533
|
}).toValues())
|
|
2550
2534
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2551
2535
|
.chain((values) => values.head())
|
|
2552
|
-
.chain(($identifier) =>
|
|
2536
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
2553
2537
|
graph: _$options.graph,
|
|
2554
2538
|
resource: $resource,
|
|
2555
2539
|
propertySchema: PropertyGroup.schema.properties.comment,
|
|
@@ -2577,8 +2561,22 @@ export var PropertyGroup;
|
|
|
2577
2561
|
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2578
2562
|
value: Maybe.empty(),
|
|
2579
2563
|
})),
|
|
2580
|
-
}).map((label) => ({ $identifier,
|
|
2564
|
+
}).map((label) => create({ $identifier, comment, label })))));
|
|
2581
2565
|
};
|
|
2566
|
+
PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
|
|
2567
|
+
PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2568
|
+
.toResource()
|
|
2569
|
+
.chain((resource) => PropertyGroup.fromRdfResource(resource, options))));
|
|
2570
|
+
PropertyGroup.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
|
|
2571
|
+
function isPropertyGroup(object) {
|
|
2572
|
+
switch (object.$type) {
|
|
2573
|
+
case "PropertyGroup":
|
|
2574
|
+
return true;
|
|
2575
|
+
default:
|
|
2576
|
+
return false;
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
PropertyGroup.isPropertyGroup = isPropertyGroup;
|
|
2582
2580
|
PropertyGroup.schema = {
|
|
2583
2581
|
properties: {
|
|
2584
2582
|
$identifier: {
|
|
@@ -2610,34 +2608,28 @@ export var PropertyGroup;
|
|
|
2610
2608
|
},
|
|
2611
2609
|
},
|
|
2612
2610
|
};
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
dataFactory: dataFactory,
|
|
2617
|
-
dataset: datasetFactory.dataset(),
|
|
2618
|
-
});
|
|
2619
|
-
const resource = resourceSet.resource(_propertyGroup.$identifier());
|
|
2620
|
-
if (!options?.ignoreRdfType) {
|
|
2621
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), options?.graph);
|
|
2611
|
+
PropertyGroup._toRdfResource = (parameters) => {
|
|
2612
|
+
if (!parameters.ignoreRdfType) {
|
|
2613
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), parameters.graph);
|
|
2622
2614
|
}
|
|
2623
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
2615
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
2624
2616
|
.toList()
|
|
2625
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2626
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
2617
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2618
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
2627
2619
|
.toList()
|
|
2628
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2629
|
-
return resource;
|
|
2630
|
-
}
|
|
2631
|
-
PropertyGroup.toRdfResource =
|
|
2632
|
-
function
|
|
2620
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2621
|
+
return parameters.resource;
|
|
2622
|
+
};
|
|
2623
|
+
PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
|
|
2624
|
+
function _propertiesToStrings(_propertyGroup) {
|
|
2633
2625
|
return $compactRecord({
|
|
2634
2626
|
$identifier: _propertyGroup.$identifier().toString(),
|
|
2635
2627
|
label: _propertyGroup.label.map((item) => item.toString()).extract(),
|
|
2636
2628
|
});
|
|
2637
2629
|
}
|
|
2638
|
-
PropertyGroup.
|
|
2630
|
+
PropertyGroup._propertiesToStrings = _propertiesToStrings;
|
|
2639
2631
|
function $toString(_propertyGroup) {
|
|
2640
|
-
return `PropertyGroup(${JSON.stringify(
|
|
2632
|
+
return `PropertyGroup(${JSON.stringify(_propertiesToStrings((_propertyGroup ?? this)))})`;
|
|
2641
2633
|
}
|
|
2642
2634
|
PropertyGroup.$toString = $toString;
|
|
2643
2635
|
})(PropertyGroup || (PropertyGroup = {}));
|
|
@@ -2769,33 +2761,7 @@ export var Ontology;
|
|
|
2769
2761
|
return true;
|
|
2770
2762
|
}
|
|
2771
2763
|
Ontology.filter = filter;
|
|
2772
|
-
Ontology.
|
|
2773
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2774
|
-
if (!objectSet) {
|
|
2775
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
2776
|
-
}
|
|
2777
|
-
return Ontology.propertiesFromRdfResource(resource, {
|
|
2778
|
-
context,
|
|
2779
|
-
graph,
|
|
2780
|
-
ignoreRdfType,
|
|
2781
|
-
objectSet,
|
|
2782
|
-
preferredLanguages,
|
|
2783
|
-
}).map(create);
|
|
2784
|
-
};
|
|
2785
|
-
Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2786
|
-
.toResource()
|
|
2787
|
-
.chain((resource) => Ontology.fromRdfResource(resource, options))));
|
|
2788
|
-
Ontology.fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
|
|
2789
|
-
function isOntology(object) {
|
|
2790
|
-
switch (object.$type) {
|
|
2791
|
-
case "Ontology":
|
|
2792
|
-
return true;
|
|
2793
|
-
default:
|
|
2794
|
-
return false;
|
|
2795
|
-
}
|
|
2796
|
-
}
|
|
2797
|
-
Ontology.isOntology = isOntology;
|
|
2798
|
-
Ontology.propertiesFromRdfResource = ($resource, _$options) => {
|
|
2764
|
+
Ontology._fromRdfResource = ($resource, _$options) => {
|
|
2799
2765
|
return (!_$options.ignoreRdfType
|
|
2800
2766
|
? $resource
|
|
2801
2767
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -2822,7 +2788,7 @@ export var Ontology;
|
|
|
2822
2788
|
}).toValues())
|
|
2823
2789
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2824
2790
|
.chain((values) => values.head())
|
|
2825
|
-
.chain(($identifier) =>
|
|
2791
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
2826
2792
|
graph: _$options.graph,
|
|
2827
2793
|
resource: $resource,
|
|
2828
2794
|
propertySchema: Ontology.schema.properties.comment,
|
|
@@ -2909,16 +2875,29 @@ export var Ontology;
|
|
|
2909
2875
|
propertyPath: Ontology.schema.properties.tsImports.path,
|
|
2910
2876
|
value: valuesArray,
|
|
2911
2877
|
})),
|
|
2912
|
-
}).map((tsImports) => ({
|
|
2878
|
+
}).map((tsImports) => create({
|
|
2913
2879
|
$identifier,
|
|
2914
|
-
$type,
|
|
2915
2880
|
comment,
|
|
2916
2881
|
label,
|
|
2917
2882
|
tsFeatureExcludes,
|
|
2918
2883
|
tsFeatureIncludes,
|
|
2919
2884
|
tsImports,
|
|
2920
|
-
}))))))))
|
|
2885
|
+
}))))))));
|
|
2921
2886
|
};
|
|
2887
|
+
Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
|
|
2888
|
+
Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2889
|
+
.toResource()
|
|
2890
|
+
.chain((resource) => Ontology.fromRdfResource(resource, options))));
|
|
2891
|
+
Ontology.fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
|
|
2892
|
+
function isOntology(object) {
|
|
2893
|
+
switch (object.$type) {
|
|
2894
|
+
case "Ontology":
|
|
2895
|
+
return true;
|
|
2896
|
+
default:
|
|
2897
|
+
return false;
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
Ontology.isOntology = isOntology;
|
|
2922
2901
|
Ontology.schema = {
|
|
2923
2902
|
properties: {
|
|
2924
2903
|
$identifier: {
|
|
@@ -3002,37 +2981,33 @@ export var Ontology;
|
|
|
3002
2981
|
},
|
|
3003
2982
|
},
|
|
3004
2983
|
};
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
dataFactory: dataFactory,
|
|
3009
|
-
dataset: datasetFactory.dataset(),
|
|
3010
|
-
});
|
|
3011
|
-
const resource = resourceSet.resource(_ontology.$identifier());
|
|
3012
|
-
if (!options?.ignoreRdfType) {
|
|
3013
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), options?.graph);
|
|
2984
|
+
Ontology._toRdfResource = (parameters) => {
|
|
2985
|
+
if (!parameters.ignoreRdfType) {
|
|
2986
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), parameters.graph);
|
|
3014
2987
|
}
|
|
3015
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
2988
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
3016
2989
|
.toList()
|
|
3017
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
3018
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
2990
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2991
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
3019
2992
|
.toList()
|
|
3020
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
3021
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureExclude"),
|
|
3022
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureInclude"),
|
|
3023
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"),
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
2993
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2994
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureExclude"), parameters.object.tsFeatureExcludes.flatMap((item) => [item]), parameters.graph);
|
|
2995
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureInclude"), parameters.object.tsFeatureIncludes.flatMap((item) => [item]), parameters.graph);
|
|
2996
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"), parameters.object.tsImports.flatMap((item) => [
|
|
2997
|
+
$literalFactory.string(item),
|
|
2998
|
+
]), parameters.graph);
|
|
2999
|
+
return parameters.resource;
|
|
3000
|
+
};
|
|
3001
|
+
Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
|
|
3002
|
+
function _propertiesToStrings(_ontology) {
|
|
3028
3003
|
return $compactRecord({
|
|
3029
3004
|
$identifier: _ontology.$identifier().toString(),
|
|
3030
3005
|
label: _ontology.label.map((item) => item.toString()).extract(),
|
|
3031
3006
|
});
|
|
3032
3007
|
}
|
|
3033
|
-
Ontology.
|
|
3008
|
+
Ontology._propertiesToStrings = _propertiesToStrings;
|
|
3034
3009
|
function $toString(_ontology) {
|
|
3035
|
-
return `Ontology(${JSON.stringify(
|
|
3010
|
+
return `Ontology(${JSON.stringify(_propertiesToStrings((_ontology ?? this)))})`;
|
|
3036
3011
|
}
|
|
3037
3012
|
Ontology.$toString = $toString;
|
|
3038
3013
|
})(Ontology || (Ontology = {}));
|
|
@@ -3915,33 +3890,7 @@ export var NodeShape;
|
|
|
3915
3890
|
return true;
|
|
3916
3891
|
}
|
|
3917
3892
|
NodeShape.filter = filter;
|
|
3918
|
-
NodeShape.
|
|
3919
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
3920
|
-
if (!objectSet) {
|
|
3921
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
3922
|
-
}
|
|
3923
|
-
return NodeShape.propertiesFromRdfResource(resource, {
|
|
3924
|
-
context,
|
|
3925
|
-
graph,
|
|
3926
|
-
ignoreRdfType,
|
|
3927
|
-
objectSet,
|
|
3928
|
-
preferredLanguages,
|
|
3929
|
-
}).map(create);
|
|
3930
|
-
};
|
|
3931
|
-
NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
3932
|
-
.toResource()
|
|
3933
|
-
.chain((resource) => NodeShape.fromRdfResource(resource, options))));
|
|
3934
|
-
NodeShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
|
|
3935
|
-
function isNodeShape(object) {
|
|
3936
|
-
switch (object.$type) {
|
|
3937
|
-
case "NodeShape":
|
|
3938
|
-
return true;
|
|
3939
|
-
default:
|
|
3940
|
-
return false;
|
|
3941
|
-
}
|
|
3942
|
-
}
|
|
3943
|
-
NodeShape.isNodeShape = isNodeShape;
|
|
3944
|
-
NodeShape.propertiesFromRdfResource = ($resource, _$options) => {
|
|
3893
|
+
NodeShape._fromRdfResource = ($resource, _$options) => {
|
|
3945
3894
|
return (!_$options.ignoreRdfType
|
|
3946
3895
|
? $resource
|
|
3947
3896
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -3968,7 +3917,7 @@ export var NodeShape;
|
|
|
3968
3917
|
}).toValues())
|
|
3969
3918
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3970
3919
|
.chain((values) => values.head())
|
|
3971
|
-
.chain(($identifier) =>
|
|
3920
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
3972
3921
|
graph: _$options.graph,
|
|
3973
3922
|
resource: $resource,
|
|
3974
3923
|
propertySchema: NodeShape.schema.properties.and,
|
|
@@ -4036,8 +3985,7 @@ export var NodeShape;
|
|
|
4036
3985
|
? values.map((value) => Maybe.of(value))
|
|
4037
3986
|
: Resource.Values.fromValue({
|
|
4038
3987
|
focusResource: $resource,
|
|
4039
|
-
propertyPath: PropertyShape.schema.properties.datatype
|
|
4040
|
-
.path,
|
|
3988
|
+
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
4041
3989
|
value: Maybe.empty(),
|
|
4042
3990
|
})),
|
|
4043
3991
|
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
@@ -4050,8 +3998,8 @@ export var NodeShape;
|
|
|
4050
3998
|
? values.map((value) => Maybe.of(value))
|
|
4051
3999
|
: Resource.Values.fromValue({
|
|
4052
4000
|
focusResource: $resource,
|
|
4053
|
-
propertyPath: PropertyShape.schema.properties
|
|
4054
|
-
.
|
|
4001
|
+
propertyPath: PropertyShape.schema.properties.deactivated
|
|
4002
|
+
.path,
|
|
4055
4003
|
value: Maybe.empty(),
|
|
4056
4004
|
})),
|
|
4057
4005
|
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
@@ -4079,8 +4027,7 @@ export var NodeShape;
|
|
|
4079
4027
|
? values.map((value) => Maybe.of(value))
|
|
4080
4028
|
: Resource.Values.fromValue({
|
|
4081
4029
|
focusResource: $resource,
|
|
4082
|
-
propertyPath: NodeShape.schema.properties.extern
|
|
4083
|
-
.path,
|
|
4030
|
+
propertyPath: NodeShape.schema.properties.extern.path,
|
|
4084
4031
|
value: Maybe.empty(),
|
|
4085
4032
|
})),
|
|
4086
4033
|
}).chain((extern) => $shaclPropertyFromRdf({
|
|
@@ -4175,9 +4122,7 @@ export var NodeShape;
|
|
|
4175
4122
|
propertyPath: PropertyShape.schema
|
|
4176
4123
|
.properties.in_.path,
|
|
4177
4124
|
values: valueList.toArray(),
|
|
4178
|
-
})).chain((values) => values.chainMap((value) => value
|
|
4179
|
-
.toTerm()
|
|
4180
|
-
.chain((term) => {
|
|
4125
|
+
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
4181
4126
|
switch (term.termType) {
|
|
4182
4127
|
case "NamedNode":
|
|
4183
4128
|
case "Literal":
|
|
@@ -4189,8 +4134,8 @@ export var NodeShape;
|
|
|
4189
4134
|
focusResource: $resource,
|
|
4190
4135
|
propertyPath: PropertyShape
|
|
4191
4136
|
.schema
|
|
4192
|
-
.properties
|
|
4193
|
-
.
|
|
4137
|
+
.properties.in_
|
|
4138
|
+
.path,
|
|
4194
4139
|
}));
|
|
4195
4140
|
}
|
|
4196
4141
|
})))))
|
|
@@ -4230,8 +4175,7 @@ export var NodeShape;
|
|
|
4230
4175
|
: Resource.Values.fromValue({
|
|
4231
4176
|
focusResource: $resource,
|
|
4232
4177
|
propertyPath: PropertyShape.schema
|
|
4233
|
-
.properties.label
|
|
4234
|
-
.path,
|
|
4178
|
+
.properties.label.path,
|
|
4235
4179
|
value: Maybe.empty(),
|
|
4236
4180
|
})),
|
|
4237
4181
|
}).chain((label) => $shaclPropertyFromRdf({
|
|
@@ -4244,11 +4188,9 @@ export var NodeShape;
|
|
|
4244
4188
|
})))
|
|
4245
4189
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
4246
4190
|
focusResource: $resource,
|
|
4247
|
-
propertyPath: PropertyShape
|
|
4248
|
-
.schema
|
|
4191
|
+
propertyPath: PropertyShape.schema
|
|
4249
4192
|
.properties
|
|
4250
|
-
.languageIn
|
|
4251
|
-
.path,
|
|
4193
|
+
.languageIn.path,
|
|
4252
4194
|
values: valueList.toArray(),
|
|
4253
4195
|
}))
|
|
4254
4196
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -4259,8 +4201,8 @@ export var NodeShape;
|
|
|
4259
4201
|
: Resource.Values.fromValue({
|
|
4260
4202
|
focusResource: $resource,
|
|
4261
4203
|
propertyPath: PropertyShape.schema
|
|
4262
|
-
.properties
|
|
4263
|
-
.
|
|
4204
|
+
.properties.languageIn
|
|
4205
|
+
.path,
|
|
4264
4206
|
value: Maybe.empty(),
|
|
4265
4207
|
})),
|
|
4266
4208
|
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
@@ -4274,15 +4216,14 @@ export var NodeShape;
|
|
|
4274
4216
|
: Resource.Values.fromValue({
|
|
4275
4217
|
focusResource: $resource,
|
|
4276
4218
|
propertyPath: PropertyShape.schema
|
|
4277
|
-
.properties
|
|
4278
|
-
.
|
|
4219
|
+
.properties.maxCount
|
|
4220
|
+
.path,
|
|
4279
4221
|
value: Maybe.empty(),
|
|
4280
4222
|
})),
|
|
4281
4223
|
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
4282
4224
|
graph: _$options.graph,
|
|
4283
4225
|
resource: $resource,
|
|
4284
|
-
propertySchema: NodeShape.schema.properties
|
|
4285
|
-
.maxExclusive,
|
|
4226
|
+
propertySchema: NodeShape.schema.properties.maxExclusive,
|
|
4286
4227
|
typeFromRdf: (resourceValues) => resourceValues
|
|
4287
4228
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
4288
4229
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -4290,8 +4231,7 @@ export var NodeShape;
|
|
|
4290
4231
|
? values.map((value) => Maybe.of(value))
|
|
4291
4232
|
: Resource.Values.fromValue({
|
|
4292
4233
|
focusResource: $resource,
|
|
4293
|
-
propertyPath: PropertyShape
|
|
4294
|
-
.schema
|
|
4234
|
+
propertyPath: PropertyShape.schema
|
|
4295
4235
|
.properties
|
|
4296
4236
|
.maxExclusive
|
|
4297
4237
|
.path,
|
|
@@ -4319,8 +4259,7 @@ export var NodeShape;
|
|
|
4319
4259
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
4320
4260
|
graph: _$options.graph,
|
|
4321
4261
|
resource: $resource,
|
|
4322
|
-
propertySchema: NodeShape.schema.properties
|
|
4323
|
-
.maxLength,
|
|
4262
|
+
propertySchema: NodeShape.schema.properties.maxLength,
|
|
4324
4263
|
typeFromRdf: (resourceValues) => resourceValues
|
|
4325
4264
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
4326
4265
|
.map((values) => values.length > 0
|
|
@@ -4379,8 +4318,7 @@ export var NodeShape;
|
|
|
4379
4318
|
typeFromRdf: (resourceValues) => resourceValues
|
|
4380
4319
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
4381
4320
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
4382
|
-
.map((values) => values.length >
|
|
4383
|
-
0
|
|
4321
|
+
.map((values) => values.length > 0
|
|
4384
4322
|
? values.map((value) => Maybe.of(value))
|
|
4385
4323
|
: Resource.Values.fromValue({
|
|
4386
4324
|
focusResource: $resource,
|
|
@@ -4394,8 +4332,7 @@ export var NodeShape;
|
|
|
4394
4332
|
}).chain((minInclusive) => $shaclPropertyFromRdf({
|
|
4395
4333
|
graph: _$options.graph,
|
|
4396
4334
|
resource: $resource,
|
|
4397
|
-
propertySchema: NodeShape.schema
|
|
4398
|
-
.properties
|
|
4335
|
+
propertySchema: NodeShape.schema.properties
|
|
4399
4336
|
.minLength,
|
|
4400
4337
|
typeFromRdf: (resourceValues) => resourceValues
|
|
4401
4338
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
@@ -4769,9 +4706,8 @@ export var NodeShape;
|
|
|
4769
4706
|
.path,
|
|
4770
4707
|
value: Maybe.empty(),
|
|
4771
4708
|
})),
|
|
4772
|
-
}).map((xone) => ({
|
|
4709
|
+
}).map((xone) => create({
|
|
4773
4710
|
$identifier,
|
|
4774
|
-
$type,
|
|
4775
4711
|
and,
|
|
4776
4712
|
classes,
|
|
4777
4713
|
closed,
|
|
@@ -4812,8 +4748,22 @@ export var NodeShape;
|
|
|
4812
4748
|
tsImports,
|
|
4813
4749
|
types,
|
|
4814
4750
|
xone,
|
|
4815
|
-
})))))))))))))))))))))))))))))))))))))))))))
|
|
4751
|
+
})))))))))))))))))))))))))))))))))))))))))));
|
|
4816
4752
|
};
|
|
4753
|
+
NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
|
|
4754
|
+
NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
4755
|
+
.toResource()
|
|
4756
|
+
.chain((resource) => NodeShape.fromRdfResource(resource, options))));
|
|
4757
|
+
NodeShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
|
|
4758
|
+
function isNodeShape(object) {
|
|
4759
|
+
switch (object.$type) {
|
|
4760
|
+
case "NodeShape":
|
|
4761
|
+
return true;
|
|
4762
|
+
default:
|
|
4763
|
+
return false;
|
|
4764
|
+
}
|
|
4765
|
+
}
|
|
4766
|
+
NodeShape.isNodeShape = isNodeShape;
|
|
4817
4767
|
NodeShape.schema = {
|
|
4818
4768
|
properties: {
|
|
4819
4769
|
$identifier: {
|
|
@@ -5205,226 +5155,224 @@ export var NodeShape;
|
|
|
5205
5155
|
},
|
|
5206
5156
|
},
|
|
5207
5157
|
};
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
dataFactory: dataFactory,
|
|
5212
|
-
dataset: datasetFactory.dataset(),
|
|
5213
|
-
});
|
|
5214
|
-
const resource = resourceSet.resource(_nodeShape.$identifier());
|
|
5215
|
-
if (!options?.ignoreRdfType) {
|
|
5216
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), options?.graph);
|
|
5158
|
+
NodeShape._toRdfResource = (parameters) => {
|
|
5159
|
+
if (!parameters.ignoreRdfType) {
|
|
5160
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), parameters.graph);
|
|
5217
5161
|
}
|
|
5218
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
|
|
5162
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"), parameters.object.and.toList().flatMap((value) => [
|
|
5219
5163
|
value.length > 0
|
|
5220
5164
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
5221
5165
|
if (itemIndex === 0) {
|
|
5222
5166
|
currentSubListResource = listResource;
|
|
5223
5167
|
}
|
|
5224
5168
|
else {
|
|
5225
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
5226
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
5169
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
5170
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
5227
5171
|
currentSubListResource = newSubListResource;
|
|
5228
5172
|
}
|
|
5229
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
5173
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
5230
5174
|
if (itemIndex + 1 === list.length) {
|
|
5231
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
5175
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
5232
5176
|
}
|
|
5233
5177
|
return { currentSubListResource, listResource };
|
|
5234
5178
|
}, {
|
|
5235
5179
|
currentSubListResource: null,
|
|
5236
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5180
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5237
5181
|
}).listResource.identifier
|
|
5238
5182
|
: $RdfVocabularies.rdf.nil,
|
|
5239
|
-
]),
|
|
5240
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
5241
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
|
|
5183
|
+
]), parameters.graph);
|
|
5184
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"), parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
5185
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"), parameters.object.closed
|
|
5242
5186
|
.toList()
|
|
5243
5187
|
.flatMap((value) => [
|
|
5244
5188
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
5245
|
-
]),
|
|
5246
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
5189
|
+
]), parameters.graph);
|
|
5190
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
5247
5191
|
.toList()
|
|
5248
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
5249
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
|
|
5250
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
|
|
5192
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
5193
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"), parameters.object.datatype.toList(), parameters.graph);
|
|
5194
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"), parameters.object.deactivated
|
|
5251
5195
|
.toList()
|
|
5252
5196
|
.flatMap((value) => [
|
|
5253
5197
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
5254
|
-
]),
|
|
5255
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"),
|
|
5198
|
+
]), parameters.graph);
|
|
5199
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"), parameters.object.discriminantValue
|
|
5256
5200
|
.toList()
|
|
5257
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
5258
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#extern"),
|
|
5201
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
5202
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#extern"), parameters.object.extern
|
|
5259
5203
|
.toList()
|
|
5260
5204
|
.flatMap((value) => [
|
|
5261
5205
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
5262
|
-
]),
|
|
5263
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
|
|
5264
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#fromRdfType"),
|
|
5265
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
|
|
5266
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
|
|
5206
|
+
]), parameters.graph);
|
|
5207
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
|
|
5208
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#fromRdfType"), parameters.object.fromRdfType.toList(), parameters.graph);
|
|
5209
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
5210
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"), parameters.object.ignoredProperties.toList().flatMap((value) => [
|
|
5267
5211
|
value.length > 0
|
|
5268
5212
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
5269
5213
|
if (itemIndex === 0) {
|
|
5270
5214
|
currentSubListResource = listResource;
|
|
5271
5215
|
}
|
|
5272
5216
|
else {
|
|
5273
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
5274
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
5217
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
5218
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
5275
5219
|
currentSubListResource = newSubListResource;
|
|
5276
5220
|
}
|
|
5277
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
5221
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
5278
5222
|
if (itemIndex + 1 === list.length) {
|
|
5279
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
5223
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
5280
5224
|
}
|
|
5281
5225
|
return { currentSubListResource, listResource };
|
|
5282
5226
|
}, {
|
|
5283
5227
|
currentSubListResource: null,
|
|
5284
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5228
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5285
5229
|
}).listResource.identifier
|
|
5286
5230
|
: $RdfVocabularies.rdf.nil,
|
|
5287
|
-
]),
|
|
5288
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
|
|
5231
|
+
]), parameters.graph);
|
|
5232
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"), parameters.object.in_.toList().flatMap((value) => [
|
|
5289
5233
|
value.length > 0
|
|
5290
5234
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
5291
5235
|
if (itemIndex === 0) {
|
|
5292
5236
|
currentSubListResource = listResource;
|
|
5293
5237
|
}
|
|
5294
5238
|
else {
|
|
5295
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
5296
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
5239
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
5240
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
5297
5241
|
currentSubListResource = newSubListResource;
|
|
5298
5242
|
}
|
|
5299
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
5243
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
5300
5244
|
if (itemIndex + 1 === list.length) {
|
|
5301
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
5245
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
5302
5246
|
}
|
|
5303
5247
|
return { currentSubListResource, listResource };
|
|
5304
5248
|
}, {
|
|
5305
5249
|
currentSubListResource: null,
|
|
5306
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5250
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5307
5251
|
}).listResource.identifier
|
|
5308
5252
|
: $RdfVocabularies.rdf.nil,
|
|
5309
|
-
]),
|
|
5310
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
5311
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
5253
|
+
]), parameters.graph);
|
|
5254
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"), parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
5255
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
5312
5256
|
.toList()
|
|
5313
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
5314
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
|
|
5257
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
5258
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"), parameters.object.languageIn.toList().flatMap((value) => [
|
|
5315
5259
|
value.length > 0
|
|
5316
5260
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
5317
5261
|
if (itemIndex === 0) {
|
|
5318
5262
|
currentSubListResource = listResource;
|
|
5319
5263
|
}
|
|
5320
5264
|
else {
|
|
5321
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
5322
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
5265
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
5266
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
5323
5267
|
currentSubListResource = newSubListResource;
|
|
5324
5268
|
}
|
|
5325
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)],
|
|
5269
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
5326
5270
|
if (itemIndex + 1 === list.length) {
|
|
5327
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
5271
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
5328
5272
|
}
|
|
5329
5273
|
return { currentSubListResource, listResource };
|
|
5330
5274
|
}, {
|
|
5331
5275
|
currentSubListResource: null,
|
|
5332
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5276
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5333
5277
|
}).listResource.identifier
|
|
5334
5278
|
: $RdfVocabularies.rdf.nil,
|
|
5335
|
-
]),
|
|
5336
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
|
|
5279
|
+
]), parameters.graph);
|
|
5280
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"), parameters.object.maxCount
|
|
5337
5281
|
.toList()
|
|
5338
5282
|
.flatMap((value) => [
|
|
5339
5283
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
5340
|
-
]),
|
|
5341
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
|
|
5342
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
|
|
5343
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
|
|
5284
|
+
]), parameters.graph);
|
|
5285
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"), parameters.object.maxExclusive.toList(), parameters.graph);
|
|
5286
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"), parameters.object.maxInclusive.toList(), parameters.graph);
|
|
5287
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"), parameters.object.maxLength
|
|
5344
5288
|
.toList()
|
|
5345
5289
|
.flatMap((value) => [
|
|
5346
5290
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
5347
|
-
]),
|
|
5348
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
|
|
5291
|
+
]), parameters.graph);
|
|
5292
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"), parameters.object.minCount
|
|
5349
5293
|
.toList()
|
|
5350
5294
|
.flatMap((value) => [
|
|
5351
5295
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
5352
|
-
]),
|
|
5353
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
|
|
5354
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
|
|
5355
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
|
|
5296
|
+
]), parameters.graph);
|
|
5297
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"), parameters.object.minExclusive.toList(), parameters.graph);
|
|
5298
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"), parameters.object.minInclusive.toList(), parameters.graph);
|
|
5299
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"), parameters.object.minLength
|
|
5356
5300
|
.toList()
|
|
5357
5301
|
.flatMap((value) => [
|
|
5358
5302
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
5359
|
-
]),
|
|
5360
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"),
|
|
5303
|
+
]), parameters.graph);
|
|
5304
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"), parameters.object.mutable
|
|
5361
5305
|
.toList()
|
|
5362
5306
|
.flatMap((value) => [
|
|
5363
5307
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
5364
|
-
]),
|
|
5365
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
5366
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
|
|
5367
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
|
|
5368
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
|
|
5308
|
+
]), parameters.graph);
|
|
5309
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"), parameters.object.node.toList(), parameters.graph);
|
|
5310
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"), parameters.object.nodeKind.toList(), parameters.graph);
|
|
5311
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"), parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
5312
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"), parameters.object.or.toList().flatMap((value) => [
|
|
5369
5313
|
value.length > 0
|
|
5370
5314
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
5371
5315
|
if (itemIndex === 0) {
|
|
5372
5316
|
currentSubListResource = listResource;
|
|
5373
5317
|
}
|
|
5374
5318
|
else {
|
|
5375
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
5376
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
5319
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
5320
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
5377
5321
|
currentSubListResource = newSubListResource;
|
|
5378
5322
|
}
|
|
5379
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
5323
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
5380
5324
|
if (itemIndex + 1 === list.length) {
|
|
5381
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
5325
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
5382
5326
|
}
|
|
5383
5327
|
return { currentSubListResource, listResource };
|
|
5384
5328
|
}, {
|
|
5385
5329
|
currentSubListResource: null,
|
|
5386
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5330
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5387
5331
|
}).listResource.identifier
|
|
5388
5332
|
: $RdfVocabularies.rdf.nil,
|
|
5389
|
-
]),
|
|
5390
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
resource.add(dataFactory.namedNode("http://
|
|
5333
|
+
]), parameters.graph);
|
|
5334
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"), parameters.object.patterns.flatMap((item) => [
|
|
5335
|
+
$literalFactory.string(item),
|
|
5336
|
+
]), parameters.graph);
|
|
5337
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#property"), parameters.object.properties.flatMap((item) => [item]), parameters.graph);
|
|
5338
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#rdfType"), parameters.object.rdfType.toList(), parameters.graph);
|
|
5339
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"), parameters.object.shaclmateName
|
|
5394
5340
|
.toList()
|
|
5395
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
5396
|
-
resource.add($RdfVocabularies.rdfs.subClassOf,
|
|
5397
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#toRdfType"),
|
|
5398
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureExclude"),
|
|
5399
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureInclude"),
|
|
5400
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"),
|
|
5401
|
-
|
|
5402
|
-
|
|
5341
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
5342
|
+
parameters.resource.add($RdfVocabularies.rdfs.subClassOf, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
|
|
5343
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#toRdfType"), parameters.object.toRdfTypes.flatMap((item) => [item]), parameters.graph);
|
|
5344
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureExclude"), parameters.object.tsFeatureExcludes.flatMap((item) => [item]), parameters.graph);
|
|
5345
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureInclude"), parameters.object.tsFeatureIncludes.flatMap((item) => [item]), parameters.graph);
|
|
5346
|
+
parameters.resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"), parameters.object.tsImports.flatMap((item) => [
|
|
5347
|
+
$literalFactory.string(item),
|
|
5348
|
+
]), parameters.graph);
|
|
5349
|
+
parameters.resource.add($RdfVocabularies.rdf.type, parameters.object.types.flatMap((item) => [item]), parameters.graph);
|
|
5350
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"), parameters.object.xone.toList().flatMap((value) => [
|
|
5403
5351
|
value.length > 0
|
|
5404
5352
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
5405
5353
|
if (itemIndex === 0) {
|
|
5406
5354
|
currentSubListResource = listResource;
|
|
5407
5355
|
}
|
|
5408
5356
|
else {
|
|
5409
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
5410
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
5357
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
5358
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
5411
5359
|
currentSubListResource = newSubListResource;
|
|
5412
5360
|
}
|
|
5413
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
5361
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
5414
5362
|
if (itemIndex + 1 === list.length) {
|
|
5415
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
5363
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
5416
5364
|
}
|
|
5417
5365
|
return { currentSubListResource, listResource };
|
|
5418
5366
|
}, {
|
|
5419
5367
|
currentSubListResource: null,
|
|
5420
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5368
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
5421
5369
|
}).listResource.identifier
|
|
5422
5370
|
: $RdfVocabularies.rdf.nil,
|
|
5423
|
-
]),
|
|
5424
|
-
return resource;
|
|
5425
|
-
}
|
|
5426
|
-
NodeShape.toRdfResource =
|
|
5427
|
-
function
|
|
5371
|
+
]), parameters.graph);
|
|
5372
|
+
return parameters.resource;
|
|
5373
|
+
};
|
|
5374
|
+
NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
|
|
5375
|
+
function _propertiesToStrings(_nodeShape) {
|
|
5428
5376
|
return $compactRecord({
|
|
5429
5377
|
$identifier: _nodeShape.$identifier().toString(),
|
|
5430
5378
|
label: _nodeShape.label.map((item) => item.toString()).extract(),
|
|
@@ -5433,9 +5381,9 @@ export var NodeShape;
|
|
|
5433
5381
|
.extract(),
|
|
5434
5382
|
});
|
|
5435
5383
|
}
|
|
5436
|
-
NodeShape.
|
|
5384
|
+
NodeShape._propertiesToStrings = _propertiesToStrings;
|
|
5437
5385
|
function $toString(_nodeShape) {
|
|
5438
|
-
return `NodeShape(${JSON.stringify(
|
|
5386
|
+
return `NodeShape(${JSON.stringify(_propertiesToStrings((_nodeShape ?? this)))})`;
|
|
5439
5387
|
}
|
|
5440
5388
|
NodeShape.$toString = $toString;
|
|
5441
5389
|
})(NodeShape || (NodeShape = {}));
|
|
@@ -5760,12 +5708,12 @@ export var Shape;
|
|
|
5760
5708
|
},
|
|
5761
5709
|
},
|
|
5762
5710
|
};
|
|
5763
|
-
Shape.toRdfResource = (
|
|
5764
|
-
if (NodeShape.isNodeShape(
|
|
5765
|
-
return NodeShape.toRdfResource(
|
|
5711
|
+
Shape.toRdfResource = (object, options) => {
|
|
5712
|
+
if (NodeShape.isNodeShape(object)) {
|
|
5713
|
+
return NodeShape.toRdfResource(object, options);
|
|
5766
5714
|
}
|
|
5767
|
-
if (PropertyShape.isPropertyShape(
|
|
5768
|
-
return PropertyShape.toRdfResource(
|
|
5715
|
+
if (PropertyShape.isPropertyShape(object)) {
|
|
5716
|
+
return PropertyShape.toRdfResource(object, options);
|
|
5769
5717
|
}
|
|
5770
5718
|
throw new Error("unrecognized type");
|
|
5771
5719
|
};
|
|
@@ -5930,18 +5878,18 @@ export var $Object;
|
|
|
5930
5878
|
},
|
|
5931
5879
|
},
|
|
5932
5880
|
};
|
|
5933
|
-
$Object.toRdfResource = (
|
|
5934
|
-
if (NodeShape.isNodeShape(
|
|
5935
|
-
return NodeShape.toRdfResource(
|
|
5881
|
+
$Object.toRdfResource = (object, options) => {
|
|
5882
|
+
if (NodeShape.isNodeShape(object)) {
|
|
5883
|
+
return NodeShape.toRdfResource(object, options);
|
|
5936
5884
|
}
|
|
5937
|
-
if (Ontology.isOntology(
|
|
5938
|
-
return Ontology.toRdfResource(
|
|
5885
|
+
if (Ontology.isOntology(object)) {
|
|
5886
|
+
return Ontology.toRdfResource(object, options);
|
|
5939
5887
|
}
|
|
5940
|
-
if (PropertyGroup.isPropertyGroup(
|
|
5941
|
-
return PropertyGroup.toRdfResource(
|
|
5888
|
+
if (PropertyGroup.isPropertyGroup(object)) {
|
|
5889
|
+
return PropertyGroup.toRdfResource(object, options);
|
|
5942
5890
|
}
|
|
5943
|
-
if (PropertyShape.isPropertyShape(
|
|
5944
|
-
return PropertyShape.toRdfResource(
|
|
5891
|
+
if (PropertyShape.isPropertyShape(object)) {
|
|
5892
|
+
return PropertyShape.toRdfResource(object, options);
|
|
5945
5893
|
}
|
|
5946
5894
|
throw new Error("unrecognized type");
|
|
5947
5895
|
};
|