@shaclmate/shacl-ast 4.0.29 → 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/AbstractShapesGraph.d.ts +2 -2
- package/dist/AbstractShapesGraph.js +8 -8
- package/dist/ShapesGraph.d.ts +4 -4
- package/dist/ShapesGraph.js +4 -4
- package/dist/generated.d.ts +184 -250
- package/dist/generated.js +654 -711
- package/package.json +1 -1
package/dist/generated.js
CHANGED
|
@@ -191,16 +191,16 @@ const $literalFactory = new LiteralFactory({ dataFactory: dataFactory });
|
|
|
191
191
|
const $parseIdentifier = NTriplesIdentifier.parser(dataFactory);
|
|
192
192
|
export var $PropertyPath;
|
|
193
193
|
(function ($PropertyPath) {
|
|
194
|
-
function
|
|
194
|
+
function filter(_filter, _value) {
|
|
195
195
|
return true;
|
|
196
196
|
}
|
|
197
|
-
$PropertyPath
|
|
198
|
-
$PropertyPath
|
|
199
|
-
$PropertyPath
|
|
197
|
+
$PropertyPath.filter = filter;
|
|
198
|
+
$PropertyPath.fromRdfResource = RdfxResourcePropertyPath.fromResource;
|
|
199
|
+
$PropertyPath.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
200
200
|
.toResource()
|
|
201
|
-
.chain((resource) => $PropertyPath
|
|
202
|
-
$PropertyPath
|
|
203
|
-
$PropertyPath
|
|
201
|
+
.chain((resource) => $PropertyPath.fromRdfResource(resource, options))));
|
|
202
|
+
$PropertyPath.schema = {};
|
|
203
|
+
$PropertyPath.toRdfResource = RdfxResourcePropertyPath.toResource;
|
|
204
204
|
$PropertyPath.$toString = RdfxResourcePropertyPath.toString;
|
|
205
205
|
})($PropertyPath || ($PropertyPath = {}));
|
|
206
206
|
var $RdfVocabularies;
|
|
@@ -244,9 +244,44 @@ var $RdfVocabularies;
|
|
|
244
244
|
function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }) {
|
|
245
245
|
return typeFromRdf(Right(resource.values(propertySchema.path, { graph, unique: true }))).chain((values) => values.head());
|
|
246
246
|
}
|
|
247
|
+
function $wrap_FromRdfResourceFunction(_fromRdfResourceFunction) {
|
|
248
|
+
return (resource, options) => {
|
|
249
|
+
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
250
|
+
if (!objectSet) {
|
|
251
|
+
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
252
|
+
}
|
|
253
|
+
return _fromRdfResourceFunction(resource, {
|
|
254
|
+
context,
|
|
255
|
+
graph,
|
|
256
|
+
ignoreRdfType,
|
|
257
|
+
objectSet,
|
|
258
|
+
preferredLanguages,
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
|
|
263
|
+
return (object, options) => {
|
|
264
|
+
let { graph, ignoreRdfType = false, resourceSet } = options ?? {};
|
|
265
|
+
if (!resourceSet) {
|
|
266
|
+
resourceSet = new ResourceSet({
|
|
267
|
+
dataFactory: dataFactory,
|
|
268
|
+
dataset: datasetFactory.dataset(),
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
const resource = resourceSet.resource(object.$identifier());
|
|
272
|
+
_toRdfResourceFunction({
|
|
273
|
+
graph,
|
|
274
|
+
ignoreRdfType,
|
|
275
|
+
object,
|
|
276
|
+
resource,
|
|
277
|
+
resourceSet,
|
|
278
|
+
});
|
|
279
|
+
return resource;
|
|
280
|
+
};
|
|
281
|
+
}
|
|
247
282
|
export var PropertyShape;
|
|
248
283
|
(function (PropertyShape) {
|
|
249
|
-
function
|
|
284
|
+
function create(parameters) {
|
|
250
285
|
const $identifierParameter = parameters.$identifier;
|
|
251
286
|
let $identifier;
|
|
252
287
|
if (typeof $identifierParameter === "function") {
|
|
@@ -835,13 +870,13 @@ export var PropertyShape;
|
|
|
835
870
|
xone,
|
|
836
871
|
};
|
|
837
872
|
}
|
|
838
|
-
PropertyShape
|
|
839
|
-
let
|
|
840
|
-
(function (
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
})(
|
|
844
|
-
function
|
|
873
|
+
PropertyShape.create = create;
|
|
874
|
+
let Identifier;
|
|
875
|
+
(function (Identifier) {
|
|
876
|
+
Identifier.parse = $parseIdentifier;
|
|
877
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
878
|
+
})(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
|
|
879
|
+
function filter(filter, value) {
|
|
845
880
|
if (filter.$identifier !== undefined &&
|
|
846
881
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
847
882
|
return false;
|
|
@@ -959,7 +994,7 @@ export var PropertyShape;
|
|
|
959
994
|
return false;
|
|
960
995
|
}
|
|
961
996
|
if (filter.path !== undefined &&
|
|
962
|
-
!$PropertyPath
|
|
997
|
+
!$PropertyPath.filter(filter.path, value.path)) {
|
|
963
998
|
return false;
|
|
964
999
|
}
|
|
965
1000
|
if (filter.patterns !== undefined &&
|
|
@@ -976,34 +1011,8 @@ export var PropertyShape;
|
|
|
976
1011
|
}
|
|
977
1012
|
return true;
|
|
978
1013
|
}
|
|
979
|
-
PropertyShape
|
|
980
|
-
PropertyShape
|
|
981
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
982
|
-
if (!objectSet) {
|
|
983
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
984
|
-
}
|
|
985
|
-
return PropertyShape.$propertiesFromRdfResource(resource, {
|
|
986
|
-
context,
|
|
987
|
-
graph,
|
|
988
|
-
ignoreRdfType,
|
|
989
|
-
objectSet,
|
|
990
|
-
preferredLanguages,
|
|
991
|
-
}).map($create);
|
|
992
|
-
};
|
|
993
|
-
PropertyShape.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
994
|
-
.toResource()
|
|
995
|
-
.chain((resource) => PropertyShape.$fromRdfResource(resource, options))));
|
|
996
|
-
PropertyShape.$fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
|
|
997
|
-
function isPropertyShape(object) {
|
|
998
|
-
switch (object.$type) {
|
|
999
|
-
case "PropertyShape":
|
|
1000
|
-
return true;
|
|
1001
|
-
default:
|
|
1002
|
-
return false;
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
PropertyShape.isPropertyShape = isPropertyShape;
|
|
1006
|
-
PropertyShape.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
1014
|
+
PropertyShape.filter = filter;
|
|
1015
|
+
PropertyShape._fromRdfResource = ($resource, _$options) => {
|
|
1007
1016
|
return (!_$options.ignoreRdfType
|
|
1008
1017
|
? $resource
|
|
1009
1018
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -1015,7 +1024,7 @@ export var PropertyShape;
|
|
|
1015
1024
|
return Right(true);
|
|
1016
1025
|
}
|
|
1017
1026
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
1018
|
-
if ($resource.isInstanceOf(PropertyShape
|
|
1027
|
+
if ($resource.isInstanceOf(PropertyShape.fromRdfType, {
|
|
1019
1028
|
graph: _$options.graph,
|
|
1020
1029
|
})) {
|
|
1021
1030
|
return Right(true);
|
|
@@ -1030,15 +1039,15 @@ export var PropertyShape;
|
|
|
1030
1039
|
}).toValues())
|
|
1031
1040
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1032
1041
|
.chain((values) => values.head())
|
|
1033
|
-
.chain(($identifier) =>
|
|
1042
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
1034
1043
|
graph: _$options.graph,
|
|
1035
1044
|
resource: $resource,
|
|
1036
|
-
propertySchema: PropertyShape
|
|
1045
|
+
propertySchema: PropertyShape.schema.properties.and,
|
|
1037
1046
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1038
1047
|
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1039
1048
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1040
1049
|
focusResource: $resource,
|
|
1041
|
-
propertyPath: PropertyShape
|
|
1050
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1042
1051
|
values: valueList.toArray(),
|
|
1043
1052
|
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
1044
1053
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
@@ -1046,25 +1055,25 @@ export var PropertyShape;
|
|
|
1046
1055
|
? values.map((value) => Maybe.of(value))
|
|
1047
1056
|
: Resource.Values.fromValue({
|
|
1048
1057
|
focusResource: $resource,
|
|
1049
|
-
propertyPath: PropertyShape
|
|
1058
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1050
1059
|
value: Maybe.empty(),
|
|
1051
1060
|
})),
|
|
1052
1061
|
}).chain((and) => $shaclPropertyFromRdf({
|
|
1053
1062
|
graph: _$options.graph,
|
|
1054
1063
|
resource: $resource,
|
|
1055
|
-
propertySchema: PropertyShape
|
|
1064
|
+
propertySchema: PropertyShape.schema.properties.classes,
|
|
1056
1065
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1057
1066
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1058
1067
|
.map((values) => values.toArray())
|
|
1059
1068
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1060
1069
|
focusResource: $resource,
|
|
1061
|
-
propertyPath: PropertyShape
|
|
1070
|
+
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
1062
1071
|
value: valuesArray,
|
|
1063
1072
|
})),
|
|
1064
1073
|
}).chain((classes) => $shaclPropertyFromRdf({
|
|
1065
1074
|
graph: _$options.graph,
|
|
1066
1075
|
resource: $resource,
|
|
1067
|
-
propertySchema: PropertyShape
|
|
1076
|
+
propertySchema: PropertyShape.schema.properties.comment,
|
|
1068
1077
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1069
1078
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1070
1079
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -1072,41 +1081,40 @@ export var PropertyShape;
|
|
|
1072
1081
|
? values.map((value) => Maybe.of(value))
|
|
1073
1082
|
: Resource.Values.fromValue({
|
|
1074
1083
|
focusResource: $resource,
|
|
1075
|
-
propertyPath: PropertyShape
|
|
1084
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
1076
1085
|
value: Maybe.empty(),
|
|
1077
1086
|
})),
|
|
1078
1087
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
1079
1088
|
graph: _$options.graph,
|
|
1080
1089
|
resource: $resource,
|
|
1081
|
-
propertySchema: PropertyShape
|
|
1090
|
+
propertySchema: PropertyShape.schema.properties.datatype,
|
|
1082
1091
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1083
1092
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1084
1093
|
.map((values) => values.length > 0
|
|
1085
1094
|
? values.map((value) => Maybe.of(value))
|
|
1086
1095
|
: Resource.Values.fromValue({
|
|
1087
1096
|
focusResource: $resource,
|
|
1088
|
-
propertyPath: PropertyShape
|
|
1089
|
-
.path,
|
|
1097
|
+
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
1090
1098
|
value: Maybe.empty(),
|
|
1091
1099
|
})),
|
|
1092
1100
|
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
1093
1101
|
graph: _$options.graph,
|
|
1094
1102
|
resource: $resource,
|
|
1095
|
-
propertySchema: PropertyShape
|
|
1103
|
+
propertySchema: PropertyShape.schema.properties.deactivated,
|
|
1096
1104
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1097
1105
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1098
1106
|
.map((values) => values.length > 0
|
|
1099
1107
|
? values.map((value) => Maybe.of(value))
|
|
1100
1108
|
: Resource.Values.fromValue({
|
|
1101
1109
|
focusResource: $resource,
|
|
1102
|
-
propertyPath: PropertyShape
|
|
1110
|
+
propertyPath: PropertyShape.schema.properties.deactivated
|
|
1103
1111
|
.path,
|
|
1104
1112
|
value: Maybe.empty(),
|
|
1105
1113
|
})),
|
|
1106
1114
|
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
1107
1115
|
graph: _$options.graph,
|
|
1108
1116
|
resource: $resource,
|
|
1109
|
-
propertySchema: PropertyShape
|
|
1117
|
+
propertySchema: PropertyShape.schema.properties.defaultValue,
|
|
1110
1118
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1111
1119
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1112
1120
|
switch (term.termType) {
|
|
@@ -1118,7 +1126,7 @@ export var PropertyShape;
|
|
|
1118
1126
|
actualValue: term,
|
|
1119
1127
|
expectedValueType: "(NamedNode | Literal)",
|
|
1120
1128
|
focusResource: $resource,
|
|
1121
|
-
propertyPath: PropertyShape
|
|
1129
|
+
propertyPath: PropertyShape.schema.properties
|
|
1122
1130
|
.defaultValue.path,
|
|
1123
1131
|
}));
|
|
1124
1132
|
}
|
|
@@ -1127,14 +1135,14 @@ export var PropertyShape;
|
|
|
1127
1135
|
? values.map((value) => Maybe.of(value))
|
|
1128
1136
|
: Resource.Values.fromValue({
|
|
1129
1137
|
focusResource: $resource,
|
|
1130
|
-
propertyPath: PropertyShape
|
|
1131
|
-
.
|
|
1138
|
+
propertyPath: PropertyShape.schema.properties.defaultValue
|
|
1139
|
+
.path,
|
|
1132
1140
|
value: Maybe.empty(),
|
|
1133
1141
|
})),
|
|
1134
1142
|
}).chain((defaultValue) => $shaclPropertyFromRdf({
|
|
1135
1143
|
graph: _$options.graph,
|
|
1136
1144
|
resource: $resource,
|
|
1137
|
-
propertySchema: PropertyShape
|
|
1145
|
+
propertySchema: PropertyShape.schema.properties.description,
|
|
1138
1146
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1139
1147
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1140
1148
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -1142,41 +1150,40 @@ export var PropertyShape;
|
|
|
1142
1150
|
? values.map((value) => Maybe.of(value))
|
|
1143
1151
|
: Resource.Values.fromValue({
|
|
1144
1152
|
focusResource: $resource,
|
|
1145
|
-
propertyPath: PropertyShape
|
|
1153
|
+
propertyPath: PropertyShape.schema.properties
|
|
1146
1154
|
.description.path,
|
|
1147
1155
|
value: Maybe.empty(),
|
|
1148
1156
|
})),
|
|
1149
1157
|
}).chain((description) => $shaclPropertyFromRdf({
|
|
1150
1158
|
graph: _$options.graph,
|
|
1151
1159
|
resource: $resource,
|
|
1152
|
-
propertySchema: PropertyShape
|
|
1160
|
+
propertySchema: PropertyShape.schema.properties.flags,
|
|
1153
1161
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1154
1162
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1155
1163
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1156
1164
|
.map((values) => values.toArray())
|
|
1157
1165
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1158
1166
|
focusResource: $resource,
|
|
1159
|
-
propertyPath: PropertyShape
|
|
1160
|
-
.path,
|
|
1167
|
+
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
1161
1168
|
value: valuesArray,
|
|
1162
1169
|
})),
|
|
1163
1170
|
}).chain((flags) => $shaclPropertyFromRdf({
|
|
1164
1171
|
graph: _$options.graph,
|
|
1165
1172
|
resource: $resource,
|
|
1166
|
-
propertySchema: PropertyShape
|
|
1173
|
+
propertySchema: PropertyShape.schema.properties.groups,
|
|
1167
1174
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1168
1175
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1169
1176
|
.map((values) => values.toArray())
|
|
1170
1177
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1171
1178
|
focusResource: $resource,
|
|
1172
|
-
propertyPath: PropertyShape
|
|
1179
|
+
propertyPath: PropertyShape.schema.properties.groups
|
|
1173
1180
|
.path,
|
|
1174
1181
|
value: valuesArray,
|
|
1175
1182
|
})),
|
|
1176
1183
|
}).chain((groups) => $shaclPropertyFromRdf({
|
|
1177
1184
|
graph: _$options.graph,
|
|
1178
1185
|
resource: $resource,
|
|
1179
|
-
propertySchema: PropertyShape
|
|
1186
|
+
propertySchema: PropertyShape.schema.properties.hasValues,
|
|
1180
1187
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1181
1188
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1182
1189
|
switch (term.termType) {
|
|
@@ -1188,7 +1195,7 @@ export var PropertyShape;
|
|
|
1188
1195
|
actualValue: term,
|
|
1189
1196
|
expectedValueType: "(NamedNode | Literal)",
|
|
1190
1197
|
focusResource: $resource,
|
|
1191
|
-
propertyPath: PropertyShape
|
|
1198
|
+
propertyPath: PropertyShape.schema
|
|
1192
1199
|
.properties.hasValues
|
|
1193
1200
|
.path,
|
|
1194
1201
|
}));
|
|
@@ -1197,21 +1204,21 @@ export var PropertyShape;
|
|
|
1197
1204
|
.map((values) => values.toArray())
|
|
1198
1205
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1199
1206
|
focusResource: $resource,
|
|
1200
|
-
propertyPath: PropertyShape
|
|
1207
|
+
propertyPath: PropertyShape.schema.properties
|
|
1201
1208
|
.hasValues.path,
|
|
1202
1209
|
value: valuesArray,
|
|
1203
1210
|
})),
|
|
1204
1211
|
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
1205
1212
|
graph: _$options.graph,
|
|
1206
1213
|
resource: $resource,
|
|
1207
|
-
propertySchema: PropertyShape
|
|
1214
|
+
propertySchema: PropertyShape.schema.properties.in_,
|
|
1208
1215
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1209
1216
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
1210
1217
|
graph: _$options.graph,
|
|
1211
1218
|
})))
|
|
1212
1219
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1213
1220
|
focusResource: $resource,
|
|
1214
|
-
propertyPath: PropertyShape
|
|
1221
|
+
propertyPath: PropertyShape.schema.properties
|
|
1215
1222
|
.in_.path,
|
|
1216
1223
|
values: valueList.toArray(),
|
|
1217
1224
|
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
@@ -1224,8 +1231,7 @@ export var PropertyShape;
|
|
|
1224
1231
|
actualValue: term,
|
|
1225
1232
|
expectedValueType: "(NamedNode | Literal)",
|
|
1226
1233
|
focusResource: $resource,
|
|
1227
|
-
propertyPath: PropertyShape
|
|
1228
|
-
.$schema
|
|
1234
|
+
propertyPath: PropertyShape.schema
|
|
1229
1235
|
.properties.in_
|
|
1230
1236
|
.path,
|
|
1231
1237
|
}));
|
|
@@ -1236,29 +1242,28 @@ export var PropertyShape;
|
|
|
1236
1242
|
? values.map((value) => Maybe.of(value))
|
|
1237
1243
|
: Resource.Values.fromValue({
|
|
1238
1244
|
focusResource: $resource,
|
|
1239
|
-
propertyPath: PropertyShape
|
|
1245
|
+
propertyPath: PropertyShape.schema.properties
|
|
1240
1246
|
.in_.path,
|
|
1241
1247
|
value: Maybe.empty(),
|
|
1242
1248
|
})),
|
|
1243
1249
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
1244
1250
|
graph: _$options.graph,
|
|
1245
1251
|
resource: $resource,
|
|
1246
|
-
propertySchema: PropertyShape
|
|
1252
|
+
propertySchema: PropertyShape.schema.properties.isDefinedBy,
|
|
1247
1253
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1248
1254
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1249
1255
|
.map((values) => values.length > 0
|
|
1250
1256
|
? values.map((value) => Maybe.of(value))
|
|
1251
1257
|
: Resource.Values.fromValue({
|
|
1252
1258
|
focusResource: $resource,
|
|
1253
|
-
propertyPath: PropertyShape
|
|
1254
|
-
.
|
|
1255
|
-
.path,
|
|
1259
|
+
propertyPath: PropertyShape.schema.properties
|
|
1260
|
+
.isDefinedBy.path,
|
|
1256
1261
|
value: Maybe.empty(),
|
|
1257
1262
|
})),
|
|
1258
1263
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
1259
1264
|
graph: _$options.graph,
|
|
1260
1265
|
resource: $resource,
|
|
1261
|
-
propertySchema: PropertyShape
|
|
1266
|
+
propertySchema: PropertyShape.schema.properties.label,
|
|
1262
1267
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1263
1268
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1264
1269
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -1266,21 +1271,21 @@ export var PropertyShape;
|
|
|
1266
1271
|
? values.map((value) => Maybe.of(value))
|
|
1267
1272
|
: Resource.Values.fromValue({
|
|
1268
1273
|
focusResource: $resource,
|
|
1269
|
-
propertyPath: PropertyShape
|
|
1274
|
+
propertyPath: PropertyShape.schema
|
|
1270
1275
|
.properties.label.path,
|
|
1271
1276
|
value: Maybe.empty(),
|
|
1272
1277
|
})),
|
|
1273
1278
|
}).chain((label) => $shaclPropertyFromRdf({
|
|
1274
1279
|
graph: _$options.graph,
|
|
1275
1280
|
resource: $resource,
|
|
1276
|
-
propertySchema: PropertyShape
|
|
1281
|
+
propertySchema: PropertyShape.schema.properties.languageIn,
|
|
1277
1282
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1278
1283
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
1279
1284
|
graph: _$options.graph,
|
|
1280
1285
|
})))
|
|
1281
1286
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1282
1287
|
focusResource: $resource,
|
|
1283
|
-
propertyPath: PropertyShape
|
|
1288
|
+
propertyPath: PropertyShape.schema
|
|
1284
1289
|
.properties.languageIn
|
|
1285
1290
|
.path,
|
|
1286
1291
|
values: valueList.toArray(),
|
|
@@ -1292,7 +1297,7 @@ export var PropertyShape;
|
|
|
1292
1297
|
? values.map((value) => Maybe.of(value))
|
|
1293
1298
|
: Resource.Values.fromValue({
|
|
1294
1299
|
focusResource: $resource,
|
|
1295
|
-
propertyPath: PropertyShape
|
|
1300
|
+
propertyPath: PropertyShape.schema
|
|
1296
1301
|
.properties.languageIn
|
|
1297
1302
|
.path,
|
|
1298
1303
|
value: Maybe.empty(),
|
|
@@ -1300,14 +1305,14 @@ export var PropertyShape;
|
|
|
1300
1305
|
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
1301
1306
|
graph: _$options.graph,
|
|
1302
1307
|
resource: $resource,
|
|
1303
|
-
propertySchema: PropertyShape
|
|
1308
|
+
propertySchema: PropertyShape.schema.properties.maxCount,
|
|
1304
1309
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1305
1310
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1306
1311
|
.map((values) => values.length > 0
|
|
1307
1312
|
? values.map((value) => Maybe.of(value))
|
|
1308
1313
|
: Resource.Values.fromValue({
|
|
1309
1314
|
focusResource: $resource,
|
|
1310
|
-
propertyPath: PropertyShape
|
|
1315
|
+
propertyPath: PropertyShape.schema
|
|
1311
1316
|
.properties.maxCount
|
|
1312
1317
|
.path,
|
|
1313
1318
|
value: Maybe.empty(),
|
|
@@ -1315,7 +1320,7 @@ export var PropertyShape;
|
|
|
1315
1320
|
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
1316
1321
|
graph: _$options.graph,
|
|
1317
1322
|
resource: $resource,
|
|
1318
|
-
propertySchema: PropertyShape
|
|
1323
|
+
propertySchema: PropertyShape.schema.properties.maxExclusive,
|
|
1319
1324
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1320
1325
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1321
1326
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -1323,7 +1328,7 @@ export var PropertyShape;
|
|
|
1323
1328
|
? values.map((value) => Maybe.of(value))
|
|
1324
1329
|
: Resource.Values.fromValue({
|
|
1325
1330
|
focusResource: $resource,
|
|
1326
|
-
propertyPath: PropertyShape
|
|
1331
|
+
propertyPath: PropertyShape.schema
|
|
1327
1332
|
.properties
|
|
1328
1333
|
.maxExclusive.path,
|
|
1329
1334
|
value: Maybe.empty(),
|
|
@@ -1331,7 +1336,7 @@ export var PropertyShape;
|
|
|
1331
1336
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
1332
1337
|
graph: _$options.graph,
|
|
1333
1338
|
resource: $resource,
|
|
1334
|
-
propertySchema: PropertyShape
|
|
1339
|
+
propertySchema: PropertyShape.schema.properties.maxInclusive,
|
|
1335
1340
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1336
1341
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1337
1342
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -1339,25 +1344,22 @@ export var PropertyShape;
|
|
|
1339
1344
|
? values.map((value) => Maybe.of(value))
|
|
1340
1345
|
: Resource.Values.fromValue({
|
|
1341
1346
|
focusResource: $resource,
|
|
1342
|
-
propertyPath: PropertyShape
|
|
1343
|
-
.$schema
|
|
1347
|
+
propertyPath: PropertyShape.schema
|
|
1344
1348
|
.properties
|
|
1345
|
-
.maxInclusive
|
|
1346
|
-
.path,
|
|
1349
|
+
.maxInclusive.path,
|
|
1347
1350
|
value: Maybe.empty(),
|
|
1348
1351
|
})),
|
|
1349
1352
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
1350
1353
|
graph: _$options.graph,
|
|
1351
1354
|
resource: $resource,
|
|
1352
|
-
propertySchema: PropertyShape
|
|
1355
|
+
propertySchema: PropertyShape.schema.properties.maxLength,
|
|
1353
1356
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1354
1357
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1355
1358
|
.map((values) => values.length > 0
|
|
1356
1359
|
? values.map((value) => Maybe.of(value))
|
|
1357
1360
|
: Resource.Values.fromValue({
|
|
1358
1361
|
focusResource: $resource,
|
|
1359
|
-
propertyPath: PropertyShape
|
|
1360
|
-
.$schema
|
|
1362
|
+
propertyPath: PropertyShape.schema
|
|
1361
1363
|
.properties
|
|
1362
1364
|
.maxLength.path,
|
|
1363
1365
|
value: Maybe.empty(),
|
|
@@ -1365,7 +1367,7 @@ export var PropertyShape;
|
|
|
1365
1367
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
1366
1368
|
graph: _$options.graph,
|
|
1367
1369
|
resource: $resource,
|
|
1368
|
-
propertySchema: PropertyShape
|
|
1370
|
+
propertySchema: PropertyShape.schema.properties.minCount,
|
|
1369
1371
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1370
1372
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1371
1373
|
.map((values) => values.length > 0
|
|
@@ -1373,16 +1375,15 @@ export var PropertyShape;
|
|
|
1373
1375
|
: Resource.Values.fromValue({
|
|
1374
1376
|
focusResource: $resource,
|
|
1375
1377
|
propertyPath: PropertyShape
|
|
1376
|
-
|
|
1378
|
+
.schema
|
|
1377
1379
|
.properties
|
|
1378
|
-
.minCount
|
|
1379
|
-
.path,
|
|
1380
|
+
.minCount.path,
|
|
1380
1381
|
value: Maybe.empty(),
|
|
1381
1382
|
})),
|
|
1382
1383
|
}).chain((minCount) => $shaclPropertyFromRdf({
|
|
1383
1384
|
graph: _$options.graph,
|
|
1384
1385
|
resource: $resource,
|
|
1385
|
-
propertySchema: PropertyShape
|
|
1386
|
+
propertySchema: PropertyShape.schema.properties
|
|
1386
1387
|
.minExclusive,
|
|
1387
1388
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1388
1389
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -1392,7 +1393,7 @@ export var PropertyShape;
|
|
|
1392
1393
|
: Resource.Values.fromValue({
|
|
1393
1394
|
focusResource: $resource,
|
|
1394
1395
|
propertyPath: PropertyShape
|
|
1395
|
-
|
|
1396
|
+
.schema
|
|
1396
1397
|
.properties
|
|
1397
1398
|
.minExclusive
|
|
1398
1399
|
.path,
|
|
@@ -1401,7 +1402,7 @@ export var PropertyShape;
|
|
|
1401
1402
|
}).chain((minExclusive) => $shaclPropertyFromRdf({
|
|
1402
1403
|
graph: _$options.graph,
|
|
1403
1404
|
resource: $resource,
|
|
1404
|
-
propertySchema: PropertyShape
|
|
1405
|
+
propertySchema: PropertyShape.schema.properties
|
|
1405
1406
|
.minInclusive,
|
|
1406
1407
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1407
1408
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -1411,7 +1412,7 @@ export var PropertyShape;
|
|
|
1411
1412
|
: Resource.Values.fromValue({
|
|
1412
1413
|
focusResource: $resource,
|
|
1413
1414
|
propertyPath: PropertyShape
|
|
1414
|
-
|
|
1415
|
+
.schema
|
|
1415
1416
|
.properties
|
|
1416
1417
|
.minInclusive
|
|
1417
1418
|
.path,
|
|
@@ -1420,7 +1421,7 @@ export var PropertyShape;
|
|
|
1420
1421
|
}).chain((minInclusive) => $shaclPropertyFromRdf({
|
|
1421
1422
|
graph: _$options.graph,
|
|
1422
1423
|
resource: $resource,
|
|
1423
|
-
propertySchema: PropertyShape
|
|
1424
|
+
propertySchema: PropertyShape.schema.properties
|
|
1424
1425
|
.minLength,
|
|
1425
1426
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1426
1427
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
@@ -1429,7 +1430,7 @@ export var PropertyShape;
|
|
|
1429
1430
|
: Resource.Values.fromValue({
|
|
1430
1431
|
focusResource: $resource,
|
|
1431
1432
|
propertyPath: PropertyShape
|
|
1432
|
-
|
|
1433
|
+
.schema
|
|
1433
1434
|
.properties
|
|
1434
1435
|
.minLength
|
|
1435
1436
|
.path,
|
|
@@ -1438,18 +1439,17 @@ export var PropertyShape;
|
|
|
1438
1439
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
1439
1440
|
graph: _$options.graph,
|
|
1440
1441
|
resource: $resource,
|
|
1441
|
-
propertySchema: PropertyShape
|
|
1442
|
+
propertySchema: PropertyShape.schema.properties
|
|
1442
1443
|
.name,
|
|
1443
1444
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1444
1445
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1445
1446
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1446
|
-
.map((values) => values.length >
|
|
1447
|
-
0
|
|
1447
|
+
.map((values) => values.length > 0
|
|
1448
1448
|
? values.map((value) => Maybe.of(value))
|
|
1449
1449
|
: Resource.Values.fromValue({
|
|
1450
1450
|
focusResource: $resource,
|
|
1451
1451
|
propertyPath: PropertyShape
|
|
1452
|
-
|
|
1452
|
+
.schema
|
|
1453
1453
|
.properties
|
|
1454
1454
|
.name
|
|
1455
1455
|
.path,
|
|
@@ -1458,8 +1458,7 @@ export var PropertyShape;
|
|
|
1458
1458
|
}).chain((name) => $shaclPropertyFromRdf({
|
|
1459
1459
|
graph: _$options.graph,
|
|
1460
1460
|
resource: $resource,
|
|
1461
|
-
propertySchema: PropertyShape
|
|
1462
|
-
.properties
|
|
1461
|
+
propertySchema: PropertyShape.schema.properties
|
|
1463
1462
|
.node,
|
|
1464
1463
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1465
1464
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
@@ -1469,7 +1468,7 @@ export var PropertyShape;
|
|
|
1469
1468
|
: Resource.Values.fromValue({
|
|
1470
1469
|
focusResource: $resource,
|
|
1471
1470
|
propertyPath: PropertyShape
|
|
1472
|
-
|
|
1471
|
+
.schema
|
|
1473
1472
|
.properties
|
|
1474
1473
|
.node
|
|
1475
1474
|
.path,
|
|
@@ -1478,7 +1477,7 @@ export var PropertyShape;
|
|
|
1478
1477
|
}).chain((node) => $shaclPropertyFromRdf({
|
|
1479
1478
|
graph: _$options.graph,
|
|
1480
1479
|
resource: $resource,
|
|
1481
|
-
propertySchema: PropertyShape
|
|
1480
|
+
propertySchema: PropertyShape.schema
|
|
1482
1481
|
.properties
|
|
1483
1482
|
.nodeKind,
|
|
1484
1483
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1496,7 +1495,7 @@ export var PropertyShape;
|
|
|
1496
1495
|
: Resource.Values.fromValue({
|
|
1497
1496
|
focusResource: $resource,
|
|
1498
1497
|
propertyPath: PropertyShape
|
|
1499
|
-
|
|
1498
|
+
.schema
|
|
1500
1499
|
.properties
|
|
1501
1500
|
.nodeKind
|
|
1502
1501
|
.path,
|
|
@@ -1505,7 +1504,7 @@ export var PropertyShape;
|
|
|
1505
1504
|
}).chain((nodeKind) => $shaclPropertyFromRdf({
|
|
1506
1505
|
graph: _$options.graph,
|
|
1507
1506
|
resource: $resource,
|
|
1508
|
-
propertySchema: PropertyShape
|
|
1507
|
+
propertySchema: PropertyShape.schema
|
|
1509
1508
|
.properties
|
|
1510
1509
|
.not,
|
|
1511
1510
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1514,7 +1513,7 @@ export var PropertyShape;
|
|
|
1514
1513
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1515
1514
|
focusResource: $resource,
|
|
1516
1515
|
propertyPath: PropertyShape
|
|
1517
|
-
|
|
1516
|
+
.schema
|
|
1518
1517
|
.properties
|
|
1519
1518
|
.not
|
|
1520
1519
|
.path,
|
|
@@ -1523,7 +1522,7 @@ export var PropertyShape;
|
|
|
1523
1522
|
}).chain((not) => $shaclPropertyFromRdf({
|
|
1524
1523
|
graph: _$options.graph,
|
|
1525
1524
|
resource: $resource,
|
|
1526
|
-
propertySchema: PropertyShape
|
|
1525
|
+
propertySchema: PropertyShape.schema
|
|
1527
1526
|
.properties
|
|
1528
1527
|
.or,
|
|
1529
1528
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1533,7 +1532,7 @@ export var PropertyShape;
|
|
|
1533
1532
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1534
1533
|
focusResource: $resource,
|
|
1535
1534
|
propertyPath: PropertyShape
|
|
1536
|
-
|
|
1535
|
+
.schema
|
|
1537
1536
|
.properties
|
|
1538
1537
|
.or
|
|
1539
1538
|
.path,
|
|
@@ -1546,7 +1545,7 @@ export var PropertyShape;
|
|
|
1546
1545
|
: Resource.Values.fromValue({
|
|
1547
1546
|
focusResource: $resource,
|
|
1548
1547
|
propertyPath: PropertyShape
|
|
1549
|
-
|
|
1548
|
+
.schema
|
|
1550
1549
|
.properties
|
|
1551
1550
|
.or
|
|
1552
1551
|
.path,
|
|
@@ -1555,7 +1554,7 @@ export var PropertyShape;
|
|
|
1555
1554
|
}).chain((or) => $shaclPropertyFromRdf({
|
|
1556
1555
|
graph: _$options.graph,
|
|
1557
1556
|
resource: $resource,
|
|
1558
|
-
propertySchema: PropertyShape
|
|
1557
|
+
propertySchema: PropertyShape.schema
|
|
1559
1558
|
.properties
|
|
1560
1559
|
.order,
|
|
1561
1560
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1566,7 +1565,7 @@ export var PropertyShape;
|
|
|
1566
1565
|
: Resource.Values.fromValue({
|
|
1567
1566
|
focusResource: $resource,
|
|
1568
1567
|
propertyPath: PropertyShape
|
|
1569
|
-
|
|
1568
|
+
.schema
|
|
1570
1569
|
.properties
|
|
1571
1570
|
.order
|
|
1572
1571
|
.path,
|
|
@@ -1575,10 +1574,10 @@ export var PropertyShape;
|
|
|
1575
1574
|
}).chain((order) => $shaclPropertyFromRdf({
|
|
1576
1575
|
graph: _$options.graph,
|
|
1577
1576
|
resource: $resource,
|
|
1578
|
-
propertySchema: PropertyShape
|
|
1577
|
+
propertySchema: PropertyShape.schema
|
|
1579
1578
|
.properties
|
|
1580
1579
|
.path,
|
|
1581
|
-
typeFromRdf: (resourceValues) => $PropertyPath
|
|
1580
|
+
typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
|
|
1582
1581
|
context: _$options.context,
|
|
1583
1582
|
graph: _$options.graph,
|
|
1584
1583
|
preferredLanguages: _$options.preferredLanguages,
|
|
@@ -1586,7 +1585,7 @@ export var PropertyShape;
|
|
|
1586
1585
|
resource: $resource,
|
|
1587
1586
|
ignoreRdfType: true,
|
|
1588
1587
|
propertyPath: PropertyShape
|
|
1589
|
-
|
|
1588
|
+
.schema
|
|
1590
1589
|
.properties
|
|
1591
1590
|
.path
|
|
1592
1591
|
.path,
|
|
@@ -1594,7 +1593,7 @@ export var PropertyShape;
|
|
|
1594
1593
|
}).chain((path) => $shaclPropertyFromRdf({
|
|
1595
1594
|
graph: _$options.graph,
|
|
1596
1595
|
resource: $resource,
|
|
1597
|
-
propertySchema: PropertyShape
|
|
1596
|
+
propertySchema: PropertyShape.schema
|
|
1598
1597
|
.properties
|
|
1599
1598
|
.patterns,
|
|
1600
1599
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1604,7 +1603,7 @@ export var PropertyShape;
|
|
|
1604
1603
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1605
1604
|
focusResource: $resource,
|
|
1606
1605
|
propertyPath: PropertyShape
|
|
1607
|
-
|
|
1606
|
+
.schema
|
|
1608
1607
|
.properties
|
|
1609
1608
|
.patterns
|
|
1610
1609
|
.path,
|
|
@@ -1613,7 +1612,7 @@ export var PropertyShape;
|
|
|
1613
1612
|
}).chain((patterns) => $shaclPropertyFromRdf({
|
|
1614
1613
|
graph: _$options.graph,
|
|
1615
1614
|
resource: $resource,
|
|
1616
|
-
propertySchema: PropertyShape
|
|
1615
|
+
propertySchema: PropertyShape.schema
|
|
1617
1616
|
.properties
|
|
1618
1617
|
.uniqueLang,
|
|
1619
1618
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1624,7 +1623,7 @@ export var PropertyShape;
|
|
|
1624
1623
|
: Resource.Values.fromValue({
|
|
1625
1624
|
focusResource: $resource,
|
|
1626
1625
|
propertyPath: PropertyShape
|
|
1627
|
-
|
|
1626
|
+
.schema
|
|
1628
1627
|
.properties
|
|
1629
1628
|
.uniqueLang
|
|
1630
1629
|
.path,
|
|
@@ -1633,7 +1632,7 @@ export var PropertyShape;
|
|
|
1633
1632
|
}).chain((uniqueLang) => $shaclPropertyFromRdf({
|
|
1634
1633
|
graph: _$options.graph,
|
|
1635
1634
|
resource: $resource,
|
|
1636
|
-
propertySchema: PropertyShape
|
|
1635
|
+
propertySchema: PropertyShape.schema
|
|
1637
1636
|
.properties
|
|
1638
1637
|
.xone,
|
|
1639
1638
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1643,7 +1642,7 @@ export var PropertyShape;
|
|
|
1643
1642
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1644
1643
|
focusResource: $resource,
|
|
1645
1644
|
propertyPath: PropertyShape
|
|
1646
|
-
|
|
1645
|
+
.schema
|
|
1647
1646
|
.properties
|
|
1648
1647
|
.xone
|
|
1649
1648
|
.path,
|
|
@@ -1656,15 +1655,14 @@ export var PropertyShape;
|
|
|
1656
1655
|
: Resource.Values.fromValue({
|
|
1657
1656
|
focusResource: $resource,
|
|
1658
1657
|
propertyPath: PropertyShape
|
|
1659
|
-
|
|
1658
|
+
.schema
|
|
1660
1659
|
.properties
|
|
1661
1660
|
.xone
|
|
1662
1661
|
.path,
|
|
1663
1662
|
value: Maybe.empty(),
|
|
1664
1663
|
})),
|
|
1665
|
-
}).map((xone) => ({
|
|
1664
|
+
}).map((xone) => create({
|
|
1666
1665
|
$identifier,
|
|
1667
|
-
$type,
|
|
1668
1666
|
and,
|
|
1669
1667
|
classes,
|
|
1670
1668
|
comment,
|
|
@@ -1697,9 +1695,23 @@ export var PropertyShape;
|
|
|
1697
1695
|
patterns,
|
|
1698
1696
|
uniqueLang,
|
|
1699
1697
|
xone,
|
|
1700
|
-
})))))))))))))))))))))))))))))))))))
|
|
1698
|
+
})))))))))))))))))))))))))))))))))));
|
|
1701
1699
|
};
|
|
1702
|
-
PropertyShape
|
|
1700
|
+
PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
|
|
1701
|
+
PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
1702
|
+
.toResource()
|
|
1703
|
+
.chain((resource) => PropertyShape.fromRdfResource(resource, options))));
|
|
1704
|
+
PropertyShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
|
|
1705
|
+
function isPropertyShape(object) {
|
|
1706
|
+
switch (object.$type) {
|
|
1707
|
+
case "PropertyShape":
|
|
1708
|
+
return true;
|
|
1709
|
+
default:
|
|
1710
|
+
return false;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
PropertyShape.isPropertyShape = isPropertyShape;
|
|
1714
|
+
PropertyShape.schema = {
|
|
1703
1715
|
properties: {
|
|
1704
1716
|
$identifier: {
|
|
1705
1717
|
kind: "Identifier",
|
|
@@ -1960,7 +1972,7 @@ export var PropertyShape;
|
|
|
1960
1972
|
},
|
|
1961
1973
|
path: {
|
|
1962
1974
|
kind: "Shacl",
|
|
1963
|
-
type: () => $PropertyPath
|
|
1975
|
+
type: () => $PropertyPath.schema,
|
|
1964
1976
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
|
|
1965
1977
|
},
|
|
1966
1978
|
patterns: {
|
|
@@ -1992,198 +2004,194 @@ export var PropertyShape;
|
|
|
1992
2004
|
},
|
|
1993
2005
|
},
|
|
1994
2006
|
};
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
dataFactory: dataFactory,
|
|
1999
|
-
dataset: datasetFactory.dataset(),
|
|
2000
|
-
});
|
|
2001
|
-
const resource = resourceSet.resource(_propertyShape.$identifier());
|
|
2002
|
-
if (!options?.ignoreRdfType) {
|
|
2003
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), options?.graph);
|
|
2007
|
+
PropertyShape._toRdfResource = (parameters) => {
|
|
2008
|
+
if (!parameters.ignoreRdfType) {
|
|
2009
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), parameters.graph);
|
|
2004
2010
|
}
|
|
2005
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
|
|
2011
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"), parameters.object.and.toList().flatMap((value) => [
|
|
2006
2012
|
value.length > 0
|
|
2007
2013
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2008
2014
|
if (itemIndex === 0) {
|
|
2009
2015
|
currentSubListResource = listResource;
|
|
2010
2016
|
}
|
|
2011
2017
|
else {
|
|
2012
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2013
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2018
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2019
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2014
2020
|
currentSubListResource = newSubListResource;
|
|
2015
2021
|
}
|
|
2016
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2022
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2017
2023
|
if (itemIndex + 1 === list.length) {
|
|
2018
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2024
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2019
2025
|
}
|
|
2020
2026
|
return { currentSubListResource, listResource };
|
|
2021
2027
|
}, {
|
|
2022
2028
|
currentSubListResource: null,
|
|
2023
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2029
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2024
2030
|
}).listResource.identifier
|
|
2025
2031
|
: $RdfVocabularies.rdf.nil,
|
|
2026
|
-
]),
|
|
2027
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
2028
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
2032
|
+
]), parameters.graph);
|
|
2033
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"), parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
2034
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
2029
2035
|
.toList()
|
|
2030
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2031
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
|
|
2032
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
|
|
2036
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2037
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"), parameters.object.datatype.toList(), parameters.graph);
|
|
2038
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"), parameters.object.deactivated
|
|
2033
2039
|
.toList()
|
|
2034
2040
|
.flatMap((value) => [
|
|
2035
2041
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2036
|
-
]),
|
|
2037
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
|
|
2038
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
|
|
2042
|
+
]), parameters.graph);
|
|
2043
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"), parameters.object.defaultValue.toList(), parameters.graph);
|
|
2044
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#description"), parameters.object.description
|
|
2039
2045
|
.toList()
|
|
2040
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2041
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
|
|
2042
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
|
|
2043
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
|
|
2044
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
|
|
2046
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2047
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
|
|
2048
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#group"), parameters.object.groups.flatMap((item) => [item]), parameters.graph);
|
|
2049
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
2050
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"), parameters.object.in_.toList().flatMap((value) => [
|
|
2045
2051
|
value.length > 0
|
|
2046
2052
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2047
2053
|
if (itemIndex === 0) {
|
|
2048
2054
|
currentSubListResource = listResource;
|
|
2049
2055
|
}
|
|
2050
2056
|
else {
|
|
2051
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2052
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2057
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2058
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2053
2059
|
currentSubListResource = newSubListResource;
|
|
2054
2060
|
}
|
|
2055
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2061
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2056
2062
|
if (itemIndex + 1 === list.length) {
|
|
2057
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2063
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2058
2064
|
}
|
|
2059
2065
|
return { currentSubListResource, listResource };
|
|
2060
2066
|
}, {
|
|
2061
2067
|
currentSubListResource: null,
|
|
2062
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2068
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2063
2069
|
}).listResource.identifier
|
|
2064
2070
|
: $RdfVocabularies.rdf.nil,
|
|
2065
|
-
]),
|
|
2066
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
2067
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
2071
|
+
]), parameters.graph);
|
|
2072
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"), parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
2073
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
2068
2074
|
.toList()
|
|
2069
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2070
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
|
|
2075
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2076
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"), parameters.object.languageIn.toList().flatMap((value) => [
|
|
2071
2077
|
value.length > 0
|
|
2072
2078
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2073
2079
|
if (itemIndex === 0) {
|
|
2074
2080
|
currentSubListResource = listResource;
|
|
2075
2081
|
}
|
|
2076
2082
|
else {
|
|
2077
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2078
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2083
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2084
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2079
2085
|
currentSubListResource = newSubListResource;
|
|
2080
2086
|
}
|
|
2081
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)],
|
|
2087
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
2082
2088
|
if (itemIndex + 1 === list.length) {
|
|
2083
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2089
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2084
2090
|
}
|
|
2085
2091
|
return { currentSubListResource, listResource };
|
|
2086
2092
|
}, {
|
|
2087
2093
|
currentSubListResource: null,
|
|
2088
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2094
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2089
2095
|
}).listResource.identifier
|
|
2090
2096
|
: $RdfVocabularies.rdf.nil,
|
|
2091
|
-
]),
|
|
2092
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
|
|
2097
|
+
]), parameters.graph);
|
|
2098
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"), parameters.object.maxCount
|
|
2093
2099
|
.toList()
|
|
2094
2100
|
.flatMap((value) => [
|
|
2095
2101
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2096
|
-
]),
|
|
2097
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
|
|
2098
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
|
|
2099
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
|
|
2102
|
+
]), parameters.graph);
|
|
2103
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"), parameters.object.maxExclusive.toList(), parameters.graph);
|
|
2104
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"), parameters.object.maxInclusive.toList(), parameters.graph);
|
|
2105
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"), parameters.object.maxLength
|
|
2100
2106
|
.toList()
|
|
2101
2107
|
.flatMap((value) => [
|
|
2102
2108
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2103
|
-
]),
|
|
2104
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
|
|
2109
|
+
]), parameters.graph);
|
|
2110
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"), parameters.object.minCount
|
|
2105
2111
|
.toList()
|
|
2106
2112
|
.flatMap((value) => [
|
|
2107
2113
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2108
|
-
]),
|
|
2109
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
|
|
2110
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
|
|
2111
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
|
|
2114
|
+
]), parameters.graph);
|
|
2115
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"), parameters.object.minExclusive.toList(), parameters.graph);
|
|
2116
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"), parameters.object.minInclusive.toList(), parameters.graph);
|
|
2117
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"), parameters.object.minLength
|
|
2112
2118
|
.toList()
|
|
2113
2119
|
.flatMap((value) => [
|
|
2114
2120
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2115
|
-
]),
|
|
2116
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
|
|
2121
|
+
]), parameters.graph);
|
|
2122
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#name"), parameters.object.name
|
|
2117
2123
|
.toList()
|
|
2118
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2119
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
2120
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
|
|
2121
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
|
|
2122
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
|
|
2124
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2125
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"), parameters.object.node.toList(), parameters.graph);
|
|
2126
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"), parameters.object.nodeKind.toList(), parameters.graph);
|
|
2127
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"), parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
2128
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"), parameters.object.or.toList().flatMap((value) => [
|
|
2123
2129
|
value.length > 0
|
|
2124
2130
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2125
2131
|
if (itemIndex === 0) {
|
|
2126
2132
|
currentSubListResource = listResource;
|
|
2127
2133
|
}
|
|
2128
2134
|
else {
|
|
2129
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2130
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2135
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2136
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2131
2137
|
currentSubListResource = newSubListResource;
|
|
2132
2138
|
}
|
|
2133
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2139
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2134
2140
|
if (itemIndex + 1 === list.length) {
|
|
2135
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2141
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2136
2142
|
}
|
|
2137
2143
|
return { currentSubListResource, listResource };
|
|
2138
2144
|
}, {
|
|
2139
2145
|
currentSubListResource: null,
|
|
2140
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2146
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2141
2147
|
}).listResource.identifier
|
|
2142
2148
|
: $RdfVocabularies.rdf.nil,
|
|
2143
|
-
]),
|
|
2144
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
|
|
2149
|
+
]), parameters.graph);
|
|
2150
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#order"), parameters.object.order
|
|
2145
2151
|
.toList()
|
|
2146
2152
|
.flatMap((value) => [
|
|
2147
2153
|
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
2148
|
-
]),
|
|
2149
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#path"), [
|
|
2150
|
-
$PropertyPath
|
|
2151
|
-
graph:
|
|
2152
|
-
resourceSet: resourceSet,
|
|
2154
|
+
]), parameters.graph);
|
|
2155
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#path"), [
|
|
2156
|
+
$PropertyPath.toRdfResource(parameters.object.path, {
|
|
2157
|
+
graph: parameters.graph,
|
|
2158
|
+
resourceSet: parameters.resourceSet,
|
|
2153
2159
|
}).identifier,
|
|
2154
|
-
],
|
|
2155
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
2156
|
-
|
|
2160
|
+
], parameters.graph);
|
|
2161
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"), parameters.object.patterns.flatMap((item) => [
|
|
2162
|
+
$literalFactory.string(item),
|
|
2163
|
+
]), parameters.graph);
|
|
2164
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"), parameters.object.uniqueLang
|
|
2157
2165
|
.toList()
|
|
2158
2166
|
.flatMap((value) => [
|
|
2159
2167
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2160
|
-
]),
|
|
2161
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
2168
|
+
]), parameters.graph);
|
|
2169
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"), parameters.object.xone.toList().flatMap((value) => [
|
|
2162
2170
|
value.length > 0
|
|
2163
2171
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2164
2172
|
if (itemIndex === 0) {
|
|
2165
2173
|
currentSubListResource = listResource;
|
|
2166
2174
|
}
|
|
2167
2175
|
else {
|
|
2168
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
2169
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
2176
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2177
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2170
2178
|
currentSubListResource = newSubListResource;
|
|
2171
2179
|
}
|
|
2172
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
2180
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2173
2181
|
if (itemIndex + 1 === list.length) {
|
|
2174
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
2182
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2175
2183
|
}
|
|
2176
2184
|
return { currentSubListResource, listResource };
|
|
2177
2185
|
}, {
|
|
2178
2186
|
currentSubListResource: null,
|
|
2179
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2187
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2180
2188
|
}).listResource.identifier
|
|
2181
2189
|
: $RdfVocabularies.rdf.nil,
|
|
2182
|
-
]),
|
|
2183
|
-
return resource;
|
|
2184
|
-
}
|
|
2185
|
-
PropertyShape
|
|
2186
|
-
function
|
|
2190
|
+
]), parameters.graph);
|
|
2191
|
+
return parameters.resource;
|
|
2192
|
+
};
|
|
2193
|
+
PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
|
|
2194
|
+
function _propertiesToStrings(_propertyShape) {
|
|
2187
2195
|
return $compactRecord({
|
|
2188
2196
|
$identifier: _propertyShape.$identifier().toString(),
|
|
2189
2197
|
label: _propertyShape.label.map((item) => item.toString()).extract(),
|
|
@@ -2191,15 +2199,15 @@ export var PropertyShape;
|
|
|
2191
2199
|
path: $PropertyPath.$toString(_propertyShape.path),
|
|
2192
2200
|
});
|
|
2193
2201
|
}
|
|
2194
|
-
PropertyShape
|
|
2202
|
+
PropertyShape._propertiesToStrings = _propertiesToStrings;
|
|
2195
2203
|
function $toString(_propertyShape) {
|
|
2196
|
-
return `PropertyShape(${JSON.stringify(
|
|
2204
|
+
return `PropertyShape(${JSON.stringify(_propertiesToStrings((_propertyShape ?? this)))})`;
|
|
2197
2205
|
}
|
|
2198
2206
|
PropertyShape.$toString = $toString;
|
|
2199
2207
|
})(PropertyShape || (PropertyShape = {}));
|
|
2200
2208
|
export var PropertyGroup;
|
|
2201
2209
|
(function (PropertyGroup) {
|
|
2202
|
-
function
|
|
2210
|
+
function create(parameters) {
|
|
2203
2211
|
const $identifierParameter = parameters?.$identifier;
|
|
2204
2212
|
let $identifier;
|
|
2205
2213
|
if (typeof $identifierParameter === "function") {
|
|
@@ -2247,13 +2255,13 @@ export var PropertyGroup;
|
|
|
2247
2255
|
}
|
|
2248
2256
|
return { $identifier, $type, comment, label };
|
|
2249
2257
|
}
|
|
2250
|
-
PropertyGroup
|
|
2251
|
-
let
|
|
2252
|
-
(function (
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
})(
|
|
2256
|
-
function
|
|
2258
|
+
PropertyGroup.create = create;
|
|
2259
|
+
let Identifier;
|
|
2260
|
+
(function (Identifier) {
|
|
2261
|
+
Identifier.parse = $parseIdentifier;
|
|
2262
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
2263
|
+
})(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
|
|
2264
|
+
function filter(filter, value) {
|
|
2257
2265
|
if (filter.$identifier !== undefined &&
|
|
2258
2266
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
2259
2267
|
return false;
|
|
@@ -2268,34 +2276,8 @@ export var PropertyGroup;
|
|
|
2268
2276
|
}
|
|
2269
2277
|
return true;
|
|
2270
2278
|
}
|
|
2271
|
-
PropertyGroup
|
|
2272
|
-
PropertyGroup
|
|
2273
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2274
|
-
if (!objectSet) {
|
|
2275
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
2276
|
-
}
|
|
2277
|
-
return PropertyGroup.$propertiesFromRdfResource(resource, {
|
|
2278
|
-
context,
|
|
2279
|
-
graph,
|
|
2280
|
-
ignoreRdfType,
|
|
2281
|
-
objectSet,
|
|
2282
|
-
preferredLanguages,
|
|
2283
|
-
}).map($create);
|
|
2284
|
-
};
|
|
2285
|
-
PropertyGroup.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2286
|
-
.toResource()
|
|
2287
|
-
.chain((resource) => PropertyGroup.$fromRdfResource(resource, options))));
|
|
2288
|
-
PropertyGroup.$fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
|
|
2289
|
-
function isPropertyGroup(object) {
|
|
2290
|
-
switch (object.$type) {
|
|
2291
|
-
case "PropertyGroup":
|
|
2292
|
-
return true;
|
|
2293
|
-
default:
|
|
2294
|
-
return false;
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
PropertyGroup.isPropertyGroup = isPropertyGroup;
|
|
2298
|
-
PropertyGroup.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
2279
|
+
PropertyGroup.filter = filter;
|
|
2280
|
+
PropertyGroup._fromRdfResource = ($resource, _$options) => {
|
|
2299
2281
|
return (!_$options.ignoreRdfType
|
|
2300
2282
|
? $resource
|
|
2301
2283
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -2307,7 +2289,7 @@ export var PropertyGroup;
|
|
|
2307
2289
|
return Right(true);
|
|
2308
2290
|
}
|
|
2309
2291
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
2310
|
-
if ($resource.isInstanceOf(PropertyGroup
|
|
2292
|
+
if ($resource.isInstanceOf(PropertyGroup.fromRdfType, {
|
|
2311
2293
|
graph: _$options.graph,
|
|
2312
2294
|
})) {
|
|
2313
2295
|
return Right(true);
|
|
@@ -2322,10 +2304,10 @@ export var PropertyGroup;
|
|
|
2322
2304
|
}).toValues())
|
|
2323
2305
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2324
2306
|
.chain((values) => values.head())
|
|
2325
|
-
.chain(($identifier) =>
|
|
2307
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
2326
2308
|
graph: _$options.graph,
|
|
2327
2309
|
resource: $resource,
|
|
2328
|
-
propertySchema: PropertyGroup
|
|
2310
|
+
propertySchema: PropertyGroup.schema.properties.comment,
|
|
2329
2311
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2330
2312
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2331
2313
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2333,13 +2315,13 @@ export var PropertyGroup;
|
|
|
2333
2315
|
? values.map((value) => Maybe.of(value))
|
|
2334
2316
|
: Resource.Values.fromValue({
|
|
2335
2317
|
focusResource: $resource,
|
|
2336
|
-
propertyPath: PropertyShape
|
|
2318
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
2337
2319
|
value: Maybe.empty(),
|
|
2338
2320
|
})),
|
|
2339
2321
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
2340
2322
|
graph: _$options.graph,
|
|
2341
2323
|
resource: $resource,
|
|
2342
|
-
propertySchema: PropertyGroup
|
|
2324
|
+
propertySchema: PropertyGroup.schema.properties.label,
|
|
2343
2325
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2344
2326
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2345
2327
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2347,12 +2329,26 @@ export var PropertyGroup;
|
|
|
2347
2329
|
? values.map((value) => Maybe.of(value))
|
|
2348
2330
|
: Resource.Values.fromValue({
|
|
2349
2331
|
focusResource: $resource,
|
|
2350
|
-
propertyPath: PropertyShape
|
|
2332
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2351
2333
|
value: Maybe.empty(),
|
|
2352
2334
|
})),
|
|
2353
|
-
}).map((label) => ({ $identifier,
|
|
2335
|
+
}).map((label) => create({ $identifier, comment, label })))));
|
|
2354
2336
|
};
|
|
2355
|
-
PropertyGroup
|
|
2337
|
+
PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
|
|
2338
|
+
PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2339
|
+
.toResource()
|
|
2340
|
+
.chain((resource) => PropertyGroup.fromRdfResource(resource, options))));
|
|
2341
|
+
PropertyGroup.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
|
|
2342
|
+
function isPropertyGroup(object) {
|
|
2343
|
+
switch (object.$type) {
|
|
2344
|
+
case "PropertyGroup":
|
|
2345
|
+
return true;
|
|
2346
|
+
default:
|
|
2347
|
+
return false;
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
PropertyGroup.isPropertyGroup = isPropertyGroup;
|
|
2351
|
+
PropertyGroup.schema = {
|
|
2356
2352
|
properties: {
|
|
2357
2353
|
$identifier: {
|
|
2358
2354
|
kind: "Identifier",
|
|
@@ -2383,40 +2379,34 @@ export var PropertyGroup;
|
|
|
2383
2379
|
},
|
|
2384
2380
|
},
|
|
2385
2381
|
};
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
dataFactory: dataFactory,
|
|
2390
|
-
dataset: datasetFactory.dataset(),
|
|
2391
|
-
});
|
|
2392
|
-
const resource = resourceSet.resource(_propertyGroup.$identifier());
|
|
2393
|
-
if (!options?.ignoreRdfType) {
|
|
2394
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), options?.graph);
|
|
2382
|
+
PropertyGroup._toRdfResource = (parameters) => {
|
|
2383
|
+
if (!parameters.ignoreRdfType) {
|
|
2384
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), parameters.graph);
|
|
2395
2385
|
}
|
|
2396
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
2386
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
2397
2387
|
.toList()
|
|
2398
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2399
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
2388
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2389
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
2400
2390
|
.toList()
|
|
2401
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2402
|
-
return resource;
|
|
2403
|
-
}
|
|
2404
|
-
PropertyGroup
|
|
2405
|
-
function
|
|
2391
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2392
|
+
return parameters.resource;
|
|
2393
|
+
};
|
|
2394
|
+
PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
|
|
2395
|
+
function _propertiesToStrings(_propertyGroup) {
|
|
2406
2396
|
return $compactRecord({
|
|
2407
2397
|
$identifier: _propertyGroup.$identifier().toString(),
|
|
2408
2398
|
label: _propertyGroup.label.map((item) => item.toString()).extract(),
|
|
2409
2399
|
});
|
|
2410
2400
|
}
|
|
2411
|
-
PropertyGroup
|
|
2401
|
+
PropertyGroup._propertiesToStrings = _propertiesToStrings;
|
|
2412
2402
|
function $toString(_propertyGroup) {
|
|
2413
|
-
return `PropertyGroup(${JSON.stringify(
|
|
2403
|
+
return `PropertyGroup(${JSON.stringify(_propertiesToStrings((_propertyGroup ?? this)))})`;
|
|
2414
2404
|
}
|
|
2415
2405
|
PropertyGroup.$toString = $toString;
|
|
2416
2406
|
})(PropertyGroup || (PropertyGroup = {}));
|
|
2417
2407
|
export var Ontology;
|
|
2418
2408
|
(function (Ontology) {
|
|
2419
|
-
function
|
|
2409
|
+
function create(parameters) {
|
|
2420
2410
|
const $identifierParameter = parameters?.$identifier;
|
|
2421
2411
|
let $identifier;
|
|
2422
2412
|
if (typeof $identifierParameter === "function") {
|
|
@@ -2464,13 +2454,13 @@ export var Ontology;
|
|
|
2464
2454
|
}
|
|
2465
2455
|
return { $identifier, $type, comment, label };
|
|
2466
2456
|
}
|
|
2467
|
-
Ontology
|
|
2468
|
-
let
|
|
2469
|
-
(function (
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
})(
|
|
2473
|
-
function
|
|
2457
|
+
Ontology.create = create;
|
|
2458
|
+
let Identifier;
|
|
2459
|
+
(function (Identifier) {
|
|
2460
|
+
Identifier.parse = $parseIdentifier;
|
|
2461
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
2462
|
+
})(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
|
|
2463
|
+
function filter(filter, value) {
|
|
2474
2464
|
if (filter.$identifier !== undefined &&
|
|
2475
2465
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
2476
2466
|
return false;
|
|
@@ -2485,34 +2475,8 @@ export var Ontology;
|
|
|
2485
2475
|
}
|
|
2486
2476
|
return true;
|
|
2487
2477
|
}
|
|
2488
|
-
Ontology
|
|
2489
|
-
Ontology
|
|
2490
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2491
|
-
if (!objectSet) {
|
|
2492
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
2493
|
-
}
|
|
2494
|
-
return Ontology.$propertiesFromRdfResource(resource, {
|
|
2495
|
-
context,
|
|
2496
|
-
graph,
|
|
2497
|
-
ignoreRdfType,
|
|
2498
|
-
objectSet,
|
|
2499
|
-
preferredLanguages,
|
|
2500
|
-
}).map($create);
|
|
2501
|
-
};
|
|
2502
|
-
Ontology.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2503
|
-
.toResource()
|
|
2504
|
-
.chain((resource) => Ontology.$fromRdfResource(resource, options))));
|
|
2505
|
-
Ontology.$fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
|
|
2506
|
-
function isOntology(object) {
|
|
2507
|
-
switch (object.$type) {
|
|
2508
|
-
case "Ontology":
|
|
2509
|
-
return true;
|
|
2510
|
-
default:
|
|
2511
|
-
return false;
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2514
|
-
Ontology.isOntology = isOntology;
|
|
2515
|
-
Ontology.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
2478
|
+
Ontology.filter = filter;
|
|
2479
|
+
Ontology._fromRdfResource = ($resource, _$options) => {
|
|
2516
2480
|
return (!_$options.ignoreRdfType
|
|
2517
2481
|
? $resource
|
|
2518
2482
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -2524,7 +2488,7 @@ export var Ontology;
|
|
|
2524
2488
|
return Right(true);
|
|
2525
2489
|
}
|
|
2526
2490
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
2527
|
-
if ($resource.isInstanceOf(Ontology
|
|
2491
|
+
if ($resource.isInstanceOf(Ontology.fromRdfType, {
|
|
2528
2492
|
graph: _$options.graph,
|
|
2529
2493
|
})) {
|
|
2530
2494
|
return Right(true);
|
|
@@ -2539,10 +2503,10 @@ export var Ontology;
|
|
|
2539
2503
|
}).toValues())
|
|
2540
2504
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2541
2505
|
.chain((values) => values.head())
|
|
2542
|
-
.chain(($identifier) =>
|
|
2506
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
2543
2507
|
graph: _$options.graph,
|
|
2544
2508
|
resource: $resource,
|
|
2545
|
-
propertySchema: Ontology
|
|
2509
|
+
propertySchema: Ontology.schema.properties.comment,
|
|
2546
2510
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2547
2511
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2548
2512
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2550,13 +2514,13 @@ export var Ontology;
|
|
|
2550
2514
|
? values.map((value) => Maybe.of(value))
|
|
2551
2515
|
: Resource.Values.fromValue({
|
|
2552
2516
|
focusResource: $resource,
|
|
2553
|
-
propertyPath: PropertyShape
|
|
2517
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
2554
2518
|
value: Maybe.empty(),
|
|
2555
2519
|
})),
|
|
2556
2520
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
2557
2521
|
graph: _$options.graph,
|
|
2558
2522
|
resource: $resource,
|
|
2559
|
-
propertySchema: Ontology
|
|
2523
|
+
propertySchema: Ontology.schema.properties.label,
|
|
2560
2524
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2561
2525
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2562
2526
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2564,12 +2528,26 @@ export var Ontology;
|
|
|
2564
2528
|
? values.map((value) => Maybe.of(value))
|
|
2565
2529
|
: Resource.Values.fromValue({
|
|
2566
2530
|
focusResource: $resource,
|
|
2567
|
-
propertyPath: PropertyShape
|
|
2531
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2568
2532
|
value: Maybe.empty(),
|
|
2569
2533
|
})),
|
|
2570
|
-
}).map((label) => ({ $identifier,
|
|
2534
|
+
}).map((label) => create({ $identifier, comment, label })))));
|
|
2571
2535
|
};
|
|
2572
|
-
Ontology
|
|
2536
|
+
Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
|
|
2537
|
+
Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2538
|
+
.toResource()
|
|
2539
|
+
.chain((resource) => Ontology.fromRdfResource(resource, options))));
|
|
2540
|
+
Ontology.fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
|
|
2541
|
+
function isOntology(object) {
|
|
2542
|
+
switch (object.$type) {
|
|
2543
|
+
case "Ontology":
|
|
2544
|
+
return true;
|
|
2545
|
+
default:
|
|
2546
|
+
return false;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
Ontology.isOntology = isOntology;
|
|
2550
|
+
Ontology.schema = {
|
|
2573
2551
|
properties: {
|
|
2574
2552
|
$identifier: {
|
|
2575
2553
|
kind: "Identifier",
|
|
@@ -2600,40 +2578,34 @@ export var Ontology;
|
|
|
2600
2578
|
},
|
|
2601
2579
|
},
|
|
2602
2580
|
};
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
dataFactory: dataFactory,
|
|
2607
|
-
dataset: datasetFactory.dataset(),
|
|
2608
|
-
});
|
|
2609
|
-
const resource = resourceSet.resource(_ontology.$identifier());
|
|
2610
|
-
if (!options?.ignoreRdfType) {
|
|
2611
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), options?.graph);
|
|
2581
|
+
Ontology._toRdfResource = (parameters) => {
|
|
2582
|
+
if (!parameters.ignoreRdfType) {
|
|
2583
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), parameters.graph);
|
|
2612
2584
|
}
|
|
2613
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
2585
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
2614
2586
|
.toList()
|
|
2615
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2616
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
2587
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2588
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
2617
2589
|
.toList()
|
|
2618
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
2619
|
-
return resource;
|
|
2620
|
-
}
|
|
2621
|
-
Ontology
|
|
2622
|
-
function
|
|
2590
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2591
|
+
return parameters.resource;
|
|
2592
|
+
};
|
|
2593
|
+
Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
|
|
2594
|
+
function _propertiesToStrings(_ontology) {
|
|
2623
2595
|
return $compactRecord({
|
|
2624
2596
|
$identifier: _ontology.$identifier().toString(),
|
|
2625
2597
|
label: _ontology.label.map((item) => item.toString()).extract(),
|
|
2626
2598
|
});
|
|
2627
2599
|
}
|
|
2628
|
-
Ontology
|
|
2600
|
+
Ontology._propertiesToStrings = _propertiesToStrings;
|
|
2629
2601
|
function $toString(_ontology) {
|
|
2630
|
-
return `Ontology(${JSON.stringify(
|
|
2602
|
+
return `Ontology(${JSON.stringify(_propertiesToStrings((_ontology ?? this)))})`;
|
|
2631
2603
|
}
|
|
2632
2604
|
Ontology.$toString = $toString;
|
|
2633
2605
|
})(Ontology || (Ontology = {}));
|
|
2634
2606
|
export var NodeShape;
|
|
2635
2607
|
(function (NodeShape) {
|
|
2636
|
-
function
|
|
2608
|
+
function create(parameters) {
|
|
2637
2609
|
const $identifierParameter = parameters?.$identifier;
|
|
2638
2610
|
let $identifier;
|
|
2639
2611
|
if (typeof $identifierParameter === "function") {
|
|
@@ -3193,13 +3165,13 @@ export var NodeShape;
|
|
|
3193
3165
|
xone,
|
|
3194
3166
|
};
|
|
3195
3167
|
}
|
|
3196
|
-
NodeShape
|
|
3197
|
-
let
|
|
3198
|
-
(function (
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
})(
|
|
3202
|
-
function
|
|
3168
|
+
NodeShape.create = create;
|
|
3169
|
+
let Identifier;
|
|
3170
|
+
(function (Identifier) {
|
|
3171
|
+
Identifier.parse = $parseIdentifier;
|
|
3172
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
3173
|
+
})(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
|
|
3174
|
+
function filter(filter, value) {
|
|
3203
3175
|
if (filter.$identifier !== undefined &&
|
|
3204
3176
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
3205
3177
|
return false;
|
|
@@ -3326,34 +3298,8 @@ export var NodeShape;
|
|
|
3326
3298
|
}
|
|
3327
3299
|
return true;
|
|
3328
3300
|
}
|
|
3329
|
-
NodeShape
|
|
3330
|
-
NodeShape
|
|
3331
|
-
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
3332
|
-
if (!objectSet) {
|
|
3333
|
-
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
3334
|
-
}
|
|
3335
|
-
return NodeShape.$propertiesFromRdfResource(resource, {
|
|
3336
|
-
context,
|
|
3337
|
-
graph,
|
|
3338
|
-
ignoreRdfType,
|
|
3339
|
-
objectSet,
|
|
3340
|
-
preferredLanguages,
|
|
3341
|
-
}).map($create);
|
|
3342
|
-
};
|
|
3343
|
-
NodeShape.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
3344
|
-
.toResource()
|
|
3345
|
-
.chain((resource) => NodeShape.$fromRdfResource(resource, options))));
|
|
3346
|
-
NodeShape.$fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
|
|
3347
|
-
function isNodeShape(object) {
|
|
3348
|
-
switch (object.$type) {
|
|
3349
|
-
case "NodeShape":
|
|
3350
|
-
return true;
|
|
3351
|
-
default:
|
|
3352
|
-
return false;
|
|
3353
|
-
}
|
|
3354
|
-
}
|
|
3355
|
-
NodeShape.isNodeShape = isNodeShape;
|
|
3356
|
-
NodeShape.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
3301
|
+
NodeShape.filter = filter;
|
|
3302
|
+
NodeShape._fromRdfResource = ($resource, _$options) => {
|
|
3357
3303
|
return (!_$options.ignoreRdfType
|
|
3358
3304
|
? $resource
|
|
3359
3305
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -3365,7 +3311,7 @@ export var NodeShape;
|
|
|
3365
3311
|
return Right(true);
|
|
3366
3312
|
}
|
|
3367
3313
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
3368
|
-
if ($resource.isInstanceOf(NodeShape
|
|
3314
|
+
if ($resource.isInstanceOf(NodeShape.fromRdfType, {
|
|
3369
3315
|
graph: _$options.graph,
|
|
3370
3316
|
})) {
|
|
3371
3317
|
return Right(true);
|
|
@@ -3380,15 +3326,15 @@ export var NodeShape;
|
|
|
3380
3326
|
}).toValues())
|
|
3381
3327
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3382
3328
|
.chain((values) => values.head())
|
|
3383
|
-
.chain(($identifier) =>
|
|
3329
|
+
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
3384
3330
|
graph: _$options.graph,
|
|
3385
3331
|
resource: $resource,
|
|
3386
|
-
propertySchema: NodeShape
|
|
3332
|
+
propertySchema: NodeShape.schema.properties.and,
|
|
3387
3333
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3388
3334
|
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3389
3335
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3390
3336
|
focusResource: $resource,
|
|
3391
|
-
propertyPath: PropertyShape
|
|
3337
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3392
3338
|
values: valueList.toArray(),
|
|
3393
3339
|
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3394
3340
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
@@ -3396,38 +3342,38 @@ export var NodeShape;
|
|
|
3396
3342
|
? values.map((value) => Maybe.of(value))
|
|
3397
3343
|
: Resource.Values.fromValue({
|
|
3398
3344
|
focusResource: $resource,
|
|
3399
|
-
propertyPath: PropertyShape
|
|
3345
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3400
3346
|
value: Maybe.empty(),
|
|
3401
3347
|
})),
|
|
3402
3348
|
}).chain((and) => $shaclPropertyFromRdf({
|
|
3403
3349
|
graph: _$options.graph,
|
|
3404
3350
|
resource: $resource,
|
|
3405
|
-
propertySchema: NodeShape
|
|
3351
|
+
propertySchema: NodeShape.schema.properties.classes,
|
|
3406
3352
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3407
3353
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3408
3354
|
.map((values) => values.toArray())
|
|
3409
3355
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3410
3356
|
focusResource: $resource,
|
|
3411
|
-
propertyPath: PropertyShape
|
|
3357
|
+
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
3412
3358
|
value: valuesArray,
|
|
3413
3359
|
})),
|
|
3414
3360
|
}).chain((classes) => $shaclPropertyFromRdf({
|
|
3415
3361
|
graph: _$options.graph,
|
|
3416
3362
|
resource: $resource,
|
|
3417
|
-
propertySchema: NodeShape
|
|
3363
|
+
propertySchema: NodeShape.schema.properties.closed,
|
|
3418
3364
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3419
3365
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3420
3366
|
.map((values) => values.length > 0
|
|
3421
3367
|
? values.map((value) => Maybe.of(value))
|
|
3422
3368
|
: Resource.Values.fromValue({
|
|
3423
3369
|
focusResource: $resource,
|
|
3424
|
-
propertyPath: NodeShape
|
|
3370
|
+
propertyPath: NodeShape.schema.properties.closed.path,
|
|
3425
3371
|
value: Maybe.empty(),
|
|
3426
3372
|
})),
|
|
3427
3373
|
}).chain((closed) => $shaclPropertyFromRdf({
|
|
3428
3374
|
graph: _$options.graph,
|
|
3429
3375
|
resource: $resource,
|
|
3430
|
-
propertySchema: NodeShape
|
|
3376
|
+
propertySchema: NodeShape.schema.properties.comment,
|
|
3431
3377
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3432
3378
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3433
3379
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -3435,54 +3381,53 @@ export var NodeShape;
|
|
|
3435
3381
|
? values.map((value) => Maybe.of(value))
|
|
3436
3382
|
: Resource.Values.fromValue({
|
|
3437
3383
|
focusResource: $resource,
|
|
3438
|
-
propertyPath: PropertyShape
|
|
3384
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
3439
3385
|
value: Maybe.empty(),
|
|
3440
3386
|
})),
|
|
3441
3387
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
3442
3388
|
graph: _$options.graph,
|
|
3443
3389
|
resource: $resource,
|
|
3444
|
-
propertySchema: NodeShape
|
|
3390
|
+
propertySchema: NodeShape.schema.properties.datatype,
|
|
3445
3391
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3446
3392
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3447
3393
|
.map((values) => values.length > 0
|
|
3448
3394
|
? values.map((value) => Maybe.of(value))
|
|
3449
3395
|
: Resource.Values.fromValue({
|
|
3450
3396
|
focusResource: $resource,
|
|
3451
|
-
propertyPath: PropertyShape
|
|
3452
|
-
.path,
|
|
3397
|
+
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
3453
3398
|
value: Maybe.empty(),
|
|
3454
3399
|
})),
|
|
3455
3400
|
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
3456
3401
|
graph: _$options.graph,
|
|
3457
3402
|
resource: $resource,
|
|
3458
|
-
propertySchema: NodeShape
|
|
3403
|
+
propertySchema: NodeShape.schema.properties.deactivated,
|
|
3459
3404
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3460
3405
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3461
3406
|
.map((values) => values.length > 0
|
|
3462
3407
|
? values.map((value) => Maybe.of(value))
|
|
3463
3408
|
: Resource.Values.fromValue({
|
|
3464
3409
|
focusResource: $resource,
|
|
3465
|
-
propertyPath: PropertyShape
|
|
3466
|
-
.
|
|
3410
|
+
propertyPath: PropertyShape.schema.properties.deactivated
|
|
3411
|
+
.path,
|
|
3467
3412
|
value: Maybe.empty(),
|
|
3468
3413
|
})),
|
|
3469
3414
|
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
3470
3415
|
graph: _$options.graph,
|
|
3471
3416
|
resource: $resource,
|
|
3472
|
-
propertySchema: NodeShape
|
|
3417
|
+
propertySchema: NodeShape.schema.properties.flags,
|
|
3473
3418
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3474
3419
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3475
3420
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3476
3421
|
.map((values) => values.toArray())
|
|
3477
3422
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3478
3423
|
focusResource: $resource,
|
|
3479
|
-
propertyPath: PropertyShape
|
|
3424
|
+
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
3480
3425
|
value: valuesArray,
|
|
3481
3426
|
})),
|
|
3482
3427
|
}).chain((flags) => $shaclPropertyFromRdf({
|
|
3483
3428
|
graph: _$options.graph,
|
|
3484
3429
|
resource: $resource,
|
|
3485
|
-
propertySchema: NodeShape
|
|
3430
|
+
propertySchema: NodeShape.schema.properties.hasValues,
|
|
3486
3431
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3487
3432
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
3488
3433
|
switch (term.termType) {
|
|
@@ -3494,27 +3439,27 @@ export var NodeShape;
|
|
|
3494
3439
|
actualValue: term,
|
|
3495
3440
|
expectedValueType: "(NamedNode | Literal)",
|
|
3496
3441
|
focusResource: $resource,
|
|
3497
|
-
propertyPath: PropertyShape
|
|
3498
|
-
.
|
|
3442
|
+
propertyPath: PropertyShape.schema.properties
|
|
3443
|
+
.hasValues.path,
|
|
3499
3444
|
}));
|
|
3500
3445
|
}
|
|
3501
3446
|
})))
|
|
3502
3447
|
.map((values) => values.toArray())
|
|
3503
3448
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3504
3449
|
focusResource: $resource,
|
|
3505
|
-
propertyPath: PropertyShape
|
|
3450
|
+
propertyPath: PropertyShape.schema.properties.hasValues
|
|
3506
3451
|
.path,
|
|
3507
3452
|
value: valuesArray,
|
|
3508
3453
|
})),
|
|
3509
3454
|
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
3510
3455
|
graph: _$options.graph,
|
|
3511
3456
|
resource: $resource,
|
|
3512
|
-
propertySchema: NodeShape
|
|
3457
|
+
propertySchema: NodeShape.schema.properties.ignoredProperties,
|
|
3513
3458
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3514
3459
|
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3515
3460
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3516
3461
|
focusResource: $resource,
|
|
3517
|
-
propertyPath: NodeShape
|
|
3462
|
+
propertyPath: NodeShape.schema.properties
|
|
3518
3463
|
.ignoredProperties.path,
|
|
3519
3464
|
values: valueList.toArray(),
|
|
3520
3465
|
})).chain((values) => values.chainMap((value) => value.toIri()))))
|
|
@@ -3523,22 +3468,20 @@ export var NodeShape;
|
|
|
3523
3468
|
? values.map((value) => Maybe.of(value))
|
|
3524
3469
|
: Resource.Values.fromValue({
|
|
3525
3470
|
focusResource: $resource,
|
|
3526
|
-
propertyPath: NodeShape
|
|
3471
|
+
propertyPath: NodeShape.schema.properties
|
|
3527
3472
|
.ignoredProperties.path,
|
|
3528
3473
|
value: Maybe.empty(),
|
|
3529
3474
|
})),
|
|
3530
3475
|
}).chain((ignoredProperties) => $shaclPropertyFromRdf({
|
|
3531
3476
|
graph: _$options.graph,
|
|
3532
3477
|
resource: $resource,
|
|
3533
|
-
propertySchema: NodeShape
|
|
3478
|
+
propertySchema: NodeShape.schema.properties.in_,
|
|
3534
3479
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3535
|
-
.chain((values) => values.chainMap((value) => value.toList({
|
|
3536
|
-
graph: _$options.graph,
|
|
3537
|
-
})))
|
|
3480
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3538
3481
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3539
3482
|
focusResource: $resource,
|
|
3540
|
-
propertyPath: PropertyShape
|
|
3541
|
-
.
|
|
3483
|
+
propertyPath: PropertyShape.schema.properties.in_
|
|
3484
|
+
.path,
|
|
3542
3485
|
values: valueList.toArray(),
|
|
3543
3486
|
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
3544
3487
|
switch (term.termType) {
|
|
@@ -3550,9 +3493,8 @@ export var NodeShape;
|
|
|
3550
3493
|
actualValue: term,
|
|
3551
3494
|
expectedValueType: "(NamedNode | Literal)",
|
|
3552
3495
|
focusResource: $resource,
|
|
3553
|
-
propertyPath: PropertyShape
|
|
3554
|
-
.properties.in_
|
|
3555
|
-
.path,
|
|
3496
|
+
propertyPath: PropertyShape.schema
|
|
3497
|
+
.properties.in_.path,
|
|
3556
3498
|
}));
|
|
3557
3499
|
}
|
|
3558
3500
|
})))))
|
|
@@ -3561,28 +3503,28 @@ export var NodeShape;
|
|
|
3561
3503
|
? values.map((value) => Maybe.of(value))
|
|
3562
3504
|
: Resource.Values.fromValue({
|
|
3563
3505
|
focusResource: $resource,
|
|
3564
|
-
propertyPath: PropertyShape
|
|
3565
|
-
.
|
|
3506
|
+
propertyPath: PropertyShape.schema.properties.in_
|
|
3507
|
+
.path,
|
|
3566
3508
|
value: Maybe.empty(),
|
|
3567
3509
|
})),
|
|
3568
3510
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
3569
3511
|
graph: _$options.graph,
|
|
3570
3512
|
resource: $resource,
|
|
3571
|
-
propertySchema: NodeShape
|
|
3513
|
+
propertySchema: NodeShape.schema.properties.isDefinedBy,
|
|
3572
3514
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3573
3515
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3574
3516
|
.map((values) => values.length > 0
|
|
3575
3517
|
? values.map((value) => Maybe.of(value))
|
|
3576
3518
|
: Resource.Values.fromValue({
|
|
3577
3519
|
focusResource: $resource,
|
|
3578
|
-
propertyPath: PropertyShape
|
|
3520
|
+
propertyPath: PropertyShape.schema.properties
|
|
3579
3521
|
.isDefinedBy.path,
|
|
3580
3522
|
value: Maybe.empty(),
|
|
3581
3523
|
})),
|
|
3582
3524
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
3583
3525
|
graph: _$options.graph,
|
|
3584
3526
|
resource: $resource,
|
|
3585
|
-
propertySchema: NodeShape
|
|
3527
|
+
propertySchema: NodeShape.schema.properties.label,
|
|
3586
3528
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3587
3529
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3588
3530
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -3590,23 +3532,22 @@ export var NodeShape;
|
|
|
3590
3532
|
? values.map((value) => Maybe.of(value))
|
|
3591
3533
|
: Resource.Values.fromValue({
|
|
3592
3534
|
focusResource: $resource,
|
|
3593
|
-
propertyPath: PropertyShape
|
|
3594
|
-
.
|
|
3535
|
+
propertyPath: PropertyShape.schema.properties
|
|
3536
|
+
.label.path,
|
|
3595
3537
|
value: Maybe.empty(),
|
|
3596
3538
|
})),
|
|
3597
3539
|
}).chain((label) => $shaclPropertyFromRdf({
|
|
3598
3540
|
graph: _$options.graph,
|
|
3599
3541
|
resource: $resource,
|
|
3600
|
-
propertySchema: NodeShape
|
|
3542
|
+
propertySchema: NodeShape.schema.properties.languageIn,
|
|
3601
3543
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3602
3544
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
3603
3545
|
graph: _$options.graph,
|
|
3604
3546
|
})))
|
|
3605
3547
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3606
3548
|
focusResource: $resource,
|
|
3607
|
-
propertyPath: PropertyShape
|
|
3608
|
-
.properties.languageIn
|
|
3609
|
-
.path,
|
|
3549
|
+
propertyPath: PropertyShape.schema
|
|
3550
|
+
.properties.languageIn.path,
|
|
3610
3551
|
values: valueList.toArray(),
|
|
3611
3552
|
}))
|
|
3612
3553
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -3616,30 +3557,28 @@ export var NodeShape;
|
|
|
3616
3557
|
? values.map((value) => Maybe.of(value))
|
|
3617
3558
|
: Resource.Values.fromValue({
|
|
3618
3559
|
focusResource: $resource,
|
|
3619
|
-
propertyPath: PropertyShape
|
|
3620
|
-
.properties.languageIn
|
|
3621
|
-
.path,
|
|
3560
|
+
propertyPath: PropertyShape.schema
|
|
3561
|
+
.properties.languageIn.path,
|
|
3622
3562
|
value: Maybe.empty(),
|
|
3623
3563
|
})),
|
|
3624
3564
|
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
3625
3565
|
graph: _$options.graph,
|
|
3626
3566
|
resource: $resource,
|
|
3627
|
-
propertySchema: NodeShape
|
|
3567
|
+
propertySchema: NodeShape.schema.properties.maxCount,
|
|
3628
3568
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3629
3569
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3630
3570
|
.map((values) => values.length > 0
|
|
3631
3571
|
? values.map((value) => Maybe.of(value))
|
|
3632
3572
|
: Resource.Values.fromValue({
|
|
3633
3573
|
focusResource: $resource,
|
|
3634
|
-
propertyPath: PropertyShape
|
|
3635
|
-
.properties.maxCount
|
|
3636
|
-
.path,
|
|
3574
|
+
propertyPath: PropertyShape.schema
|
|
3575
|
+
.properties.maxCount.path,
|
|
3637
3576
|
value: Maybe.empty(),
|
|
3638
3577
|
})),
|
|
3639
3578
|
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
3640
3579
|
graph: _$options.graph,
|
|
3641
3580
|
resource: $resource,
|
|
3642
|
-
propertySchema: NodeShape
|
|
3581
|
+
propertySchema: NodeShape.schema.properties.maxExclusive,
|
|
3643
3582
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3644
3583
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3645
3584
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -3647,15 +3586,15 @@ export var NodeShape;
|
|
|
3647
3586
|
? values.map((value) => Maybe.of(value))
|
|
3648
3587
|
: Resource.Values.fromValue({
|
|
3649
3588
|
focusResource: $resource,
|
|
3650
|
-
propertyPath: PropertyShape
|
|
3651
|
-
.properties
|
|
3652
|
-
.
|
|
3589
|
+
propertyPath: PropertyShape.schema
|
|
3590
|
+
.properties.maxExclusive
|
|
3591
|
+
.path,
|
|
3653
3592
|
value: Maybe.empty(),
|
|
3654
3593
|
})),
|
|
3655
3594
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
3656
3595
|
graph: _$options.graph,
|
|
3657
3596
|
resource: $resource,
|
|
3658
|
-
propertySchema: NodeShape
|
|
3597
|
+
propertySchema: NodeShape.schema.properties.maxInclusive,
|
|
3659
3598
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3660
3599
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3661
3600
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -3663,7 +3602,7 @@ export var NodeShape;
|
|
|
3663
3602
|
? values.map((value) => Maybe.of(value))
|
|
3664
3603
|
: Resource.Values.fromValue({
|
|
3665
3604
|
focusResource: $resource,
|
|
3666
|
-
propertyPath: PropertyShape
|
|
3605
|
+
propertyPath: PropertyShape.schema
|
|
3667
3606
|
.properties
|
|
3668
3607
|
.maxInclusive.path,
|
|
3669
3608
|
value: Maybe.empty(),
|
|
@@ -3671,15 +3610,14 @@ export var NodeShape;
|
|
|
3671
3610
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
3672
3611
|
graph: _$options.graph,
|
|
3673
3612
|
resource: $resource,
|
|
3674
|
-
propertySchema: NodeShape
|
|
3613
|
+
propertySchema: NodeShape.schema.properties.maxLength,
|
|
3675
3614
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3676
3615
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3677
3616
|
.map((values) => values.length > 0
|
|
3678
3617
|
? values.map((value) => Maybe.of(value))
|
|
3679
3618
|
: Resource.Values.fromValue({
|
|
3680
3619
|
focusResource: $resource,
|
|
3681
|
-
propertyPath: PropertyShape
|
|
3682
|
-
.$schema
|
|
3620
|
+
propertyPath: PropertyShape.schema
|
|
3683
3621
|
.properties
|
|
3684
3622
|
.maxLength.path,
|
|
3685
3623
|
value: Maybe.empty(),
|
|
@@ -3687,15 +3625,14 @@ export var NodeShape;
|
|
|
3687
3625
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
3688
3626
|
graph: _$options.graph,
|
|
3689
3627
|
resource: $resource,
|
|
3690
|
-
propertySchema: NodeShape
|
|
3628
|
+
propertySchema: NodeShape.schema.properties.minCount,
|
|
3691
3629
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3692
3630
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3693
3631
|
.map((values) => values.length > 0
|
|
3694
3632
|
? values.map((value) => Maybe.of(value))
|
|
3695
3633
|
: Resource.Values.fromValue({
|
|
3696
3634
|
focusResource: $resource,
|
|
3697
|
-
propertyPath: PropertyShape
|
|
3698
|
-
.$schema
|
|
3635
|
+
propertyPath: PropertyShape.schema
|
|
3699
3636
|
.properties
|
|
3700
3637
|
.minCount.path,
|
|
3701
3638
|
value: Maybe.empty(),
|
|
@@ -3703,7 +3640,7 @@ export var NodeShape;
|
|
|
3703
3640
|
}).chain((minCount) => $shaclPropertyFromRdf({
|
|
3704
3641
|
graph: _$options.graph,
|
|
3705
3642
|
resource: $resource,
|
|
3706
|
-
propertySchema: NodeShape
|
|
3643
|
+
propertySchema: NodeShape.schema.properties
|
|
3707
3644
|
.minExclusive,
|
|
3708
3645
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3709
3646
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -3713,7 +3650,7 @@ export var NodeShape;
|
|
|
3713
3650
|
: Resource.Values.fromValue({
|
|
3714
3651
|
focusResource: $resource,
|
|
3715
3652
|
propertyPath: PropertyShape
|
|
3716
|
-
|
|
3653
|
+
.schema
|
|
3717
3654
|
.properties
|
|
3718
3655
|
.minExclusive
|
|
3719
3656
|
.path,
|
|
@@ -3722,7 +3659,7 @@ export var NodeShape;
|
|
|
3722
3659
|
}).chain((minExclusive) => $shaclPropertyFromRdf({
|
|
3723
3660
|
graph: _$options.graph,
|
|
3724
3661
|
resource: $resource,
|
|
3725
|
-
propertySchema: NodeShape
|
|
3662
|
+
propertySchema: NodeShape.schema.properties
|
|
3726
3663
|
.minInclusive,
|
|
3727
3664
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3728
3665
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -3732,7 +3669,7 @@ export var NodeShape;
|
|
|
3732
3669
|
: Resource.Values.fromValue({
|
|
3733
3670
|
focusResource: $resource,
|
|
3734
3671
|
propertyPath: PropertyShape
|
|
3735
|
-
|
|
3672
|
+
.schema
|
|
3736
3673
|
.properties
|
|
3737
3674
|
.minInclusive
|
|
3738
3675
|
.path,
|
|
@@ -3741,7 +3678,7 @@ export var NodeShape;
|
|
|
3741
3678
|
}).chain((minInclusive) => $shaclPropertyFromRdf({
|
|
3742
3679
|
graph: _$options.graph,
|
|
3743
3680
|
resource: $resource,
|
|
3744
|
-
propertySchema: NodeShape
|
|
3681
|
+
propertySchema: NodeShape.schema.properties
|
|
3745
3682
|
.minLength,
|
|
3746
3683
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3747
3684
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
@@ -3750,7 +3687,7 @@ export var NodeShape;
|
|
|
3750
3687
|
: Resource.Values.fromValue({
|
|
3751
3688
|
focusResource: $resource,
|
|
3752
3689
|
propertyPath: PropertyShape
|
|
3753
|
-
|
|
3690
|
+
.schema
|
|
3754
3691
|
.properties
|
|
3755
3692
|
.minLength
|
|
3756
3693
|
.path,
|
|
@@ -3759,8 +3696,7 @@ export var NodeShape;
|
|
|
3759
3696
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
3760
3697
|
graph: _$options.graph,
|
|
3761
3698
|
resource: $resource,
|
|
3762
|
-
propertySchema: NodeShape
|
|
3763
|
-
.node,
|
|
3699
|
+
propertySchema: NodeShape.schema.properties.node,
|
|
3764
3700
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3765
3701
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3766
3702
|
.map((values) => values.length > 0
|
|
@@ -3768,7 +3704,7 @@ export var NodeShape;
|
|
|
3768
3704
|
: Resource.Values.fromValue({
|
|
3769
3705
|
focusResource: $resource,
|
|
3770
3706
|
propertyPath: PropertyShape
|
|
3771
|
-
|
|
3707
|
+
.schema
|
|
3772
3708
|
.properties
|
|
3773
3709
|
.node
|
|
3774
3710
|
.path,
|
|
@@ -3777,7 +3713,7 @@ export var NodeShape;
|
|
|
3777
3713
|
}).chain((node) => $shaclPropertyFromRdf({
|
|
3778
3714
|
graph: _$options.graph,
|
|
3779
3715
|
resource: $resource,
|
|
3780
|
-
propertySchema: NodeShape
|
|
3716
|
+
propertySchema: NodeShape.schema.properties
|
|
3781
3717
|
.nodeKind,
|
|
3782
3718
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3783
3719
|
.chain((values) => values.chainMap((value) => value.toIri([
|
|
@@ -3788,13 +3724,12 @@ export var NodeShape;
|
|
|
3788
3724
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
|
|
3789
3725
|
dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
|
|
3790
3726
|
])))
|
|
3791
|
-
.map((values) => values.length >
|
|
3792
|
-
0
|
|
3727
|
+
.map((values) => values.length > 0
|
|
3793
3728
|
? values.map((value) => Maybe.of(value))
|
|
3794
3729
|
: Resource.Values.fromValue({
|
|
3795
3730
|
focusResource: $resource,
|
|
3796
3731
|
propertyPath: PropertyShape
|
|
3797
|
-
|
|
3732
|
+
.schema
|
|
3798
3733
|
.properties
|
|
3799
3734
|
.nodeKind
|
|
3800
3735
|
.path,
|
|
@@ -3803,8 +3738,7 @@ export var NodeShape;
|
|
|
3803
3738
|
}).chain((nodeKind) => $shaclPropertyFromRdf({
|
|
3804
3739
|
graph: _$options.graph,
|
|
3805
3740
|
resource: $resource,
|
|
3806
|
-
propertySchema: NodeShape
|
|
3807
|
-
.properties
|
|
3741
|
+
propertySchema: NodeShape.schema.properties
|
|
3808
3742
|
.not,
|
|
3809
3743
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3810
3744
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
@@ -3812,7 +3746,7 @@ export var NodeShape;
|
|
|
3812
3746
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3813
3747
|
focusResource: $resource,
|
|
3814
3748
|
propertyPath: PropertyShape
|
|
3815
|
-
|
|
3749
|
+
.schema
|
|
3816
3750
|
.properties
|
|
3817
3751
|
.not
|
|
3818
3752
|
.path,
|
|
@@ -3821,7 +3755,7 @@ export var NodeShape;
|
|
|
3821
3755
|
}).chain((not) => $shaclPropertyFromRdf({
|
|
3822
3756
|
graph: _$options.graph,
|
|
3823
3757
|
resource: $resource,
|
|
3824
|
-
propertySchema: NodeShape
|
|
3758
|
+
propertySchema: NodeShape.schema
|
|
3825
3759
|
.properties
|
|
3826
3760
|
.or,
|
|
3827
3761
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3831,7 +3765,7 @@ export var NodeShape;
|
|
|
3831
3765
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3832
3766
|
focusResource: $resource,
|
|
3833
3767
|
propertyPath: PropertyShape
|
|
3834
|
-
|
|
3768
|
+
.schema
|
|
3835
3769
|
.properties
|
|
3836
3770
|
.or
|
|
3837
3771
|
.path,
|
|
@@ -3844,7 +3778,7 @@ export var NodeShape;
|
|
|
3844
3778
|
: Resource.Values.fromValue({
|
|
3845
3779
|
focusResource: $resource,
|
|
3846
3780
|
propertyPath: PropertyShape
|
|
3847
|
-
|
|
3781
|
+
.schema
|
|
3848
3782
|
.properties
|
|
3849
3783
|
.or
|
|
3850
3784
|
.path,
|
|
@@ -3853,7 +3787,7 @@ export var NodeShape;
|
|
|
3853
3787
|
}).chain((or) => $shaclPropertyFromRdf({
|
|
3854
3788
|
graph: _$options.graph,
|
|
3855
3789
|
resource: $resource,
|
|
3856
|
-
propertySchema: NodeShape
|
|
3790
|
+
propertySchema: NodeShape.schema
|
|
3857
3791
|
.properties
|
|
3858
3792
|
.patterns,
|
|
3859
3793
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3863,7 +3797,7 @@ export var NodeShape;
|
|
|
3863
3797
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3864
3798
|
focusResource: $resource,
|
|
3865
3799
|
propertyPath: PropertyShape
|
|
3866
|
-
|
|
3800
|
+
.schema
|
|
3867
3801
|
.properties
|
|
3868
3802
|
.patterns
|
|
3869
3803
|
.path,
|
|
@@ -3872,7 +3806,7 @@ export var NodeShape;
|
|
|
3872
3806
|
}).chain((patterns) => $shaclPropertyFromRdf({
|
|
3873
3807
|
graph: _$options.graph,
|
|
3874
3808
|
resource: $resource,
|
|
3875
|
-
propertySchema: NodeShape
|
|
3809
|
+
propertySchema: NodeShape.schema
|
|
3876
3810
|
.properties
|
|
3877
3811
|
.properties,
|
|
3878
3812
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3881,7 +3815,7 @@ export var NodeShape;
|
|
|
3881
3815
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3882
3816
|
focusResource: $resource,
|
|
3883
3817
|
propertyPath: NodeShape
|
|
3884
|
-
|
|
3818
|
+
.schema
|
|
3885
3819
|
.properties
|
|
3886
3820
|
.properties
|
|
3887
3821
|
.path,
|
|
@@ -3890,7 +3824,7 @@ export var NodeShape;
|
|
|
3890
3824
|
}).chain((properties) => $shaclPropertyFromRdf({
|
|
3891
3825
|
graph: _$options.graph,
|
|
3892
3826
|
resource: $resource,
|
|
3893
|
-
propertySchema: NodeShape
|
|
3827
|
+
propertySchema: NodeShape.schema
|
|
3894
3828
|
.properties
|
|
3895
3829
|
.subClassOf,
|
|
3896
3830
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3899,7 +3833,7 @@ export var NodeShape;
|
|
|
3899
3833
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3900
3834
|
focusResource: $resource,
|
|
3901
3835
|
propertyPath: NodeShape
|
|
3902
|
-
|
|
3836
|
+
.schema
|
|
3903
3837
|
.properties
|
|
3904
3838
|
.subClassOf
|
|
3905
3839
|
.path,
|
|
@@ -3908,7 +3842,7 @@ export var NodeShape;
|
|
|
3908
3842
|
}).chain((subClassOf) => $shaclPropertyFromRdf({
|
|
3909
3843
|
graph: _$options.graph,
|
|
3910
3844
|
resource: $resource,
|
|
3911
|
-
propertySchema: NodeShape
|
|
3845
|
+
propertySchema: NodeShape.schema
|
|
3912
3846
|
.properties
|
|
3913
3847
|
.types,
|
|
3914
3848
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3917,7 +3851,7 @@ export var NodeShape;
|
|
|
3917
3851
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3918
3852
|
focusResource: $resource,
|
|
3919
3853
|
propertyPath: NodeShape
|
|
3920
|
-
|
|
3854
|
+
.schema
|
|
3921
3855
|
.properties
|
|
3922
3856
|
.types
|
|
3923
3857
|
.path,
|
|
@@ -3926,7 +3860,7 @@ export var NodeShape;
|
|
|
3926
3860
|
}).chain((types) => $shaclPropertyFromRdf({
|
|
3927
3861
|
graph: _$options.graph,
|
|
3928
3862
|
resource: $resource,
|
|
3929
|
-
propertySchema: NodeShape
|
|
3863
|
+
propertySchema: NodeShape.schema
|
|
3930
3864
|
.properties
|
|
3931
3865
|
.xone,
|
|
3932
3866
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3936,7 +3870,7 @@ export var NodeShape;
|
|
|
3936
3870
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3937
3871
|
focusResource: $resource,
|
|
3938
3872
|
propertyPath: PropertyShape
|
|
3939
|
-
|
|
3873
|
+
.schema
|
|
3940
3874
|
.properties
|
|
3941
3875
|
.xone
|
|
3942
3876
|
.path,
|
|
@@ -3949,15 +3883,14 @@ export var NodeShape;
|
|
|
3949
3883
|
: Resource.Values.fromValue({
|
|
3950
3884
|
focusResource: $resource,
|
|
3951
3885
|
propertyPath: PropertyShape
|
|
3952
|
-
|
|
3886
|
+
.schema
|
|
3953
3887
|
.properties
|
|
3954
3888
|
.xone
|
|
3955
3889
|
.path,
|
|
3956
3890
|
value: Maybe.empty(),
|
|
3957
3891
|
})),
|
|
3958
|
-
}).map((xone) => ({
|
|
3892
|
+
}).map((xone) => create({
|
|
3959
3893
|
$identifier,
|
|
3960
|
-
$type,
|
|
3961
3894
|
and,
|
|
3962
3895
|
classes,
|
|
3963
3896
|
closed,
|
|
@@ -3988,9 +3921,23 @@ export var NodeShape;
|
|
|
3988
3921
|
subClassOf,
|
|
3989
3922
|
types,
|
|
3990
3923
|
xone,
|
|
3991
|
-
})))))))))))))))))))))))))))))))))
|
|
3924
|
+
})))))))))))))))))))))))))))))))));
|
|
3992
3925
|
};
|
|
3993
|
-
NodeShape
|
|
3926
|
+
NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
|
|
3927
|
+
NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
3928
|
+
.toResource()
|
|
3929
|
+
.chain((resource) => NodeShape.fromRdfResource(resource, options))));
|
|
3930
|
+
NodeShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
|
|
3931
|
+
function isNodeShape(object) {
|
|
3932
|
+
switch (object.$type) {
|
|
3933
|
+
case "NodeShape":
|
|
3934
|
+
return true;
|
|
3935
|
+
default:
|
|
3936
|
+
return false;
|
|
3937
|
+
}
|
|
3938
|
+
}
|
|
3939
|
+
NodeShape.isNodeShape = isNodeShape;
|
|
3940
|
+
NodeShape.schema = {
|
|
3994
3941
|
properties: {
|
|
3995
3942
|
$identifier: {
|
|
3996
3943
|
kind: "Identifier",
|
|
@@ -4273,246 +4220,251 @@ export var NodeShape;
|
|
|
4273
4220
|
},
|
|
4274
4221
|
},
|
|
4275
4222
|
};
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
dataFactory: dataFactory,
|
|
4280
|
-
dataset: datasetFactory.dataset(),
|
|
4281
|
-
});
|
|
4282
|
-
const resource = resourceSet.resource(_nodeShape.$identifier());
|
|
4283
|
-
if (!options?.ignoreRdfType) {
|
|
4284
|
-
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), options?.graph);
|
|
4223
|
+
NodeShape._toRdfResource = (parameters) => {
|
|
4224
|
+
if (!parameters.ignoreRdfType) {
|
|
4225
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), parameters.graph);
|
|
4285
4226
|
}
|
|
4286
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
|
|
4227
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#and"), parameters.object.and.toList().flatMap((value) => [
|
|
4287
4228
|
value.length > 0
|
|
4288
4229
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
4289
4230
|
if (itemIndex === 0) {
|
|
4290
4231
|
currentSubListResource = listResource;
|
|
4291
4232
|
}
|
|
4292
4233
|
else {
|
|
4293
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
4294
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
4234
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
4235
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
4295
4236
|
currentSubListResource = newSubListResource;
|
|
4296
4237
|
}
|
|
4297
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
4238
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
4298
4239
|
if (itemIndex + 1 === list.length) {
|
|
4299
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
4240
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
4300
4241
|
}
|
|
4301
4242
|
return { currentSubListResource, listResource };
|
|
4302
4243
|
}, {
|
|
4303
4244
|
currentSubListResource: null,
|
|
4304
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4245
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4305
4246
|
}).listResource.identifier
|
|
4306
4247
|
: $RdfVocabularies.rdf.nil,
|
|
4307
|
-
]),
|
|
4308
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
4309
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
|
|
4248
|
+
]), parameters.graph);
|
|
4249
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#class"), parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
4250
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"), parameters.object.closed
|
|
4310
4251
|
.toList()
|
|
4311
4252
|
.flatMap((value) => [
|
|
4312
4253
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
4313
|
-
]),
|
|
4314
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
4254
|
+
]), parameters.graph);
|
|
4255
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"), parameters.object.comment
|
|
4315
4256
|
.toList()
|
|
4316
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
4317
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"),
|
|
4318
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"),
|
|
4257
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
4258
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#datatype"), parameters.object.datatype.toList(), parameters.graph);
|
|
4259
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#deactivated"), parameters.object.deactivated
|
|
4319
4260
|
.toList()
|
|
4320
4261
|
.flatMap((value) => [
|
|
4321
4262
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
4322
|
-
]),
|
|
4323
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
|
|
4324
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
|
|
4325
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
|
|
4263
|
+
]), parameters.graph);
|
|
4264
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"), parameters.object.flags.flatMap((item) => [$literalFactory.string(item)]), parameters.graph);
|
|
4265
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"), parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
4266
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"), parameters.object.ignoredProperties.toList().flatMap((value) => [
|
|
4326
4267
|
value.length > 0
|
|
4327
4268
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
4328
4269
|
if (itemIndex === 0) {
|
|
4329
4270
|
currentSubListResource = listResource;
|
|
4330
4271
|
}
|
|
4331
4272
|
else {
|
|
4332
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
4333
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
4273
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
4274
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
4334
4275
|
currentSubListResource = newSubListResource;
|
|
4335
4276
|
}
|
|
4336
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
4277
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
4337
4278
|
if (itemIndex + 1 === list.length) {
|
|
4338
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
4279
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
4339
4280
|
}
|
|
4340
4281
|
return { currentSubListResource, listResource };
|
|
4341
4282
|
}, {
|
|
4342
4283
|
currentSubListResource: null,
|
|
4343
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4284
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4344
4285
|
}).listResource.identifier
|
|
4345
4286
|
: $RdfVocabularies.rdf.nil,
|
|
4346
|
-
]),
|
|
4347
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"),
|
|
4287
|
+
]), parameters.graph);
|
|
4288
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#in"), parameters.object.in_.toList().flatMap((value) => [
|
|
4348
4289
|
value.length > 0
|
|
4349
4290
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
4350
4291
|
if (itemIndex === 0) {
|
|
4351
4292
|
currentSubListResource = listResource;
|
|
4352
4293
|
}
|
|
4353
4294
|
else {
|
|
4354
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
4355
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
4295
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
4296
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
4356
4297
|
currentSubListResource = newSubListResource;
|
|
4357
4298
|
}
|
|
4358
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
4299
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
4359
4300
|
if (itemIndex + 1 === list.length) {
|
|
4360
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
4301
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
4361
4302
|
}
|
|
4362
4303
|
return { currentSubListResource, listResource };
|
|
4363
4304
|
}, {
|
|
4364
4305
|
currentSubListResource: null,
|
|
4365
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4306
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4366
4307
|
}).listResource.identifier
|
|
4367
4308
|
: $RdfVocabularies.rdf.nil,
|
|
4368
|
-
]),
|
|
4369
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"),
|
|
4370
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),
|
|
4309
|
+
]), parameters.graph);
|
|
4310
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#isDefinedBy"), parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
4311
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), parameters.object.label
|
|
4371
4312
|
.toList()
|
|
4372
|
-
.flatMap((value) => [$literalFactory.string(value)]),
|
|
4373
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"),
|
|
4313
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
4314
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#languageIn"), parameters.object.languageIn.toList().flatMap((value) => [
|
|
4374
4315
|
value.length > 0
|
|
4375
4316
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
4376
4317
|
if (itemIndex === 0) {
|
|
4377
4318
|
currentSubListResource = listResource;
|
|
4378
4319
|
}
|
|
4379
4320
|
else {
|
|
4380
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
4381
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
4321
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
4322
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
4382
4323
|
currentSubListResource = newSubListResource;
|
|
4383
4324
|
}
|
|
4384
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)],
|
|
4325
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [$literalFactory.string(item)], parameters.graph);
|
|
4385
4326
|
if (itemIndex + 1 === list.length) {
|
|
4386
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
4327
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
4387
4328
|
}
|
|
4388
4329
|
return { currentSubListResource, listResource };
|
|
4389
4330
|
}, {
|
|
4390
4331
|
currentSubListResource: null,
|
|
4391
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4332
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4392
4333
|
}).listResource.identifier
|
|
4393
4334
|
: $RdfVocabularies.rdf.nil,
|
|
4394
|
-
]),
|
|
4395
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
|
|
4335
|
+
]), parameters.graph);
|
|
4336
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"), parameters.object.maxCount
|
|
4396
4337
|
.toList()
|
|
4397
4338
|
.flatMap((value) => [
|
|
4398
4339
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
4399
|
-
]),
|
|
4400
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
|
|
4401
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"),
|
|
4402
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"),
|
|
4340
|
+
]), parameters.graph);
|
|
4341
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"), parameters.object.maxExclusive.toList(), parameters.graph);
|
|
4342
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxInclusive"), parameters.object.maxInclusive.toList(), parameters.graph);
|
|
4343
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#maxLength"), parameters.object.maxLength
|
|
4403
4344
|
.toList()
|
|
4404
4345
|
.flatMap((value) => [
|
|
4405
4346
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
4406
|
-
]),
|
|
4407
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
|
|
4347
|
+
]), parameters.graph);
|
|
4348
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"), parameters.object.minCount
|
|
4408
4349
|
.toList()
|
|
4409
4350
|
.flatMap((value) => [
|
|
4410
4351
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
4411
|
-
]),
|
|
4412
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"),
|
|
4413
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"),
|
|
4414
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"),
|
|
4352
|
+
]), parameters.graph);
|
|
4353
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minExclusive"), parameters.object.minExclusive.toList(), parameters.graph);
|
|
4354
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minInclusive"), parameters.object.minInclusive.toList(), parameters.graph);
|
|
4355
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#minLength"), parameters.object.minLength
|
|
4415
4356
|
.toList()
|
|
4416
4357
|
.flatMap((value) => [
|
|
4417
4358
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
4418
|
-
]),
|
|
4419
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
4420
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"),
|
|
4421
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"),
|
|
4422
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"),
|
|
4359
|
+
]), parameters.graph);
|
|
4360
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#node"), parameters.object.node.toList(), parameters.graph);
|
|
4361
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind"), parameters.object.nodeKind.toList(), parameters.graph);
|
|
4362
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#not"), parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
4363
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#or"), parameters.object.or.toList().flatMap((value) => [
|
|
4423
4364
|
value.length > 0
|
|
4424
4365
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
4425
4366
|
if (itemIndex === 0) {
|
|
4426
4367
|
currentSubListResource = listResource;
|
|
4427
4368
|
}
|
|
4428
4369
|
else {
|
|
4429
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
4430
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
4370
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
4371
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
4431
4372
|
currentSubListResource = newSubListResource;
|
|
4432
4373
|
}
|
|
4433
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
4374
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
4434
4375
|
if (itemIndex + 1 === list.length) {
|
|
4435
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
4376
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
4436
4377
|
}
|
|
4437
4378
|
return { currentSubListResource, listResource };
|
|
4438
4379
|
}, {
|
|
4439
4380
|
currentSubListResource: null,
|
|
4440
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4381
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4441
4382
|
}).listResource.identifier
|
|
4442
4383
|
: $RdfVocabularies.rdf.nil,
|
|
4443
|
-
]),
|
|
4444
|
-
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
resource.add(
|
|
4448
|
-
resource.add(
|
|
4384
|
+
]), parameters.graph);
|
|
4385
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"), parameters.object.patterns.flatMap((item) => [
|
|
4386
|
+
$literalFactory.string(item),
|
|
4387
|
+
]), parameters.graph);
|
|
4388
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#property"), parameters.object.properties.flatMap((item) => [item]), parameters.graph);
|
|
4389
|
+
parameters.resource.add($RdfVocabularies.rdfs.subClassOf, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
|
|
4390
|
+
parameters.resource.add($RdfVocabularies.rdf.type, parameters.object.types.flatMap((item) => [item]), parameters.graph);
|
|
4391
|
+
parameters.resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"), parameters.object.xone.toList().flatMap((value) => [
|
|
4449
4392
|
value.length > 0
|
|
4450
4393
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
4451
4394
|
if (itemIndex === 0) {
|
|
4452
4395
|
currentSubListResource = listResource;
|
|
4453
4396
|
}
|
|
4454
4397
|
else {
|
|
4455
|
-
const newSubListResource = resourceSet.resource((() => dataFactory.blankNode())());
|
|
4456
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier,
|
|
4398
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
4399
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
4457
4400
|
currentSubListResource = newSubListResource;
|
|
4458
4401
|
}
|
|
4459
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item],
|
|
4402
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
4460
4403
|
if (itemIndex + 1 === list.length) {
|
|
4461
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil,
|
|
4404
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
4462
4405
|
}
|
|
4463
4406
|
return { currentSubListResource, listResource };
|
|
4464
4407
|
}, {
|
|
4465
4408
|
currentSubListResource: null,
|
|
4466
|
-
listResource: resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4409
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
4467
4410
|
}).listResource.identifier
|
|
4468
4411
|
: $RdfVocabularies.rdf.nil,
|
|
4469
|
-
]),
|
|
4470
|
-
return resource;
|
|
4471
|
-
}
|
|
4472
|
-
NodeShape
|
|
4473
|
-
function
|
|
4412
|
+
]), parameters.graph);
|
|
4413
|
+
return parameters.resource;
|
|
4414
|
+
};
|
|
4415
|
+
NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
|
|
4416
|
+
function _propertiesToStrings(_nodeShape) {
|
|
4474
4417
|
return $compactRecord({
|
|
4475
4418
|
$identifier: _nodeShape.$identifier().toString(),
|
|
4476
4419
|
label: _nodeShape.label.map((item) => item.toString()).extract(),
|
|
4477
4420
|
});
|
|
4478
4421
|
}
|
|
4479
|
-
NodeShape
|
|
4422
|
+
NodeShape._propertiesToStrings = _propertiesToStrings;
|
|
4480
4423
|
function $toString(_nodeShape) {
|
|
4481
|
-
return `NodeShape(${JSON.stringify(
|
|
4424
|
+
return `NodeShape(${JSON.stringify(_propertiesToStrings((_nodeShape ?? this)))})`;
|
|
4482
4425
|
}
|
|
4483
4426
|
NodeShape.$toString = $toString;
|
|
4484
4427
|
})(NodeShape || (NodeShape = {}));
|
|
4485
4428
|
export var Shape;
|
|
4486
4429
|
(function (Shape) {
|
|
4487
|
-
Shape.$
|
|
4430
|
+
Shape.$toString = (value) => {
|
|
4431
|
+
if (NodeShape.isNodeShape(value)) {
|
|
4432
|
+
return NodeShape.$toString(value);
|
|
4433
|
+
}
|
|
4434
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
4435
|
+
return PropertyShape.$toString(value);
|
|
4436
|
+
}
|
|
4437
|
+
throw new Error("unable to serialize to string");
|
|
4438
|
+
};
|
|
4439
|
+
Shape.filter = (filter, value) => {
|
|
4488
4440
|
if (filter.$identifier !== undefined &&
|
|
4489
4441
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
4490
4442
|
return false;
|
|
4491
4443
|
}
|
|
4492
4444
|
if (filter.on?.["NodeShape"] !== undefined &&
|
|
4493
4445
|
NodeShape.isNodeShape(value)) {
|
|
4494
|
-
if (!NodeShape
|
|
4446
|
+
if (!NodeShape.filter(filter.on["NodeShape"], value)) {
|
|
4495
4447
|
return false;
|
|
4496
4448
|
}
|
|
4497
4449
|
}
|
|
4498
4450
|
if (filter.on?.["PropertyShape"] !== undefined &&
|
|
4499
4451
|
PropertyShape.isPropertyShape(value)) {
|
|
4500
|
-
if (!PropertyShape
|
|
4452
|
+
if (!PropertyShape.filter(filter.on["PropertyShape"], value)) {
|
|
4501
4453
|
return false;
|
|
4502
4454
|
}
|
|
4503
4455
|
}
|
|
4504
4456
|
return true;
|
|
4505
4457
|
};
|
|
4506
|
-
Shape
|
|
4458
|
+
Shape.fromRdfResource = (resource, options) => NodeShape.fromRdfResource(resource, {
|
|
4507
4459
|
...options,
|
|
4508
4460
|
ignoreRdfType: false,
|
|
4509
|
-
}).altLazy(() => PropertyShape
|
|
4461
|
+
}).altLazy(() => PropertyShape.fromRdfResource(resource, {
|
|
4510
4462
|
...options,
|
|
4511
4463
|
ignoreRdfType: false,
|
|
4512
4464
|
}));
|
|
4513
|
-
Shape
|
|
4465
|
+
Shape.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
|
|
4514
4466
|
const valueAsValues = Right(value.toValues());
|
|
4515
|
-
return NodeShape
|
|
4467
|
+
return NodeShape.fromRdfResourceValues(valueAsValues, {
|
|
4516
4468
|
context: _options.context,
|
|
4517
4469
|
graph: _options.graph,
|
|
4518
4470
|
ignoreRdfType: false,
|
|
@@ -4521,7 +4473,7 @@ export var Shape;
|
|
|
4521
4473
|
propertyPath: _options.propertyPath,
|
|
4522
4474
|
resource: _options.resource,
|
|
4523
4475
|
})
|
|
4524
|
-
.altLazy(() => PropertyShape
|
|
4476
|
+
.altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
|
|
4525
4477
|
context: _options.context,
|
|
4526
4478
|
graph: _options.graph,
|
|
4527
4479
|
ignoreRdfType: false,
|
|
@@ -4532,18 +4484,22 @@ export var Shape;
|
|
|
4532
4484
|
}))
|
|
4533
4485
|
.chain((values) => values.head());
|
|
4534
4486
|
})));
|
|
4535
|
-
let
|
|
4536
|
-
(function (
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
})(
|
|
4540
|
-
|
|
4487
|
+
let Identifier;
|
|
4488
|
+
(function (Identifier) {
|
|
4489
|
+
Identifier.parse = $parseIdentifier;
|
|
4490
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
4491
|
+
})(Identifier = Shape.Identifier || (Shape.Identifier = {}));
|
|
4492
|
+
function isShape(object) {
|
|
4493
|
+
return (NodeShape.isNodeShape(object) || PropertyShape.isPropertyShape(object));
|
|
4494
|
+
}
|
|
4495
|
+
Shape.isShape = isShape;
|
|
4496
|
+
Shape.schema = {
|
|
4541
4497
|
kind: "NamedObjectUnion",
|
|
4542
4498
|
members: {
|
|
4543
|
-
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape
|
|
4499
|
+
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.schema },
|
|
4544
4500
|
PropertyShape: {
|
|
4545
4501
|
discriminantValues: ["PropertyShape"],
|
|
4546
|
-
type: PropertyShape
|
|
4502
|
+
type: PropertyShape.schema,
|
|
4547
4503
|
},
|
|
4548
4504
|
},
|
|
4549
4505
|
properties: {
|
|
@@ -4774,19 +4730,19 @@ export var Shape;
|
|
|
4774
4730
|
},
|
|
4775
4731
|
},
|
|
4776
4732
|
};
|
|
4777
|
-
Shape
|
|
4778
|
-
if (NodeShape.isNodeShape(
|
|
4779
|
-
return NodeShape
|
|
4733
|
+
Shape.toRdfResource = (object, options) => {
|
|
4734
|
+
if (NodeShape.isNodeShape(object)) {
|
|
4735
|
+
return NodeShape.toRdfResource(object, options);
|
|
4780
4736
|
}
|
|
4781
|
-
if (PropertyShape.isPropertyShape(
|
|
4782
|
-
return PropertyShape
|
|
4737
|
+
if (PropertyShape.isPropertyShape(object)) {
|
|
4738
|
+
return PropertyShape.toRdfResource(object, options);
|
|
4783
4739
|
}
|
|
4784
4740
|
throw new Error("unrecognized type");
|
|
4785
4741
|
};
|
|
4786
|
-
Shape
|
|
4742
|
+
Shape.toRdfResourceValues = ((value, _options) => {
|
|
4787
4743
|
if (NodeShape.isNodeShape(value)) {
|
|
4788
4744
|
return [
|
|
4789
|
-
NodeShape
|
|
4745
|
+
NodeShape.toRdfResource(value, {
|
|
4790
4746
|
graph: _options.graph,
|
|
4791
4747
|
resourceSet: _options.resourceSet,
|
|
4792
4748
|
}).identifier,
|
|
@@ -4794,7 +4750,7 @@ export var Shape;
|
|
|
4794
4750
|
}
|
|
4795
4751
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4796
4752
|
return [
|
|
4797
|
-
PropertyShape
|
|
4753
|
+
PropertyShape.toRdfResource(value, {
|
|
4798
4754
|
graph: _options.graph,
|
|
4799
4755
|
resourceSet: _options.resourceSet,
|
|
4800
4756
|
}).identifier,
|
|
@@ -4802,71 +4758,73 @@ export var Shape;
|
|
|
4802
4758
|
}
|
|
4803
4759
|
throw new Error("unable to serialize to RDF");
|
|
4804
4760
|
});
|
|
4805
|
-
|
|
4761
|
+
})(Shape || (Shape = {}));
|
|
4762
|
+
export var $Object;
|
|
4763
|
+
(function ($Object) {
|
|
4764
|
+
$Object.$toString = (value) => {
|
|
4806
4765
|
if (NodeShape.isNodeShape(value)) {
|
|
4807
4766
|
return NodeShape.$toString(value);
|
|
4808
4767
|
}
|
|
4768
|
+
if (Ontology.isOntology(value)) {
|
|
4769
|
+
return Ontology.$toString(value);
|
|
4770
|
+
}
|
|
4771
|
+
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4772
|
+
return PropertyGroup.$toString(value);
|
|
4773
|
+
}
|
|
4809
4774
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4810
4775
|
return PropertyShape.$toString(value);
|
|
4811
4776
|
}
|
|
4812
4777
|
throw new Error("unable to serialize to string");
|
|
4813
4778
|
};
|
|
4814
|
-
|
|
4815
|
-
return (NodeShape.isNodeShape(object) || PropertyShape.isPropertyShape(object));
|
|
4816
|
-
}
|
|
4817
|
-
Shape.isShape = isShape;
|
|
4818
|
-
})(Shape || (Shape = {}));
|
|
4819
|
-
export var $Object;
|
|
4820
|
-
(function ($Object) {
|
|
4821
|
-
$Object.$filter = (filter, value) => {
|
|
4779
|
+
$Object.filter = (filter, value) => {
|
|
4822
4780
|
if (filter.$identifier !== undefined &&
|
|
4823
4781
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
4824
4782
|
return false;
|
|
4825
4783
|
}
|
|
4826
4784
|
if (filter.on?.["NodeShape"] !== undefined &&
|
|
4827
4785
|
NodeShape.isNodeShape(value)) {
|
|
4828
|
-
if (!NodeShape
|
|
4786
|
+
if (!NodeShape.filter(filter.on["NodeShape"], value)) {
|
|
4829
4787
|
return false;
|
|
4830
4788
|
}
|
|
4831
4789
|
}
|
|
4832
4790
|
if (filter.on?.["Ontology"] !== undefined && Ontology.isOntology(value)) {
|
|
4833
|
-
if (!Ontology
|
|
4791
|
+
if (!Ontology.filter(filter.on["Ontology"], value)) {
|
|
4834
4792
|
return false;
|
|
4835
4793
|
}
|
|
4836
4794
|
}
|
|
4837
4795
|
if (filter.on?.["PropertyGroup"] !== undefined &&
|
|
4838
4796
|
PropertyGroup.isPropertyGroup(value)) {
|
|
4839
|
-
if (!PropertyGroup
|
|
4797
|
+
if (!PropertyGroup.filter(filter.on["PropertyGroup"], value)) {
|
|
4840
4798
|
return false;
|
|
4841
4799
|
}
|
|
4842
4800
|
}
|
|
4843
4801
|
if (filter.on?.["PropertyShape"] !== undefined &&
|
|
4844
4802
|
PropertyShape.isPropertyShape(value)) {
|
|
4845
|
-
if (!PropertyShape
|
|
4803
|
+
if (!PropertyShape.filter(filter.on["PropertyShape"], value)) {
|
|
4846
4804
|
return false;
|
|
4847
4805
|
}
|
|
4848
4806
|
}
|
|
4849
4807
|
return true;
|
|
4850
4808
|
};
|
|
4851
|
-
$Object
|
|
4809
|
+
$Object.fromRdfResource = (resource, options) => NodeShape.fromRdfResource(resource, {
|
|
4852
4810
|
...options,
|
|
4853
4811
|
ignoreRdfType: false,
|
|
4854
4812
|
})
|
|
4855
|
-
.altLazy(() => Ontology
|
|
4813
|
+
.altLazy(() => Ontology.fromRdfResource(resource, {
|
|
4856
4814
|
...options,
|
|
4857
4815
|
ignoreRdfType: false,
|
|
4858
4816
|
}))
|
|
4859
|
-
.altLazy(() => PropertyGroup
|
|
4817
|
+
.altLazy(() => PropertyGroup.fromRdfResource(resource, {
|
|
4860
4818
|
...options,
|
|
4861
4819
|
ignoreRdfType: false,
|
|
4862
4820
|
}))
|
|
4863
|
-
.altLazy(() => PropertyShape
|
|
4821
|
+
.altLazy(() => PropertyShape.fromRdfResource(resource, {
|
|
4864
4822
|
...options,
|
|
4865
4823
|
ignoreRdfType: false,
|
|
4866
4824
|
}));
|
|
4867
|
-
$Object
|
|
4825
|
+
$Object.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
|
|
4868
4826
|
const valueAsValues = Right(value.toValues());
|
|
4869
|
-
return NodeShape
|
|
4827
|
+
return NodeShape.fromRdfResourceValues(valueAsValues, {
|
|
4870
4828
|
context: _options.context,
|
|
4871
4829
|
graph: _options.graph,
|
|
4872
4830
|
ignoreRdfType: false,
|
|
@@ -4875,7 +4833,7 @@ export var $Object;
|
|
|
4875
4833
|
propertyPath: _options.propertyPath,
|
|
4876
4834
|
resource: _options.resource,
|
|
4877
4835
|
})
|
|
4878
|
-
.altLazy(() => Ontology
|
|
4836
|
+
.altLazy(() => Ontology.fromRdfResourceValues(valueAsValues, {
|
|
4879
4837
|
context: _options.context,
|
|
4880
4838
|
graph: _options.graph,
|
|
4881
4839
|
ignoreRdfType: false,
|
|
@@ -4884,7 +4842,7 @@ export var $Object;
|
|
|
4884
4842
|
propertyPath: _options.propertyPath,
|
|
4885
4843
|
resource: _options.resource,
|
|
4886
4844
|
}))
|
|
4887
|
-
.altLazy(() => PropertyGroup
|
|
4845
|
+
.altLazy(() => PropertyGroup.fromRdfResourceValues(valueAsValues, {
|
|
4888
4846
|
context: _options.context,
|
|
4889
4847
|
graph: _options.graph,
|
|
4890
4848
|
ignoreRdfType: false,
|
|
@@ -4893,7 +4851,7 @@ export var $Object;
|
|
|
4893
4851
|
propertyPath: _options.propertyPath,
|
|
4894
4852
|
resource: _options.resource,
|
|
4895
4853
|
}))
|
|
4896
|
-
.altLazy(() => PropertyShape
|
|
4854
|
+
.altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
|
|
4897
4855
|
context: _options.context,
|
|
4898
4856
|
graph: _options.graph,
|
|
4899
4857
|
ignoreRdfType: false,
|
|
@@ -4904,23 +4862,23 @@ export var $Object;
|
|
|
4904
4862
|
}))
|
|
4905
4863
|
.chain((values) => values.head());
|
|
4906
4864
|
})));
|
|
4907
|
-
let
|
|
4908
|
-
(function (
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
})(
|
|
4912
|
-
$Object
|
|
4865
|
+
let Identifier;
|
|
4866
|
+
(function (Identifier) {
|
|
4867
|
+
Identifier.parse = $parseIdentifier;
|
|
4868
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
4869
|
+
})(Identifier = $Object.Identifier || ($Object.Identifier = {}));
|
|
4870
|
+
$Object.schema = {
|
|
4913
4871
|
kind: "NamedObjectUnion",
|
|
4914
4872
|
members: {
|
|
4915
|
-
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape
|
|
4916
|
-
Ontology: { discriminantValues: ["Ontology"], type: Ontology
|
|
4873
|
+
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.schema },
|
|
4874
|
+
Ontology: { discriminantValues: ["Ontology"], type: Ontology.schema },
|
|
4917
4875
|
PropertyGroup: {
|
|
4918
4876
|
discriminantValues: ["PropertyGroup"],
|
|
4919
|
-
type: PropertyGroup
|
|
4877
|
+
type: PropertyGroup.schema,
|
|
4920
4878
|
},
|
|
4921
4879
|
PropertyShape: {
|
|
4922
4880
|
discriminantValues: ["PropertyShape"],
|
|
4923
|
-
type: PropertyShape
|
|
4881
|
+
type: PropertyShape.schema,
|
|
4924
4882
|
},
|
|
4925
4883
|
},
|
|
4926
4884
|
properties: {
|
|
@@ -4942,25 +4900,25 @@ export var $Object;
|
|
|
4942
4900
|
},
|
|
4943
4901
|
},
|
|
4944
4902
|
};
|
|
4945
|
-
$Object
|
|
4946
|
-
if (NodeShape.isNodeShape(
|
|
4947
|
-
return NodeShape
|
|
4903
|
+
$Object.toRdfResource = (object, options) => {
|
|
4904
|
+
if (NodeShape.isNodeShape(object)) {
|
|
4905
|
+
return NodeShape.toRdfResource(object, options);
|
|
4948
4906
|
}
|
|
4949
|
-
if (Ontology.isOntology(
|
|
4950
|
-
return Ontology
|
|
4907
|
+
if (Ontology.isOntology(object)) {
|
|
4908
|
+
return Ontology.toRdfResource(object, options);
|
|
4951
4909
|
}
|
|
4952
|
-
if (PropertyGroup.isPropertyGroup(
|
|
4953
|
-
return PropertyGroup
|
|
4910
|
+
if (PropertyGroup.isPropertyGroup(object)) {
|
|
4911
|
+
return PropertyGroup.toRdfResource(object, options);
|
|
4954
4912
|
}
|
|
4955
|
-
if (PropertyShape.isPropertyShape(
|
|
4956
|
-
return PropertyShape
|
|
4913
|
+
if (PropertyShape.isPropertyShape(object)) {
|
|
4914
|
+
return PropertyShape.toRdfResource(object, options);
|
|
4957
4915
|
}
|
|
4958
4916
|
throw new Error("unrecognized type");
|
|
4959
4917
|
};
|
|
4960
|
-
$Object
|
|
4918
|
+
$Object.toRdfResourceValues = ((value, _options) => {
|
|
4961
4919
|
if (NodeShape.isNodeShape(value)) {
|
|
4962
4920
|
return [
|
|
4963
|
-
NodeShape
|
|
4921
|
+
NodeShape.toRdfResource(value, {
|
|
4964
4922
|
graph: _options.graph,
|
|
4965
4923
|
resourceSet: _options.resourceSet,
|
|
4966
4924
|
}).identifier,
|
|
@@ -4968,7 +4926,7 @@ export var $Object;
|
|
|
4968
4926
|
}
|
|
4969
4927
|
if (Ontology.isOntology(value)) {
|
|
4970
4928
|
return [
|
|
4971
|
-
Ontology
|
|
4929
|
+
Ontology.toRdfResource(value, {
|
|
4972
4930
|
graph: _options.graph,
|
|
4973
4931
|
resourceSet: _options.resourceSet,
|
|
4974
4932
|
}).identifier,
|
|
@@ -4976,7 +4934,7 @@ export var $Object;
|
|
|
4976
4934
|
}
|
|
4977
4935
|
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4978
4936
|
return [
|
|
4979
|
-
PropertyGroup
|
|
4937
|
+
PropertyGroup.toRdfResource(value, {
|
|
4980
4938
|
graph: _options.graph,
|
|
4981
4939
|
resourceSet: _options.resourceSet,
|
|
4982
4940
|
}).identifier,
|
|
@@ -4984,7 +4942,7 @@ export var $Object;
|
|
|
4984
4942
|
}
|
|
4985
4943
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4986
4944
|
return [
|
|
4987
|
-
PropertyShape
|
|
4945
|
+
PropertyShape.toRdfResource(value, {
|
|
4988
4946
|
graph: _options.graph,
|
|
4989
4947
|
resourceSet: _options.resourceSet,
|
|
4990
4948
|
}).identifier,
|
|
@@ -4992,28 +4950,13 @@ export var $Object;
|
|
|
4992
4950
|
}
|
|
4993
4951
|
throw new Error("unable to serialize to RDF");
|
|
4994
4952
|
});
|
|
4995
|
-
$Object.$toString = (value) => {
|
|
4996
|
-
if (NodeShape.isNodeShape(value)) {
|
|
4997
|
-
return NodeShape.$toString(value);
|
|
4998
|
-
}
|
|
4999
|
-
if (Ontology.isOntology(value)) {
|
|
5000
|
-
return Ontology.$toString(value);
|
|
5001
|
-
}
|
|
5002
|
-
if (PropertyGroup.isPropertyGroup(value)) {
|
|
5003
|
-
return PropertyGroup.$toString(value);
|
|
5004
|
-
}
|
|
5005
|
-
if (PropertyShape.isPropertyShape(value)) {
|
|
5006
|
-
return PropertyShape.$toString(value);
|
|
5007
|
-
}
|
|
5008
|
-
throw new Error("unable to serialize to string");
|
|
5009
|
-
};
|
|
5010
4953
|
})($Object || ($Object = {}));
|
|
5011
4954
|
export class $RdfjsDatasetObjectSet {
|
|
5012
|
-
$graph;
|
|
5013
4955
|
#dataset;
|
|
4956
|
+
#graph;
|
|
5014
4957
|
constructor(dataset, options) {
|
|
5015
4958
|
this.#dataset = dataset;
|
|
5016
|
-
this
|
|
4959
|
+
this.#graph = options?.graph;
|
|
5017
4960
|
}
|
|
5018
4961
|
$dataset() {
|
|
5019
4962
|
if (typeof this.#dataset === "object") {
|
|
@@ -5053,9 +4996,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5053
4996
|
}
|
|
5054
4997
|
nodeShapesSync(query) {
|
|
5055
4998
|
return this.#objectsSync({
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
4999
|
+
filter: NodeShape.filter,
|
|
5000
|
+
fromRdfResource: NodeShape.fromRdfResource,
|
|
5001
|
+
fromRdfTypes: [NodeShape.fromRdfType],
|
|
5059
5002
|
}, query);
|
|
5060
5003
|
}
|
|
5061
5004
|
async ontology(identifier, options) {
|
|
@@ -5084,9 +5027,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5084
5027
|
}
|
|
5085
5028
|
ontologiesSync(query) {
|
|
5086
5029
|
return this.#objectsSync({
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5030
|
+
filter: Ontology.filter,
|
|
5031
|
+
fromRdfResource: Ontology.fromRdfResource,
|
|
5032
|
+
fromRdfTypes: [Ontology.fromRdfType],
|
|
5090
5033
|
}, query);
|
|
5091
5034
|
}
|
|
5092
5035
|
async propertyGroup(identifier, options) {
|
|
@@ -5115,9 +5058,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5115
5058
|
}
|
|
5116
5059
|
propertyGroupsSync(query) {
|
|
5117
5060
|
return this.#objectsSync({
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5061
|
+
filter: PropertyGroup.filter,
|
|
5062
|
+
fromRdfResource: PropertyGroup.fromRdfResource,
|
|
5063
|
+
fromRdfTypes: [PropertyGroup.fromRdfType],
|
|
5121
5064
|
}, query);
|
|
5122
5065
|
}
|
|
5123
5066
|
async propertyShape(identifier, options) {
|
|
@@ -5146,9 +5089,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5146
5089
|
}
|
|
5147
5090
|
propertyShapesSync(query) {
|
|
5148
5091
|
return this.#objectsSync({
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5092
|
+
filter: PropertyShape.filter,
|
|
5093
|
+
fromRdfResource: PropertyShape.fromRdfResource,
|
|
5094
|
+
fromRdfTypes: [PropertyShape.fromRdfType],
|
|
5152
5095
|
}, query);
|
|
5153
5096
|
}
|
|
5154
5097
|
async shape(identifier, options) {
|
|
@@ -5178,14 +5121,14 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5178
5121
|
shapesSync(query) {
|
|
5179
5122
|
return this.#objectUnionsSync([
|
|
5180
5123
|
{
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5124
|
+
filter: Shape.filter,
|
|
5125
|
+
fromRdfResource: NodeShape.fromRdfResource,
|
|
5126
|
+
fromRdfTypes: [NodeShape.fromRdfType],
|
|
5184
5127
|
},
|
|
5185
5128
|
{
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5129
|
+
filter: Shape.filter,
|
|
5130
|
+
fromRdfResource: PropertyShape.fromRdfResource,
|
|
5131
|
+
fromRdfTypes: [PropertyShape.fromRdfType],
|
|
5189
5132
|
},
|
|
5190
5133
|
], query);
|
|
5191
5134
|
}
|
|
@@ -5216,29 +5159,29 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5216
5159
|
$objectsSync(query) {
|
|
5217
5160
|
return this.#objectUnionsSync([
|
|
5218
5161
|
{
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5162
|
+
filter: $Object.filter,
|
|
5163
|
+
fromRdfResource: NodeShape.fromRdfResource,
|
|
5164
|
+
fromRdfTypes: [NodeShape.fromRdfType],
|
|
5222
5165
|
},
|
|
5223
5166
|
{
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5167
|
+
filter: $Object.filter,
|
|
5168
|
+
fromRdfResource: Ontology.fromRdfResource,
|
|
5169
|
+
fromRdfTypes: [Ontology.fromRdfType],
|
|
5227
5170
|
},
|
|
5228
5171
|
{
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5172
|
+
filter: $Object.filter,
|
|
5173
|
+
fromRdfResource: PropertyGroup.fromRdfResource,
|
|
5174
|
+
fromRdfTypes: [PropertyGroup.fromRdfType],
|
|
5232
5175
|
},
|
|
5233
5176
|
{
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5177
|
+
filter: $Object.filter,
|
|
5178
|
+
fromRdfResource: PropertyShape.fromRdfResource,
|
|
5179
|
+
fromRdfTypes: [PropertyShape.fromRdfType],
|
|
5237
5180
|
},
|
|
5238
5181
|
], query);
|
|
5239
5182
|
}
|
|
5240
5183
|
#objectsSync(namedObjectType, query) {
|
|
5241
|
-
const graph = query?.graph ?? this
|
|
5184
|
+
const graph = query?.graph ?? this.#graph;
|
|
5242
5185
|
const limit = query?.limit ?? Number.MAX_SAFE_INTEGER;
|
|
5243
5186
|
if (limit <= 0) {
|
|
5244
5187
|
return Right([]);
|
|
@@ -5261,11 +5204,11 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5261
5204
|
}));
|
|
5262
5205
|
sortResources = false;
|
|
5263
5206
|
}
|
|
5264
|
-
else if (namedObjectType
|
|
5207
|
+
else if (namedObjectType.fromRdfTypes.length > 0) {
|
|
5265
5208
|
const identifierSet = new $IdentifierSet();
|
|
5266
5209
|
resources = [];
|
|
5267
5210
|
sortResources = true;
|
|
5268
|
-
for (const fromRdfType of namedObjectType
|
|
5211
|
+
for (const fromRdfType of namedObjectType.fromRdfTypes) {
|
|
5269
5212
|
for (const resource of resourceSet.instancesOf(fromRdfType, {
|
|
5270
5213
|
graph,
|
|
5271
5214
|
})) {
|
|
@@ -5298,7 +5241,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5298
5241
|
const resource = resourceSet.resource(quad.subject);
|
|
5299
5242
|
// Eagerly eliminate the majority of resources that won't match the object type
|
|
5300
5243
|
namedObjectType
|
|
5301
|
-
|
|
5244
|
+
.fromRdfResource(resource, fromRdfResourceOptions)
|
|
5302
5245
|
.ifRight((object) => {
|
|
5303
5246
|
resources.push({ object, resource });
|
|
5304
5247
|
});
|
|
@@ -5312,13 +5255,13 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5312
5255
|
const objects = [];
|
|
5313
5256
|
for (let { object, resource } of resources) {
|
|
5314
5257
|
if (!object) {
|
|
5315
|
-
const objectEither = namedObjectType
|
|
5258
|
+
const objectEither = namedObjectType.fromRdfResource(resource, fromRdfResourceOptions);
|
|
5316
5259
|
if (objectEither.isLeft()) {
|
|
5317
5260
|
return objectEither;
|
|
5318
5261
|
}
|
|
5319
5262
|
object = objectEither.unsafeCoerce();
|
|
5320
5263
|
}
|
|
5321
|
-
if (query?.filter && !namedObjectType
|
|
5264
|
+
if (query?.filter && !namedObjectType.filter(query.filter, object)) {
|
|
5322
5265
|
continue;
|
|
5323
5266
|
}
|
|
5324
5267
|
if (objectI++ >= offset) {
|
|
@@ -5331,7 +5274,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5331
5274
|
return Right(objects);
|
|
5332
5275
|
}
|
|
5333
5276
|
#objectUnionsSync(namedObjectTypes, query) {
|
|
5334
|
-
const graph = query?.graph ?? this
|
|
5277
|
+
const graph = query?.graph ?? this.#graph;
|
|
5335
5278
|
const limit = query?.limit ?? Number.MAX_SAFE_INTEGER;
|
|
5336
5279
|
if (limit <= 0) {
|
|
5337
5280
|
return Right([]);
|
|
@@ -5354,12 +5297,12 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5354
5297
|
}));
|
|
5355
5298
|
sortResources = false;
|
|
5356
5299
|
}
|
|
5357
|
-
else if (namedObjectTypes.every((namedObjectType) => namedObjectType
|
|
5300
|
+
else if (namedObjectTypes.every((namedObjectType) => namedObjectType.fromRdfTypes.length > 0)) {
|
|
5358
5301
|
const identifierSet = new $IdentifierSet();
|
|
5359
5302
|
resources = [];
|
|
5360
5303
|
sortResources = true;
|
|
5361
5304
|
for (const namedObjectType of namedObjectTypes) {
|
|
5362
|
-
for (const fromRdfType of namedObjectType
|
|
5305
|
+
for (const fromRdfType of namedObjectType.fromRdfTypes) {
|
|
5363
5306
|
for (const resource of resourceSet.instancesOf(fromRdfType, {
|
|
5364
5307
|
graph,
|
|
5365
5308
|
})) {
|
|
@@ -5394,7 +5337,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5394
5337
|
const resource = resourceSet.resource(quad.subject);
|
|
5395
5338
|
for (const namedObjectType of namedObjectTypes) {
|
|
5396
5339
|
if (namedObjectType
|
|
5397
|
-
|
|
5340
|
+
.fromRdfResource(resource, fromRdfResourceOptions)
|
|
5398
5341
|
.ifRight((object) => {
|
|
5399
5342
|
resources.push({ object, namedObjectType, resource });
|
|
5400
5343
|
})
|
|
@@ -5414,12 +5357,12 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5414
5357
|
if (!object) {
|
|
5415
5358
|
let objectEither;
|
|
5416
5359
|
if (namedObjectType) {
|
|
5417
|
-
objectEither = namedObjectType
|
|
5360
|
+
objectEither = namedObjectType.fromRdfResource(resource, fromRdfResourceOptions);
|
|
5418
5361
|
}
|
|
5419
5362
|
else {
|
|
5420
5363
|
objectEither = Left(new Error("no object types"));
|
|
5421
5364
|
for (const tryObjectType of namedObjectTypes) {
|
|
5422
|
-
objectEither = tryObjectType
|
|
5365
|
+
objectEither = tryObjectType.fromRdfResource(resource, fromRdfResourceOptions);
|
|
5423
5366
|
if (objectEither.isRight()) {
|
|
5424
5367
|
namedObjectType = tryObjectType;
|
|
5425
5368
|
break;
|
|
@@ -5434,7 +5377,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5434
5377
|
if (!namedObjectType) {
|
|
5435
5378
|
throw new Error("namedObjectType should be set here");
|
|
5436
5379
|
}
|
|
5437
|
-
if (query?.filter && !namedObjectType
|
|
5380
|
+
if (query?.filter && !namedObjectType.filter(query.filter, object)) {
|
|
5438
5381
|
continue;
|
|
5439
5382
|
}
|
|
5440
5383
|
if (objectI++ >= offset) {
|