@shaclmate/compiler 4.0.13 → 4.0.14
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.js +2 -2
- package/dist/_ShapesGraphToAstTransformer/ShapeStack.js +6 -5
- package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.d.ts +3 -2
- package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.js +8 -5
- package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.js +2 -1
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +6 -6
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.d.ts +2 -1
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +23 -17
- package/dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts +5 -0
- package/dist/_ShapesGraphToAstTransformer/shapeOntology.js +25 -0
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +23 -16
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +6 -6
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +15 -15
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +122 -118
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +10 -8
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
- package/dist/ast/ObjectType.d.ts +3 -3
- package/dist/enums/IdentifierMintingStrategy.d.ts +4 -0
- package/dist/enums/IdentifierMintingStrategy.js +17 -1
- package/dist/enums/TsObjectDeclarationType.d.ts +4 -0
- package/dist/enums/TsObjectDeclarationType.js +15 -1
- package/dist/enums/Visibility.d.ts +6 -0
- package/dist/enums/Visibility.js +18 -0
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +3 -3
- package/dist/input/NodeShape.d.ts +8 -46
- package/dist/input/NodeShape.js +1 -153
- package/dist/input/Shape.d.ts +2 -2
- package/dist/input/ShapesGraph.d.ts +10 -10
- package/dist/input/ShapesGraph.js +11 -13
- package/dist/input/generated.d.ts +185 -152
- package/dist/input/generated.js +316 -249
- package/dist/input/index.d.ts +1 -3
- package/dist/input/index.js +1 -3
- package/package.json +2 -2
- package/dist/enums/PropertyVisibility.d.ts +0 -2
- package/dist/enums/PropertyVisibility.js +0 -2
- package/dist/input/Ontology.d.ts +0 -13
- package/dist/input/Ontology.js +0 -40
- package/dist/input/PropertyShape.d.ts +0 -20
- package/dist/input/PropertyShape.js +0 -78
package/dist/input/generated.js
CHANGED
|
@@ -237,8 +237,8 @@ export var PropertyShape;
|
|
|
237
237
|
!$filterArray($filterIri)(filter.classes, value.classes)) {
|
|
238
238
|
return false;
|
|
239
239
|
}
|
|
240
|
-
if (filter.
|
|
241
|
-
!$
|
|
240
|
+
if (filter.comment !== undefined &&
|
|
241
|
+
!$filterMaybe($filterString)(filter.comment, value.comment)) {
|
|
242
242
|
return false;
|
|
243
243
|
}
|
|
244
244
|
if (filter.datatype !== undefined &&
|
|
@@ -253,8 +253,8 @@ export var PropertyShape;
|
|
|
253
253
|
!$filterMaybe($filterTerm)(filter.defaultValue, value.defaultValue)) {
|
|
254
254
|
return false;
|
|
255
255
|
}
|
|
256
|
-
if (filter.
|
|
257
|
-
!$
|
|
256
|
+
if (filter.description !== undefined &&
|
|
257
|
+
!$filterMaybe($filterString)(filter.description, value.description)) {
|
|
258
258
|
return false;
|
|
259
259
|
}
|
|
260
260
|
if (filter.flags !== undefined &&
|
|
@@ -277,8 +277,8 @@ export var PropertyShape;
|
|
|
277
277
|
!$filterMaybe($filterIdentifier)(filter.isDefinedBy, value.isDefinedBy)) {
|
|
278
278
|
return false;
|
|
279
279
|
}
|
|
280
|
-
if (filter.
|
|
281
|
-
!$
|
|
280
|
+
if (filter.label !== undefined &&
|
|
281
|
+
!$filterMaybe($filterString)(filter.label, value.label)) {
|
|
282
282
|
return false;
|
|
283
283
|
}
|
|
284
284
|
if (filter.languageIn !== undefined &&
|
|
@@ -325,10 +325,6 @@ export var PropertyShape;
|
|
|
325
325
|
!$filterMaybe($filterString)(filter.name, value.name)) {
|
|
326
326
|
return false;
|
|
327
327
|
}
|
|
328
|
-
if (filter.names !== undefined &&
|
|
329
|
-
!$filterArray($filterString)(filter.names, value.names)) {
|
|
330
|
-
return false;
|
|
331
|
-
}
|
|
332
328
|
if (filter.nodeKind !== undefined &&
|
|
333
329
|
!$filterMaybe($filterIri)(filter.nodeKind, value.nodeKind)) {
|
|
334
330
|
return false;
|
|
@@ -361,6 +357,10 @@ export var PropertyShape;
|
|
|
361
357
|
!$filterMaybe($filterIdentifier)(filter.resolve, value.resolve)) {
|
|
362
358
|
return false;
|
|
363
359
|
}
|
|
360
|
+
if (filter.shaclmateName !== undefined &&
|
|
361
|
+
!$filterMaybe($filterString)(filter.shaclmateName, value.shaclmateName)) {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
364
|
if (filter.uniqueLang !== undefined &&
|
|
365
365
|
!$filterMaybe($filterBoolean)(filter.uniqueLang, value.uniqueLang)) {
|
|
366
366
|
return false;
|
|
@@ -462,17 +462,18 @@ export var PropertyShape;
|
|
|
462
462
|
}).chain((classes) => $shaclPropertyFromRdf({
|
|
463
463
|
graph: _$options.graph,
|
|
464
464
|
resource: $resource,
|
|
465
|
-
propertySchema: PropertyShape.$schema.properties.
|
|
465
|
+
propertySchema: PropertyShape.$schema.properties.comment,
|
|
466
466
|
typeFromRdf: (resourceValues) => resourceValues
|
|
467
467
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
468
468
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
469
|
-
.map((values) => values.
|
|
470
|
-
.map((
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
469
|
+
.map((values) => values.length > 0
|
|
470
|
+
? values.map((value) => Maybe.of(value))
|
|
471
|
+
: Resource.Values.fromValue({
|
|
472
|
+
focusResource: $resource,
|
|
473
|
+
propertyPath: PropertyShape.$schema.properties.comment.path,
|
|
474
|
+
value: Maybe.empty(),
|
|
475
|
+
})),
|
|
476
|
+
}).chain((comment) => $shaclPropertyFromRdf({
|
|
476
477
|
graph: _$options.graph,
|
|
477
478
|
resource: $resource,
|
|
478
479
|
propertySchema: PropertyShape.$schema.properties.datatype,
|
|
@@ -531,18 +532,19 @@ export var PropertyShape;
|
|
|
531
532
|
}).chain((defaultValue) => $shaclPropertyFromRdf({
|
|
532
533
|
graph: _$options.graph,
|
|
533
534
|
resource: $resource,
|
|
534
|
-
propertySchema: PropertyShape.$schema.properties.
|
|
535
|
+
propertySchema: PropertyShape.$schema.properties.description,
|
|
535
536
|
typeFromRdf: (resourceValues) => resourceValues
|
|
536
537
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
537
538
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
538
|
-
.map((values) => values.
|
|
539
|
-
.map((
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
.
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
539
|
+
.map((values) => values.length > 0
|
|
540
|
+
? values.map((value) => Maybe.of(value))
|
|
541
|
+
: Resource.Values.fromValue({
|
|
542
|
+
focusResource: $resource,
|
|
543
|
+
propertyPath: PropertyShape.$schema.properties
|
|
544
|
+
.description.path,
|
|
545
|
+
value: Maybe.empty(),
|
|
546
|
+
})),
|
|
547
|
+
}).chain((description) => $shaclPropertyFromRdf({
|
|
546
548
|
graph: _$options.graph,
|
|
547
549
|
resource: $resource,
|
|
548
550
|
propertySchema: PropertyShape.$schema.properties.flags,
|
|
@@ -654,18 +656,19 @@ export var PropertyShape;
|
|
|
654
656
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
655
657
|
graph: _$options.graph,
|
|
656
658
|
resource: $resource,
|
|
657
|
-
propertySchema: PropertyShape.$schema.properties.
|
|
659
|
+
propertySchema: PropertyShape.$schema.properties.label,
|
|
658
660
|
typeFromRdf: (resourceValues) => resourceValues
|
|
659
661
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
660
662
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
661
|
-
.map((values) => values.
|
|
662
|
-
.map((
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
663
|
+
.map((values) => values.length > 0
|
|
664
|
+
? values.map((value) => Maybe.of(value))
|
|
665
|
+
: Resource.Values.fromValue({
|
|
666
|
+
focusResource: $resource,
|
|
667
|
+
propertyPath: PropertyShape.$schema
|
|
668
|
+
.properties.label.path,
|
|
669
|
+
value: Maybe.empty(),
|
|
670
|
+
})),
|
|
671
|
+
}).chain((label) => $shaclPropertyFromRdf({
|
|
669
672
|
graph: _$options.graph,
|
|
670
673
|
resource: $resource,
|
|
671
674
|
propertySchema: PropertyShape.$schema.properties.languageIn,
|
|
@@ -871,25 +874,6 @@ export var PropertyShape;
|
|
|
871
874
|
value: Maybe.empty(),
|
|
872
875
|
})),
|
|
873
876
|
}).chain((name) => $shaclPropertyFromRdf({
|
|
874
|
-
graph: _$options.graph,
|
|
875
|
-
resource: $resource,
|
|
876
|
-
propertySchema: PropertyShape.$schema
|
|
877
|
-
.properties
|
|
878
|
-
.names,
|
|
879
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
880
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
881
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
882
|
-
.map((values) => values.toArray())
|
|
883
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
884
|
-
focusResource: $resource,
|
|
885
|
-
propertyPath: PropertyShape
|
|
886
|
-
.$schema
|
|
887
|
-
.properties
|
|
888
|
-
.names
|
|
889
|
-
.path,
|
|
890
|
-
value: valuesArray,
|
|
891
|
-
})),
|
|
892
|
-
}).chain((names) => $shaclPropertyFromRdf({
|
|
893
877
|
graph: _$options.graph,
|
|
894
878
|
resource: $resource,
|
|
895
879
|
propertySchema: PropertyShape.$schema
|
|
@@ -1061,6 +1045,27 @@ export var PropertyShape;
|
|
|
1061
1045
|
value: Maybe.empty(),
|
|
1062
1046
|
})),
|
|
1063
1047
|
}).chain((resolve) => $shaclPropertyFromRdf({
|
|
1048
|
+
graph: _$options.graph,
|
|
1049
|
+
resource: $resource,
|
|
1050
|
+
propertySchema: PropertyShape.$schema
|
|
1051
|
+
.properties
|
|
1052
|
+
.shaclmateName,
|
|
1053
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1054
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1055
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1056
|
+
.map((values) => values.length >
|
|
1057
|
+
0
|
|
1058
|
+
? values.map((value) => Maybe.of(value))
|
|
1059
|
+
: Resource.Values.fromValue({
|
|
1060
|
+
focusResource: $resource,
|
|
1061
|
+
propertyPath: PropertyShape
|
|
1062
|
+
.$schema
|
|
1063
|
+
.properties
|
|
1064
|
+
.shaclmateName
|
|
1065
|
+
.path,
|
|
1066
|
+
value: Maybe.empty(),
|
|
1067
|
+
})),
|
|
1068
|
+
}).chain((shaclmateName) => $shaclPropertyFromRdf({
|
|
1064
1069
|
graph: _$options.graph,
|
|
1065
1070
|
resource: $resource,
|
|
1066
1071
|
propertySchema: PropertyShape.$schema
|
|
@@ -1139,17 +1144,17 @@ export var PropertyShape;
|
|
|
1139
1144
|
$type,
|
|
1140
1145
|
and,
|
|
1141
1146
|
classes,
|
|
1142
|
-
|
|
1147
|
+
comment,
|
|
1143
1148
|
datatype,
|
|
1144
1149
|
deactivated,
|
|
1145
1150
|
defaultValue,
|
|
1146
|
-
|
|
1151
|
+
description,
|
|
1147
1152
|
flags,
|
|
1148
1153
|
groups,
|
|
1149
1154
|
hasValues,
|
|
1150
1155
|
in_,
|
|
1151
1156
|
isDefinedBy,
|
|
1152
|
-
|
|
1157
|
+
label,
|
|
1153
1158
|
languageIn,
|
|
1154
1159
|
maxCount,
|
|
1155
1160
|
maxExclusive,
|
|
@@ -1161,7 +1166,6 @@ export var PropertyShape;
|
|
|
1161
1166
|
minLength,
|
|
1162
1167
|
mutable,
|
|
1163
1168
|
name,
|
|
1164
|
-
names,
|
|
1165
1169
|
nodeKind,
|
|
1166
1170
|
nodes,
|
|
1167
1171
|
not,
|
|
@@ -1170,6 +1174,7 @@ export var PropertyShape;
|
|
|
1170
1174
|
path,
|
|
1171
1175
|
patterns,
|
|
1172
1176
|
resolve,
|
|
1177
|
+
shaclmateName,
|
|
1173
1178
|
uniqueLang,
|
|
1174
1179
|
visibility,
|
|
1175
1180
|
xone,
|
|
@@ -1207,10 +1212,10 @@ export var PropertyShape;
|
|
|
1207
1212
|
}),
|
|
1208
1213
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
1209
1214
|
},
|
|
1210
|
-
|
|
1215
|
+
comment: {
|
|
1211
1216
|
kind: "Shacl",
|
|
1212
1217
|
type: () => ({
|
|
1213
|
-
kind: "
|
|
1218
|
+
kind: "Maybe",
|
|
1214
1219
|
item: () => ({ kind: "String" }),
|
|
1215
1220
|
}),
|
|
1216
1221
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
@@ -1239,10 +1244,10 @@ export var PropertyShape;
|
|
|
1239
1244
|
}),
|
|
1240
1245
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
|
|
1241
1246
|
},
|
|
1242
|
-
|
|
1247
|
+
description: {
|
|
1243
1248
|
kind: "Shacl",
|
|
1244
1249
|
type: () => ({
|
|
1245
|
-
kind: "
|
|
1250
|
+
kind: "Maybe",
|
|
1246
1251
|
item: () => ({ kind: "String" }),
|
|
1247
1252
|
}),
|
|
1248
1253
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
|
|
@@ -1290,10 +1295,10 @@ export var PropertyShape;
|
|
|
1290
1295
|
}),
|
|
1291
1296
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
1292
1297
|
},
|
|
1293
|
-
|
|
1298
|
+
label: {
|
|
1294
1299
|
kind: "Shacl",
|
|
1295
1300
|
type: () => ({
|
|
1296
|
-
kind: "
|
|
1301
|
+
kind: "Maybe",
|
|
1297
1302
|
item: () => ({ kind: "String" }),
|
|
1298
1303
|
}),
|
|
1299
1304
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
@@ -1387,14 +1392,6 @@ export var PropertyShape;
|
|
|
1387
1392
|
kind: "Maybe",
|
|
1388
1393
|
item: () => ({ kind: "String" }),
|
|
1389
1394
|
}),
|
|
1390
|
-
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
|
|
1391
|
-
},
|
|
1392
|
-
names: {
|
|
1393
|
-
kind: "Shacl",
|
|
1394
|
-
type: () => ({
|
|
1395
|
-
kind: "Set",
|
|
1396
|
-
item: () => ({ kind: "String" }),
|
|
1397
|
-
}),
|
|
1398
1395
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
|
|
1399
1396
|
},
|
|
1400
1397
|
nodeKind: {
|
|
@@ -1471,6 +1468,14 @@ export var PropertyShape;
|
|
|
1471
1468
|
}),
|
|
1472
1469
|
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#resolve"),
|
|
1473
1470
|
},
|
|
1471
|
+
shaclmateName: {
|
|
1472
|
+
kind: "Shacl",
|
|
1473
|
+
type: () => ({
|
|
1474
|
+
kind: "Maybe",
|
|
1475
|
+
item: () => ({ kind: "String" }),
|
|
1476
|
+
}),
|
|
1477
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
|
|
1478
|
+
},
|
|
1474
1479
|
uniqueLang: {
|
|
1475
1480
|
kind: "Shacl",
|
|
1476
1481
|
type: () => ({
|
|
@@ -1537,7 +1542,9 @@ export var PropertyShape;
|
|
|
1537
1542
|
: $RdfVocabularies.rdf.nil,
|
|
1538
1543
|
]), options?.graph);
|
|
1539
1544
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"), _propertyShape.classes.flatMap((item) => [item]), options?.graph);
|
|
1540
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), _propertyShape.
|
|
1545
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), _propertyShape.comment
|
|
1546
|
+
.toList()
|
|
1547
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
1541
1548
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"), _propertyShape.datatype.toList(), options?.graph);
|
|
1542
1549
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"), _propertyShape.deactivated
|
|
1543
1550
|
.toList()
|
|
@@ -1545,9 +1552,9 @@ export var PropertyShape;
|
|
|
1545
1552
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1546
1553
|
]), options?.graph);
|
|
1547
1554
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"), _propertyShape.defaultValue.toList(), options?.graph);
|
|
1548
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"), _propertyShape.
|
|
1549
|
-
|
|
1550
|
-
|
|
1555
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"), _propertyShape.description
|
|
1556
|
+
.toList()
|
|
1557
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
1551
1558
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), _propertyShape.flags.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
|
|
1552
1559
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#group"), _propertyShape.groups.flatMap((item) => [item]), options?.graph);
|
|
1553
1560
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), _propertyShape.hasValues.flatMap((item) => [item]), options?.graph);
|
|
@@ -1574,7 +1581,9 @@ export var PropertyShape;
|
|
|
1574
1581
|
: $RdfVocabularies.rdf.nil,
|
|
1575
1582
|
]), options?.graph);
|
|
1576
1583
|
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"), _propertyShape.isDefinedBy.toList(), options?.graph);
|
|
1577
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), _propertyShape.
|
|
1584
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), _propertyShape.label
|
|
1585
|
+
.toList()
|
|
1586
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
1578
1587
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"), _propertyShape.languageIn.toList().flatMap((value) => [
|
|
1579
1588
|
value.length > 0
|
|
1580
1589
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
@@ -1626,10 +1635,9 @@ export var PropertyShape;
|
|
|
1626
1635
|
.flatMap((value) => [
|
|
1627
1636
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1628
1637
|
]), options?.graph);
|
|
1629
|
-
resource.add(dataFactory.namedNode("http://
|
|
1638
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#name"), _propertyShape.name
|
|
1630
1639
|
.toList()
|
|
1631
1640
|
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
1632
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#name"), _propertyShape.names.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
|
|
1633
1641
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"), _propertyShape.nodeKind.toList(), options?.graph);
|
|
1634
1642
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"), _propertyShape.nodes.flatMap((item) => [item]), options?.graph);
|
|
1635
1643
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"), _propertyShape.not.flatMap((item) => [item]), options?.graph);
|
|
@@ -1668,6 +1676,9 @@ export var PropertyShape;
|
|
|
1668
1676
|
], options?.graph);
|
|
1669
1677
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"), _propertyShape.patterns.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
|
|
1670
1678
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#resolve"), _propertyShape.resolve.toList(), options?.graph);
|
|
1679
|
+
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"), _propertyShape.shaclmateName
|
|
1680
|
+
.toList()
|
|
1681
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
1671
1682
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"), _propertyShape.uniqueLang
|
|
1672
1683
|
.toList()
|
|
1673
1684
|
.flatMap((value) => [
|
|
@@ -1712,12 +1723,12 @@ export var PropertyGroup;
|
|
|
1712
1723
|
!$filterIdentifier(filter.$identifier, value.$identifier)) {
|
|
1713
1724
|
return false;
|
|
1714
1725
|
}
|
|
1715
|
-
if (filter.
|
|
1716
|
-
!$
|
|
1726
|
+
if (filter.comment !== undefined &&
|
|
1727
|
+
!$filterMaybe($filterString)(filter.comment, value.comment)) {
|
|
1717
1728
|
return false;
|
|
1718
1729
|
}
|
|
1719
|
-
if (filter.
|
|
1720
|
-
!$
|
|
1730
|
+
if (filter.label !== undefined &&
|
|
1731
|
+
!$filterMaybe($filterString)(filter.label, value.label)) {
|
|
1721
1732
|
return false;
|
|
1722
1733
|
}
|
|
1723
1734
|
return true;
|
|
@@ -1779,30 +1790,32 @@ export var PropertyGroup;
|
|
|
1779
1790
|
.chain(($identifier) => Right("PropertyGroup").chain(($type) => $shaclPropertyFromRdf({
|
|
1780
1791
|
graph: _$options.graph,
|
|
1781
1792
|
resource: $resource,
|
|
1782
|
-
propertySchema: PropertyGroup.$schema.properties.
|
|
1793
|
+
propertySchema: PropertyGroup.$schema.properties.comment,
|
|
1783
1794
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1784
1795
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1785
1796
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1786
|
-
.map((values) => values.
|
|
1787
|
-
.map((
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1797
|
+
.map((values) => values.length > 0
|
|
1798
|
+
? values.map((value) => Maybe.of(value))
|
|
1799
|
+
: Resource.Values.fromValue({
|
|
1800
|
+
focusResource: $resource,
|
|
1801
|
+
propertyPath: PropertyShape.$schema.properties.comment.path,
|
|
1802
|
+
value: Maybe.empty(),
|
|
1803
|
+
})),
|
|
1804
|
+
}).chain((comment) => $shaclPropertyFromRdf({
|
|
1793
1805
|
graph: _$options.graph,
|
|
1794
1806
|
resource: $resource,
|
|
1795
|
-
propertySchema: PropertyGroup.$schema.properties.
|
|
1807
|
+
propertySchema: PropertyGroup.$schema.properties.label,
|
|
1796
1808
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1797
1809
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1798
1810
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1799
|
-
.map((values) => values.
|
|
1800
|
-
.map((
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1811
|
+
.map((values) => values.length > 0
|
|
1812
|
+
? values.map((value) => Maybe.of(value))
|
|
1813
|
+
: Resource.Values.fromValue({
|
|
1814
|
+
focusResource: $resource,
|
|
1815
|
+
propertyPath: PropertyShape.$schema.properties.label.path,
|
|
1816
|
+
value: Maybe.empty(),
|
|
1817
|
+
})),
|
|
1818
|
+
}).map((label) => ({ $identifier, $type, comment, label }))))));
|
|
1806
1819
|
};
|
|
1807
1820
|
PropertyGroup.$schema = {
|
|
1808
1821
|
properties: {
|
|
@@ -1817,18 +1830,18 @@ export var PropertyGroup;
|
|
|
1817
1830
|
ownValues: ["PropertyGroup"],
|
|
1818
1831
|
}),
|
|
1819
1832
|
},
|
|
1820
|
-
|
|
1833
|
+
comment: {
|
|
1821
1834
|
kind: "Shacl",
|
|
1822
1835
|
type: () => ({
|
|
1823
|
-
kind: "
|
|
1836
|
+
kind: "Maybe",
|
|
1824
1837
|
item: () => ({ kind: "String" }),
|
|
1825
1838
|
}),
|
|
1826
1839
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
1827
1840
|
},
|
|
1828
|
-
|
|
1841
|
+
label: {
|
|
1829
1842
|
kind: "Shacl",
|
|
1830
1843
|
type: () => ({
|
|
1831
|
-
kind: "
|
|
1844
|
+
kind: "Maybe",
|
|
1832
1845
|
item: () => ({ kind: "String" }),
|
|
1833
1846
|
}),
|
|
1834
1847
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
@@ -1842,8 +1855,12 @@ export var PropertyGroup;
|
|
|
1842
1855
|
if (!options?.ignoreRdfType) {
|
|
1843
1856
|
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), options?.graph);
|
|
1844
1857
|
}
|
|
1845
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), _propertyGroup.
|
|
1846
|
-
|
|
1858
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), _propertyGroup.comment
|
|
1859
|
+
.toList()
|
|
1860
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
1861
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), _propertyGroup.label
|
|
1862
|
+
.toList()
|
|
1863
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
1847
1864
|
return resource;
|
|
1848
1865
|
}
|
|
1849
1866
|
PropertyGroup.$toRdfResource = $toRdfResource;
|
|
@@ -1860,8 +1877,12 @@ export var Ontology;
|
|
|
1860
1877
|
!$filterIdentifier(filter.$identifier, value.$identifier)) {
|
|
1861
1878
|
return false;
|
|
1862
1879
|
}
|
|
1863
|
-
if (filter.
|
|
1864
|
-
!$
|
|
1880
|
+
if (filter.comment !== undefined &&
|
|
1881
|
+
!$filterMaybe($filterString)(filter.comment, value.comment)) {
|
|
1882
|
+
return false;
|
|
1883
|
+
}
|
|
1884
|
+
if (filter.label !== undefined &&
|
|
1885
|
+
!$filterMaybe($filterString)(filter.label, value.label)) {
|
|
1865
1886
|
return false;
|
|
1866
1887
|
}
|
|
1867
1888
|
if (filter.tsFeatureExcludes !== undefined &&
|
|
@@ -1939,17 +1960,32 @@ export var Ontology;
|
|
|
1939
1960
|
.chain(($identifier) => Right("Ontology").chain(($type) => $shaclPropertyFromRdf({
|
|
1940
1961
|
graph: _$options.graph,
|
|
1941
1962
|
resource: $resource,
|
|
1942
|
-
propertySchema: Ontology.$schema.properties.
|
|
1963
|
+
propertySchema: Ontology.$schema.properties.comment,
|
|
1943
1964
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1944
1965
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1945
1966
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1946
|
-
.map((values) => values.
|
|
1947
|
-
.map((
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1967
|
+
.map((values) => values.length > 0
|
|
1968
|
+
? values.map((value) => Maybe.of(value))
|
|
1969
|
+
: Resource.Values.fromValue({
|
|
1970
|
+
focusResource: $resource,
|
|
1971
|
+
propertyPath: PropertyShape.$schema.properties.comment.path,
|
|
1972
|
+
value: Maybe.empty(),
|
|
1973
|
+
})),
|
|
1974
|
+
}).chain((comment) => $shaclPropertyFromRdf({
|
|
1975
|
+
graph: _$options.graph,
|
|
1976
|
+
resource: $resource,
|
|
1977
|
+
propertySchema: Ontology.$schema.properties.label,
|
|
1978
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1979
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1980
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1981
|
+
.map((values) => values.length > 0
|
|
1982
|
+
? values.map((value) => Maybe.of(value))
|
|
1983
|
+
: Resource.Values.fromValue({
|
|
1984
|
+
focusResource: $resource,
|
|
1985
|
+
propertyPath: PropertyShape.$schema.properties.label.path,
|
|
1986
|
+
value: Maybe.empty(),
|
|
1987
|
+
})),
|
|
1988
|
+
}).chain((label) => $shaclPropertyFromRdf({
|
|
1953
1989
|
graph: _$options.graph,
|
|
1954
1990
|
resource: $resource,
|
|
1955
1991
|
propertySchema: Ontology.$schema.properties.tsFeatureExcludes,
|
|
@@ -1992,7 +2028,8 @@ export var Ontology;
|
|
|
1992
2028
|
.map((values) => values.toArray())
|
|
1993
2029
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1994
2030
|
focusResource: $resource,
|
|
1995
|
-
propertyPath: Ontology.$schema.properties.tsFeatureIncludes
|
|
2031
|
+
propertyPath: Ontology.$schema.properties.tsFeatureIncludes
|
|
2032
|
+
.path,
|
|
1996
2033
|
value: valuesArray,
|
|
1997
2034
|
})),
|
|
1998
2035
|
}).chain((tsFeatureIncludes) => $shaclPropertyFromRdf({
|
|
@@ -2028,12 +2065,13 @@ export var Ontology;
|
|
|
2028
2065
|
}).map((tsObjectDeclarationType) => ({
|
|
2029
2066
|
$identifier,
|
|
2030
2067
|
$type,
|
|
2031
|
-
|
|
2068
|
+
comment,
|
|
2069
|
+
label,
|
|
2032
2070
|
tsFeatureExcludes,
|
|
2033
2071
|
tsFeatureIncludes,
|
|
2034
2072
|
tsImports,
|
|
2035
2073
|
tsObjectDeclarationType,
|
|
2036
|
-
})))))))));
|
|
2074
|
+
}))))))))));
|
|
2037
2075
|
};
|
|
2038
2076
|
Ontology.$schema = {
|
|
2039
2077
|
properties: {
|
|
@@ -2048,10 +2086,18 @@ export var Ontology;
|
|
|
2048
2086
|
ownValues: ["Ontology"],
|
|
2049
2087
|
}),
|
|
2050
2088
|
},
|
|
2051
|
-
|
|
2089
|
+
comment: {
|
|
2052
2090
|
kind: "Shacl",
|
|
2053
2091
|
type: () => ({
|
|
2054
|
-
kind: "
|
|
2092
|
+
kind: "Maybe",
|
|
2093
|
+
item: () => ({ kind: "String" }),
|
|
2094
|
+
}),
|
|
2095
|
+
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
2096
|
+
},
|
|
2097
|
+
label: {
|
|
2098
|
+
kind: "Shacl",
|
|
2099
|
+
type: () => ({
|
|
2100
|
+
kind: "Maybe",
|
|
2055
2101
|
item: () => ({ kind: "String" }),
|
|
2056
2102
|
}),
|
|
2057
2103
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
@@ -2131,7 +2177,12 @@ export var Ontology;
|
|
|
2131
2177
|
if (!options?.ignoreRdfType) {
|
|
2132
2178
|
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), options?.graph);
|
|
2133
2179
|
}
|
|
2134
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#
|
|
2180
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), _ontology.comment
|
|
2181
|
+
.toList()
|
|
2182
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
2183
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), _ontology.label
|
|
2184
|
+
.toList()
|
|
2185
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
2135
2186
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureExclude"), _ontology.tsFeatureExcludes.flatMap((item) => [item]), options?.graph);
|
|
2136
2187
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureInclude"), _ontology.tsFeatureIncludes.flatMap((item) => [item]), options?.graph);
|
|
2137
2188
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"), _ontology.tsImports.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
|
|
@@ -2168,8 +2219,8 @@ export var NodeShape;
|
|
|
2168
2219
|
!$filterMaybe($filterBoolean)(filter.closed, value.closed)) {
|
|
2169
2220
|
return false;
|
|
2170
2221
|
}
|
|
2171
|
-
if (filter.
|
|
2172
|
-
!$
|
|
2222
|
+
if (filter.comment !== undefined &&
|
|
2223
|
+
!$filterMaybe($filterString)(filter.comment, value.comment)) {
|
|
2173
2224
|
return false;
|
|
2174
2225
|
}
|
|
2175
2226
|
if (filter.datatype !== undefined &&
|
|
@@ -2216,8 +2267,8 @@ export var NodeShape;
|
|
|
2216
2267
|
!$filterMaybe($filterIdentifier)(filter.isDefinedBy, value.isDefinedBy)) {
|
|
2217
2268
|
return false;
|
|
2218
2269
|
}
|
|
2219
|
-
if (filter.
|
|
2220
|
-
!$
|
|
2270
|
+
if (filter.label !== undefined &&
|
|
2271
|
+
!$filterMaybe($filterString)(filter.label, value.label)) {
|
|
2221
2272
|
return false;
|
|
2222
2273
|
}
|
|
2223
2274
|
if (filter.languageIn !== undefined &&
|
|
@@ -2260,10 +2311,6 @@ export var NodeShape;
|
|
|
2260
2311
|
!$filterMaybe($filterBoolean)(filter.mutable, value.mutable)) {
|
|
2261
2312
|
return false;
|
|
2262
2313
|
}
|
|
2263
|
-
if (filter.name !== undefined &&
|
|
2264
|
-
!$filterMaybe($filterString)(filter.name, value.name)) {
|
|
2265
|
-
return false;
|
|
2266
|
-
}
|
|
2267
2314
|
if (filter.nodeKind !== undefined &&
|
|
2268
2315
|
!$filterMaybe($filterIri)(filter.nodeKind, value.nodeKind)) {
|
|
2269
2316
|
return false;
|
|
@@ -2292,6 +2339,10 @@ export var NodeShape;
|
|
|
2292
2339
|
!$filterMaybe($filterIri)(filter.rdfType, value.rdfType)) {
|
|
2293
2340
|
return false;
|
|
2294
2341
|
}
|
|
2342
|
+
if (filter.shaclmateName !== undefined &&
|
|
2343
|
+
!$filterMaybe($filterString)(filter.shaclmateName, value.shaclmateName)) {
|
|
2344
|
+
return false;
|
|
2345
|
+
}
|
|
2295
2346
|
if (filter.toRdfTypes !== undefined &&
|
|
2296
2347
|
!$filterArray($filterIri)(filter.toRdfTypes, value.toRdfTypes)) {
|
|
2297
2348
|
return false;
|
|
@@ -2431,17 +2482,19 @@ export var NodeShape;
|
|
|
2431
2482
|
}).chain((closed) => $shaclPropertyFromRdf({
|
|
2432
2483
|
graph: _$options.graph,
|
|
2433
2484
|
resource: $resource,
|
|
2434
|
-
propertySchema: NodeShape.$schema.properties.
|
|
2485
|
+
propertySchema: NodeShape.$schema.properties.comment,
|
|
2435
2486
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2436
2487
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2437
2488
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2438
|
-
.map((values) => values.
|
|
2439
|
-
.map((
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2489
|
+
.map((values) => values.length > 0
|
|
2490
|
+
? values.map((value) => Maybe.of(value))
|
|
2491
|
+
: Resource.Values.fromValue({
|
|
2492
|
+
focusResource: $resource,
|
|
2493
|
+
propertyPath: PropertyShape.$schema.properties.comment
|
|
2494
|
+
.path,
|
|
2495
|
+
value: Maybe.empty(),
|
|
2496
|
+
})),
|
|
2497
|
+
}).chain((comment) => $shaclPropertyFromRdf({
|
|
2445
2498
|
graph: _$options.graph,
|
|
2446
2499
|
resource: $resource,
|
|
2447
2500
|
propertySchema: NodeShape.$schema.properties.datatype,
|
|
@@ -2661,19 +2714,21 @@ export var NodeShape;
|
|
|
2661
2714
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
2662
2715
|
graph: _$options.graph,
|
|
2663
2716
|
resource: $resource,
|
|
2664
|
-
propertySchema: NodeShape.$schema.properties.
|
|
2717
|
+
propertySchema: NodeShape.$schema.properties.label,
|
|
2665
2718
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2666
2719
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2667
2720
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2668
|
-
.map((values) => values.
|
|
2669
|
-
.map((
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2721
|
+
.map((values) => values.length > 0
|
|
2722
|
+
? values.map((value) => Maybe.of(value))
|
|
2723
|
+
: Resource.Values.fromValue({
|
|
2724
|
+
focusResource: $resource,
|
|
2725
|
+
propertyPath: PropertyShape
|
|
2726
|
+
.$schema
|
|
2727
|
+
.properties.label
|
|
2728
|
+
.path,
|
|
2729
|
+
value: Maybe.empty(),
|
|
2730
|
+
})),
|
|
2731
|
+
}).chain((label) => $shaclPropertyFromRdf({
|
|
2677
2732
|
graph: _$options.graph,
|
|
2678
2733
|
resource: $resource,
|
|
2679
2734
|
propertySchema: NodeShape.$schema.properties.languageIn,
|
|
@@ -2879,27 +2934,6 @@ export var NodeShape;
|
|
|
2879
2934
|
value: Maybe.empty(),
|
|
2880
2935
|
})),
|
|
2881
2936
|
}).chain((mutable) => $shaclPropertyFromRdf({
|
|
2882
|
-
graph: _$options.graph,
|
|
2883
|
-
resource: $resource,
|
|
2884
|
-
propertySchema: NodeShape.$schema
|
|
2885
|
-
.properties
|
|
2886
|
-
.name,
|
|
2887
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2888
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2889
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2890
|
-
.map((values) => values.length >
|
|
2891
|
-
0
|
|
2892
|
-
? values.map((value) => Maybe.of(value))
|
|
2893
|
-
: Resource.Values.fromValue({
|
|
2894
|
-
focusResource: $resource,
|
|
2895
|
-
propertyPath: PropertyShape
|
|
2896
|
-
.$schema
|
|
2897
|
-
.properties
|
|
2898
|
-
.name
|
|
2899
|
-
.path,
|
|
2900
|
-
value: Maybe.empty(),
|
|
2901
|
-
})),
|
|
2902
|
-
}).chain((name) => $shaclPropertyFromRdf({
|
|
2903
2937
|
graph: _$options.graph,
|
|
2904
2938
|
resource: $resource,
|
|
2905
2939
|
propertySchema: NodeShape.$schema
|
|
@@ -3050,6 +3084,27 @@ export var NodeShape;
|
|
|
3050
3084
|
value: Maybe.empty(),
|
|
3051
3085
|
})),
|
|
3052
3086
|
}).chain((rdfType) => $shaclPropertyFromRdf({
|
|
3087
|
+
graph: _$options.graph,
|
|
3088
|
+
resource: $resource,
|
|
3089
|
+
propertySchema: NodeShape.$schema
|
|
3090
|
+
.properties
|
|
3091
|
+
.shaclmateName,
|
|
3092
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3093
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3094
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3095
|
+
.map((values) => values.length >
|
|
3096
|
+
0
|
|
3097
|
+
? values.map((value) => Maybe.of(value))
|
|
3098
|
+
: Resource.Values.fromValue({
|
|
3099
|
+
focusResource: $resource,
|
|
3100
|
+
propertyPath: PropertyShape
|
|
3101
|
+
.$schema
|
|
3102
|
+
.properties
|
|
3103
|
+
.shaclmateName
|
|
3104
|
+
.path,
|
|
3105
|
+
value: Maybe.empty(),
|
|
3106
|
+
})),
|
|
3107
|
+
}).chain((shaclmateName) => $shaclPropertyFromRdf({
|
|
3053
3108
|
graph: _$options.graph,
|
|
3054
3109
|
resource: $resource,
|
|
3055
3110
|
propertySchema: NodeShape.$schema
|
|
@@ -3204,7 +3259,7 @@ export var NodeShape;
|
|
|
3204
3259
|
and,
|
|
3205
3260
|
classes,
|
|
3206
3261
|
closed,
|
|
3207
|
-
|
|
3262
|
+
comment,
|
|
3208
3263
|
datatype,
|
|
3209
3264
|
deactivated,
|
|
3210
3265
|
discriminantValue,
|
|
@@ -3216,7 +3271,7 @@ export var NodeShape;
|
|
|
3216
3271
|
ignoredProperties,
|
|
3217
3272
|
in_,
|
|
3218
3273
|
isDefinedBy,
|
|
3219
|
-
|
|
3274
|
+
label,
|
|
3220
3275
|
languageIn,
|
|
3221
3276
|
maxCount,
|
|
3222
3277
|
maxExclusive,
|
|
@@ -3227,7 +3282,6 @@ export var NodeShape;
|
|
|
3227
3282
|
minInclusive,
|
|
3228
3283
|
minLength,
|
|
3229
3284
|
mutable,
|
|
3230
|
-
name,
|
|
3231
3285
|
nodeKind,
|
|
3232
3286
|
nodes,
|
|
3233
3287
|
not,
|
|
@@ -3235,6 +3289,7 @@ export var NodeShape;
|
|
|
3235
3289
|
patterns,
|
|
3236
3290
|
properties,
|
|
3237
3291
|
rdfType,
|
|
3292
|
+
shaclmateName,
|
|
3238
3293
|
toRdfTypes,
|
|
3239
3294
|
tsFeatureExcludes,
|
|
3240
3295
|
tsFeatureIncludes,
|
|
@@ -3291,10 +3346,10 @@ export var NodeShape;
|
|
|
3291
3346
|
}),
|
|
3292
3347
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
|
|
3293
3348
|
},
|
|
3294
|
-
|
|
3349
|
+
comment: {
|
|
3295
3350
|
kind: "Shacl",
|
|
3296
3351
|
type: () => ({
|
|
3297
|
-
kind: "
|
|
3352
|
+
kind: "Maybe",
|
|
3298
3353
|
item: () => ({ kind: "String" }),
|
|
3299
3354
|
}),
|
|
3300
3355
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
@@ -3400,10 +3455,10 @@ export var NodeShape;
|
|
|
3400
3455
|
}),
|
|
3401
3456
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
3402
3457
|
},
|
|
3403
|
-
|
|
3458
|
+
label: {
|
|
3404
3459
|
kind: "Shacl",
|
|
3405
3460
|
type: () => ({
|
|
3406
|
-
kind: "
|
|
3461
|
+
kind: "Maybe",
|
|
3407
3462
|
item: () => ({ kind: "String" }),
|
|
3408
3463
|
}),
|
|
3409
3464
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
@@ -3491,14 +3546,6 @@ export var NodeShape;
|
|
|
3491
3546
|
}),
|
|
3492
3547
|
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"),
|
|
3493
3548
|
},
|
|
3494
|
-
name: {
|
|
3495
|
-
kind: "Shacl",
|
|
3496
|
-
type: () => ({
|
|
3497
|
-
kind: "Maybe",
|
|
3498
|
-
item: () => ({ kind: "String" }),
|
|
3499
|
-
}),
|
|
3500
|
-
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
|
|
3501
|
-
},
|
|
3502
3549
|
nodeKind: {
|
|
3503
3550
|
kind: "Shacl",
|
|
3504
3551
|
type: () => ({
|
|
@@ -3568,6 +3615,14 @@ export var NodeShape;
|
|
|
3568
3615
|
}),
|
|
3569
3616
|
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#rdfType"),
|
|
3570
3617
|
},
|
|
3618
|
+
shaclmateName: {
|
|
3619
|
+
kind: "Shacl",
|
|
3620
|
+
type: () => ({
|
|
3621
|
+
kind: "Maybe",
|
|
3622
|
+
item: () => ({ kind: "String" }),
|
|
3623
|
+
}),
|
|
3624
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
|
|
3625
|
+
},
|
|
3571
3626
|
toRdfTypes: {
|
|
3572
3627
|
kind: "Shacl",
|
|
3573
3628
|
type: () => ({
|
|
@@ -3695,7 +3750,9 @@ export var NodeShape;
|
|
|
3695
3750
|
.flatMap((value) => [
|
|
3696
3751
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
3697
3752
|
]), options?.graph);
|
|
3698
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), _nodeShape.
|
|
3753
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), _nodeShape.comment
|
|
3754
|
+
.toList()
|
|
3755
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
3699
3756
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"), _nodeShape.datatype.toList(), options?.graph);
|
|
3700
3757
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"), _nodeShape.deactivated
|
|
3701
3758
|
.toList()
|
|
@@ -3759,7 +3816,9 @@ export var NodeShape;
|
|
|
3759
3816
|
: $RdfVocabularies.rdf.nil,
|
|
3760
3817
|
]), options?.graph);
|
|
3761
3818
|
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"), _nodeShape.isDefinedBy.toList(), options?.graph);
|
|
3762
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), _nodeShape.
|
|
3819
|
+
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), _nodeShape.label
|
|
3820
|
+
.toList()
|
|
3821
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
3763
3822
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"), _nodeShape.languageIn.toList().flatMap((value) => [
|
|
3764
3823
|
value.length > 0
|
|
3765
3824
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
@@ -3811,9 +3870,6 @@ export var NodeShape;
|
|
|
3811
3870
|
.flatMap((value) => [
|
|
3812
3871
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
3813
3872
|
]), options?.graph);
|
|
3814
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"), _nodeShape.name
|
|
3815
|
-
.toList()
|
|
3816
|
-
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
3817
3873
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"), _nodeShape.nodeKind.toList(), options?.graph);
|
|
3818
3874
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"), _nodeShape.nodes.flatMap((item) => [item]), options?.graph);
|
|
3819
3875
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"), _nodeShape.not.flatMap((item) => [item]), options?.graph);
|
|
@@ -3842,6 +3898,9 @@ export var NodeShape;
|
|
|
3842
3898
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"), _nodeShape.patterns.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
|
|
3843
3899
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#property"), _nodeShape.properties.flatMap((item) => [item]), options?.graph);
|
|
3844
3900
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#rdfType"), _nodeShape.rdfType.toList(), options?.graph);
|
|
3901
|
+
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"), _nodeShape.shaclmateName
|
|
3902
|
+
.toList()
|
|
3903
|
+
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
3845
3904
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#toRdfType"), _nodeShape.toRdfTypes.flatMap((item) => [item]), options?.graph);
|
|
3846
3905
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureExclude"), _nodeShape.tsFeatureExcludes.flatMap((item) => [item]), options?.graph);
|
|
3847
3906
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsFeatureInclude"), _nodeShape.tsFeatureIncludes.flatMap((item) => [item]), options?.graph);
|
|
@@ -3875,15 +3934,6 @@ export var NodeShape;
|
|
|
3875
3934
|
})(NodeShape || (NodeShape = {}));
|
|
3876
3935
|
export var Shape;
|
|
3877
3936
|
(function (Shape) {
|
|
3878
|
-
Shape.$toRdfResource = (value, options) => {
|
|
3879
|
-
if (NodeShape.isNodeShape(value)) {
|
|
3880
|
-
return NodeShape.$toRdfResource(value, options);
|
|
3881
|
-
}
|
|
3882
|
-
if (PropertyShape.isPropertyShape(value)) {
|
|
3883
|
-
return PropertyShape.$toRdfResource(value, options);
|
|
3884
|
-
}
|
|
3885
|
-
throw new Error("unrecognized type");
|
|
3886
|
-
};
|
|
3887
3937
|
Shape.$filter = (filter, value) => {
|
|
3888
3938
|
if (filter.$identifier !== undefined &&
|
|
3889
3939
|
!$filterIdentifier(filter.$identifier, value.$identifier)) {
|
|
@@ -3966,10 +4016,10 @@ export var Shape;
|
|
|
3966
4016
|
}),
|
|
3967
4017
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
3968
4018
|
},
|
|
3969
|
-
|
|
4019
|
+
comment: {
|
|
3970
4020
|
kind: "Shacl",
|
|
3971
4021
|
type: () => ({
|
|
3972
|
-
kind: "
|
|
4022
|
+
kind: "Maybe",
|
|
3973
4023
|
item: () => ({ kind: "String" }),
|
|
3974
4024
|
}),
|
|
3975
4025
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
@@ -4025,10 +4075,10 @@ export var Shape;
|
|
|
4025
4075
|
}),
|
|
4026
4076
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
4027
4077
|
},
|
|
4028
|
-
|
|
4078
|
+
label: {
|
|
4029
4079
|
kind: "Shacl",
|
|
4030
4080
|
type: () => ({
|
|
4031
|
-
kind: "
|
|
4081
|
+
kind: "Maybe",
|
|
4032
4082
|
item: () => ({ kind: "String" }),
|
|
4033
4083
|
}),
|
|
4034
4084
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
@@ -4116,14 +4166,6 @@ export var Shape;
|
|
|
4116
4166
|
}),
|
|
4117
4167
|
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#mutable"),
|
|
4118
4168
|
},
|
|
4119
|
-
name: {
|
|
4120
|
-
kind: "Shacl",
|
|
4121
|
-
type: () => ({
|
|
4122
|
-
kind: "Maybe",
|
|
4123
|
-
item: () => ({ kind: "String" }),
|
|
4124
|
-
}),
|
|
4125
|
-
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
|
|
4126
|
-
},
|
|
4127
4169
|
nodeKind: {
|
|
4128
4170
|
kind: "Shacl",
|
|
4129
4171
|
type: () => ({
|
|
@@ -4177,6 +4219,14 @@ export var Shape;
|
|
|
4177
4219
|
}),
|
|
4178
4220
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
4179
4221
|
},
|
|
4222
|
+
shaclmateName: {
|
|
4223
|
+
kind: "Shacl",
|
|
4224
|
+
type: () => ({
|
|
4225
|
+
kind: "Maybe",
|
|
4226
|
+
item: () => ({ kind: "String" }),
|
|
4227
|
+
}),
|
|
4228
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#name"),
|
|
4229
|
+
},
|
|
4180
4230
|
xone: {
|
|
4181
4231
|
kind: "Shacl",
|
|
4182
4232
|
type: () => ({
|
|
@@ -4190,6 +4240,15 @@ export var Shape;
|
|
|
4190
4240
|
},
|
|
4191
4241
|
},
|
|
4192
4242
|
};
|
|
4243
|
+
Shape.$toRdfResource = (value, options) => {
|
|
4244
|
+
if (NodeShape.isNodeShape(value)) {
|
|
4245
|
+
return NodeShape.$toRdfResource(value, options);
|
|
4246
|
+
}
|
|
4247
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
4248
|
+
return PropertyShape.$toRdfResource(value, options);
|
|
4249
|
+
}
|
|
4250
|
+
throw new Error("unrecognized type");
|
|
4251
|
+
};
|
|
4193
4252
|
Shape.$toRdfResourceValues = ((value, _options) => {
|
|
4194
4253
|
if (NodeShape.isNodeShape(value)) {
|
|
4195
4254
|
return [
|
|
@@ -4216,21 +4275,6 @@ export var Shape;
|
|
|
4216
4275
|
})(Shape || (Shape = {}));
|
|
4217
4276
|
export var $Object;
|
|
4218
4277
|
(function ($Object) {
|
|
4219
|
-
$Object.$toRdfResource = (value, options) => {
|
|
4220
|
-
if (NodeShape.isNodeShape(value)) {
|
|
4221
|
-
return NodeShape.$toRdfResource(value, options);
|
|
4222
|
-
}
|
|
4223
|
-
if (Ontology.isOntology(value)) {
|
|
4224
|
-
return Ontology.$toRdfResource(value, options);
|
|
4225
|
-
}
|
|
4226
|
-
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4227
|
-
return PropertyGroup.$toRdfResource(value, options);
|
|
4228
|
-
}
|
|
4229
|
-
if (PropertyShape.isPropertyShape(value)) {
|
|
4230
|
-
return PropertyShape.$toRdfResource(value, options);
|
|
4231
|
-
}
|
|
4232
|
-
throw new Error("unrecognized type");
|
|
4233
|
-
};
|
|
4234
4278
|
$Object.$filter = (filter, value) => {
|
|
4235
4279
|
if (filter.$identifier !== undefined &&
|
|
4236
4280
|
!$filterIdentifier(filter.$identifier, value.$identifier)) {
|
|
@@ -4337,16 +4381,39 @@ export var $Object;
|
|
|
4337
4381
|
},
|
|
4338
4382
|
},
|
|
4339
4383
|
properties: {
|
|
4340
|
-
|
|
4384
|
+
comment: {
|
|
4341
4385
|
kind: "Shacl",
|
|
4342
4386
|
type: () => ({
|
|
4343
|
-
kind: "
|
|
4387
|
+
kind: "Maybe",
|
|
4388
|
+
item: () => ({ kind: "String" }),
|
|
4389
|
+
}),
|
|
4390
|
+
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
4391
|
+
},
|
|
4392
|
+
label: {
|
|
4393
|
+
kind: "Shacl",
|
|
4394
|
+
type: () => ({
|
|
4395
|
+
kind: "Maybe",
|
|
4344
4396
|
item: () => ({ kind: "String" }),
|
|
4345
4397
|
}),
|
|
4346
4398
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
4347
4399
|
},
|
|
4348
4400
|
},
|
|
4349
4401
|
};
|
|
4402
|
+
$Object.$toRdfResource = (value, options) => {
|
|
4403
|
+
if (NodeShape.isNodeShape(value)) {
|
|
4404
|
+
return NodeShape.$toRdfResource(value, options);
|
|
4405
|
+
}
|
|
4406
|
+
if (Ontology.isOntology(value)) {
|
|
4407
|
+
return Ontology.$toRdfResource(value, options);
|
|
4408
|
+
}
|
|
4409
|
+
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4410
|
+
return PropertyGroup.$toRdfResource(value, options);
|
|
4411
|
+
}
|
|
4412
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
4413
|
+
return PropertyShape.$toRdfResource(value, options);
|
|
4414
|
+
}
|
|
4415
|
+
throw new Error("unrecognized type");
|
|
4416
|
+
};
|
|
4350
4417
|
$Object.$toRdfResourceValues = ((value, _options) => {
|
|
4351
4418
|
if (NodeShape.isNodeShape(value)) {
|
|
4352
4419
|
return [
|
|
@@ -4609,7 +4676,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4609
4676
|
},
|
|
4610
4677
|
], query);
|
|
4611
4678
|
}
|
|
4612
|
-
$objectsSync(
|
|
4679
|
+
$objectsSync(namedObjectType, query) {
|
|
4613
4680
|
const graph = query?.graph ?? this.$graph;
|
|
4614
4681
|
const limit = query?.limit ?? Number.MAX_SAFE_INTEGER;
|
|
4615
4682
|
if (limit <= 0) {
|
|
@@ -4633,11 +4700,11 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4633
4700
|
}));
|
|
4634
4701
|
sortResources = false;
|
|
4635
4702
|
}
|
|
4636
|
-
else if (
|
|
4703
|
+
else if (namedObjectType.$fromRdfTypes.length > 0) {
|
|
4637
4704
|
const identifierSet = new $IdentifierSet();
|
|
4638
4705
|
resources = [];
|
|
4639
4706
|
sortResources = true;
|
|
4640
|
-
for (const fromRdfType of
|
|
4707
|
+
for (const fromRdfType of namedObjectType.$fromRdfTypes) {
|
|
4641
4708
|
for (const resource of resourceSet.instancesOf(fromRdfType, {
|
|
4642
4709
|
graph,
|
|
4643
4710
|
})) {
|
|
@@ -4669,7 +4736,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4669
4736
|
identifierSet.add(quad.subject);
|
|
4670
4737
|
const resource = resourceSet.resource(quad.subject);
|
|
4671
4738
|
// Eagerly eliminate the majority of resources that won't match the object type
|
|
4672
|
-
|
|
4739
|
+
namedObjectType
|
|
4673
4740
|
.$fromRdfResource(resource, fromRdfResourceOptions)
|
|
4674
4741
|
.ifRight((object) => {
|
|
4675
4742
|
resources.push({ object, resource });
|
|
@@ -4684,13 +4751,13 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4684
4751
|
const objects = [];
|
|
4685
4752
|
for (let { object, resource } of resources) {
|
|
4686
4753
|
if (!object) {
|
|
4687
|
-
const objectEither =
|
|
4754
|
+
const objectEither = namedObjectType.$fromRdfResource(resource, fromRdfResourceOptions);
|
|
4688
4755
|
if (objectEither.isLeft()) {
|
|
4689
4756
|
return objectEither;
|
|
4690
4757
|
}
|
|
4691
4758
|
object = objectEither.unsafeCoerce();
|
|
4692
4759
|
}
|
|
4693
|
-
if (query?.filter && !
|
|
4760
|
+
if (query?.filter && !namedObjectType.$filter(query.filter, object)) {
|
|
4694
4761
|
continue;
|
|
4695
4762
|
}
|
|
4696
4763
|
if (objectI++ >= offset) {
|
|
@@ -4702,7 +4769,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4702
4769
|
}
|
|
4703
4770
|
return Right(objects);
|
|
4704
4771
|
}
|
|
4705
|
-
$objectUnionsSync(
|
|
4772
|
+
$objectUnionsSync(namedObjectTypes, query) {
|
|
4706
4773
|
const graph = query?.graph ?? this.$graph;
|
|
4707
4774
|
const limit = query?.limit ?? Number.MAX_SAFE_INTEGER;
|
|
4708
4775
|
if (limit <= 0) {
|
|
@@ -4726,18 +4793,18 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4726
4793
|
}));
|
|
4727
4794
|
sortResources = false;
|
|
4728
4795
|
}
|
|
4729
|
-
else if (
|
|
4796
|
+
else if (namedObjectTypes.every((namedObjectType) => namedObjectType.$fromRdfTypes.length > 0)) {
|
|
4730
4797
|
const identifierSet = new $IdentifierSet();
|
|
4731
4798
|
resources = [];
|
|
4732
4799
|
sortResources = true;
|
|
4733
|
-
for (const
|
|
4734
|
-
for (const fromRdfType of
|
|
4800
|
+
for (const namedObjectType of namedObjectTypes) {
|
|
4801
|
+
for (const fromRdfType of namedObjectType.$fromRdfTypes) {
|
|
4735
4802
|
for (const resource of resourceSet.instancesOf(fromRdfType, {
|
|
4736
4803
|
graph,
|
|
4737
4804
|
})) {
|
|
4738
4805
|
if (!identifierSet.has(resource.identifier)) {
|
|
4739
4806
|
identifierSet.add(resource.identifier);
|
|
4740
|
-
resources.push({
|
|
4807
|
+
resources.push({ namedObjectType, resource });
|
|
4741
4808
|
}
|
|
4742
4809
|
}
|
|
4743
4810
|
}
|
|
@@ -4764,11 +4831,11 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4764
4831
|
identifierSet.add(quad.subject);
|
|
4765
4832
|
// Eagerly eliminate the majority of resources that won't match the object types
|
|
4766
4833
|
const resource = resourceSet.resource(quad.subject);
|
|
4767
|
-
for (const
|
|
4768
|
-
if (
|
|
4834
|
+
for (const namedObjectType of namedObjectTypes) {
|
|
4835
|
+
if (namedObjectType
|
|
4769
4836
|
.$fromRdfResource(resource, fromRdfResourceOptions)
|
|
4770
4837
|
.ifRight((object) => {
|
|
4771
|
-
resources.push({ object,
|
|
4838
|
+
resources.push({ object, namedObjectType, resource });
|
|
4772
4839
|
})
|
|
4773
4840
|
.isRight()) {
|
|
4774
4841
|
break;
|
|
@@ -4782,18 +4849,18 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4782
4849
|
}
|
|
4783
4850
|
let objectI = 0;
|
|
4784
4851
|
const objects = [];
|
|
4785
|
-
for (let { object,
|
|
4852
|
+
for (let { object, namedObjectType, resource } of resources) {
|
|
4786
4853
|
if (!object) {
|
|
4787
4854
|
let objectEither;
|
|
4788
|
-
if (
|
|
4789
|
-
objectEither =
|
|
4855
|
+
if (namedObjectType) {
|
|
4856
|
+
objectEither = namedObjectType.$fromRdfResource(resource, fromRdfResourceOptions);
|
|
4790
4857
|
}
|
|
4791
4858
|
else {
|
|
4792
4859
|
objectEither = Left(new Error("no object types"));
|
|
4793
|
-
for (const tryObjectType of
|
|
4860
|
+
for (const tryObjectType of namedObjectTypes) {
|
|
4794
4861
|
objectEither = tryObjectType.$fromRdfResource(resource, fromRdfResourceOptions);
|
|
4795
4862
|
if (objectEither.isRight()) {
|
|
4796
|
-
|
|
4863
|
+
namedObjectType = tryObjectType;
|
|
4797
4864
|
break;
|
|
4798
4865
|
}
|
|
4799
4866
|
}
|
|
@@ -4803,10 +4870,10 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4803
4870
|
}
|
|
4804
4871
|
object = objectEither.unsafeCoerce();
|
|
4805
4872
|
}
|
|
4806
|
-
if (!
|
|
4807
|
-
throw new Error("
|
|
4873
|
+
if (!namedObjectType) {
|
|
4874
|
+
throw new Error("namedObjectType should be set here");
|
|
4808
4875
|
}
|
|
4809
|
-
if (query?.filter && !
|
|
4876
|
+
if (query?.filter && !namedObjectType.$filter(query.filter, object)) {
|
|
4810
4877
|
continue;
|
|
4811
4878
|
}
|
|
4812
4879
|
if (objectI++ >= offset) {
|