@shaclmate/shacl-ast 4.0.31 → 4.0.32
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/generated.js +1079 -1290
- package/package.json +1 -1
package/dist/generated.js
CHANGED
|
@@ -241,6 +241,17 @@ var $RdfVocabularies;
|
|
|
241
241
|
xsd.unsignedShort = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort");
|
|
242
242
|
})(xsd = $RdfVocabularies.xsd || ($RdfVocabularies.xsd = {}));
|
|
243
243
|
})($RdfVocabularies || ($RdfVocabularies = {}));
|
|
244
|
+
function $sequenceRecord(record) {
|
|
245
|
+
const result = {};
|
|
246
|
+
for (const key of globalThis.Object.keys(record)) {
|
|
247
|
+
const either = record[key];
|
|
248
|
+
if (either.isLeft()) {
|
|
249
|
+
return either;
|
|
250
|
+
}
|
|
251
|
+
result[key] = either.extract();
|
|
252
|
+
}
|
|
253
|
+
return Right(result);
|
|
254
|
+
}
|
|
244
255
|
function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }) {
|
|
245
256
|
return typeFromRdf(Right(resource.values(propertySchema.path, { graph, unique: true }))).chain((values) => values.head());
|
|
246
257
|
}
|
|
@@ -1031,671 +1042,546 @@ export var PropertyShape;
|
|
|
1031
1042
|
}
|
|
1032
1043
|
return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyShape)`));
|
|
1033
1044
|
})
|
|
1034
|
-
: Right(true)).chain((_rdfTypeCheck) =>
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1038
|
-
term: $resource.identifier,
|
|
1039
|
-
}).toValues())
|
|
1040
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1041
|
-
.chain((values) => values.head())
|
|
1042
|
-
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
1043
|
-
graph: _$options.graph,
|
|
1044
|
-
resource: $resource,
|
|
1045
|
-
propertySchema: PropertyShape.schema.properties.and,
|
|
1046
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1047
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1048
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1049
|
-
focusResource: $resource,
|
|
1050
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1051
|
-
values: valueList.toArray(),
|
|
1052
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
1053
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1054
|
-
.map((values) => values.length > 0
|
|
1055
|
-
? values.map((value) => Maybe.of(value))
|
|
1056
|
-
: Resource.Values.fromValue({
|
|
1057
|
-
focusResource: $resource,
|
|
1058
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1059
|
-
value: Maybe.empty(),
|
|
1060
|
-
})),
|
|
1061
|
-
}).chain((and) => $shaclPropertyFromRdf({
|
|
1062
|
-
graph: _$options.graph,
|
|
1063
|
-
resource: $resource,
|
|
1064
|
-
propertySchema: PropertyShape.schema.properties.classes,
|
|
1065
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1066
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1067
|
-
.map((values) => values.toArray())
|
|
1068
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
1069
|
-
focusResource: $resource,
|
|
1070
|
-
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
1071
|
-
value: valuesArray,
|
|
1072
|
-
})),
|
|
1073
|
-
}).chain((classes) => $shaclPropertyFromRdf({
|
|
1074
|
-
graph: _$options.graph,
|
|
1075
|
-
resource: $resource,
|
|
1076
|
-
propertySchema: PropertyShape.schema.properties.comment,
|
|
1077
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1078
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1079
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1080
|
-
.map((values) => values.length > 0
|
|
1081
|
-
? values.map((value) => Maybe.of(value))
|
|
1082
|
-
: Resource.Values.fromValue({
|
|
1083
|
-
focusResource: $resource,
|
|
1084
|
-
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
1085
|
-
value: Maybe.empty(),
|
|
1086
|
-
})),
|
|
1087
|
-
}).chain((comment) => $shaclPropertyFromRdf({
|
|
1088
|
-
graph: _$options.graph,
|
|
1089
|
-
resource: $resource,
|
|
1090
|
-
propertySchema: PropertyShape.schema.properties.datatype,
|
|
1091
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1092
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1093
|
-
.map((values) => values.length > 0
|
|
1094
|
-
? values.map((value) => Maybe.of(value))
|
|
1095
|
-
: Resource.Values.fromValue({
|
|
1096
|
-
focusResource: $resource,
|
|
1097
|
-
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
1098
|
-
value: Maybe.empty(),
|
|
1099
|
-
})),
|
|
1100
|
-
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
1101
|
-
graph: _$options.graph,
|
|
1102
|
-
resource: $resource,
|
|
1103
|
-
propertySchema: PropertyShape.schema.properties.deactivated,
|
|
1104
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1105
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1106
|
-
.map((values) => values.length > 0
|
|
1107
|
-
? values.map((value) => Maybe.of(value))
|
|
1108
|
-
: Resource.Values.fromValue({
|
|
1109
|
-
focusResource: $resource,
|
|
1110
|
-
propertyPath: PropertyShape.schema.properties.deactivated
|
|
1111
|
-
.path,
|
|
1112
|
-
value: Maybe.empty(),
|
|
1113
|
-
})),
|
|
1114
|
-
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
1115
|
-
graph: _$options.graph,
|
|
1116
|
-
resource: $resource,
|
|
1117
|
-
propertySchema: PropertyShape.schema.properties.defaultValue,
|
|
1118
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1119
|
-
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1120
|
-
switch (term.termType) {
|
|
1121
|
-
case "NamedNode":
|
|
1122
|
-
case "Literal":
|
|
1123
|
-
return Either.of(term);
|
|
1124
|
-
default:
|
|
1125
|
-
return Left(new Resource.MistypedTermValueError({
|
|
1126
|
-
actualValue: term,
|
|
1127
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
1128
|
-
focusResource: $resource,
|
|
1129
|
-
propertyPath: PropertyShape.schema.properties
|
|
1130
|
-
.defaultValue.path,
|
|
1131
|
-
}));
|
|
1132
|
-
}
|
|
1133
|
-
})))
|
|
1134
|
-
.map((values) => values.length > 0
|
|
1135
|
-
? values.map((value) => Maybe.of(value))
|
|
1136
|
-
: Resource.Values.fromValue({
|
|
1137
|
-
focusResource: $resource,
|
|
1138
|
-
propertyPath: PropertyShape.schema.properties.defaultValue
|
|
1139
|
-
.path,
|
|
1140
|
-
value: Maybe.empty(),
|
|
1141
|
-
})),
|
|
1142
|
-
}).chain((defaultValue) => $shaclPropertyFromRdf({
|
|
1143
|
-
graph: _$options.graph,
|
|
1144
|
-
resource: $resource,
|
|
1145
|
-
propertySchema: PropertyShape.schema.properties.description,
|
|
1146
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1147
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1148
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1149
|
-
.map((values) => values.length > 0
|
|
1150
|
-
? values.map((value) => Maybe.of(value))
|
|
1151
|
-
: Resource.Values.fromValue({
|
|
1152
|
-
focusResource: $resource,
|
|
1153
|
-
propertyPath: PropertyShape.schema.properties
|
|
1154
|
-
.description.path,
|
|
1155
|
-
value: Maybe.empty(),
|
|
1156
|
-
})),
|
|
1157
|
-
}).chain((description) => $shaclPropertyFromRdf({
|
|
1158
|
-
graph: _$options.graph,
|
|
1159
|
-
resource: $resource,
|
|
1160
|
-
propertySchema: PropertyShape.schema.properties.flags,
|
|
1161
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1162
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1163
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1164
|
-
.map((values) => values.toArray())
|
|
1165
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
1045
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
1046
|
+
$identifier: Right(new Resource.Value({
|
|
1047
|
+
dataFactory: dataFactory,
|
|
1166
1048
|
focusResource: $resource,
|
|
1167
|
-
propertyPath:
|
|
1168
|
-
|
|
1169
|
-
}))
|
|
1170
|
-
}).chain((flags) => $shaclPropertyFromRdf({
|
|
1171
|
-
graph: _$options.graph,
|
|
1172
|
-
resource: $resource,
|
|
1173
|
-
propertySchema: PropertyShape.schema.properties.groups,
|
|
1174
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1049
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1050
|
+
term: $resource.identifier,
|
|
1051
|
+
}).toValues())
|
|
1175
1052
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1176
|
-
.
|
|
1177
|
-
|
|
1178
|
-
focusResource: $resource,
|
|
1179
|
-
propertyPath: PropertyShape.schema.properties.groups
|
|
1180
|
-
.path,
|
|
1181
|
-
value: valuesArray,
|
|
1182
|
-
})),
|
|
1183
|
-
}).chain((groups) => $shaclPropertyFromRdf({
|
|
1184
|
-
graph: _$options.graph,
|
|
1185
|
-
resource: $resource,
|
|
1186
|
-
propertySchema: PropertyShape.schema.properties.hasValues,
|
|
1187
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1188
|
-
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1189
|
-
switch (term.termType) {
|
|
1190
|
-
case "NamedNode":
|
|
1191
|
-
case "Literal":
|
|
1192
|
-
return Either.of(term);
|
|
1193
|
-
default:
|
|
1194
|
-
return Left(new Resource.MistypedTermValueError({
|
|
1195
|
-
actualValue: term,
|
|
1196
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
1197
|
-
focusResource: $resource,
|
|
1198
|
-
propertyPath: PropertyShape.schema
|
|
1199
|
-
.properties.hasValues
|
|
1200
|
-
.path,
|
|
1201
|
-
}));
|
|
1202
|
-
}
|
|
1203
|
-
})))
|
|
1204
|
-
.map((values) => values.toArray())
|
|
1205
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
1206
|
-
focusResource: $resource,
|
|
1207
|
-
propertyPath: PropertyShape.schema.properties
|
|
1208
|
-
.hasValues.path,
|
|
1209
|
-
value: valuesArray,
|
|
1210
|
-
})),
|
|
1211
|
-
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
1212
|
-
graph: _$options.graph,
|
|
1213
|
-
resource: $resource,
|
|
1214
|
-
propertySchema: PropertyShape.schema.properties.in_,
|
|
1215
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1216
|
-
.chain((values) => values.chainMap((value) => value.toList({
|
|
1053
|
+
.chain((values) => values.head()),
|
|
1054
|
+
and: $shaclPropertyFromRdf({
|
|
1217
1055
|
graph: _$options.graph,
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
.
|
|
1223
|
-
values: valueList.toArray(),
|
|
1224
|
-
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1225
|
-
switch (term.termType) {
|
|
1226
|
-
case "NamedNode":
|
|
1227
|
-
case "Literal":
|
|
1228
|
-
return Either.of(term);
|
|
1229
|
-
default:
|
|
1230
|
-
return Left(new Resource.MistypedTermValueError({
|
|
1231
|
-
actualValue: term,
|
|
1232
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
1233
|
-
focusResource: $resource,
|
|
1234
|
-
propertyPath: PropertyShape.schema
|
|
1235
|
-
.properties.in_
|
|
1236
|
-
.path,
|
|
1237
|
-
}));
|
|
1238
|
-
}
|
|
1239
|
-
})))))
|
|
1240
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1241
|
-
.map((values) => values.length > 0
|
|
1242
|
-
? values.map((value) => Maybe.of(value))
|
|
1243
|
-
: Resource.Values.fromValue({
|
|
1244
|
-
focusResource: $resource,
|
|
1245
|
-
propertyPath: PropertyShape.schema.properties
|
|
1246
|
-
.in_.path,
|
|
1247
|
-
value: Maybe.empty(),
|
|
1248
|
-
})),
|
|
1249
|
-
}).chain((in_) => $shaclPropertyFromRdf({
|
|
1250
|
-
graph: _$options.graph,
|
|
1251
|
-
resource: $resource,
|
|
1252
|
-
propertySchema: PropertyShape.schema.properties.isDefinedBy,
|
|
1253
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1254
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1255
|
-
.map((values) => values.length > 0
|
|
1256
|
-
? values.map((value) => Maybe.of(value))
|
|
1257
|
-
: Resource.Values.fromValue({
|
|
1258
|
-
focusResource: $resource,
|
|
1259
|
-
propertyPath: PropertyShape.schema.properties
|
|
1260
|
-
.isDefinedBy.path,
|
|
1261
|
-
value: Maybe.empty(),
|
|
1262
|
-
})),
|
|
1263
|
-
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
1264
|
-
graph: _$options.graph,
|
|
1265
|
-
resource: $resource,
|
|
1266
|
-
propertySchema: PropertyShape.schema.properties.label,
|
|
1267
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1268
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1269
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1270
|
-
.map((values) => values.length > 0
|
|
1271
|
-
? values.map((value) => Maybe.of(value))
|
|
1272
|
-
: Resource.Values.fromValue({
|
|
1056
|
+
resource: $resource,
|
|
1057
|
+
propertySchema: PropertyShape.schema.properties.and,
|
|
1058
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1059
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1060
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1273
1061
|
focusResource: $resource,
|
|
1274
|
-
propertyPath: PropertyShape.schema
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1062
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1063
|
+
values: valueList.toArray(),
|
|
1064
|
+
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
1065
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1066
|
+
.map((values) => values.length > 0
|
|
1067
|
+
? values.map((value) => Maybe.of(value))
|
|
1068
|
+
: Resource.Values.fromValue({
|
|
1069
|
+
focusResource: $resource,
|
|
1070
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1071
|
+
value: Maybe.empty(),
|
|
1072
|
+
})),
|
|
1073
|
+
}),
|
|
1074
|
+
classes: $shaclPropertyFromRdf({
|
|
1284
1075
|
graph: _$options.graph,
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
.
|
|
1290
|
-
.
|
|
1291
|
-
values: valueList.toArray(),
|
|
1292
|
-
}))
|
|
1293
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1294
|
-
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
1295
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1296
|
-
.map((values) => values.length > 0
|
|
1297
|
-
? values.map((value) => Maybe.of(value))
|
|
1298
|
-
: Resource.Values.fromValue({
|
|
1299
|
-
focusResource: $resource,
|
|
1300
|
-
propertyPath: PropertyShape.schema
|
|
1301
|
-
.properties.languageIn
|
|
1302
|
-
.path,
|
|
1303
|
-
value: Maybe.empty(),
|
|
1304
|
-
})),
|
|
1305
|
-
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
1306
|
-
graph: _$options.graph,
|
|
1307
|
-
resource: $resource,
|
|
1308
|
-
propertySchema: PropertyShape.schema.properties.maxCount,
|
|
1309
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1310
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1311
|
-
.map((values) => values.length > 0
|
|
1312
|
-
? values.map((value) => Maybe.of(value))
|
|
1313
|
-
: Resource.Values.fromValue({
|
|
1314
|
-
focusResource: $resource,
|
|
1315
|
-
propertyPath: PropertyShape.schema
|
|
1316
|
-
.properties.maxCount
|
|
1317
|
-
.path,
|
|
1318
|
-
value: Maybe.empty(),
|
|
1319
|
-
})),
|
|
1320
|
-
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
1321
|
-
graph: _$options.graph,
|
|
1322
|
-
resource: $resource,
|
|
1323
|
-
propertySchema: PropertyShape.schema.properties.maxExclusive,
|
|
1324
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1325
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1326
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
1327
|
-
.map((values) => values.length > 0
|
|
1328
|
-
? values.map((value) => Maybe.of(value))
|
|
1329
|
-
: Resource.Values.fromValue({
|
|
1330
|
-
focusResource: $resource,
|
|
1331
|
-
propertyPath: PropertyShape.schema
|
|
1332
|
-
.properties
|
|
1333
|
-
.maxExclusive.path,
|
|
1334
|
-
value: Maybe.empty(),
|
|
1335
|
-
})),
|
|
1336
|
-
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
1337
|
-
graph: _$options.graph,
|
|
1338
|
-
resource: $resource,
|
|
1339
|
-
propertySchema: PropertyShape.schema.properties.maxInclusive,
|
|
1340
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1341
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1342
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
1343
|
-
.map((values) => values.length > 0
|
|
1344
|
-
? values.map((value) => Maybe.of(value))
|
|
1345
|
-
: Resource.Values.fromValue({
|
|
1346
|
-
focusResource: $resource,
|
|
1347
|
-
propertyPath: PropertyShape.schema
|
|
1348
|
-
.properties
|
|
1349
|
-
.maxInclusive.path,
|
|
1350
|
-
value: Maybe.empty(),
|
|
1351
|
-
})),
|
|
1352
|
-
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
1353
|
-
graph: _$options.graph,
|
|
1354
|
-
resource: $resource,
|
|
1355
|
-
propertySchema: PropertyShape.schema.properties.maxLength,
|
|
1356
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1357
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1358
|
-
.map((values) => values.length > 0
|
|
1359
|
-
? values.map((value) => Maybe.of(value))
|
|
1360
|
-
: Resource.Values.fromValue({
|
|
1361
|
-
focusResource: $resource,
|
|
1362
|
-
propertyPath: PropertyShape.schema
|
|
1363
|
-
.properties
|
|
1364
|
-
.maxLength.path,
|
|
1365
|
-
value: Maybe.empty(),
|
|
1366
|
-
})),
|
|
1367
|
-
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
1368
|
-
graph: _$options.graph,
|
|
1369
|
-
resource: $resource,
|
|
1370
|
-
propertySchema: PropertyShape.schema.properties.minCount,
|
|
1371
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1372
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1373
|
-
.map((values) => values.length > 0
|
|
1374
|
-
? values.map((value) => Maybe.of(value))
|
|
1375
|
-
: Resource.Values.fromValue({
|
|
1376
|
-
focusResource: $resource,
|
|
1377
|
-
propertyPath: PropertyShape
|
|
1378
|
-
.schema
|
|
1379
|
-
.properties
|
|
1380
|
-
.minCount.path,
|
|
1381
|
-
value: Maybe.empty(),
|
|
1382
|
-
})),
|
|
1383
|
-
}).chain((minCount) => $shaclPropertyFromRdf({
|
|
1384
|
-
graph: _$options.graph,
|
|
1385
|
-
resource: $resource,
|
|
1386
|
-
propertySchema: PropertyShape.schema.properties
|
|
1387
|
-
.minExclusive,
|
|
1388
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1389
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1390
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
1391
|
-
.map((values) => values.length > 0
|
|
1392
|
-
? values.map((value) => Maybe.of(value))
|
|
1393
|
-
: Resource.Values.fromValue({
|
|
1076
|
+
resource: $resource,
|
|
1077
|
+
propertySchema: PropertyShape.schema.properties.classes,
|
|
1078
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1079
|
+
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1080
|
+
.map((values) => values.toArray())
|
|
1081
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
1394
1082
|
focusResource: $resource,
|
|
1395
|
-
propertyPath: PropertyShape
|
|
1396
|
-
|
|
1397
|
-
.properties
|
|
1398
|
-
.minExclusive
|
|
1399
|
-
.path,
|
|
1400
|
-
value: Maybe.empty(),
|
|
1083
|
+
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
1084
|
+
value: valuesArray,
|
|
1401
1085
|
})),
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
.
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1086
|
+
}),
|
|
1087
|
+
comment: $shaclPropertyFromRdf({
|
|
1088
|
+
graph: _$options.graph,
|
|
1089
|
+
resource: $resource,
|
|
1090
|
+
propertySchema: PropertyShape.schema.properties.comment,
|
|
1091
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1092
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1093
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1094
|
+
.map((values) => values.length > 0
|
|
1095
|
+
? values.map((value) => Maybe.of(value))
|
|
1096
|
+
: Resource.Values.fromValue({
|
|
1097
|
+
focusResource: $resource,
|
|
1098
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
1099
|
+
value: Maybe.empty(),
|
|
1100
|
+
})),
|
|
1101
|
+
}),
|
|
1102
|
+
datatype: $shaclPropertyFromRdf({
|
|
1103
|
+
graph: _$options.graph,
|
|
1104
|
+
resource: $resource,
|
|
1105
|
+
propertySchema: PropertyShape.schema.properties.datatype,
|
|
1106
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1107
|
+
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1108
|
+
.map((values) => values.length > 0
|
|
1109
|
+
? values.map((value) => Maybe.of(value))
|
|
1110
|
+
: Resource.Values.fromValue({
|
|
1111
|
+
focusResource: $resource,
|
|
1112
|
+
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
1113
|
+
value: Maybe.empty(),
|
|
1114
|
+
})),
|
|
1115
|
+
}),
|
|
1116
|
+
deactivated: $shaclPropertyFromRdf({
|
|
1117
|
+
graph: _$options.graph,
|
|
1118
|
+
resource: $resource,
|
|
1119
|
+
propertySchema: PropertyShape.schema.properties.deactivated,
|
|
1120
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1121
|
+
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1122
|
+
.map((values) => values.length > 0
|
|
1123
|
+
? values.map((value) => Maybe.of(value))
|
|
1124
|
+
: Resource.Values.fromValue({
|
|
1125
|
+
focusResource: $resource,
|
|
1126
|
+
propertyPath: PropertyShape.schema.properties.deactivated.path,
|
|
1127
|
+
value: Maybe.empty(),
|
|
1128
|
+
})),
|
|
1129
|
+
}),
|
|
1130
|
+
defaultValue: $shaclPropertyFromRdf({
|
|
1131
|
+
graph: _$options.graph,
|
|
1132
|
+
resource: $resource,
|
|
1133
|
+
propertySchema: PropertyShape.schema.properties.defaultValue,
|
|
1134
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1135
|
+
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1136
|
+
switch (term.termType) {
|
|
1137
|
+
case "NamedNode":
|
|
1138
|
+
case "Literal":
|
|
1139
|
+
return Either.of(term);
|
|
1140
|
+
default:
|
|
1141
|
+
return Left(new Resource.MistypedTermValueError({
|
|
1142
|
+
actualValue: term,
|
|
1143
|
+
expectedValueType: "(NamedNode | Literal)",
|
|
1144
|
+
focusResource: $resource,
|
|
1145
|
+
propertyPath: PropertyShape.schema.properties.defaultValue.path,
|
|
1146
|
+
}));
|
|
1147
|
+
}
|
|
1148
|
+
})))
|
|
1149
|
+
.map((values) => values.length > 0
|
|
1150
|
+
? values.map((value) => Maybe.of(value))
|
|
1151
|
+
: Resource.Values.fromValue({
|
|
1152
|
+
focusResource: $resource,
|
|
1153
|
+
propertyPath: PropertyShape.schema.properties.defaultValue.path,
|
|
1154
|
+
value: Maybe.empty(),
|
|
1155
|
+
})),
|
|
1156
|
+
}),
|
|
1157
|
+
description: $shaclPropertyFromRdf({
|
|
1158
|
+
graph: _$options.graph,
|
|
1159
|
+
resource: $resource,
|
|
1160
|
+
propertySchema: PropertyShape.schema.properties.description,
|
|
1161
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1162
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1163
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1164
|
+
.map((values) => values.length > 0
|
|
1165
|
+
? values.map((value) => Maybe.of(value))
|
|
1166
|
+
: Resource.Values.fromValue({
|
|
1167
|
+
focusResource: $resource,
|
|
1168
|
+
propertyPath: PropertyShape.schema.properties.description.path,
|
|
1169
|
+
value: Maybe.empty(),
|
|
1170
|
+
})),
|
|
1171
|
+
}),
|
|
1172
|
+
flags: $shaclPropertyFromRdf({
|
|
1173
|
+
graph: _$options.graph,
|
|
1174
|
+
resource: $resource,
|
|
1175
|
+
propertySchema: PropertyShape.schema.properties.flags,
|
|
1176
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1177
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1178
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1179
|
+
.map((values) => values.toArray())
|
|
1180
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
1413
1181
|
focusResource: $resource,
|
|
1414
|
-
propertyPath: PropertyShape
|
|
1415
|
-
|
|
1416
|
-
.properties
|
|
1417
|
-
.minInclusive
|
|
1418
|
-
.path,
|
|
1419
|
-
value: Maybe.empty(),
|
|
1182
|
+
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
1183
|
+
value: valuesArray,
|
|
1420
1184
|
})),
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
.
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
: Resource.Values.fromValue({
|
|
1185
|
+
}),
|
|
1186
|
+
groups: $shaclPropertyFromRdf({
|
|
1187
|
+
graph: _$options.graph,
|
|
1188
|
+
resource: $resource,
|
|
1189
|
+
propertySchema: PropertyShape.schema.properties.groups,
|
|
1190
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1191
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1192
|
+
.map((values) => values.toArray())
|
|
1193
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
1431
1194
|
focusResource: $resource,
|
|
1432
|
-
propertyPath: PropertyShape
|
|
1433
|
-
|
|
1434
|
-
.properties
|
|
1435
|
-
.minLength
|
|
1436
|
-
.path,
|
|
1437
|
-
value: Maybe.empty(),
|
|
1195
|
+
propertyPath: PropertyShape.schema.properties.groups.path,
|
|
1196
|
+
value: valuesArray,
|
|
1438
1197
|
})),
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
.
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1198
|
+
}),
|
|
1199
|
+
hasValues: $shaclPropertyFromRdf({
|
|
1200
|
+
graph: _$options.graph,
|
|
1201
|
+
resource: $resource,
|
|
1202
|
+
propertySchema: PropertyShape.schema.properties.hasValues,
|
|
1203
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1204
|
+
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1205
|
+
switch (term.termType) {
|
|
1206
|
+
case "NamedNode":
|
|
1207
|
+
case "Literal":
|
|
1208
|
+
return Either.of(term);
|
|
1209
|
+
default:
|
|
1210
|
+
return Left(new Resource.MistypedTermValueError({
|
|
1211
|
+
actualValue: term,
|
|
1212
|
+
expectedValueType: "(NamedNode | Literal)",
|
|
1213
|
+
focusResource: $resource,
|
|
1214
|
+
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
1215
|
+
}));
|
|
1216
|
+
}
|
|
1217
|
+
})))
|
|
1218
|
+
.map((values) => values.toArray())
|
|
1219
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
1450
1220
|
focusResource: $resource,
|
|
1451
|
-
propertyPath: PropertyShape
|
|
1452
|
-
|
|
1453
|
-
.properties
|
|
1454
|
-
.name
|
|
1455
|
-
.path,
|
|
1456
|
-
value: Maybe.empty(),
|
|
1221
|
+
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
1222
|
+
value: valuesArray,
|
|
1457
1223
|
})),
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
.
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
0
|
|
1467
|
-
? values.map((value) => Maybe.of(value))
|
|
1468
|
-
: Resource.Values.fromValue({
|
|
1224
|
+
}),
|
|
1225
|
+
in_: $shaclPropertyFromRdf({
|
|
1226
|
+
graph: _$options.graph,
|
|
1227
|
+
resource: $resource,
|
|
1228
|
+
propertySchema: PropertyShape.schema.properties.in_,
|
|
1229
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1230
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1231
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1469
1232
|
focusResource: $resource,
|
|
1470
|
-
propertyPath: PropertyShape
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1233
|
+
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
1234
|
+
values: valueList.toArray(),
|
|
1235
|
+
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1236
|
+
switch (term.termType) {
|
|
1237
|
+
case "NamedNode":
|
|
1238
|
+
case "Literal":
|
|
1239
|
+
return Either.of(term);
|
|
1240
|
+
default:
|
|
1241
|
+
return Left(new Resource.MistypedTermValueError({
|
|
1242
|
+
actualValue: term,
|
|
1243
|
+
expectedValueType: "(NamedNode | Literal)",
|
|
1244
|
+
focusResource: $resource,
|
|
1245
|
+
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
1246
|
+
}));
|
|
1247
|
+
}
|
|
1248
|
+
})))))
|
|
1249
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1250
|
+
.map((values) => values.length > 0
|
|
1251
|
+
? values.map((value) => Maybe.of(value))
|
|
1252
|
+
: Resource.Values.fromValue({
|
|
1253
|
+
focusResource: $resource,
|
|
1254
|
+
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
1255
|
+
value: Maybe.empty(),
|
|
1256
|
+
})),
|
|
1257
|
+
}),
|
|
1258
|
+
isDefinedBy: $shaclPropertyFromRdf({
|
|
1259
|
+
graph: _$options.graph,
|
|
1260
|
+
resource: $resource,
|
|
1261
|
+
propertySchema: PropertyShape.schema.properties.isDefinedBy,
|
|
1262
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1263
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1264
|
+
.map((values) => values.length > 0
|
|
1265
|
+
? values.map((value) => Maybe.of(value))
|
|
1266
|
+
: Resource.Values.fromValue({
|
|
1267
|
+
focusResource: $resource,
|
|
1268
|
+
propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
|
|
1269
|
+
value: Maybe.empty(),
|
|
1270
|
+
})),
|
|
1271
|
+
}),
|
|
1272
|
+
label: $shaclPropertyFromRdf({
|
|
1273
|
+
graph: _$options.graph,
|
|
1274
|
+
resource: $resource,
|
|
1275
|
+
propertySchema: PropertyShape.schema.properties.label,
|
|
1276
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1277
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1278
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1279
|
+
.map((values) => values.length > 0
|
|
1280
|
+
? values.map((value) => Maybe.of(value))
|
|
1281
|
+
: Resource.Values.fromValue({
|
|
1282
|
+
focusResource: $resource,
|
|
1283
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
1284
|
+
value: Maybe.empty(),
|
|
1285
|
+
})),
|
|
1286
|
+
}),
|
|
1287
|
+
languageIn: $shaclPropertyFromRdf({
|
|
1288
|
+
graph: _$options.graph,
|
|
1289
|
+
resource: $resource,
|
|
1290
|
+
propertySchema: PropertyShape.schema.properties.languageIn,
|
|
1291
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1292
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1293
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1496
1294
|
focusResource: $resource,
|
|
1497
|
-
propertyPath: PropertyShape
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
.map((values) => values.toArray())
|
|
1513
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
1514
|
-
focusResource: $resource,
|
|
1515
|
-
propertyPath: PropertyShape
|
|
1516
|
-
.schema
|
|
1517
|
-
.properties
|
|
1518
|
-
.not
|
|
1519
|
-
.path,
|
|
1520
|
-
value: valuesArray,
|
|
1521
|
-
})),
|
|
1522
|
-
}).chain((not) => $shaclPropertyFromRdf({
|
|
1523
|
-
graph: _$options.graph,
|
|
1524
|
-
resource: $resource,
|
|
1525
|
-
propertySchema: PropertyShape.schema
|
|
1526
|
-
.properties
|
|
1527
|
-
.or,
|
|
1528
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1529
|
-
.chain((values) => values.chainMap((value) => value.toList({
|
|
1295
|
+
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
1296
|
+
values: valueList.toArray(),
|
|
1297
|
+
}))
|
|
1298
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1299
|
+
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
1300
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1301
|
+
.map((values) => values.length > 0
|
|
1302
|
+
? values.map((value) => Maybe.of(value))
|
|
1303
|
+
: Resource.Values.fromValue({
|
|
1304
|
+
focusResource: $resource,
|
|
1305
|
+
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
1306
|
+
value: Maybe.empty(),
|
|
1307
|
+
})),
|
|
1308
|
+
}),
|
|
1309
|
+
maxCount: $shaclPropertyFromRdf({
|
|
1530
1310
|
graph: _$options.graph,
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
.
|
|
1536
|
-
.
|
|
1537
|
-
.
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
:
|
|
1311
|
+
resource: $resource,
|
|
1312
|
+
propertySchema: PropertyShape.schema.properties.maxCount,
|
|
1313
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1314
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1315
|
+
.map((values) => values.length > 0
|
|
1316
|
+
? values.map((value) => Maybe.of(value))
|
|
1317
|
+
: Resource.Values.fromValue({
|
|
1318
|
+
focusResource: $resource,
|
|
1319
|
+
propertyPath: PropertyShape.schema.properties.maxCount.path,
|
|
1320
|
+
value: Maybe.empty(),
|
|
1321
|
+
})),
|
|
1322
|
+
}),
|
|
1323
|
+
maxExclusive: $shaclPropertyFromRdf({
|
|
1324
|
+
graph: _$options.graph,
|
|
1325
|
+
resource: $resource,
|
|
1326
|
+
propertySchema: PropertyShape.schema.properties.maxExclusive,
|
|
1327
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1328
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1329
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
1330
|
+
.map((values) => values.length > 0
|
|
1331
|
+
? values.map((value) => Maybe.of(value))
|
|
1332
|
+
: Resource.Values.fromValue({
|
|
1333
|
+
focusResource: $resource,
|
|
1334
|
+
propertyPath: PropertyShape.schema.properties.maxExclusive.path,
|
|
1335
|
+
value: Maybe.empty(),
|
|
1336
|
+
})),
|
|
1337
|
+
}),
|
|
1338
|
+
maxInclusive: $shaclPropertyFromRdf({
|
|
1339
|
+
graph: _$options.graph,
|
|
1340
|
+
resource: $resource,
|
|
1341
|
+
propertySchema: PropertyShape.schema.properties.maxInclusive,
|
|
1342
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1343
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1344
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
1345
|
+
.map((values) => values.length > 0
|
|
1346
|
+
? values.map((value) => Maybe.of(value))
|
|
1347
|
+
: Resource.Values.fromValue({
|
|
1348
|
+
focusResource: $resource,
|
|
1349
|
+
propertyPath: PropertyShape.schema.properties.maxInclusive.path,
|
|
1350
|
+
value: Maybe.empty(),
|
|
1351
|
+
})),
|
|
1352
|
+
}),
|
|
1353
|
+
maxLength: $shaclPropertyFromRdf({
|
|
1354
|
+
graph: _$options.graph,
|
|
1355
|
+
resource: $resource,
|
|
1356
|
+
propertySchema: PropertyShape.schema.properties.maxLength,
|
|
1357
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1358
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1359
|
+
.map((values) => values.length > 0
|
|
1360
|
+
? values.map((value) => Maybe.of(value))
|
|
1361
|
+
: Resource.Values.fromValue({
|
|
1362
|
+
focusResource: $resource,
|
|
1363
|
+
propertyPath: PropertyShape.schema.properties.maxLength.path,
|
|
1364
|
+
value: Maybe.empty(),
|
|
1365
|
+
})),
|
|
1366
|
+
}),
|
|
1367
|
+
minCount: $shaclPropertyFromRdf({
|
|
1368
|
+
graph: _$options.graph,
|
|
1369
|
+
resource: $resource,
|
|
1370
|
+
propertySchema: PropertyShape.schema.properties.minCount,
|
|
1371
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1372
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1373
|
+
.map((values) => values.length > 0
|
|
1374
|
+
? values.map((value) => Maybe.of(value))
|
|
1375
|
+
: Resource.Values.fromValue({
|
|
1376
|
+
focusResource: $resource,
|
|
1377
|
+
propertyPath: PropertyShape.schema.properties.minCount.path,
|
|
1378
|
+
value: Maybe.empty(),
|
|
1379
|
+
})),
|
|
1380
|
+
}),
|
|
1381
|
+
minExclusive: $shaclPropertyFromRdf({
|
|
1382
|
+
graph: _$options.graph,
|
|
1383
|
+
resource: $resource,
|
|
1384
|
+
propertySchema: PropertyShape.schema.properties.minExclusive,
|
|
1385
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1386
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1387
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
1388
|
+
.map((values) => values.length > 0
|
|
1389
|
+
? values.map((value) => Maybe.of(value))
|
|
1390
|
+
: Resource.Values.fromValue({
|
|
1391
|
+
focusResource: $resource,
|
|
1392
|
+
propertyPath: PropertyShape.schema.properties.minExclusive.path,
|
|
1393
|
+
value: Maybe.empty(),
|
|
1394
|
+
})),
|
|
1395
|
+
}),
|
|
1396
|
+
minInclusive: $shaclPropertyFromRdf({
|
|
1397
|
+
graph: _$options.graph,
|
|
1398
|
+
resource: $resource,
|
|
1399
|
+
propertySchema: PropertyShape.schema.properties.minInclusive,
|
|
1400
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1401
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1402
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
1403
|
+
.map((values) => values.length > 0
|
|
1404
|
+
? values.map((value) => Maybe.of(value))
|
|
1405
|
+
: Resource.Values.fromValue({
|
|
1406
|
+
focusResource: $resource,
|
|
1407
|
+
propertyPath: PropertyShape.schema.properties.minInclusive.path,
|
|
1408
|
+
value: Maybe.empty(),
|
|
1409
|
+
})),
|
|
1410
|
+
}),
|
|
1411
|
+
minLength: $shaclPropertyFromRdf({
|
|
1412
|
+
graph: _$options.graph,
|
|
1413
|
+
resource: $resource,
|
|
1414
|
+
propertySchema: PropertyShape.schema.properties.minLength,
|
|
1415
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1416
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1417
|
+
.map((values) => values.length > 0
|
|
1418
|
+
? values.map((value) => Maybe.of(value))
|
|
1419
|
+
: Resource.Values.fromValue({
|
|
1420
|
+
focusResource: $resource,
|
|
1421
|
+
propertyPath: PropertyShape.schema.properties.minLength.path,
|
|
1422
|
+
value: Maybe.empty(),
|
|
1423
|
+
})),
|
|
1424
|
+
}),
|
|
1425
|
+
name: $shaclPropertyFromRdf({
|
|
1426
|
+
graph: _$options.graph,
|
|
1427
|
+
resource: $resource,
|
|
1428
|
+
propertySchema: PropertyShape.schema.properties.name,
|
|
1429
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1430
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1431
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1432
|
+
.map((values) => values.length > 0
|
|
1433
|
+
? values.map((value) => Maybe.of(value))
|
|
1434
|
+
: Resource.Values.fromValue({
|
|
1435
|
+
focusResource: $resource,
|
|
1436
|
+
propertyPath: PropertyShape.schema.properties.name.path,
|
|
1437
|
+
value: Maybe.empty(),
|
|
1438
|
+
})),
|
|
1439
|
+
}),
|
|
1440
|
+
node: $shaclPropertyFromRdf({
|
|
1441
|
+
graph: _$options.graph,
|
|
1442
|
+
resource: $resource,
|
|
1443
|
+
propertySchema: PropertyShape.schema.properties.node,
|
|
1444
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1445
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1446
|
+
.map((values) => values.length > 0
|
|
1447
|
+
? values.map((value) => Maybe.of(value))
|
|
1448
|
+
: Resource.Values.fromValue({
|
|
1449
|
+
focusResource: $resource,
|
|
1450
|
+
propertyPath: PropertyShape.schema.properties.node.path,
|
|
1451
|
+
value: Maybe.empty(),
|
|
1452
|
+
})),
|
|
1453
|
+
}),
|
|
1454
|
+
nodeKind: $shaclPropertyFromRdf({
|
|
1455
|
+
graph: _$options.graph,
|
|
1456
|
+
resource: $resource,
|
|
1457
|
+
propertySchema: PropertyShape.schema.properties.nodeKind,
|
|
1458
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1459
|
+
.chain((values) => values.chainMap((value) => value.toIri([
|
|
1460
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
|
|
1461
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
|
|
1462
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
|
|
1463
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
|
|
1464
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
|
|
1465
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
|
|
1466
|
+
])))
|
|
1467
|
+
.map((values) => values.length > 0
|
|
1468
|
+
? values.map((value) => Maybe.of(value))
|
|
1469
|
+
: Resource.Values.fromValue({
|
|
1470
|
+
focusResource: $resource,
|
|
1471
|
+
propertyPath: PropertyShape.schema.properties.nodeKind.path,
|
|
1472
|
+
value: Maybe.empty(),
|
|
1473
|
+
})),
|
|
1474
|
+
}),
|
|
1475
|
+
not: $shaclPropertyFromRdf({
|
|
1476
|
+
graph: _$options.graph,
|
|
1477
|
+
resource: $resource,
|
|
1478
|
+
propertySchema: PropertyShape.schema.properties.not,
|
|
1479
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1480
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1481
|
+
.map((values) => values.toArray())
|
|
1482
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
1546
1483
|
focusResource: $resource,
|
|
1547
|
-
propertyPath: PropertyShape
|
|
1548
|
-
|
|
1549
|
-
.properties
|
|
1550
|
-
.or
|
|
1551
|
-
.path,
|
|
1552
|
-
value: Maybe.empty(),
|
|
1484
|
+
propertyPath: PropertyShape.schema.properties.not.path,
|
|
1485
|
+
value: valuesArray,
|
|
1553
1486
|
})),
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
.properties
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
.map((values) => values.length >
|
|
1563
|
-
0
|
|
1564
|
-
? values.map((value) => Maybe.of(value))
|
|
1565
|
-
: Resource.Values.fromValue({
|
|
1487
|
+
}),
|
|
1488
|
+
or: $shaclPropertyFromRdf({
|
|
1489
|
+
graph: _$options.graph,
|
|
1490
|
+
resource: $resource,
|
|
1491
|
+
propertySchema: PropertyShape.schema.properties.or,
|
|
1492
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1493
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1494
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1566
1495
|
focusResource: $resource,
|
|
1567
|
-
propertyPath: PropertyShape
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
value
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
|
|
1581
|
-
context: _$options.context,
|
|
1496
|
+
propertyPath: PropertyShape.schema.properties.or.path,
|
|
1497
|
+
values: valueList.toArray(),
|
|
1498
|
+
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
1499
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1500
|
+
.map((values) => values.length > 0
|
|
1501
|
+
? values.map((value) => Maybe.of(value))
|
|
1502
|
+
: Resource.Values.fromValue({
|
|
1503
|
+
focusResource: $resource,
|
|
1504
|
+
propertyPath: PropertyShape.schema.properties.or.path,
|
|
1505
|
+
value: Maybe.empty(),
|
|
1506
|
+
})),
|
|
1507
|
+
}),
|
|
1508
|
+
order: $shaclPropertyFromRdf({
|
|
1582
1509
|
graph: _$options.graph,
|
|
1583
|
-
preferredLanguages: _$options.preferredLanguages,
|
|
1584
|
-
objectSet: _$options.objectSet,
|
|
1585
1510
|
resource: $resource,
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
.
|
|
1589
|
-
.
|
|
1590
|
-
.
|
|
1591
|
-
.
|
|
1511
|
+
propertySchema: PropertyShape.schema.properties.order,
|
|
1512
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1513
|
+
.chain((values) => values.chainMap((value) => value.toFloat()))
|
|
1514
|
+
.map((values) => values.length > 0
|
|
1515
|
+
? values.map((value) => Maybe.of(value))
|
|
1516
|
+
: Resource.Values.fromValue({
|
|
1517
|
+
focusResource: $resource,
|
|
1518
|
+
propertyPath: PropertyShape.schema.properties.order.path,
|
|
1519
|
+
value: Maybe.empty(),
|
|
1520
|
+
})),
|
|
1592
1521
|
}),
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
.
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
.properties
|
|
1617
|
-
.uniqueLang,
|
|
1618
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1619
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1620
|
-
.map((values) => values.length >
|
|
1621
|
-
0
|
|
1622
|
-
? values.map((value) => Maybe.of(value))
|
|
1623
|
-
: Resource.Values.fromValue({
|
|
1522
|
+
path: $shaclPropertyFromRdf({
|
|
1523
|
+
graph: _$options.graph,
|
|
1524
|
+
resource: $resource,
|
|
1525
|
+
propertySchema: PropertyShape.schema.properties.path,
|
|
1526
|
+
typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
|
|
1527
|
+
context: _$options.context,
|
|
1528
|
+
graph: _$options.graph,
|
|
1529
|
+
objectSet: _$options.objectSet,
|
|
1530
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1531
|
+
resource: $resource,
|
|
1532
|
+
ignoreRdfType: true,
|
|
1533
|
+
propertyPath: PropertyShape.schema.properties.path.path,
|
|
1534
|
+
}),
|
|
1535
|
+
}),
|
|
1536
|
+
patterns: $shaclPropertyFromRdf({
|
|
1537
|
+
graph: _$options.graph,
|
|
1538
|
+
resource: $resource,
|
|
1539
|
+
propertySchema: PropertyShape.schema.properties.patterns,
|
|
1540
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1541
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1542
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1543
|
+
.map((values) => values.toArray())
|
|
1544
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
1624
1545
|
focusResource: $resource,
|
|
1625
|
-
propertyPath: PropertyShape
|
|
1626
|
-
|
|
1627
|
-
.properties
|
|
1628
|
-
.uniqueLang
|
|
1629
|
-
.path,
|
|
1630
|
-
value: Maybe.empty(),
|
|
1546
|
+
propertyPath: PropertyShape.schema.properties.patterns.path,
|
|
1547
|
+
value: valuesArray,
|
|
1631
1548
|
})),
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
resource: $resource,
|
|
1635
|
-
propertySchema: PropertyShape.schema
|
|
1636
|
-
.properties
|
|
1637
|
-
.xone,
|
|
1638
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1639
|
-
.chain((values) => values.chainMap((value) => value.toList({
|
|
1549
|
+
}),
|
|
1550
|
+
uniqueLang: $shaclPropertyFromRdf({
|
|
1640
1551
|
graph: _$options.graph,
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
.
|
|
1646
|
-
.
|
|
1647
|
-
.
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
:
|
|
1552
|
+
resource: $resource,
|
|
1553
|
+
propertySchema: PropertyShape.schema.properties.uniqueLang,
|
|
1554
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1555
|
+
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1556
|
+
.map((values) => values.length > 0
|
|
1557
|
+
? values.map((value) => Maybe.of(value))
|
|
1558
|
+
: Resource.Values.fromValue({
|
|
1559
|
+
focusResource: $resource,
|
|
1560
|
+
propertyPath: PropertyShape.schema.properties.uniqueLang.path,
|
|
1561
|
+
value: Maybe.empty(),
|
|
1562
|
+
})),
|
|
1563
|
+
}),
|
|
1564
|
+
xone: $shaclPropertyFromRdf({
|
|
1565
|
+
graph: _$options.graph,
|
|
1566
|
+
resource: $resource,
|
|
1567
|
+
propertySchema: PropertyShape.schema.properties.xone,
|
|
1568
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
1569
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1570
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1656
1571
|
focusResource: $resource,
|
|
1657
|
-
propertyPath: PropertyShape
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
value
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
deactivated,
|
|
1671
|
-
defaultValue,
|
|
1672
|
-
description,
|
|
1673
|
-
flags,
|
|
1674
|
-
groups,
|
|
1675
|
-
hasValues,
|
|
1676
|
-
in_,
|
|
1677
|
-
isDefinedBy,
|
|
1678
|
-
label,
|
|
1679
|
-
languageIn,
|
|
1680
|
-
maxCount,
|
|
1681
|
-
maxExclusive,
|
|
1682
|
-
maxInclusive,
|
|
1683
|
-
maxLength,
|
|
1684
|
-
minCount,
|
|
1685
|
-
minExclusive,
|
|
1686
|
-
minInclusive,
|
|
1687
|
-
minLength,
|
|
1688
|
-
name,
|
|
1689
|
-
node,
|
|
1690
|
-
nodeKind,
|
|
1691
|
-
not,
|
|
1692
|
-
or,
|
|
1693
|
-
order,
|
|
1694
|
-
path,
|
|
1695
|
-
patterns,
|
|
1696
|
-
uniqueLang,
|
|
1697
|
-
xone,
|
|
1698
|
-
})))))))))))))))))))))))))))))))))));
|
|
1572
|
+
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
1573
|
+
values: valueList.toArray(),
|
|
1574
|
+
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
1575
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1576
|
+
.map((values) => values.length > 0
|
|
1577
|
+
? values.map((value) => Maybe.of(value))
|
|
1578
|
+
: Resource.Values.fromValue({
|
|
1579
|
+
focusResource: $resource,
|
|
1580
|
+
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
1581
|
+
value: Maybe.empty(),
|
|
1582
|
+
})),
|
|
1583
|
+
}),
|
|
1584
|
+
}).map((properties) => create(properties)));
|
|
1699
1585
|
};
|
|
1700
1586
|
PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
|
|
1701
1587
|
PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
@@ -2296,43 +2182,46 @@ export var PropertyGroup;
|
|
|
2296
2182
|
}
|
|
2297
2183
|
return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyGroup)`));
|
|
2298
2184
|
})
|
|
2299
|
-
: Right(true)).chain((_rdfTypeCheck) =>
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
.
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2185
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
2186
|
+
$identifier: Right(new Resource.Value({
|
|
2187
|
+
dataFactory: dataFactory,
|
|
2188
|
+
focusResource: $resource,
|
|
2189
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
2190
|
+
term: $resource.identifier,
|
|
2191
|
+
}).toValues())
|
|
2192
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2193
|
+
.chain((values) => values.head()),
|
|
2194
|
+
comment: $shaclPropertyFromRdf({
|
|
2195
|
+
graph: _$options.graph,
|
|
2196
|
+
resource: $resource,
|
|
2197
|
+
propertySchema: PropertyGroup.schema.properties.comment,
|
|
2198
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
2199
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2200
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2201
|
+
.map((values) => values.length > 0
|
|
2202
|
+
? values.map((value) => Maybe.of(value))
|
|
2203
|
+
: Resource.Values.fromValue({
|
|
2204
|
+
focusResource: $resource,
|
|
2205
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
2206
|
+
value: Maybe.empty(),
|
|
2207
|
+
})),
|
|
2208
|
+
}),
|
|
2209
|
+
label: $shaclPropertyFromRdf({
|
|
2210
|
+
graph: _$options.graph,
|
|
2211
|
+
resource: $resource,
|
|
2212
|
+
propertySchema: PropertyGroup.schema.properties.label,
|
|
2213
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
2214
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2215
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2216
|
+
.map((values) => values.length > 0
|
|
2217
|
+
? values.map((value) => Maybe.of(value))
|
|
2218
|
+
: Resource.Values.fromValue({
|
|
2219
|
+
focusResource: $resource,
|
|
2220
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2221
|
+
value: Maybe.empty(),
|
|
2222
|
+
})),
|
|
2223
|
+
}),
|
|
2224
|
+
}).map((properties) => create(properties)));
|
|
2336
2225
|
};
|
|
2337
2226
|
PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
|
|
2338
2227
|
PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
@@ -2495,43 +2384,46 @@ export var Ontology;
|
|
|
2495
2384
|
}
|
|
2496
2385
|
return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/2002/07/owl#Ontology)`));
|
|
2497
2386
|
})
|
|
2498
|
-
: Right(true)).chain((_rdfTypeCheck) =>
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
.
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2387
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
2388
|
+
$identifier: Right(new Resource.Value({
|
|
2389
|
+
dataFactory: dataFactory,
|
|
2390
|
+
focusResource: $resource,
|
|
2391
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
2392
|
+
term: $resource.identifier,
|
|
2393
|
+
}).toValues())
|
|
2394
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2395
|
+
.chain((values) => values.head()),
|
|
2396
|
+
comment: $shaclPropertyFromRdf({
|
|
2397
|
+
graph: _$options.graph,
|
|
2398
|
+
resource: $resource,
|
|
2399
|
+
propertySchema: Ontology.schema.properties.comment,
|
|
2400
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
2401
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2402
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2403
|
+
.map((values) => values.length > 0
|
|
2404
|
+
? values.map((value) => Maybe.of(value))
|
|
2405
|
+
: Resource.Values.fromValue({
|
|
2406
|
+
focusResource: $resource,
|
|
2407
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
2408
|
+
value: Maybe.empty(),
|
|
2409
|
+
})),
|
|
2410
|
+
}),
|
|
2411
|
+
label: $shaclPropertyFromRdf({
|
|
2412
|
+
graph: _$options.graph,
|
|
2413
|
+
resource: $resource,
|
|
2414
|
+
propertySchema: Ontology.schema.properties.label,
|
|
2415
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
2416
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2417
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2418
|
+
.map((values) => values.length > 0
|
|
2419
|
+
? values.map((value) => Maybe.of(value))
|
|
2420
|
+
: Resource.Values.fromValue({
|
|
2421
|
+
focusResource: $resource,
|
|
2422
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2423
|
+
value: Maybe.empty(),
|
|
2424
|
+
})),
|
|
2425
|
+
}),
|
|
2426
|
+
}).map((properties) => create(properties)));
|
|
2535
2427
|
};
|
|
2536
2428
|
Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
|
|
2537
2429
|
Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
@@ -3318,610 +3210,507 @@ export var NodeShape;
|
|
|
3318
3210
|
}
|
|
3319
3211
|
return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#NodeShape)`));
|
|
3320
3212
|
})
|
|
3321
|
-
: Right(true)).chain((_rdfTypeCheck) =>
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
propertyPath: $RdfVocabularies.rdf.subject,
|
|
3325
|
-
term: $resource.identifier,
|
|
3326
|
-
}).toValues())
|
|
3327
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3328
|
-
.chain((values) => values.head())
|
|
3329
|
-
.chain(($identifier) => $shaclPropertyFromRdf({
|
|
3330
|
-
graph: _$options.graph,
|
|
3331
|
-
resource: $resource,
|
|
3332
|
-
propertySchema: NodeShape.schema.properties.and,
|
|
3333
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3334
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3335
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3336
|
-
focusResource: $resource,
|
|
3337
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3338
|
-
values: valueList.toArray(),
|
|
3339
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3340
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3341
|
-
.map((values) => values.length > 0
|
|
3342
|
-
? values.map((value) => Maybe.of(value))
|
|
3343
|
-
: Resource.Values.fromValue({
|
|
3344
|
-
focusResource: $resource,
|
|
3345
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3346
|
-
value: Maybe.empty(),
|
|
3347
|
-
})),
|
|
3348
|
-
}).chain((and) => $shaclPropertyFromRdf({
|
|
3349
|
-
graph: _$options.graph,
|
|
3350
|
-
resource: $resource,
|
|
3351
|
-
propertySchema: NodeShape.schema.properties.classes,
|
|
3352
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3353
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3354
|
-
.map((values) => values.toArray())
|
|
3355
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3356
|
-
focusResource: $resource,
|
|
3357
|
-
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
3358
|
-
value: valuesArray,
|
|
3359
|
-
})),
|
|
3360
|
-
}).chain((classes) => $shaclPropertyFromRdf({
|
|
3361
|
-
graph: _$options.graph,
|
|
3362
|
-
resource: $resource,
|
|
3363
|
-
propertySchema: NodeShape.schema.properties.closed,
|
|
3364
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3365
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3366
|
-
.map((values) => values.length > 0
|
|
3367
|
-
? values.map((value) => Maybe.of(value))
|
|
3368
|
-
: Resource.Values.fromValue({
|
|
3369
|
-
focusResource: $resource,
|
|
3370
|
-
propertyPath: NodeShape.schema.properties.closed.path,
|
|
3371
|
-
value: Maybe.empty(),
|
|
3372
|
-
})),
|
|
3373
|
-
}).chain((closed) => $shaclPropertyFromRdf({
|
|
3374
|
-
graph: _$options.graph,
|
|
3375
|
-
resource: $resource,
|
|
3376
|
-
propertySchema: NodeShape.schema.properties.comment,
|
|
3377
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3378
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3379
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3380
|
-
.map((values) => values.length > 0
|
|
3381
|
-
? values.map((value) => Maybe.of(value))
|
|
3382
|
-
: Resource.Values.fromValue({
|
|
3383
|
-
focusResource: $resource,
|
|
3384
|
-
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
3385
|
-
value: Maybe.empty(),
|
|
3386
|
-
})),
|
|
3387
|
-
}).chain((comment) => $shaclPropertyFromRdf({
|
|
3388
|
-
graph: _$options.graph,
|
|
3389
|
-
resource: $resource,
|
|
3390
|
-
propertySchema: NodeShape.schema.properties.datatype,
|
|
3391
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3392
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3393
|
-
.map((values) => values.length > 0
|
|
3394
|
-
? values.map((value) => Maybe.of(value))
|
|
3395
|
-
: Resource.Values.fromValue({
|
|
3396
|
-
focusResource: $resource,
|
|
3397
|
-
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
3398
|
-
value: Maybe.empty(),
|
|
3399
|
-
})),
|
|
3400
|
-
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
3401
|
-
graph: _$options.graph,
|
|
3402
|
-
resource: $resource,
|
|
3403
|
-
propertySchema: NodeShape.schema.properties.deactivated,
|
|
3404
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3405
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3406
|
-
.map((values) => values.length > 0
|
|
3407
|
-
? values.map((value) => Maybe.of(value))
|
|
3408
|
-
: Resource.Values.fromValue({
|
|
3409
|
-
focusResource: $resource,
|
|
3410
|
-
propertyPath: PropertyShape.schema.properties.deactivated
|
|
3411
|
-
.path,
|
|
3412
|
-
value: Maybe.empty(),
|
|
3413
|
-
})),
|
|
3414
|
-
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
3415
|
-
graph: _$options.graph,
|
|
3416
|
-
resource: $resource,
|
|
3417
|
-
propertySchema: NodeShape.schema.properties.flags,
|
|
3418
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3419
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3420
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3421
|
-
.map((values) => values.toArray())
|
|
3422
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3423
|
-
focusResource: $resource,
|
|
3424
|
-
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
3425
|
-
value: valuesArray,
|
|
3426
|
-
})),
|
|
3427
|
-
}).chain((flags) => $shaclPropertyFromRdf({
|
|
3428
|
-
graph: _$options.graph,
|
|
3429
|
-
resource: $resource,
|
|
3430
|
-
propertySchema: NodeShape.schema.properties.hasValues,
|
|
3431
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3432
|
-
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
3433
|
-
switch (term.termType) {
|
|
3434
|
-
case "NamedNode":
|
|
3435
|
-
case "Literal":
|
|
3436
|
-
return Either.of(term);
|
|
3437
|
-
default:
|
|
3438
|
-
return Left(new Resource.MistypedTermValueError({
|
|
3439
|
-
actualValue: term,
|
|
3440
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
3441
|
-
focusResource: $resource,
|
|
3442
|
-
propertyPath: PropertyShape.schema.properties
|
|
3443
|
-
.hasValues.path,
|
|
3444
|
-
}));
|
|
3445
|
-
}
|
|
3446
|
-
})))
|
|
3447
|
-
.map((values) => values.toArray())
|
|
3448
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3449
|
-
focusResource: $resource,
|
|
3450
|
-
propertyPath: PropertyShape.schema.properties.hasValues
|
|
3451
|
-
.path,
|
|
3452
|
-
value: valuesArray,
|
|
3453
|
-
})),
|
|
3454
|
-
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
3455
|
-
graph: _$options.graph,
|
|
3456
|
-
resource: $resource,
|
|
3457
|
-
propertySchema: NodeShape.schema.properties.ignoredProperties,
|
|
3458
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3459
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3460
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3461
|
-
focusResource: $resource,
|
|
3462
|
-
propertyPath: NodeShape.schema.properties
|
|
3463
|
-
.ignoredProperties.path,
|
|
3464
|
-
values: valueList.toArray(),
|
|
3465
|
-
})).chain((values) => values.chainMap((value) => value.toIri()))))
|
|
3466
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3467
|
-
.map((values) => values.length > 0
|
|
3468
|
-
? values.map((value) => Maybe.of(value))
|
|
3469
|
-
: Resource.Values.fromValue({
|
|
3470
|
-
focusResource: $resource,
|
|
3471
|
-
propertyPath: NodeShape.schema.properties
|
|
3472
|
-
.ignoredProperties.path,
|
|
3473
|
-
value: Maybe.empty(),
|
|
3474
|
-
})),
|
|
3475
|
-
}).chain((ignoredProperties) => $shaclPropertyFromRdf({
|
|
3476
|
-
graph: _$options.graph,
|
|
3477
|
-
resource: $resource,
|
|
3478
|
-
propertySchema: NodeShape.schema.properties.in_,
|
|
3479
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3480
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3481
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3213
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
3214
|
+
$identifier: Right(new Resource.Value({
|
|
3215
|
+
dataFactory: dataFactory,
|
|
3482
3216
|
focusResource: $resource,
|
|
3483
|
-
propertyPath:
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
3487
|
-
switch (term.termType) {
|
|
3488
|
-
case "NamedNode":
|
|
3489
|
-
case "Literal":
|
|
3490
|
-
return Either.of(term);
|
|
3491
|
-
default:
|
|
3492
|
-
return Left(new Resource.MistypedTermValueError({
|
|
3493
|
-
actualValue: term,
|
|
3494
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
3495
|
-
focusResource: $resource,
|
|
3496
|
-
propertyPath: PropertyShape.schema
|
|
3497
|
-
.properties.in_.path,
|
|
3498
|
-
}));
|
|
3499
|
-
}
|
|
3500
|
-
})))))
|
|
3501
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3502
|
-
.map((values) => values.length > 0
|
|
3503
|
-
? values.map((value) => Maybe.of(value))
|
|
3504
|
-
: Resource.Values.fromValue({
|
|
3505
|
-
focusResource: $resource,
|
|
3506
|
-
propertyPath: PropertyShape.schema.properties.in_
|
|
3507
|
-
.path,
|
|
3508
|
-
value: Maybe.empty(),
|
|
3509
|
-
})),
|
|
3510
|
-
}).chain((in_) => $shaclPropertyFromRdf({
|
|
3511
|
-
graph: _$options.graph,
|
|
3512
|
-
resource: $resource,
|
|
3513
|
-
propertySchema: NodeShape.schema.properties.isDefinedBy,
|
|
3514
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3217
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
3218
|
+
term: $resource.identifier,
|
|
3219
|
+
}).toValues())
|
|
3515
3220
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3516
|
-
.
|
|
3517
|
-
|
|
3518
|
-
:
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
value:
|
|
3523
|
-
|
|
3524
|
-
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
3525
|
-
graph: _$options.graph,
|
|
3526
|
-
resource: $resource,
|
|
3527
|
-
propertySchema: NodeShape.schema.properties.label,
|
|
3528
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3529
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3530
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3531
|
-
.map((values) => values.length > 0
|
|
3532
|
-
? values.map((value) => Maybe.of(value))
|
|
3533
|
-
: Resource.Values.fromValue({
|
|
3221
|
+
.chain((values) => values.head()),
|
|
3222
|
+
and: $shaclPropertyFromRdf({
|
|
3223
|
+
graph: _$options.graph,
|
|
3224
|
+
resource: $resource,
|
|
3225
|
+
propertySchema: NodeShape.schema.properties.and,
|
|
3226
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3227
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3228
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3534
3229
|
focusResource: $resource,
|
|
3535
|
-
propertyPath: PropertyShape.schema.properties
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3230
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3231
|
+
values: valueList.toArray(),
|
|
3232
|
+
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3233
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3234
|
+
.map((values) => values.length > 0
|
|
3235
|
+
? values.map((value) => Maybe.of(value))
|
|
3236
|
+
: Resource.Values.fromValue({
|
|
3237
|
+
focusResource: $resource,
|
|
3238
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3239
|
+
value: Maybe.empty(),
|
|
3240
|
+
})),
|
|
3241
|
+
}),
|
|
3242
|
+
classes: $shaclPropertyFromRdf({
|
|
3545
3243
|
graph: _$options.graph,
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
.
|
|
3551
|
-
|
|
3552
|
-
}))
|
|
3553
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3554
|
-
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
3555
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3556
|
-
.map((values) => values.length > 0
|
|
3557
|
-
? values.map((value) => Maybe.of(value))
|
|
3558
|
-
: Resource.Values.fromValue({
|
|
3244
|
+
resource: $resource,
|
|
3245
|
+
propertySchema: NodeShape.schema.properties.classes,
|
|
3246
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3247
|
+
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3248
|
+
.map((values) => values.toArray())
|
|
3249
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3559
3250
|
focusResource: $resource,
|
|
3560
|
-
propertyPath: PropertyShape.schema
|
|
3561
|
-
|
|
3562
|
-
value: Maybe.empty(),
|
|
3251
|
+
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
3252
|
+
value: valuesArray,
|
|
3563
3253
|
})),
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3254
|
+
}),
|
|
3255
|
+
closed: $shaclPropertyFromRdf({
|
|
3256
|
+
graph: _$options.graph,
|
|
3257
|
+
resource: $resource,
|
|
3258
|
+
propertySchema: NodeShape.schema.properties.closed,
|
|
3259
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3260
|
+
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3261
|
+
.map((values) => values.length > 0
|
|
3262
|
+
? values.map((value) => Maybe.of(value))
|
|
3263
|
+
: Resource.Values.fromValue({
|
|
3264
|
+
focusResource: $resource,
|
|
3265
|
+
propertyPath: NodeShape.schema.properties.closed.path,
|
|
3266
|
+
value: Maybe.empty(),
|
|
3267
|
+
})),
|
|
3268
|
+
}),
|
|
3269
|
+
comment: $shaclPropertyFromRdf({
|
|
3270
|
+
graph: _$options.graph,
|
|
3271
|
+
resource: $resource,
|
|
3272
|
+
propertySchema: NodeShape.schema.properties.comment,
|
|
3273
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3274
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3275
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3276
|
+
.map((values) => values.length > 0
|
|
3277
|
+
? values.map((value) => Maybe.of(value))
|
|
3278
|
+
: Resource.Values.fromValue({
|
|
3279
|
+
focusResource: $resource,
|
|
3280
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
3281
|
+
value: Maybe.empty(),
|
|
3282
|
+
})),
|
|
3283
|
+
}),
|
|
3284
|
+
datatype: $shaclPropertyFromRdf({
|
|
3285
|
+
graph: _$options.graph,
|
|
3286
|
+
resource: $resource,
|
|
3287
|
+
propertySchema: NodeShape.schema.properties.datatype,
|
|
3288
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3289
|
+
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3290
|
+
.map((values) => values.length > 0
|
|
3291
|
+
? values.map((value) => Maybe.of(value))
|
|
3292
|
+
: Resource.Values.fromValue({
|
|
3293
|
+
focusResource: $resource,
|
|
3294
|
+
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
3295
|
+
value: Maybe.empty(),
|
|
3296
|
+
})),
|
|
3297
|
+
}),
|
|
3298
|
+
deactivated: $shaclPropertyFromRdf({
|
|
3299
|
+
graph: _$options.graph,
|
|
3300
|
+
resource: $resource,
|
|
3301
|
+
propertySchema: NodeShape.schema.properties.deactivated,
|
|
3302
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3303
|
+
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3304
|
+
.map((values) => values.length > 0
|
|
3305
|
+
? values.map((value) => Maybe.of(value))
|
|
3306
|
+
: Resource.Values.fromValue({
|
|
3307
|
+
focusResource: $resource,
|
|
3308
|
+
propertyPath: PropertyShape.schema.properties.deactivated.path,
|
|
3309
|
+
value: Maybe.empty(),
|
|
3310
|
+
})),
|
|
3311
|
+
}),
|
|
3312
|
+
flags: $shaclPropertyFromRdf({
|
|
3313
|
+
graph: _$options.graph,
|
|
3314
|
+
resource: $resource,
|
|
3315
|
+
propertySchema: NodeShape.schema.properties.flags,
|
|
3316
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3317
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3318
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3319
|
+
.map((values) => values.toArray())
|
|
3320
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3573
3321
|
focusResource: $resource,
|
|
3574
|
-
propertyPath: PropertyShape.schema
|
|
3575
|
-
|
|
3576
|
-
value: Maybe.empty(),
|
|
3322
|
+
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
3323
|
+
value: valuesArray,
|
|
3577
3324
|
})),
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3325
|
+
}),
|
|
3326
|
+
hasValues: $shaclPropertyFromRdf({
|
|
3327
|
+
graph: _$options.graph,
|
|
3328
|
+
resource: $resource,
|
|
3329
|
+
propertySchema: NodeShape.schema.properties.hasValues,
|
|
3330
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3331
|
+
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
3332
|
+
switch (term.termType) {
|
|
3333
|
+
case "NamedNode":
|
|
3334
|
+
case "Literal":
|
|
3335
|
+
return Either.of(term);
|
|
3336
|
+
default:
|
|
3337
|
+
return Left(new Resource.MistypedTermValueError({
|
|
3338
|
+
actualValue: term,
|
|
3339
|
+
expectedValueType: "(NamedNode | Literal)",
|
|
3340
|
+
focusResource: $resource,
|
|
3341
|
+
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
3342
|
+
}));
|
|
3343
|
+
}
|
|
3344
|
+
})))
|
|
3345
|
+
.map((values) => values.toArray())
|
|
3346
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3588
3347
|
focusResource: $resource,
|
|
3589
|
-
propertyPath: PropertyShape.schema
|
|
3590
|
-
|
|
3591
|
-
.path,
|
|
3592
|
-
value: Maybe.empty(),
|
|
3348
|
+
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
3349
|
+
value: valuesArray,
|
|
3593
3350
|
})),
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
? values.map((value) => Maybe.of(value))
|
|
3603
|
-
: Resource.Values.fromValue({
|
|
3351
|
+
}),
|
|
3352
|
+
ignoredProperties: $shaclPropertyFromRdf({
|
|
3353
|
+
graph: _$options.graph,
|
|
3354
|
+
resource: $resource,
|
|
3355
|
+
propertySchema: NodeShape.schema.properties.ignoredProperties,
|
|
3356
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3357
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3358
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3604
3359
|
focusResource: $resource,
|
|
3605
|
-
propertyPath:
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
:
|
|
3360
|
+
propertyPath: NodeShape.schema.properties.ignoredProperties.path,
|
|
3361
|
+
values: valueList.toArray(),
|
|
3362
|
+
})).chain((values) => values.chainMap((value) => value.toIri()))))
|
|
3363
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3364
|
+
.map((values) => values.length > 0
|
|
3365
|
+
? values.map((value) => Maybe.of(value))
|
|
3366
|
+
: Resource.Values.fromValue({
|
|
3367
|
+
focusResource: $resource,
|
|
3368
|
+
propertyPath: NodeShape.schema.properties.ignoredProperties.path,
|
|
3369
|
+
value: Maybe.empty(),
|
|
3370
|
+
})),
|
|
3371
|
+
}),
|
|
3372
|
+
in_: $shaclPropertyFromRdf({
|
|
3373
|
+
graph: _$options.graph,
|
|
3374
|
+
resource: $resource,
|
|
3375
|
+
propertySchema: NodeShape.schema.properties.in_,
|
|
3376
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3377
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3378
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3619
3379
|
focusResource: $resource,
|
|
3620
|
-
propertyPath: PropertyShape.schema
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3380
|
+
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
3381
|
+
values: valueList.toArray(),
|
|
3382
|
+
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
3383
|
+
switch (term.termType) {
|
|
3384
|
+
case "NamedNode":
|
|
3385
|
+
case "Literal":
|
|
3386
|
+
return Either.of(term);
|
|
3387
|
+
default:
|
|
3388
|
+
return Left(new Resource.MistypedTermValueError({
|
|
3389
|
+
actualValue: term,
|
|
3390
|
+
expectedValueType: "(NamedNode | Literal)",
|
|
3391
|
+
focusResource: $resource,
|
|
3392
|
+
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
3393
|
+
}));
|
|
3394
|
+
}
|
|
3395
|
+
})))))
|
|
3396
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3397
|
+
.map((values) => values.length > 0
|
|
3398
|
+
? values.map((value) => Maybe.of(value))
|
|
3399
|
+
: Resource.Values.fromValue({
|
|
3400
|
+
focusResource: $resource,
|
|
3401
|
+
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
3402
|
+
value: Maybe.empty(),
|
|
3403
|
+
})),
|
|
3404
|
+
}),
|
|
3405
|
+
isDefinedBy: $shaclPropertyFromRdf({
|
|
3406
|
+
graph: _$options.graph,
|
|
3407
|
+
resource: $resource,
|
|
3408
|
+
propertySchema: NodeShape.schema.properties.isDefinedBy,
|
|
3409
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3410
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3411
|
+
.map((values) => values.length > 0
|
|
3412
|
+
? values.map((value) => Maybe.of(value))
|
|
3413
|
+
: Resource.Values.fromValue({
|
|
3414
|
+
focusResource: $resource,
|
|
3415
|
+
propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
|
|
3416
|
+
value: Maybe.empty(),
|
|
3417
|
+
})),
|
|
3418
|
+
}),
|
|
3419
|
+
label: $shaclPropertyFromRdf({
|
|
3420
|
+
graph: _$options.graph,
|
|
3421
|
+
resource: $resource,
|
|
3422
|
+
propertySchema: NodeShape.schema.properties.label,
|
|
3423
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3424
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3425
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3426
|
+
.map((values) => values.length > 0
|
|
3427
|
+
? values.map((value) => Maybe.of(value))
|
|
3428
|
+
: Resource.Values.fromValue({
|
|
3429
|
+
focusResource: $resource,
|
|
3430
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
3431
|
+
value: Maybe.empty(),
|
|
3432
|
+
})),
|
|
3433
|
+
}),
|
|
3434
|
+
languageIn: $shaclPropertyFromRdf({
|
|
3435
|
+
graph: _$options.graph,
|
|
3436
|
+
resource: $resource,
|
|
3437
|
+
propertySchema: NodeShape.schema.properties.languageIn,
|
|
3438
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3439
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3440
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3634
3441
|
focusResource: $resource,
|
|
3635
|
-
propertyPath: PropertyShape.schema
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
:
|
|
3442
|
+
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
3443
|
+
values: valueList.toArray(),
|
|
3444
|
+
}))
|
|
3445
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3446
|
+
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
3447
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3448
|
+
.map((values) => values.length > 0
|
|
3449
|
+
? values.map((value) => Maybe.of(value))
|
|
3450
|
+
: Resource.Values.fromValue({
|
|
3451
|
+
focusResource: $resource,
|
|
3452
|
+
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
3453
|
+
value: Maybe.empty(),
|
|
3454
|
+
})),
|
|
3455
|
+
}),
|
|
3456
|
+
maxCount: $shaclPropertyFromRdf({
|
|
3457
|
+
graph: _$options.graph,
|
|
3458
|
+
resource: $resource,
|
|
3459
|
+
propertySchema: NodeShape.schema.properties.maxCount,
|
|
3460
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3461
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3462
|
+
.map((values) => values.length > 0
|
|
3463
|
+
? values.map((value) => Maybe.of(value))
|
|
3464
|
+
: Resource.Values.fromValue({
|
|
3465
|
+
focusResource: $resource,
|
|
3466
|
+
propertyPath: PropertyShape.schema.properties.maxCount.path,
|
|
3467
|
+
value: Maybe.empty(),
|
|
3468
|
+
})),
|
|
3469
|
+
}),
|
|
3470
|
+
maxExclusive: $shaclPropertyFromRdf({
|
|
3471
|
+
graph: _$options.graph,
|
|
3472
|
+
resource: $resource,
|
|
3473
|
+
propertySchema: NodeShape.schema.properties.maxExclusive,
|
|
3474
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3475
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3476
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
3477
|
+
.map((values) => values.length > 0
|
|
3478
|
+
? values.map((value) => Maybe.of(value))
|
|
3479
|
+
: Resource.Values.fromValue({
|
|
3480
|
+
focusResource: $resource,
|
|
3481
|
+
propertyPath: PropertyShape.schema.properties.maxExclusive.path,
|
|
3482
|
+
value: Maybe.empty(),
|
|
3483
|
+
})),
|
|
3484
|
+
}),
|
|
3485
|
+
maxInclusive: $shaclPropertyFromRdf({
|
|
3486
|
+
graph: _$options.graph,
|
|
3487
|
+
resource: $resource,
|
|
3488
|
+
propertySchema: NodeShape.schema.properties.maxInclusive,
|
|
3489
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3490
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3491
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
3492
|
+
.map((values) => values.length > 0
|
|
3493
|
+
? values.map((value) => Maybe.of(value))
|
|
3494
|
+
: Resource.Values.fromValue({
|
|
3495
|
+
focusResource: $resource,
|
|
3496
|
+
propertyPath: PropertyShape.schema.properties.maxInclusive.path,
|
|
3497
|
+
value: Maybe.empty(),
|
|
3498
|
+
})),
|
|
3499
|
+
}),
|
|
3500
|
+
maxLength: $shaclPropertyFromRdf({
|
|
3501
|
+
graph: _$options.graph,
|
|
3502
|
+
resource: $resource,
|
|
3503
|
+
propertySchema: NodeShape.schema.properties.maxLength,
|
|
3504
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3505
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3506
|
+
.map((values) => values.length > 0
|
|
3507
|
+
? values.map((value) => Maybe.of(value))
|
|
3508
|
+
: Resource.Values.fromValue({
|
|
3509
|
+
focusResource: $resource,
|
|
3510
|
+
propertyPath: PropertyShape.schema.properties.maxLength.path,
|
|
3511
|
+
value: Maybe.empty(),
|
|
3512
|
+
})),
|
|
3513
|
+
}),
|
|
3514
|
+
minCount: $shaclPropertyFromRdf({
|
|
3515
|
+
graph: _$options.graph,
|
|
3516
|
+
resource: $resource,
|
|
3517
|
+
propertySchema: NodeShape.schema.properties.minCount,
|
|
3518
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3519
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3520
|
+
.map((values) => values.length > 0
|
|
3521
|
+
? values.map((value) => Maybe.of(value))
|
|
3522
|
+
: Resource.Values.fromValue({
|
|
3523
|
+
focusResource: $resource,
|
|
3524
|
+
propertyPath: PropertyShape.schema.properties.minCount.path,
|
|
3525
|
+
value: Maybe.empty(),
|
|
3526
|
+
})),
|
|
3527
|
+
}),
|
|
3528
|
+
minExclusive: $shaclPropertyFromRdf({
|
|
3529
|
+
graph: _$options.graph,
|
|
3530
|
+
resource: $resource,
|
|
3531
|
+
propertySchema: NodeShape.schema.properties.minExclusive,
|
|
3532
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3533
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3534
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
3535
|
+
.map((values) => values.length > 0
|
|
3536
|
+
? values.map((value) => Maybe.of(value))
|
|
3537
|
+
: Resource.Values.fromValue({
|
|
3538
|
+
focusResource: $resource,
|
|
3539
|
+
propertyPath: PropertyShape.schema.properties.minExclusive.path,
|
|
3540
|
+
value: Maybe.empty(),
|
|
3541
|
+
})),
|
|
3542
|
+
}),
|
|
3543
|
+
minInclusive: $shaclPropertyFromRdf({
|
|
3544
|
+
graph: _$options.graph,
|
|
3545
|
+
resource: $resource,
|
|
3546
|
+
propertySchema: NodeShape.schema.properties.minInclusive,
|
|
3547
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3548
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3549
|
+
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
3550
|
+
.map((values) => values.length > 0
|
|
3551
|
+
? values.map((value) => Maybe.of(value))
|
|
3552
|
+
: Resource.Values.fromValue({
|
|
3553
|
+
focusResource: $resource,
|
|
3554
|
+
propertyPath: PropertyShape.schema.properties.minInclusive.path,
|
|
3555
|
+
value: Maybe.empty(),
|
|
3556
|
+
})),
|
|
3557
|
+
}),
|
|
3558
|
+
minLength: $shaclPropertyFromRdf({
|
|
3559
|
+
graph: _$options.graph,
|
|
3560
|
+
resource: $resource,
|
|
3561
|
+
propertySchema: NodeShape.schema.properties.minLength,
|
|
3562
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3563
|
+
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3564
|
+
.map((values) => values.length > 0
|
|
3565
|
+
? values.map((value) => Maybe.of(value))
|
|
3566
|
+
: Resource.Values.fromValue({
|
|
3567
|
+
focusResource: $resource,
|
|
3568
|
+
propertyPath: PropertyShape.schema.properties.minLength.path,
|
|
3569
|
+
value: Maybe.empty(),
|
|
3570
|
+
})),
|
|
3571
|
+
}),
|
|
3572
|
+
node: $shaclPropertyFromRdf({
|
|
3573
|
+
graph: _$options.graph,
|
|
3574
|
+
resource: $resource,
|
|
3575
|
+
propertySchema: NodeShape.schema.properties.node,
|
|
3576
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3577
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3578
|
+
.map((values) => values.length > 0
|
|
3579
|
+
? values.map((value) => Maybe.of(value))
|
|
3580
|
+
: Resource.Values.fromValue({
|
|
3581
|
+
focusResource: $resource,
|
|
3582
|
+
propertyPath: PropertyShape.schema.properties.node.path,
|
|
3583
|
+
value: Maybe.empty(),
|
|
3584
|
+
})),
|
|
3585
|
+
}),
|
|
3586
|
+
nodeKind: $shaclPropertyFromRdf({
|
|
3587
|
+
graph: _$options.graph,
|
|
3588
|
+
resource: $resource,
|
|
3589
|
+
propertySchema: NodeShape.schema.properties.nodeKind,
|
|
3590
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3591
|
+
.chain((values) => values.chainMap((value) => value.toIri([
|
|
3592
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
|
|
3593
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
|
|
3594
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
|
|
3595
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
|
|
3596
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
|
|
3597
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
|
|
3598
|
+
])))
|
|
3599
|
+
.map((values) => values.length > 0
|
|
3600
|
+
? values.map((value) => Maybe.of(value))
|
|
3601
|
+
: Resource.Values.fromValue({
|
|
3602
|
+
focusResource: $resource,
|
|
3603
|
+
propertyPath: PropertyShape.schema.properties.nodeKind.path,
|
|
3604
|
+
value: Maybe.empty(),
|
|
3605
|
+
})),
|
|
3606
|
+
}),
|
|
3607
|
+
not: $shaclPropertyFromRdf({
|
|
3608
|
+
graph: _$options.graph,
|
|
3609
|
+
resource: $resource,
|
|
3610
|
+
propertySchema: NodeShape.schema.properties.not,
|
|
3611
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3612
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3613
|
+
.map((values) => values.toArray())
|
|
3614
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3651
3615
|
focusResource: $resource,
|
|
3652
|
-
propertyPath: PropertyShape
|
|
3653
|
-
|
|
3654
|
-
.properties
|
|
3655
|
-
.minExclusive
|
|
3656
|
-
.path,
|
|
3657
|
-
value: Maybe.empty(),
|
|
3616
|
+
propertyPath: PropertyShape.schema.properties.not.path,
|
|
3617
|
+
value: valuesArray,
|
|
3658
3618
|
})),
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
.
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
.map((values) => values.length > 0
|
|
3668
|
-
? values.map((value) => Maybe.of(value))
|
|
3669
|
-
: Resource.Values.fromValue({
|
|
3619
|
+
}),
|
|
3620
|
+
or: $shaclPropertyFromRdf({
|
|
3621
|
+
graph: _$options.graph,
|
|
3622
|
+
resource: $resource,
|
|
3623
|
+
propertySchema: NodeShape.schema.properties.or,
|
|
3624
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3625
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3626
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3670
3627
|
focusResource: $resource,
|
|
3671
|
-
propertyPath: PropertyShape
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
value
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
:
|
|
3628
|
+
propertyPath: PropertyShape.schema.properties.or.path,
|
|
3629
|
+
values: valueList.toArray(),
|
|
3630
|
+
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3631
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3632
|
+
.map((values) => values.length > 0
|
|
3633
|
+
? values.map((value) => Maybe.of(value))
|
|
3634
|
+
: Resource.Values.fromValue({
|
|
3635
|
+
focusResource: $resource,
|
|
3636
|
+
propertyPath: PropertyShape.schema.properties.or.path,
|
|
3637
|
+
value: Maybe.empty(),
|
|
3638
|
+
})),
|
|
3639
|
+
}),
|
|
3640
|
+
patterns: $shaclPropertyFromRdf({
|
|
3641
|
+
graph: _$options.graph,
|
|
3642
|
+
resource: $resource,
|
|
3643
|
+
propertySchema: NodeShape.schema.properties.patterns,
|
|
3644
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3645
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3646
|
+
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3647
|
+
.map((values) => values.toArray())
|
|
3648
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3688
3649
|
focusResource: $resource,
|
|
3689
|
-
propertyPath: PropertyShape
|
|
3690
|
-
|
|
3691
|
-
.properties
|
|
3692
|
-
.minLength
|
|
3693
|
-
.path,
|
|
3694
|
-
value: Maybe.empty(),
|
|
3650
|
+
propertyPath: PropertyShape.schema.properties.patterns.path,
|
|
3651
|
+
value: valuesArray,
|
|
3695
3652
|
})),
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3653
|
+
}),
|
|
3654
|
+
properties: $shaclPropertyFromRdf({
|
|
3655
|
+
graph: _$options.graph,
|
|
3656
|
+
resource: $resource,
|
|
3657
|
+
propertySchema: NodeShape.schema.properties.properties,
|
|
3658
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3659
|
+
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3660
|
+
.map((values) => values.toArray())
|
|
3661
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3705
3662
|
focusResource: $resource,
|
|
3706
|
-
propertyPath:
|
|
3707
|
-
|
|
3708
|
-
.properties
|
|
3709
|
-
.node
|
|
3710
|
-
.path,
|
|
3711
|
-
value: Maybe.empty(),
|
|
3663
|
+
propertyPath: NodeShape.schema.properties.properties.path,
|
|
3664
|
+
value: valuesArray,
|
|
3712
3665
|
})),
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
.
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
|
|
3723
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
|
|
3724
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
|
|
3725
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
|
|
3726
|
-
])))
|
|
3727
|
-
.map((values) => values.length > 0
|
|
3728
|
-
? values.map((value) => Maybe.of(value))
|
|
3729
|
-
: Resource.Values.fromValue({
|
|
3666
|
+
}),
|
|
3667
|
+
subClassOf: $shaclPropertyFromRdf({
|
|
3668
|
+
graph: _$options.graph,
|
|
3669
|
+
resource: $resource,
|
|
3670
|
+
propertySchema: NodeShape.schema.properties.subClassOf,
|
|
3671
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3672
|
+
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3673
|
+
.map((values) => values.toArray())
|
|
3674
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3730
3675
|
focusResource: $resource,
|
|
3731
|
-
propertyPath:
|
|
3732
|
-
|
|
3733
|
-
.properties
|
|
3734
|
-
.nodeKind
|
|
3735
|
-
.path,
|
|
3736
|
-
value: Maybe.empty(),
|
|
3676
|
+
propertyPath: NodeShape.schema.properties.subClassOf.path,
|
|
3677
|
+
value: valuesArray,
|
|
3737
3678
|
})),
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
resource: $resource,
|
|
3741
|
-
propertySchema: NodeShape.schema.properties
|
|
3742
|
-
.not,
|
|
3743
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3744
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3745
|
-
.map((values) => values.toArray())
|
|
3746
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3747
|
-
focusResource: $resource,
|
|
3748
|
-
propertyPath: PropertyShape
|
|
3749
|
-
.schema
|
|
3750
|
-
.properties
|
|
3751
|
-
.not
|
|
3752
|
-
.path,
|
|
3753
|
-
value: valuesArray,
|
|
3754
|
-
})),
|
|
3755
|
-
}).chain((not) => $shaclPropertyFromRdf({
|
|
3756
|
-
graph: _$options.graph,
|
|
3757
|
-
resource: $resource,
|
|
3758
|
-
propertySchema: NodeShape.schema
|
|
3759
|
-
.properties
|
|
3760
|
-
.or,
|
|
3761
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3762
|
-
.chain((values) => values.chainMap((value) => value.toList({
|
|
3679
|
+
}),
|
|
3680
|
+
types: $shaclPropertyFromRdf({
|
|
3763
3681
|
graph: _$options.graph,
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
.
|
|
3769
|
-
.
|
|
3770
|
-
.or
|
|
3771
|
-
.path,
|
|
3772
|
-
values: valueList.toArray(),
|
|
3773
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3774
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3775
|
-
.map((values) => values.length >
|
|
3776
|
-
0
|
|
3777
|
-
? values.map((value) => Maybe.of(value))
|
|
3778
|
-
: Resource.Values.fromValue({
|
|
3682
|
+
resource: $resource,
|
|
3683
|
+
propertySchema: NodeShape.schema.properties.types,
|
|
3684
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3685
|
+
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3686
|
+
.map((values) => values.toArray())
|
|
3687
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
3779
3688
|
focusResource: $resource,
|
|
3780
|
-
propertyPath:
|
|
3781
|
-
|
|
3782
|
-
.properties
|
|
3783
|
-
.or
|
|
3784
|
-
.path,
|
|
3785
|
-
value: Maybe.empty(),
|
|
3689
|
+
propertyPath: NodeShape.schema.properties.types.path,
|
|
3690
|
+
value: valuesArray,
|
|
3786
3691
|
})),
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
resource: $resource,
|
|
3790
|
-
propertySchema: NodeShape.schema
|
|
3791
|
-
.properties
|
|
3792
|
-
.patterns,
|
|
3793
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3794
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3795
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3796
|
-
.map((values) => values.toArray())
|
|
3797
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3798
|
-
focusResource: $resource,
|
|
3799
|
-
propertyPath: PropertyShape
|
|
3800
|
-
.schema
|
|
3801
|
-
.properties
|
|
3802
|
-
.patterns
|
|
3803
|
-
.path,
|
|
3804
|
-
value: valuesArray,
|
|
3805
|
-
})),
|
|
3806
|
-
}).chain((patterns) => $shaclPropertyFromRdf({
|
|
3807
|
-
graph: _$options.graph,
|
|
3808
|
-
resource: $resource,
|
|
3809
|
-
propertySchema: NodeShape.schema
|
|
3810
|
-
.properties
|
|
3811
|
-
.properties,
|
|
3812
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3813
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3814
|
-
.map((values) => values.toArray())
|
|
3815
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3816
|
-
focusResource: $resource,
|
|
3817
|
-
propertyPath: NodeShape
|
|
3818
|
-
.schema
|
|
3819
|
-
.properties
|
|
3820
|
-
.properties
|
|
3821
|
-
.path,
|
|
3822
|
-
value: valuesArray,
|
|
3823
|
-
})),
|
|
3824
|
-
}).chain((properties) => $shaclPropertyFromRdf({
|
|
3825
|
-
graph: _$options.graph,
|
|
3826
|
-
resource: $resource,
|
|
3827
|
-
propertySchema: NodeShape.schema
|
|
3828
|
-
.properties
|
|
3829
|
-
.subClassOf,
|
|
3830
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3831
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3832
|
-
.map((values) => values.toArray())
|
|
3833
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3834
|
-
focusResource: $resource,
|
|
3835
|
-
propertyPath: NodeShape
|
|
3836
|
-
.schema
|
|
3837
|
-
.properties
|
|
3838
|
-
.subClassOf
|
|
3839
|
-
.path,
|
|
3840
|
-
value: valuesArray,
|
|
3841
|
-
})),
|
|
3842
|
-
}).chain((subClassOf) => $shaclPropertyFromRdf({
|
|
3843
|
-
graph: _$options.graph,
|
|
3844
|
-
resource: $resource,
|
|
3845
|
-
propertySchema: NodeShape.schema
|
|
3846
|
-
.properties
|
|
3847
|
-
.types,
|
|
3848
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3849
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3850
|
-
.map((values) => values.toArray())
|
|
3851
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
3852
|
-
focusResource: $resource,
|
|
3853
|
-
propertyPath: NodeShape
|
|
3854
|
-
.schema
|
|
3855
|
-
.properties
|
|
3856
|
-
.types
|
|
3857
|
-
.path,
|
|
3858
|
-
value: valuesArray,
|
|
3859
|
-
})),
|
|
3860
|
-
}).chain((types) => $shaclPropertyFromRdf({
|
|
3861
|
-
graph: _$options.graph,
|
|
3862
|
-
resource: $resource,
|
|
3863
|
-
propertySchema: NodeShape.schema
|
|
3864
|
-
.properties
|
|
3865
|
-
.xone,
|
|
3866
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
3867
|
-
.chain((values) => values.chainMap((value) => value.toList({
|
|
3692
|
+
}),
|
|
3693
|
+
xone: $shaclPropertyFromRdf({
|
|
3868
3694
|
graph: _$options.graph,
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
.
|
|
3874
|
-
.properties
|
|
3875
|
-
.xone
|
|
3876
|
-
.path,
|
|
3877
|
-
values: valueList.toArray(),
|
|
3878
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3879
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3880
|
-
.map((values) => values.length >
|
|
3881
|
-
0
|
|
3882
|
-
? values.map((value) => Maybe.of(value))
|
|
3883
|
-
: Resource.Values.fromValue({
|
|
3695
|
+
resource: $resource,
|
|
3696
|
+
propertySchema: NodeShape.schema.properties.xone,
|
|
3697
|
+
typeFromRdf: (resourceValues) => resourceValues
|
|
3698
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3699
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3884
3700
|
focusResource: $resource,
|
|
3885
|
-
propertyPath: PropertyShape
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
value
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
datatype,
|
|
3899
|
-
deactivated,
|
|
3900
|
-
flags,
|
|
3901
|
-
hasValues,
|
|
3902
|
-
ignoredProperties,
|
|
3903
|
-
in_,
|
|
3904
|
-
isDefinedBy,
|
|
3905
|
-
label,
|
|
3906
|
-
languageIn,
|
|
3907
|
-
maxCount,
|
|
3908
|
-
maxExclusive,
|
|
3909
|
-
maxInclusive,
|
|
3910
|
-
maxLength,
|
|
3911
|
-
minCount,
|
|
3912
|
-
minExclusive,
|
|
3913
|
-
minInclusive,
|
|
3914
|
-
minLength,
|
|
3915
|
-
node,
|
|
3916
|
-
nodeKind,
|
|
3917
|
-
not,
|
|
3918
|
-
or,
|
|
3919
|
-
patterns,
|
|
3920
|
-
properties,
|
|
3921
|
-
subClassOf,
|
|
3922
|
-
types,
|
|
3923
|
-
xone,
|
|
3924
|
-
})))))))))))))))))))))))))))))))));
|
|
3701
|
+
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
3702
|
+
values: valueList.toArray(),
|
|
3703
|
+
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3704
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3705
|
+
.map((values) => values.length > 0
|
|
3706
|
+
? values.map((value) => Maybe.of(value))
|
|
3707
|
+
: Resource.Values.fromValue({
|
|
3708
|
+
focusResource: $resource,
|
|
3709
|
+
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
3710
|
+
value: Maybe.empty(),
|
|
3711
|
+
})),
|
|
3712
|
+
}),
|
|
3713
|
+
}).map((properties) => create(properties)));
|
|
3925
3714
|
};
|
|
3926
3715
|
NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
|
|
3927
3716
|
NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|