@shaclmate/compiler 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.
@@ -255,6 +255,17 @@ var $RdfVocabularies;
255
255
  xsd.unsignedShort = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort");
256
256
  })(xsd = $RdfVocabularies.xsd || ($RdfVocabularies.xsd = {}));
257
257
  })($RdfVocabularies || ($RdfVocabularies = {}));
258
+ function $sequenceRecord(record) {
259
+ const result = {};
260
+ for (const key of globalThis.Object.keys(record)) {
261
+ const either = record[key];
262
+ if (either.isLeft()) {
263
+ return either;
264
+ }
265
+ result[key] = either.extract();
266
+ }
267
+ return Right(result);
268
+ }
258
269
  function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }) {
259
270
  return typeFromRdf(Right(resource.values(propertySchema.path, { graph, unique: true }))).chain((values) => values.head());
260
271
  }
@@ -1123,758 +1134,604 @@ export var PropertyShape;
1123
1134
  }
1124
1135
  return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyShape)`));
1125
1136
  })
1126
- : Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
1127
- dataFactory: dataFactory,
1128
- focusResource: $resource,
1129
- propertyPath: $RdfVocabularies.rdf.subject,
1130
- term: $resource.identifier,
1131
- }).toValues())
1132
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1133
- .chain((values) => values.head())
1134
- .chain(($identifier) => $shaclPropertyFromRdf({
1135
- graph: _$options.graph,
1136
- resource: $resource,
1137
- propertySchema: PropertyShape.schema.properties.and,
1138
- typeFromRdf: (resourceValues) => resourceValues
1139
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1140
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1141
- focusResource: $resource,
1142
- propertyPath: PropertyShape.schema.properties.and.path,
1143
- values: valueList.toArray(),
1144
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1145
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1146
- .map((values) => values.length > 0
1147
- ? values.map((value) => Maybe.of(value))
1148
- : Resource.Values.fromValue({
1149
- focusResource: $resource,
1150
- propertyPath: PropertyShape.schema.properties.and.path,
1151
- value: Maybe.empty(),
1152
- })),
1153
- }).chain((and) => $shaclPropertyFromRdf({
1154
- graph: _$options.graph,
1155
- resource: $resource,
1156
- propertySchema: PropertyShape.schema.properties.classes,
1157
- typeFromRdf: (resourceValues) => resourceValues
1158
- .chain((values) => values.chainMap((value) => value.toIri()))
1159
- .map((values) => values.toArray())
1160
- .map((valuesArray) => Resource.Values.fromValue({
1161
- focusResource: $resource,
1162
- propertyPath: PropertyShape.schema.properties.classes.path,
1163
- value: valuesArray,
1164
- })),
1165
- }).chain((classes) => $shaclPropertyFromRdf({
1166
- graph: _$options.graph,
1167
- resource: $resource,
1168
- propertySchema: PropertyShape.schema.properties.comment,
1169
- typeFromRdf: (resourceValues) => resourceValues
1170
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1171
- .chain((values) => values.chainMap((value) => value.toString()))
1172
- .map((values) => values.length > 0
1173
- ? values.map((value) => Maybe.of(value))
1174
- : Resource.Values.fromValue({
1175
- focusResource: $resource,
1176
- propertyPath: PropertyShape.schema.properties.comment.path,
1177
- value: Maybe.empty(),
1178
- })),
1179
- }).chain((comment) => $shaclPropertyFromRdf({
1180
- graph: _$options.graph,
1181
- resource: $resource,
1182
- propertySchema: PropertyShape.schema.properties.datatype,
1183
- typeFromRdf: (resourceValues) => resourceValues
1184
- .chain((values) => values.chainMap((value) => value.toIri()))
1185
- .map((values) => values.length > 0
1186
- ? values.map((value) => Maybe.of(value))
1187
- : Resource.Values.fromValue({
1188
- focusResource: $resource,
1189
- propertyPath: PropertyShape.schema.properties.datatype.path,
1190
- value: Maybe.empty(),
1191
- })),
1192
- }).chain((datatype) => $shaclPropertyFromRdf({
1193
- graph: _$options.graph,
1194
- resource: $resource,
1195
- propertySchema: PropertyShape.schema.properties.deactivated,
1196
- typeFromRdf: (resourceValues) => resourceValues
1197
- .chain((values) => values.chainMap((value) => value.toBoolean()))
1198
- .map((values) => values.length > 0
1199
- ? values.map((value) => Maybe.of(value))
1200
- : Resource.Values.fromValue({
1201
- focusResource: $resource,
1202
- propertyPath: PropertyShape.schema.properties.deactivated
1203
- .path,
1204
- value: Maybe.empty(),
1205
- })),
1206
- }).chain((deactivated) => $shaclPropertyFromRdf({
1207
- graph: _$options.graph,
1208
- resource: $resource,
1209
- propertySchema: PropertyShape.schema.properties.defaultValue,
1210
- typeFromRdf: (resourceValues) => resourceValues
1211
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1212
- switch (term.termType) {
1213
- case "NamedNode":
1214
- case "Literal":
1215
- return Either.of(term);
1216
- default:
1217
- return Left(new Resource.MistypedTermValueError({
1218
- actualValue: term,
1219
- expectedValueType: "(NamedNode | Literal)",
1220
- focusResource: $resource,
1221
- propertyPath: PropertyShape.schema.properties
1222
- .defaultValue.path,
1223
- }));
1224
- }
1225
- })))
1226
- .map((values) => values.length > 0
1227
- ? values.map((value) => Maybe.of(value))
1228
- : Resource.Values.fromValue({
1229
- focusResource: $resource,
1230
- propertyPath: PropertyShape.schema.properties.defaultValue
1231
- .path,
1232
- value: Maybe.empty(),
1233
- })),
1234
- }).chain((defaultValue) => $shaclPropertyFromRdf({
1235
- graph: _$options.graph,
1236
- resource: $resource,
1237
- propertySchema: PropertyShape.schema.properties.description,
1238
- typeFromRdf: (resourceValues) => resourceValues
1239
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1240
- .chain((values) => values.chainMap((value) => value.toString()))
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
- .description.path,
1247
- value: Maybe.empty(),
1248
- })),
1249
- }).chain((description) => $shaclPropertyFromRdf({
1250
- graph: _$options.graph,
1251
- resource: $resource,
1252
- propertySchema: PropertyShape.schema.properties.display,
1253
- typeFromRdf: (resourceValues) => resourceValues
1254
- .map((values) => values.length > 0
1255
- ? values
1256
- : new Resource.Value({
1257
- dataFactory: dataFactory,
1258
- focusResource: $resource,
1259
- propertyPath: PropertyShape.schema.properties.display
1260
- .path,
1261
- term: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
1262
- }).toValues())
1263
- .chain((values) => values.chainMap((value) => value.toBoolean())),
1264
- }).chain((display) => $shaclPropertyFromRdf({
1265
- graph: _$options.graph,
1266
- resource: $resource,
1267
- propertySchema: PropertyShape.schema.properties.flags,
1268
- typeFromRdf: (resourceValues) => resourceValues
1269
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1270
- .chain((values) => values.chainMap((value) => value.toString()))
1271
- .map((values) => values.toArray())
1272
- .map((valuesArray) => Resource.Values.fromValue({
1137
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
1138
+ $identifier: Right(new Resource.Value({
1139
+ dataFactory: dataFactory,
1273
1140
  focusResource: $resource,
1274
- propertyPath: PropertyShape.schema.properties.flags
1275
- .path,
1276
- value: valuesArray,
1277
- })),
1278
- }).chain((flags) => $shaclPropertyFromRdf({
1279
- graph: _$options.graph,
1280
- resource: $resource,
1281
- propertySchema: PropertyShape.schema.properties.groups,
1282
- typeFromRdf: (resourceValues) => resourceValues
1141
+ propertyPath: $RdfVocabularies.rdf.subject,
1142
+ term: $resource.identifier,
1143
+ }).toValues())
1283
1144
  .chain((values) => values.chainMap((value) => value.toIdentifier()))
1284
- .map((values) => values.toArray())
1285
- .map((valuesArray) => Resource.Values.fromValue({
1286
- focusResource: $resource,
1287
- propertyPath: PropertyShape.schema.properties.groups
1288
- .path,
1289
- value: valuesArray,
1290
- })),
1291
- }).chain((groups) => $shaclPropertyFromRdf({
1292
- graph: _$options.graph,
1293
- resource: $resource,
1294
- propertySchema: PropertyShape.schema.properties.hasValues,
1295
- typeFromRdf: (resourceValues) => resourceValues
1296
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1297
- switch (term.termType) {
1298
- case "NamedNode":
1299
- case "Literal":
1300
- return Either.of(term);
1301
- default:
1302
- return Left(new Resource.MistypedTermValueError({
1303
- actualValue: term,
1304
- expectedValueType: "(NamedNode | Literal)",
1305
- focusResource: $resource,
1306
- propertyPath: PropertyShape.schema
1307
- .properties.hasValues
1308
- .path,
1309
- }));
1310
- }
1311
- })))
1312
- .map((values) => values.toArray())
1313
- .map((valuesArray) => Resource.Values.fromValue({
1314
- focusResource: $resource,
1315
- propertyPath: PropertyShape.schema.properties
1316
- .hasValues.path,
1317
- value: valuesArray,
1318
- })),
1319
- }).chain((hasValues) => $shaclPropertyFromRdf({
1320
- graph: _$options.graph,
1321
- resource: $resource,
1322
- propertySchema: PropertyShape.schema.properties.in_,
1323
- typeFromRdf: (resourceValues) => resourceValues
1324
- .chain((values) => values.chainMap((value) => value.toList({
1145
+ .chain((values) => values.head()),
1146
+ and: $shaclPropertyFromRdf({
1325
1147
  graph: _$options.graph,
1326
- })))
1327
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1328
- focusResource: $resource,
1329
- propertyPath: PropertyShape.schema.properties
1330
- .in_.path,
1331
- values: valueList.toArray(),
1332
- })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1333
- switch (term.termType) {
1334
- case "NamedNode":
1335
- case "Literal":
1336
- return Either.of(term);
1337
- default:
1338
- return Left(new Resource.MistypedTermValueError({
1339
- actualValue: term,
1340
- expectedValueType: "(NamedNode | Literal)",
1341
- focusResource: $resource,
1342
- propertyPath: PropertyShape.schema
1343
- .properties.in_
1344
- .path,
1345
- }));
1346
- }
1347
- })))))
1348
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1349
- .map((values) => values.length > 0
1350
- ? values.map((value) => Maybe.of(value))
1351
- : Resource.Values.fromValue({
1352
- focusResource: $resource,
1353
- propertyPath: PropertyShape.schema.properties
1354
- .in_.path,
1355
- value: Maybe.empty(),
1356
- })),
1357
- }).chain((in_) => $shaclPropertyFromRdf({
1358
- graph: _$options.graph,
1359
- resource: $resource,
1360
- propertySchema: PropertyShape.schema.properties.isDefinedBy,
1361
- typeFromRdf: (resourceValues) => resourceValues
1362
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1363
- .map((values) => values.length > 0
1364
- ? values.map((value) => Maybe.of(value))
1365
- : Resource.Values.fromValue({
1366
- focusResource: $resource,
1367
- propertyPath: PropertyShape.schema
1368
- .properties.isDefinedBy
1369
- .path,
1370
- value: Maybe.empty(),
1371
- })),
1372
- }).chain((isDefinedBy) => $shaclPropertyFromRdf({
1373
- graph: _$options.graph,
1374
- resource: $resource,
1375
- propertySchema: PropertyShape.schema.properties.label,
1376
- typeFromRdf: (resourceValues) => resourceValues
1377
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1378
- .chain((values) => values.chainMap((value) => value.toString()))
1379
- .map((values) => values.length > 0
1380
- ? values.map((value) => Maybe.of(value))
1381
- : Resource.Values.fromValue({
1148
+ resource: $resource,
1149
+ propertySchema: PropertyShape.schema.properties.and,
1150
+ typeFromRdf: (resourceValues) => resourceValues
1151
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1152
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1382
1153
  focusResource: $resource,
1383
- propertyPath: PropertyShape.schema
1384
- .properties.label.path,
1385
- value: Maybe.empty(),
1386
- })),
1387
- }).chain((label) => $shaclPropertyFromRdf({
1388
- graph: _$options.graph,
1389
- resource: $resource,
1390
- propertySchema: PropertyShape.schema.properties.languageIn,
1391
- typeFromRdf: (resourceValues) => resourceValues
1392
- .chain((values) => values.chainMap((value) => value.toList({
1154
+ propertyPath: PropertyShape.schema.properties.and.path,
1155
+ values: valueList.toArray(),
1156
+ })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1157
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1158
+ .map((values) => values.length > 0
1159
+ ? values.map((value) => Maybe.of(value))
1160
+ : Resource.Values.fromValue({
1161
+ focusResource: $resource,
1162
+ propertyPath: PropertyShape.schema.properties.and.path,
1163
+ value: Maybe.empty(),
1164
+ })),
1165
+ }),
1166
+ classes: $shaclPropertyFromRdf({
1393
1167
  graph: _$options.graph,
1394
- })))
1395
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1396
- focusResource: $resource,
1397
- propertyPath: PropertyShape.schema
1398
- .properties.languageIn
1399
- .path,
1400
- values: valueList.toArray(),
1401
- }))
1402
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1403
- .chain((values) => values.chainMap((value) => value.toString()))))
1404
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1405
- .map((values) => values.length > 0
1406
- ? values.map((value) => Maybe.of(value))
1407
- : Resource.Values.fromValue({
1408
- focusResource: $resource,
1409
- propertyPath: PropertyShape.schema
1410
- .properties.languageIn
1411
- .path,
1412
- value: Maybe.empty(),
1413
- })),
1414
- }).chain((languageIn) => $shaclPropertyFromRdf({
1415
- graph: _$options.graph,
1416
- resource: $resource,
1417
- propertySchema: PropertyShape.schema.properties.maxCount,
1418
- typeFromRdf: (resourceValues) => resourceValues
1419
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1420
- .map((values) => values.length > 0
1421
- ? values.map((value) => Maybe.of(value))
1422
- : Resource.Values.fromValue({
1423
- focusResource: $resource,
1424
- propertyPath: PropertyShape.schema
1425
- .properties.maxCount
1426
- .path,
1427
- value: Maybe.empty(),
1428
- })),
1429
- }).chain((maxCount) => $shaclPropertyFromRdf({
1430
- graph: _$options.graph,
1431
- resource: $resource,
1432
- propertySchema: PropertyShape.schema.properties.maxExclusive,
1433
- typeFromRdf: (resourceValues) => resourceValues
1434
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1435
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1436
- .map((values) => values.length > 0
1437
- ? values.map((value) => Maybe.of(value))
1438
- : Resource.Values.fromValue({
1439
- focusResource: $resource,
1440
- propertyPath: PropertyShape.schema
1441
- .properties
1442
- .maxExclusive.path,
1443
- value: Maybe.empty(),
1444
- })),
1445
- }).chain((maxExclusive) => $shaclPropertyFromRdf({
1446
- graph: _$options.graph,
1447
- resource: $resource,
1448
- propertySchema: PropertyShape.schema.properties.maxInclusive,
1449
- typeFromRdf: (resourceValues) => resourceValues
1450
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1451
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1452
- .map((values) => values.length > 0
1453
- ? values.map((value) => Maybe.of(value))
1454
- : Resource.Values.fromValue({
1455
- focusResource: $resource,
1456
- propertyPath: PropertyShape.schema
1457
- .properties
1458
- .maxInclusive
1459
- .path,
1460
- value: Maybe.empty(),
1461
- })),
1462
- }).chain((maxInclusive) => $shaclPropertyFromRdf({
1463
- graph: _$options.graph,
1464
- resource: $resource,
1465
- propertySchema: PropertyShape.schema.properties.maxLength,
1466
- typeFromRdf: (resourceValues) => resourceValues
1467
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1468
- .map((values) => values.length > 0
1469
- ? values.map((value) => Maybe.of(value))
1470
- : Resource.Values.fromValue({
1471
- focusResource: $resource,
1472
- propertyPath: PropertyShape
1473
- .schema
1474
- .properties
1475
- .maxLength.path,
1476
- value: Maybe.empty(),
1477
- })),
1478
- }).chain((maxLength) => $shaclPropertyFromRdf({
1479
- graph: _$options.graph,
1480
- resource: $resource,
1481
- propertySchema: PropertyShape.schema.properties.minCount,
1482
- typeFromRdf: (resourceValues) => resourceValues
1483
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1484
- .map((values) => values.length > 0
1485
- ? values.map((value) => Maybe.of(value))
1486
- : Resource.Values.fromValue({
1487
- focusResource: $resource,
1488
- propertyPath: PropertyShape
1489
- .schema
1490
- .properties
1491
- .minCount
1492
- .path,
1493
- value: Maybe.empty(),
1494
- })),
1495
- }).chain((minCount) => $shaclPropertyFromRdf({
1496
- graph: _$options.graph,
1497
- resource: $resource,
1498
- propertySchema: PropertyShape.schema.properties
1499
- .minExclusive,
1500
- typeFromRdf: (resourceValues) => resourceValues
1501
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1502
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1503
- .map((values) => values.length > 0
1504
- ? values.map((value) => Maybe.of(value))
1505
- : Resource.Values.fromValue({
1506
- focusResource: $resource,
1507
- propertyPath: PropertyShape
1508
- .schema
1509
- .properties
1510
- .minExclusive
1511
- .path,
1512
- value: Maybe.empty(),
1513
- })),
1514
- }).chain((minExclusive) => $shaclPropertyFromRdf({
1515
- graph: _$options.graph,
1516
- resource: $resource,
1517
- propertySchema: PropertyShape.schema.properties
1518
- .minInclusive,
1519
- typeFromRdf: (resourceValues) => resourceValues
1520
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1521
- .chain((values) => values.chainMap((value) => value.toLiteral()))
1522
- .map((values) => values.length > 0
1523
- ? values.map((value) => Maybe.of(value))
1524
- : Resource.Values.fromValue({
1525
- focusResource: $resource,
1526
- propertyPath: PropertyShape
1527
- .schema
1528
- .properties
1529
- .minInclusive
1530
- .path,
1531
- value: Maybe.empty(),
1532
- })),
1533
- }).chain((minInclusive) => $shaclPropertyFromRdf({
1534
- graph: _$options.graph,
1535
- resource: $resource,
1536
- propertySchema: PropertyShape.schema.properties
1537
- .minLength,
1538
- typeFromRdf: (resourceValues) => resourceValues
1539
- .chain((values) => values.chainMap((value) => value.toBigInt()))
1540
- .map((values) => values.length > 0
1541
- ? values.map((value) => Maybe.of(value))
1542
- : Resource.Values.fromValue({
1543
- focusResource: $resource,
1544
- propertyPath: PropertyShape
1545
- .schema
1546
- .properties
1547
- .minLength
1548
- .path,
1549
- value: Maybe.empty(),
1550
- })),
1551
- }).chain((minLength) => $shaclPropertyFromRdf({
1552
- graph: _$options.graph,
1553
- resource: $resource,
1554
- propertySchema: PropertyShape.schema.properties
1555
- .mutable,
1556
- typeFromRdf: (resourceValues) => resourceValues
1557
- .chain((values) => values.chainMap((value) => value.toBoolean()))
1558
- .map((values) => values.length >
1559
- 0
1560
- ? values.map((value) => Maybe.of(value))
1561
- : Resource.Values.fromValue({
1168
+ resource: $resource,
1169
+ propertySchema: PropertyShape.schema.properties.classes,
1170
+ typeFromRdf: (resourceValues) => resourceValues
1171
+ .chain((values) => values.chainMap((value) => value.toIri()))
1172
+ .map((values) => values.toArray())
1173
+ .map((valuesArray) => Resource.Values.fromValue({
1562
1174
  focusResource: $resource,
1563
- propertyPath: PropertyShape
1564
- .schema
1565
- .properties
1566
- .mutable
1567
- .path,
1568
- value: Maybe.empty(),
1175
+ propertyPath: PropertyShape.schema.properties.classes.path,
1176
+ value: valuesArray,
1569
1177
  })),
1570
- }).chain((mutable) => $shaclPropertyFromRdf({
1571
- graph: _$options.graph,
1572
- resource: $resource,
1573
- propertySchema: PropertyShape.schema
1574
- .properties
1575
- .name,
1576
- typeFromRdf: (resourceValues) => resourceValues
1577
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1578
- .chain((values) => values.chainMap((value) => value.toString()))
1579
- .map((values) => values.length >
1580
- 0
1581
- ? values.map((value) => Maybe.of(value))
1582
- : Resource.Values.fromValue({
1178
+ }),
1179
+ comment: $shaclPropertyFromRdf({
1180
+ graph: _$options.graph,
1181
+ resource: $resource,
1182
+ propertySchema: PropertyShape.schema.properties.comment,
1183
+ typeFromRdf: (resourceValues) => resourceValues
1184
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1185
+ .chain((values) => values.chainMap((value) => value.toString()))
1186
+ .map((values) => values.length > 0
1187
+ ? values.map((value) => Maybe.of(value))
1188
+ : Resource.Values.fromValue({
1189
+ focusResource: $resource,
1190
+ propertyPath: PropertyShape.schema.properties.comment.path,
1191
+ value: Maybe.empty(),
1192
+ })),
1193
+ }),
1194
+ datatype: $shaclPropertyFromRdf({
1195
+ graph: _$options.graph,
1196
+ resource: $resource,
1197
+ propertySchema: PropertyShape.schema.properties.datatype,
1198
+ typeFromRdf: (resourceValues) => resourceValues
1199
+ .chain((values) => values.chainMap((value) => value.toIri()))
1200
+ .map((values) => values.length > 0
1201
+ ? values.map((value) => Maybe.of(value))
1202
+ : Resource.Values.fromValue({
1203
+ focusResource: $resource,
1204
+ propertyPath: PropertyShape.schema.properties.datatype.path,
1205
+ value: Maybe.empty(),
1206
+ })),
1207
+ }),
1208
+ deactivated: $shaclPropertyFromRdf({
1209
+ graph: _$options.graph,
1210
+ resource: $resource,
1211
+ propertySchema: PropertyShape.schema.properties.deactivated,
1212
+ typeFromRdf: (resourceValues) => resourceValues
1213
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
1214
+ .map((values) => values.length > 0
1215
+ ? values.map((value) => Maybe.of(value))
1216
+ : Resource.Values.fromValue({
1217
+ focusResource: $resource,
1218
+ propertyPath: PropertyShape.schema.properties.deactivated.path,
1219
+ value: Maybe.empty(),
1220
+ })),
1221
+ }),
1222
+ defaultValue: $shaclPropertyFromRdf({
1223
+ graph: _$options.graph,
1224
+ resource: $resource,
1225
+ propertySchema: PropertyShape.schema.properties.defaultValue,
1226
+ typeFromRdf: (resourceValues) => resourceValues
1227
+ .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1228
+ switch (term.termType) {
1229
+ case "NamedNode":
1230
+ case "Literal":
1231
+ return Either.of(term);
1232
+ default:
1233
+ return Left(new Resource.MistypedTermValueError({
1234
+ actualValue: term,
1235
+ expectedValueType: "(NamedNode | Literal)",
1236
+ focusResource: $resource,
1237
+ propertyPath: PropertyShape.schema.properties.defaultValue.path,
1238
+ }));
1239
+ }
1240
+ })))
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.defaultValue.path,
1246
+ value: Maybe.empty(),
1247
+ })),
1248
+ }),
1249
+ description: $shaclPropertyFromRdf({
1250
+ graph: _$options.graph,
1251
+ resource: $resource,
1252
+ propertySchema: PropertyShape.schema.properties.description,
1253
+ typeFromRdf: (resourceValues) => resourceValues
1254
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1255
+ .chain((values) => values.chainMap((value) => value.toString()))
1256
+ .map((values) => values.length > 0
1257
+ ? values.map((value) => Maybe.of(value))
1258
+ : Resource.Values.fromValue({
1259
+ focusResource: $resource,
1260
+ propertyPath: PropertyShape.schema.properties.description.path,
1261
+ value: Maybe.empty(),
1262
+ })),
1263
+ }),
1264
+ display: $shaclPropertyFromRdf({
1265
+ graph: _$options.graph,
1266
+ resource: $resource,
1267
+ propertySchema: PropertyShape.schema.properties.display,
1268
+ typeFromRdf: (resourceValues) => resourceValues
1269
+ .map((values) => values.length > 0
1270
+ ? values
1271
+ : new Resource.Value({
1272
+ dataFactory: dataFactory,
1273
+ focusResource: $resource,
1274
+ propertyPath: PropertyShape.schema.properties.display.path,
1275
+ term: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
1276
+ }).toValues())
1277
+ .chain((values) => values.chainMap((value) => value.toBoolean())),
1278
+ }),
1279
+ flags: $shaclPropertyFromRdf({
1280
+ graph: _$options.graph,
1281
+ resource: $resource,
1282
+ propertySchema: PropertyShape.schema.properties.flags,
1283
+ typeFromRdf: (resourceValues) => resourceValues
1284
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1285
+ .chain((values) => values.chainMap((value) => value.toString()))
1286
+ .map((values) => values.toArray())
1287
+ .map((valuesArray) => Resource.Values.fromValue({
1583
1288
  focusResource: $resource,
1584
- propertyPath: PropertyShape
1585
- .schema
1586
- .properties
1587
- .name
1588
- .path,
1589
- value: Maybe.empty(),
1289
+ propertyPath: PropertyShape.schema.properties.flags.path,
1290
+ value: valuesArray,
1590
1291
  })),
1591
- }).chain((name) => $shaclPropertyFromRdf({
1592
- graph: _$options.graph,
1593
- resource: $resource,
1594
- propertySchema: PropertyShape.schema
1595
- .properties
1596
- .node,
1597
- typeFromRdf: (resourceValues) => resourceValues
1598
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1599
- .map((values) => values.length >
1600
- 0
1601
- ? values.map((value) => Maybe.of(value))
1602
- : Resource.Values.fromValue({
1292
+ }),
1293
+ groups: $shaclPropertyFromRdf({
1294
+ graph: _$options.graph,
1295
+ resource: $resource,
1296
+ propertySchema: PropertyShape.schema.properties.groups,
1297
+ typeFromRdf: (resourceValues) => resourceValues
1298
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
1299
+ .map((values) => values.toArray())
1300
+ .map((valuesArray) => Resource.Values.fromValue({
1603
1301
  focusResource: $resource,
1604
- propertyPath: PropertyShape
1605
- .schema
1606
- .properties
1607
- .node
1608
- .path,
1609
- value: Maybe.empty(),
1302
+ propertyPath: PropertyShape.schema.properties.groups.path,
1303
+ value: valuesArray,
1610
1304
  })),
1611
- }).chain((node) => $shaclPropertyFromRdf({
1612
- graph: _$options.graph,
1613
- resource: $resource,
1614
- propertySchema: PropertyShape.schema
1615
- .properties
1616
- .nodeKind,
1617
- typeFromRdf: (resourceValues) => resourceValues
1618
- .chain((values) => values.chainMap((value) => value.toIri([
1619
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
1620
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
1621
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
1622
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
1623
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
1624
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
1625
- ])))
1626
- .map((values) => values.length >
1627
- 0
1628
- ? values.map((value) => Maybe.of(value))
1629
- : Resource.Values.fromValue({
1305
+ }),
1306
+ hasValues: $shaclPropertyFromRdf({
1307
+ graph: _$options.graph,
1308
+ resource: $resource,
1309
+ propertySchema: PropertyShape.schema.properties.hasValues,
1310
+ typeFromRdf: (resourceValues) => resourceValues
1311
+ .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1312
+ switch (term.termType) {
1313
+ case "NamedNode":
1314
+ case "Literal":
1315
+ return Either.of(term);
1316
+ default:
1317
+ return Left(new Resource.MistypedTermValueError({
1318
+ actualValue: term,
1319
+ expectedValueType: "(NamedNode | Literal)",
1320
+ focusResource: $resource,
1321
+ propertyPath: PropertyShape.schema.properties.hasValues.path,
1322
+ }));
1323
+ }
1324
+ })))
1325
+ .map((values) => values.toArray())
1326
+ .map((valuesArray) => Resource.Values.fromValue({
1630
1327
  focusResource: $resource,
1631
- propertyPath: PropertyShape
1632
- .schema
1633
- .properties
1634
- .nodeKind
1635
- .path,
1636
- value: Maybe.empty(),
1328
+ propertyPath: PropertyShape.schema.properties.hasValues.path,
1329
+ value: valuesArray,
1637
1330
  })),
1638
- }).chain((nodeKind) => $shaclPropertyFromRdf({
1639
- graph: _$options.graph,
1640
- resource: $resource,
1641
- propertySchema: PropertyShape.schema
1642
- .properties
1643
- .not,
1644
- typeFromRdf: (resourceValues) => resourceValues
1645
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1646
- .map((values) => values.toArray())
1647
- .map((valuesArray) => Resource.Values.fromValue({
1648
- focusResource: $resource,
1649
- propertyPath: PropertyShape
1650
- .schema
1651
- .properties
1652
- .not
1653
- .path,
1654
- value: valuesArray,
1655
- })),
1656
- }).chain((not) => $shaclPropertyFromRdf({
1657
- graph: _$options.graph,
1658
- resource: $resource,
1659
- propertySchema: PropertyShape.schema
1660
- .properties
1661
- .or,
1662
- typeFromRdf: (resourceValues) => resourceValues
1663
- .chain((values) => values.chainMap((value) => value.toList({
1331
+ }),
1332
+ in_: $shaclPropertyFromRdf({
1664
1333
  graph: _$options.graph,
1665
- })))
1666
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1667
- focusResource: $resource,
1668
- propertyPath: PropertyShape
1669
- .schema
1670
- .properties
1671
- .or
1672
- .path,
1673
- values: valueList.toArray(),
1674
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1675
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1676
- .map((values) => values.length >
1677
- 0
1678
- ? values.map((value) => Maybe.of(value))
1679
- : Resource.Values.fromValue({
1334
+ resource: $resource,
1335
+ propertySchema: PropertyShape.schema.properties.in_,
1336
+ typeFromRdf: (resourceValues) => resourceValues
1337
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1338
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1680
1339
  focusResource: $resource,
1681
- propertyPath: PropertyShape
1682
- .schema
1683
- .properties
1684
- .or
1685
- .path,
1686
- value: Maybe.empty(),
1687
- })),
1688
- }).chain((or) => $shaclPropertyFromRdf({
1689
- graph: _$options.graph,
1690
- resource: $resource,
1691
- propertySchema: PropertyShape.schema
1692
- .properties
1693
- .order,
1694
- typeFromRdf: (resourceValues) => resourceValues
1695
- .chain((values) => values.chainMap((value) => value.toFloat()))
1696
- .map((values) => values.length >
1697
- 0
1698
- ? values.map((value) => Maybe.of(value))
1699
- : Resource.Values.fromValue({
1340
+ propertyPath: PropertyShape.schema.properties.in_.path,
1341
+ values: valueList.toArray(),
1342
+ })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
1343
+ switch (term.termType) {
1344
+ case "NamedNode":
1345
+ case "Literal":
1346
+ return Either.of(term);
1347
+ default:
1348
+ return Left(new Resource.MistypedTermValueError({
1349
+ actualValue: term,
1350
+ expectedValueType: "(NamedNode | Literal)",
1351
+ focusResource: $resource,
1352
+ propertyPath: PropertyShape.schema.properties.in_.path,
1353
+ }));
1354
+ }
1355
+ })))))
1356
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1357
+ .map((values) => values.length > 0
1358
+ ? values.map((value) => Maybe.of(value))
1359
+ : Resource.Values.fromValue({
1360
+ focusResource: $resource,
1361
+ propertyPath: PropertyShape.schema.properties.in_.path,
1362
+ value: Maybe.empty(),
1363
+ })),
1364
+ }),
1365
+ isDefinedBy: $shaclPropertyFromRdf({
1366
+ graph: _$options.graph,
1367
+ resource: $resource,
1368
+ propertySchema: PropertyShape.schema.properties.isDefinedBy,
1369
+ typeFromRdf: (resourceValues) => resourceValues
1370
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
1371
+ .map((values) => values.length > 0
1372
+ ? values.map((value) => Maybe.of(value))
1373
+ : Resource.Values.fromValue({
1374
+ focusResource: $resource,
1375
+ propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
1376
+ value: Maybe.empty(),
1377
+ })),
1378
+ }),
1379
+ label: $shaclPropertyFromRdf({
1380
+ graph: _$options.graph,
1381
+ resource: $resource,
1382
+ propertySchema: PropertyShape.schema.properties.label,
1383
+ typeFromRdf: (resourceValues) => resourceValues
1384
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1385
+ .chain((values) => values.chainMap((value) => value.toString()))
1386
+ .map((values) => values.length > 0
1387
+ ? values.map((value) => Maybe.of(value))
1388
+ : Resource.Values.fromValue({
1389
+ focusResource: $resource,
1390
+ propertyPath: PropertyShape.schema.properties.label.path,
1391
+ value: Maybe.empty(),
1392
+ })),
1393
+ }),
1394
+ languageIn: $shaclPropertyFromRdf({
1395
+ graph: _$options.graph,
1396
+ resource: $resource,
1397
+ propertySchema: PropertyShape.schema.properties.languageIn,
1398
+ typeFromRdf: (resourceValues) => resourceValues
1399
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1400
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1700
1401
  focusResource: $resource,
1701
- propertyPath: PropertyShape
1702
- .schema
1703
- .properties
1704
- .order
1705
- .path,
1706
- value: Maybe.empty(),
1707
- })),
1708
- }).chain((order) => $shaclPropertyFromRdf({
1709
- graph: _$options.graph,
1710
- resource: $resource,
1711
- propertySchema: PropertyShape.schema
1712
- .properties
1713
- .path,
1714
- typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
1715
- context: _$options.context,
1402
+ propertyPath: PropertyShape.schema.properties.languageIn.path,
1403
+ values: valueList.toArray(),
1404
+ }))
1405
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1406
+ .chain((values) => values.chainMap((value) => value.toString()))))
1407
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1408
+ .map((values) => values.length > 0
1409
+ ? values.map((value) => Maybe.of(value))
1410
+ : Resource.Values.fromValue({
1411
+ focusResource: $resource,
1412
+ propertyPath: PropertyShape.schema.properties.languageIn.path,
1413
+ value: Maybe.empty(),
1414
+ })),
1415
+ }),
1416
+ maxCount: $shaclPropertyFromRdf({
1716
1417
  graph: _$options.graph,
1717
- preferredLanguages: _$options.preferredLanguages,
1718
- objectSet: _$options.objectSet,
1719
1418
  resource: $resource,
1720
- ignoreRdfType: true,
1721
- propertyPath: PropertyShape
1722
- .schema
1723
- .properties
1724
- .path
1725
- .path,
1419
+ propertySchema: PropertyShape.schema.properties.maxCount,
1420
+ typeFromRdf: (resourceValues) => resourceValues
1421
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
1422
+ .map((values) => values.length > 0
1423
+ ? values.map((value) => Maybe.of(value))
1424
+ : Resource.Values.fromValue({
1425
+ focusResource: $resource,
1426
+ propertyPath: PropertyShape.schema.properties.maxCount.path,
1427
+ value: Maybe.empty(),
1428
+ })),
1726
1429
  }),
1727
- }).chain((path) => $shaclPropertyFromRdf({
1728
- graph: _$options.graph,
1729
- resource: $resource,
1730
- propertySchema: PropertyShape.schema
1731
- .properties
1732
- .patterns,
1733
- typeFromRdf: (resourceValues) => resourceValues
1734
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1735
- .chain((values) => values.chainMap((value) => value.toString()))
1736
- .map((values) => values.toArray())
1737
- .map((valuesArray) => Resource.Values.fromValue({
1738
- focusResource: $resource,
1739
- propertyPath: PropertyShape
1740
- .schema
1741
- .properties
1742
- .patterns
1743
- .path,
1744
- value: valuesArray,
1745
- })),
1746
- }).chain((patterns) => $shaclPropertyFromRdf({
1747
- graph: _$options.graph,
1748
- resource: $resource,
1749
- propertySchema: PropertyShape.schema
1750
- .properties
1751
- .resolve,
1752
- typeFromRdf: (resourceValues) => resourceValues
1753
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
1754
- .map((values) => values.length >
1755
- 0
1756
- ? values.map((value) => Maybe.of(value))
1757
- : Resource.Values.fromValue({
1430
+ maxExclusive: $shaclPropertyFromRdf({
1431
+ graph: _$options.graph,
1432
+ resource: $resource,
1433
+ propertySchema: PropertyShape.schema.properties.maxExclusive,
1434
+ typeFromRdf: (resourceValues) => resourceValues
1435
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1436
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
1437
+ .map((values) => values.length > 0
1438
+ ? values.map((value) => Maybe.of(value))
1439
+ : Resource.Values.fromValue({
1440
+ focusResource: $resource,
1441
+ propertyPath: PropertyShape.schema.properties.maxExclusive.path,
1442
+ value: Maybe.empty(),
1443
+ })),
1444
+ }),
1445
+ maxInclusive: $shaclPropertyFromRdf({
1446
+ graph: _$options.graph,
1447
+ resource: $resource,
1448
+ propertySchema: PropertyShape.schema.properties.maxInclusive,
1449
+ typeFromRdf: (resourceValues) => resourceValues
1450
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1451
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
1452
+ .map((values) => values.length > 0
1453
+ ? values.map((value) => Maybe.of(value))
1454
+ : Resource.Values.fromValue({
1455
+ focusResource: $resource,
1456
+ propertyPath: PropertyShape.schema.properties.maxInclusive.path,
1457
+ value: Maybe.empty(),
1458
+ })),
1459
+ }),
1460
+ maxLength: $shaclPropertyFromRdf({
1461
+ graph: _$options.graph,
1462
+ resource: $resource,
1463
+ propertySchema: PropertyShape.schema.properties.maxLength,
1464
+ typeFromRdf: (resourceValues) => resourceValues
1465
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
1466
+ .map((values) => values.length > 0
1467
+ ? values.map((value) => Maybe.of(value))
1468
+ : Resource.Values.fromValue({
1469
+ focusResource: $resource,
1470
+ propertyPath: PropertyShape.schema.properties.maxLength.path,
1471
+ value: Maybe.empty(),
1472
+ })),
1473
+ }),
1474
+ minCount: $shaclPropertyFromRdf({
1475
+ graph: _$options.graph,
1476
+ resource: $resource,
1477
+ propertySchema: PropertyShape.schema.properties.minCount,
1478
+ typeFromRdf: (resourceValues) => resourceValues
1479
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
1480
+ .map((values) => values.length > 0
1481
+ ? values.map((value) => Maybe.of(value))
1482
+ : Resource.Values.fromValue({
1483
+ focusResource: $resource,
1484
+ propertyPath: PropertyShape.schema.properties.minCount.path,
1485
+ value: Maybe.empty(),
1486
+ })),
1487
+ }),
1488
+ minExclusive: $shaclPropertyFromRdf({
1489
+ graph: _$options.graph,
1490
+ resource: $resource,
1491
+ propertySchema: PropertyShape.schema.properties.minExclusive,
1492
+ typeFromRdf: (resourceValues) => resourceValues
1493
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1494
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
1495
+ .map((values) => values.length > 0
1496
+ ? values.map((value) => Maybe.of(value))
1497
+ : Resource.Values.fromValue({
1498
+ focusResource: $resource,
1499
+ propertyPath: PropertyShape.schema.properties.minExclusive.path,
1500
+ value: Maybe.empty(),
1501
+ })),
1502
+ }),
1503
+ minInclusive: $shaclPropertyFromRdf({
1504
+ graph: _$options.graph,
1505
+ resource: $resource,
1506
+ propertySchema: PropertyShape.schema.properties.minInclusive,
1507
+ typeFromRdf: (resourceValues) => resourceValues
1508
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1509
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
1510
+ .map((values) => values.length > 0
1511
+ ? values.map((value) => Maybe.of(value))
1512
+ : Resource.Values.fromValue({
1513
+ focusResource: $resource,
1514
+ propertyPath: PropertyShape.schema.properties.minInclusive.path,
1515
+ value: Maybe.empty(),
1516
+ })),
1517
+ }),
1518
+ minLength: $shaclPropertyFromRdf({
1519
+ graph: _$options.graph,
1520
+ resource: $resource,
1521
+ propertySchema: PropertyShape.schema.properties.minLength,
1522
+ typeFromRdf: (resourceValues) => resourceValues
1523
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
1524
+ .map((values) => values.length > 0
1525
+ ? values.map((value) => Maybe.of(value))
1526
+ : Resource.Values.fromValue({
1527
+ focusResource: $resource,
1528
+ propertyPath: PropertyShape.schema.properties.minLength.path,
1529
+ value: Maybe.empty(),
1530
+ })),
1531
+ }),
1532
+ mutable: $shaclPropertyFromRdf({
1533
+ graph: _$options.graph,
1534
+ resource: $resource,
1535
+ propertySchema: PropertyShape.schema.properties.mutable,
1536
+ typeFromRdf: (resourceValues) => resourceValues
1537
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
1538
+ .map((values) => values.length > 0
1539
+ ? values.map((value) => Maybe.of(value))
1540
+ : Resource.Values.fromValue({
1541
+ focusResource: $resource,
1542
+ propertyPath: PropertyShape.schema.properties.mutable.path,
1543
+ value: Maybe.empty(),
1544
+ })),
1545
+ }),
1546
+ name: $shaclPropertyFromRdf({
1547
+ graph: _$options.graph,
1548
+ resource: $resource,
1549
+ propertySchema: PropertyShape.schema.properties.name,
1550
+ typeFromRdf: (resourceValues) => resourceValues
1551
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1552
+ .chain((values) => values.chainMap((value) => value.toString()))
1553
+ .map((values) => values.length > 0
1554
+ ? values.map((value) => Maybe.of(value))
1555
+ : Resource.Values.fromValue({
1556
+ focusResource: $resource,
1557
+ propertyPath: PropertyShape.schema.properties.name.path,
1558
+ value: Maybe.empty(),
1559
+ })),
1560
+ }),
1561
+ node: $shaclPropertyFromRdf({
1562
+ graph: _$options.graph,
1563
+ resource: $resource,
1564
+ propertySchema: PropertyShape.schema.properties.node,
1565
+ typeFromRdf: (resourceValues) => resourceValues
1566
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
1567
+ .map((values) => values.length > 0
1568
+ ? values.map((value) => Maybe.of(value))
1569
+ : Resource.Values.fromValue({
1570
+ focusResource: $resource,
1571
+ propertyPath: PropertyShape.schema.properties.node.path,
1572
+ value: Maybe.empty(),
1573
+ })),
1574
+ }),
1575
+ nodeKind: $shaclPropertyFromRdf({
1576
+ graph: _$options.graph,
1577
+ resource: $resource,
1578
+ propertySchema: PropertyShape.schema.properties.nodeKind,
1579
+ typeFromRdf: (resourceValues) => resourceValues
1580
+ .chain((values) => values.chainMap((value) => value.toIri([
1581
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
1582
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
1583
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
1584
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
1585
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
1586
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
1587
+ ])))
1588
+ .map((values) => values.length > 0
1589
+ ? values.map((value) => Maybe.of(value))
1590
+ : Resource.Values.fromValue({
1591
+ focusResource: $resource,
1592
+ propertyPath: PropertyShape.schema.properties.nodeKind.path,
1593
+ value: Maybe.empty(),
1594
+ })),
1595
+ }),
1596
+ not: $shaclPropertyFromRdf({
1597
+ graph: _$options.graph,
1598
+ resource: $resource,
1599
+ propertySchema: PropertyShape.schema.properties.not,
1600
+ typeFromRdf: (resourceValues) => resourceValues
1601
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
1602
+ .map((values) => values.toArray())
1603
+ .map((valuesArray) => Resource.Values.fromValue({
1758
1604
  focusResource: $resource,
1759
- propertyPath: PropertyShape
1760
- .schema
1761
- .properties
1762
- .resolve
1763
- .path,
1764
- value: Maybe.empty(),
1605
+ propertyPath: PropertyShape.schema.properties.not.path,
1606
+ value: valuesArray,
1765
1607
  })),
1766
- }).chain((resolve) => $shaclPropertyFromRdf({
1767
- graph: _$options.graph,
1768
- resource: $resource,
1769
- propertySchema: PropertyShape.schema
1770
- .properties
1771
- .shaclmateName,
1772
- typeFromRdf: (resourceValues) => resourceValues
1773
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1774
- .chain((values) => values.chainMap((value) => value.toString()))
1775
- .map((values) => values.length >
1776
- 0
1777
- ? values.map((value) => Maybe.of(value))
1778
- : Resource.Values.fromValue({
1608
+ }),
1609
+ or: $shaclPropertyFromRdf({
1610
+ graph: _$options.graph,
1611
+ resource: $resource,
1612
+ propertySchema: PropertyShape.schema.properties.or,
1613
+ typeFromRdf: (resourceValues) => resourceValues
1614
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1615
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1779
1616
  focusResource: $resource,
1780
- propertyPath: PropertyShape
1781
- .schema
1782
- .properties
1783
- .shaclmateName
1784
- .path,
1785
- value: Maybe.empty(),
1786
- })),
1787
- }).chain((shaclmateName) => $shaclPropertyFromRdf({
1788
- graph: _$options.graph,
1789
- resource: $resource,
1790
- propertySchema: PropertyShape.schema
1791
- .properties
1792
- .uniqueLang,
1793
- typeFromRdf: (resourceValues) => resourceValues
1794
- .chain((values) => values.chainMap((value) => value.toBoolean()))
1795
- .map((values) => values.length >
1796
- 0
1797
- ? values.map((value) => Maybe.of(value))
1798
- : Resource.Values.fromValue({
1617
+ propertyPath: PropertyShape.schema.properties.or.path,
1618
+ values: valueList.toArray(),
1619
+ })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1620
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1621
+ .map((values) => values.length > 0
1622
+ ? values.map((value) => Maybe.of(value))
1623
+ : Resource.Values.fromValue({
1624
+ focusResource: $resource,
1625
+ propertyPath: PropertyShape.schema.properties.or.path,
1626
+ value: Maybe.empty(),
1627
+ })),
1628
+ }),
1629
+ order: $shaclPropertyFromRdf({
1630
+ graph: _$options.graph,
1631
+ resource: $resource,
1632
+ propertySchema: PropertyShape.schema.properties.order,
1633
+ typeFromRdf: (resourceValues) => resourceValues
1634
+ .chain((values) => values.chainMap((value) => value.toFloat()))
1635
+ .map((values) => values.length > 0
1636
+ ? values.map((value) => Maybe.of(value))
1637
+ : Resource.Values.fromValue({
1638
+ focusResource: $resource,
1639
+ propertyPath: PropertyShape.schema.properties.order.path,
1640
+ value: Maybe.empty(),
1641
+ })),
1642
+ }),
1643
+ path: $shaclPropertyFromRdf({
1644
+ graph: _$options.graph,
1645
+ resource: $resource,
1646
+ propertySchema: PropertyShape.schema.properties.path,
1647
+ typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
1648
+ context: _$options.context,
1649
+ graph: _$options.graph,
1650
+ objectSet: _$options.objectSet,
1651
+ preferredLanguages: _$options.preferredLanguages,
1652
+ resource: $resource,
1653
+ ignoreRdfType: true,
1654
+ propertyPath: PropertyShape.schema.properties.path.path,
1655
+ }),
1656
+ }),
1657
+ patterns: $shaclPropertyFromRdf({
1658
+ graph: _$options.graph,
1659
+ resource: $resource,
1660
+ propertySchema: PropertyShape.schema.properties.patterns,
1661
+ typeFromRdf: (resourceValues) => resourceValues
1662
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1663
+ .chain((values) => values.chainMap((value) => value.toString()))
1664
+ .map((values) => values.toArray())
1665
+ .map((valuesArray) => Resource.Values.fromValue({
1799
1666
  focusResource: $resource,
1800
- propertyPath: PropertyShape
1801
- .schema
1802
- .properties
1803
- .uniqueLang
1804
- .path,
1805
- value: Maybe.empty(),
1667
+ propertyPath: PropertyShape.schema.properties.patterns.path,
1668
+ value: valuesArray,
1806
1669
  })),
1807
- }).chain((uniqueLang) => $shaclPropertyFromRdf({
1808
- graph: _$options.graph,
1809
- resource: $resource,
1810
- propertySchema: PropertyShape.schema
1811
- .properties
1812
- .xone,
1813
- typeFromRdf: (resourceValues) => resourceValues
1814
- .chain((values) => values.chainMap((value) => value.toList({
1670
+ }),
1671
+ resolve: $shaclPropertyFromRdf({
1815
1672
  graph: _$options.graph,
1816
- })))
1817
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1818
- focusResource: $resource,
1819
- propertyPath: PropertyShape
1820
- .schema
1821
- .properties
1822
- .xone
1823
- .path,
1824
- values: valueList.toArray(),
1825
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1826
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1827
- .map((values) => values.length >
1828
- 0
1829
- ? values.map((value) => Maybe.of(value))
1830
- : Resource.Values.fromValue({
1673
+ resource: $resource,
1674
+ propertySchema: PropertyShape.schema.properties.resolve,
1675
+ typeFromRdf: (resourceValues) => resourceValues
1676
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
1677
+ .map((values) => values.length > 0
1678
+ ? values.map((value) => Maybe.of(value))
1679
+ : Resource.Values.fromValue({
1680
+ focusResource: $resource,
1681
+ propertyPath: PropertyShape.schema.properties.resolve.path,
1682
+ value: Maybe.empty(),
1683
+ })),
1684
+ }),
1685
+ shaclmateName: $shaclPropertyFromRdf({
1686
+ graph: _$options.graph,
1687
+ resource: $resource,
1688
+ propertySchema: PropertyShape.schema.properties.shaclmateName,
1689
+ typeFromRdf: (resourceValues) => resourceValues
1690
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
1691
+ .chain((values) => values.chainMap((value) => value.toString()))
1692
+ .map((values) => values.length > 0
1693
+ ? values.map((value) => Maybe.of(value))
1694
+ : Resource.Values.fromValue({
1695
+ focusResource: $resource,
1696
+ propertyPath: PropertyShape.schema.properties.shaclmateName.path,
1697
+ value: Maybe.empty(),
1698
+ })),
1699
+ }),
1700
+ uniqueLang: $shaclPropertyFromRdf({
1701
+ graph: _$options.graph,
1702
+ resource: $resource,
1703
+ propertySchema: PropertyShape.schema.properties.uniqueLang,
1704
+ typeFromRdf: (resourceValues) => resourceValues
1705
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
1706
+ .map((values) => values.length > 0
1707
+ ? values.map((value) => Maybe.of(value))
1708
+ : Resource.Values.fromValue({
1709
+ focusResource: $resource,
1710
+ propertyPath: PropertyShape.schema.properties.uniqueLang.path,
1711
+ value: Maybe.empty(),
1712
+ })),
1713
+ }),
1714
+ xone: $shaclPropertyFromRdf({
1715
+ graph: _$options.graph,
1716
+ resource: $resource,
1717
+ propertySchema: PropertyShape.schema.properties.xone,
1718
+ typeFromRdf: (resourceValues) => resourceValues
1719
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
1720
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
1831
1721
  focusResource: $resource,
1832
- propertyPath: PropertyShape
1833
- .schema
1834
- .properties
1835
- .xone
1836
- .path,
1837
- value: Maybe.empty(),
1838
- })),
1839
- }).map((xone) => create({
1840
- $identifier,
1841
- and,
1842
- classes,
1843
- comment,
1844
- datatype,
1845
- deactivated,
1846
- defaultValue,
1847
- description,
1848
- display,
1849
- flags,
1850
- groups,
1851
- hasValues,
1852
- in_,
1853
- isDefinedBy,
1854
- label,
1855
- languageIn,
1856
- maxCount,
1857
- maxExclusive,
1858
- maxInclusive,
1859
- maxLength,
1860
- minCount,
1861
- minExclusive,
1862
- minInclusive,
1863
- minLength,
1864
- mutable,
1865
- name,
1866
- node,
1867
- nodeKind,
1868
- not,
1869
- or,
1870
- order,
1871
- path,
1872
- patterns,
1873
- resolve,
1874
- shaclmateName,
1875
- uniqueLang,
1876
- xone,
1877
- })))))))))))))))))))))))))))))))))))))));
1722
+ propertyPath: PropertyShape.schema.properties.xone.path,
1723
+ values: valueList.toArray(),
1724
+ })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
1725
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
1726
+ .map((values) => values.length > 0
1727
+ ? values.map((value) => Maybe.of(value))
1728
+ : Resource.Values.fromValue({
1729
+ focusResource: $resource,
1730
+ propertyPath: PropertyShape.schema.properties.xone.path,
1731
+ value: Maybe.empty(),
1732
+ })),
1733
+ }),
1734
+ }).map((properties) => create(properties)));
1878
1735
  };
1879
1736
  PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
1880
1737
  PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
@@ -2525,43 +2382,46 @@ export var PropertyGroup;
2525
2382
  }
2526
2383
  return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyGroup)`));
2527
2384
  })
2528
- : Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
2529
- dataFactory: dataFactory,
2530
- focusResource: $resource,
2531
- propertyPath: $RdfVocabularies.rdf.subject,
2532
- term: $resource.identifier,
2533
- }).toValues())
2534
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2535
- .chain((values) => values.head())
2536
- .chain(($identifier) => $shaclPropertyFromRdf({
2537
- graph: _$options.graph,
2538
- resource: $resource,
2539
- propertySchema: PropertyGroup.schema.properties.comment,
2540
- typeFromRdf: (resourceValues) => resourceValues
2541
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2542
- .chain((values) => values.chainMap((value) => value.toString()))
2543
- .map((values) => values.length > 0
2544
- ? values.map((value) => Maybe.of(value))
2545
- : Resource.Values.fromValue({
2546
- focusResource: $resource,
2547
- propertyPath: PropertyShape.schema.properties.comment.path,
2548
- value: Maybe.empty(),
2549
- })),
2550
- }).chain((comment) => $shaclPropertyFromRdf({
2551
- graph: _$options.graph,
2552
- resource: $resource,
2553
- propertySchema: PropertyGroup.schema.properties.label,
2554
- typeFromRdf: (resourceValues) => resourceValues
2555
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2556
- .chain((values) => values.chainMap((value) => value.toString()))
2557
- .map((values) => values.length > 0
2558
- ? values.map((value) => Maybe.of(value))
2559
- : Resource.Values.fromValue({
2560
- focusResource: $resource,
2561
- propertyPath: PropertyShape.schema.properties.label.path,
2562
- value: Maybe.empty(),
2563
- })),
2564
- }).map((label) => create({ $identifier, comment, label })))));
2385
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
2386
+ $identifier: Right(new Resource.Value({
2387
+ dataFactory: dataFactory,
2388
+ focusResource: $resource,
2389
+ propertyPath: $RdfVocabularies.rdf.subject,
2390
+ term: $resource.identifier,
2391
+ }).toValues())
2392
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
2393
+ .chain((values) => values.head()),
2394
+ comment: $shaclPropertyFromRdf({
2395
+ graph: _$options.graph,
2396
+ resource: $resource,
2397
+ propertySchema: PropertyGroup.schema.properties.comment,
2398
+ typeFromRdf: (resourceValues) => resourceValues
2399
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2400
+ .chain((values) => values.chainMap((value) => value.toString()))
2401
+ .map((values) => values.length > 0
2402
+ ? values.map((value) => Maybe.of(value))
2403
+ : Resource.Values.fromValue({
2404
+ focusResource: $resource,
2405
+ propertyPath: PropertyShape.schema.properties.comment.path,
2406
+ value: Maybe.empty(),
2407
+ })),
2408
+ }),
2409
+ label: $shaclPropertyFromRdf({
2410
+ graph: _$options.graph,
2411
+ resource: $resource,
2412
+ propertySchema: PropertyGroup.schema.properties.label,
2413
+ typeFromRdf: (resourceValues) => resourceValues
2414
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2415
+ .chain((values) => values.chainMap((value) => value.toString()))
2416
+ .map((values) => values.length > 0
2417
+ ? values.map((value) => Maybe.of(value))
2418
+ : Resource.Values.fromValue({
2419
+ focusResource: $resource,
2420
+ propertyPath: PropertyShape.schema.properties.label.path,
2421
+ value: Maybe.empty(),
2422
+ })),
2423
+ }),
2424
+ }).map((properties) => create(properties)));
2565
2425
  };
2566
2426
  PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
2567
2427
  PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
@@ -2780,109 +2640,108 @@ export var Ontology;
2780
2640
  }
2781
2641
  return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/2002/07/owl#Ontology)`));
2782
2642
  })
2783
- : Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
2784
- dataFactory: dataFactory,
2785
- focusResource: $resource,
2786
- propertyPath: $RdfVocabularies.rdf.subject,
2787
- term: $resource.identifier,
2788
- }).toValues())
2789
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
2790
- .chain((values) => values.head())
2791
- .chain(($identifier) => $shaclPropertyFromRdf({
2792
- graph: _$options.graph,
2793
- resource: $resource,
2794
- propertySchema: Ontology.schema.properties.comment,
2795
- typeFromRdf: (resourceValues) => resourceValues
2796
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2797
- .chain((values) => values.chainMap((value) => value.toString()))
2798
- .map((values) => values.length > 0
2799
- ? values.map((value) => Maybe.of(value))
2800
- : Resource.Values.fromValue({
2643
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
2644
+ $identifier: Right(new Resource.Value({
2645
+ dataFactory: dataFactory,
2646
+ focusResource: $resource,
2647
+ propertyPath: $RdfVocabularies.rdf.subject,
2648
+ term: $resource.identifier,
2649
+ }).toValues())
2650
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
2651
+ .chain((values) => values.head()),
2652
+ comment: $shaclPropertyFromRdf({
2653
+ graph: _$options.graph,
2654
+ resource: $resource,
2655
+ propertySchema: Ontology.schema.properties.comment,
2656
+ typeFromRdf: (resourceValues) => resourceValues
2657
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2658
+ .chain((values) => values.chainMap((value) => value.toString()))
2659
+ .map((values) => values.length > 0
2660
+ ? values.map((value) => Maybe.of(value))
2661
+ : Resource.Values.fromValue({
2662
+ focusResource: $resource,
2663
+ propertyPath: PropertyShape.schema.properties.comment.path,
2664
+ value: Maybe.empty(),
2665
+ })),
2666
+ }),
2667
+ label: $shaclPropertyFromRdf({
2668
+ graph: _$options.graph,
2669
+ resource: $resource,
2670
+ propertySchema: Ontology.schema.properties.label,
2671
+ typeFromRdf: (resourceValues) => resourceValues
2672
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2673
+ .chain((values) => values.chainMap((value) => value.toString()))
2674
+ .map((values) => values.length > 0
2675
+ ? values.map((value) => Maybe.of(value))
2676
+ : Resource.Values.fromValue({
2677
+ focusResource: $resource,
2678
+ propertyPath: PropertyShape.schema.properties.label.path,
2679
+ value: Maybe.empty(),
2680
+ })),
2681
+ }),
2682
+ tsFeatureExcludes: $shaclPropertyFromRdf({
2683
+ graph: _$options.graph,
2684
+ resource: $resource,
2685
+ propertySchema: Ontology.schema.properties.tsFeatureExcludes,
2686
+ typeFromRdf: (resourceValues) => resourceValues
2687
+ .chain((values) => values.chainMap((value) => value.toIri([
2688
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
2689
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
2690
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
2691
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
2692
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
2693
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
2694
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
2695
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
2696
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
2697
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
2698
+ ])))
2699
+ .map((values) => values.toArray())
2700
+ .map((valuesArray) => Resource.Values.fromValue({
2801
2701
  focusResource: $resource,
2802
- propertyPath: PropertyShape.schema.properties.comment.path,
2803
- value: Maybe.empty(),
2702
+ propertyPath: Ontology.schema.properties.tsFeatureExcludes.path,
2703
+ value: valuesArray,
2804
2704
  })),
2805
- }).chain((comment) => $shaclPropertyFromRdf({
2806
- graph: _$options.graph,
2807
- resource: $resource,
2808
- propertySchema: Ontology.schema.properties.label,
2809
- typeFromRdf: (resourceValues) => resourceValues
2810
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2811
- .chain((values) => values.chainMap((value) => value.toString()))
2812
- .map((values) => values.length > 0
2813
- ? values.map((value) => Maybe.of(value))
2814
- : Resource.Values.fromValue({
2705
+ }),
2706
+ tsFeatureIncludes: $shaclPropertyFromRdf({
2707
+ graph: _$options.graph,
2708
+ resource: $resource,
2709
+ propertySchema: Ontology.schema.properties.tsFeatureIncludes,
2710
+ typeFromRdf: (resourceValues) => resourceValues
2711
+ .chain((values) => values.chainMap((value) => value.toIri([
2712
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
2713
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
2714
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
2715
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
2716
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
2717
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
2718
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
2719
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
2720
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
2721
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
2722
+ ])))
2723
+ .map((values) => values.toArray())
2724
+ .map((valuesArray) => Resource.Values.fromValue({
2815
2725
  focusResource: $resource,
2816
- propertyPath: PropertyShape.schema.properties.label.path,
2817
- value: Maybe.empty(),
2726
+ propertyPath: Ontology.schema.properties.tsFeatureIncludes.path,
2727
+ value: valuesArray,
2818
2728
  })),
2819
- }).chain((label) => $shaclPropertyFromRdf({
2820
- graph: _$options.graph,
2821
- resource: $resource,
2822
- propertySchema: Ontology.schema.properties.tsFeatureExcludes,
2823
- typeFromRdf: (resourceValues) => resourceValues
2824
- .chain((values) => values.chainMap((value) => value.toIri([
2825
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
2826
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
2827
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
2828
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
2829
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
2830
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
2831
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
2832
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
2833
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
2834
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
2835
- ])))
2836
- .map((values) => values.toArray())
2837
- .map((valuesArray) => Resource.Values.fromValue({
2838
- focusResource: $resource,
2839
- propertyPath: Ontology.schema.properties.tsFeatureExcludes.path,
2840
- value: valuesArray,
2841
- })),
2842
- }).chain((tsFeatureExcludes) => $shaclPropertyFromRdf({
2843
- graph: _$options.graph,
2844
- resource: $resource,
2845
- propertySchema: Ontology.schema.properties.tsFeatureIncludes,
2846
- typeFromRdf: (resourceValues) => resourceValues
2847
- .chain((values) => values.chainMap((value) => value.toIri([
2848
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
2849
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
2850
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
2851
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
2852
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
2853
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
2854
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
2855
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
2856
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
2857
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
2858
- ])))
2859
- .map((values) => values.toArray())
2860
- .map((valuesArray) => Resource.Values.fromValue({
2861
- focusResource: $resource,
2862
- propertyPath: Ontology.schema.properties.tsFeatureIncludes.path,
2863
- value: valuesArray,
2864
- })),
2865
- }).chain((tsFeatureIncludes) => $shaclPropertyFromRdf({
2866
- graph: _$options.graph,
2867
- resource: $resource,
2868
- propertySchema: Ontology.schema.properties.tsImports,
2869
- typeFromRdf: (resourceValues) => resourceValues
2870
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2871
- .chain((values) => values.chainMap((value) => value.toString()))
2872
- .map((values) => values.toArray())
2873
- .map((valuesArray) => Resource.Values.fromValue({
2874
- focusResource: $resource,
2875
- propertyPath: Ontology.schema.properties.tsImports.path,
2876
- value: valuesArray,
2877
- })),
2878
- }).map((tsImports) => create({
2879
- $identifier,
2880
- comment,
2881
- label,
2882
- tsFeatureExcludes,
2883
- tsFeatureIncludes,
2884
- tsImports,
2885
- }))))))));
2729
+ }),
2730
+ tsImports: $shaclPropertyFromRdf({
2731
+ graph: _$options.graph,
2732
+ resource: $resource,
2733
+ propertySchema: Ontology.schema.properties.tsImports,
2734
+ typeFromRdf: (resourceValues) => resourceValues
2735
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
2736
+ .chain((values) => values.chainMap((value) => value.toString()))
2737
+ .map((values) => values.toArray())
2738
+ .map((valuesArray) => Resource.Values.fromValue({
2739
+ focusResource: $resource,
2740
+ propertyPath: Ontology.schema.properties.tsImports.path,
2741
+ value: valuesArray,
2742
+ })),
2743
+ }),
2744
+ }).map((properties) => create(properties)));
2886
2745
  };
2887
2746
  Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
2888
2747
  Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
@@ -3909,846 +3768,668 @@ export var NodeShape;
3909
3768
  }
3910
3769
  return Left(new Error(`${$resource.identifier} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#NodeShape)`));
3911
3770
  })
3912
- : Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
3913
- dataFactory: dataFactory,
3914
- focusResource: $resource,
3915
- propertyPath: $RdfVocabularies.rdf.subject,
3916
- term: $resource.identifier,
3917
- }).toValues())
3918
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
3919
- .chain((values) => values.head())
3920
- .chain(($identifier) => $shaclPropertyFromRdf({
3921
- graph: _$options.graph,
3922
- resource: $resource,
3923
- propertySchema: NodeShape.schema.properties.and,
3924
- typeFromRdf: (resourceValues) => resourceValues
3925
- .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
3926
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
3771
+ : Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
3772
+ $identifier: Right(new Resource.Value({
3773
+ dataFactory: dataFactory,
3927
3774
  focusResource: $resource,
3928
- propertyPath: PropertyShape.schema.properties.and.path,
3929
- values: valueList.toArray(),
3930
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
3931
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
3932
- .map((values) => values.length > 0
3933
- ? values.map((value) => Maybe.of(value))
3934
- : Resource.Values.fromValue({
3775
+ propertyPath: $RdfVocabularies.rdf.subject,
3776
+ term: $resource.identifier,
3777
+ }).toValues())
3778
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
3779
+ .chain((values) => values.head()),
3780
+ and: $shaclPropertyFromRdf({
3781
+ graph: _$options.graph,
3782
+ resource: $resource,
3783
+ propertySchema: NodeShape.schema.properties.and,
3784
+ typeFromRdf: (resourceValues) => resourceValues
3785
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
3786
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
3935
3787
  focusResource: $resource,
3936
3788
  propertyPath: PropertyShape.schema.properties.and.path,
3937
- value: Maybe.empty(),
3938
- })),
3939
- }).chain((and) => $shaclPropertyFromRdf({
3940
- graph: _$options.graph,
3941
- resource: $resource,
3942
- propertySchema: NodeShape.schema.properties.classes,
3943
- typeFromRdf: (resourceValues) => resourceValues
3944
- .chain((values) => values.chainMap((value) => value.toIri()))
3945
- .map((values) => values.toArray())
3946
- .map((valuesArray) => Resource.Values.fromValue({
3947
- focusResource: $resource,
3948
- propertyPath: PropertyShape.schema.properties.classes.path,
3949
- value: valuesArray,
3950
- })),
3951
- }).chain((classes) => $shaclPropertyFromRdf({
3952
- graph: _$options.graph,
3953
- resource: $resource,
3954
- propertySchema: NodeShape.schema.properties.closed,
3955
- typeFromRdf: (resourceValues) => resourceValues
3956
- .chain((values) => values.chainMap((value) => value.toBoolean()))
3957
- .map((values) => values.length > 0
3958
- ? values.map((value) => Maybe.of(value))
3959
- : Resource.Values.fromValue({
3960
- focusResource: $resource,
3961
- propertyPath: NodeShape.schema.properties.closed.path,
3962
- value: Maybe.empty(),
3963
- })),
3964
- }).chain((closed) => $shaclPropertyFromRdf({
3965
- graph: _$options.graph,
3966
- resource: $resource,
3967
- propertySchema: NodeShape.schema.properties.comment,
3968
- typeFromRdf: (resourceValues) => resourceValues
3969
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
3970
- .chain((values) => values.chainMap((value) => value.toString()))
3971
- .map((values) => values.length > 0
3972
- ? values.map((value) => Maybe.of(value))
3973
- : Resource.Values.fromValue({
3974
- focusResource: $resource,
3975
- propertyPath: PropertyShape.schema.properties.comment.path,
3976
- value: Maybe.empty(),
3977
- })),
3978
- }).chain((comment) => $shaclPropertyFromRdf({
3979
- graph: _$options.graph,
3980
- resource: $resource,
3981
- propertySchema: NodeShape.schema.properties.datatype,
3982
- typeFromRdf: (resourceValues) => resourceValues
3983
- .chain((values) => values.chainMap((value) => value.toIri()))
3984
- .map((values) => values.length > 0
3985
- ? values.map((value) => Maybe.of(value))
3986
- : Resource.Values.fromValue({
3987
- focusResource: $resource,
3988
- propertyPath: PropertyShape.schema.properties.datatype.path,
3989
- value: Maybe.empty(),
3990
- })),
3991
- }).chain((datatype) => $shaclPropertyFromRdf({
3992
- graph: _$options.graph,
3993
- resource: $resource,
3994
- propertySchema: NodeShape.schema.properties.deactivated,
3995
- typeFromRdf: (resourceValues) => resourceValues
3996
- .chain((values) => values.chainMap((value) => value.toBoolean()))
3997
- .map((values) => values.length > 0
3998
- ? values.map((value) => Maybe.of(value))
3999
- : Resource.Values.fromValue({
4000
- focusResource: $resource,
4001
- propertyPath: PropertyShape.schema.properties.deactivated
4002
- .path,
4003
- value: Maybe.empty(),
4004
- })),
4005
- }).chain((deactivated) => $shaclPropertyFromRdf({
4006
- graph: _$options.graph,
4007
- resource: $resource,
4008
- propertySchema: NodeShape.schema.properties.discriminantValue,
4009
- typeFromRdf: (resourceValues) => resourceValues
4010
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4011
- .chain((values) => values.chainMap((value) => value.toString()))
4012
- .map((values) => values.length > 0
4013
- ? values.map((value) => Maybe.of(value))
4014
- : Resource.Values.fromValue({
4015
- focusResource: $resource,
4016
- propertyPath: NodeShape.schema.properties
4017
- .discriminantValue.path,
4018
- value: Maybe.empty(),
4019
- })),
4020
- }).chain((discriminantValue) => $shaclPropertyFromRdf({
4021
- graph: _$options.graph,
4022
- resource: $resource,
4023
- propertySchema: NodeShape.schema.properties.extern,
4024
- typeFromRdf: (resourceValues) => resourceValues
4025
- .chain((values) => values.chainMap((value) => value.toBoolean()))
4026
- .map((values) => values.length > 0
4027
- ? values.map((value) => Maybe.of(value))
4028
- : Resource.Values.fromValue({
4029
- focusResource: $resource,
4030
- propertyPath: NodeShape.schema.properties.extern.path,
4031
- value: Maybe.empty(),
4032
- })),
4033
- }).chain((extern) => $shaclPropertyFromRdf({
4034
- graph: _$options.graph,
4035
- resource: $resource,
4036
- propertySchema: NodeShape.schema.properties.flags,
4037
- typeFromRdf: (resourceValues) => resourceValues
4038
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4039
- .chain((values) => values.chainMap((value) => value.toString()))
4040
- .map((values) => values.toArray())
4041
- .map((valuesArray) => Resource.Values.fromValue({
4042
- focusResource: $resource,
4043
- propertyPath: PropertyShape.schema.properties.flags
4044
- .path,
4045
- value: valuesArray,
4046
- })),
4047
- }).chain((flags) => $shaclPropertyFromRdf({
4048
- graph: _$options.graph,
4049
- resource: $resource,
4050
- propertySchema: NodeShape.schema.properties.fromRdfType,
4051
- typeFromRdf: (resourceValues) => resourceValues
4052
- .chain((values) => values.chainMap((value) => value.toIri()))
4053
- .map((values) => values.length > 0
4054
- ? values.map((value) => Maybe.of(value))
4055
- : Resource.Values.fromValue({
4056
- focusResource: $resource,
4057
- propertyPath: NodeShape.schema.properties
4058
- .fromRdfType.path,
4059
- value: Maybe.empty(),
4060
- })),
4061
- }).chain((fromRdfType) => $shaclPropertyFromRdf({
4062
- graph: _$options.graph,
4063
- resource: $resource,
4064
- propertySchema: NodeShape.schema.properties.hasValues,
4065
- typeFromRdf: (resourceValues) => resourceValues
4066
- .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
4067
- switch (term.termType) {
4068
- case "NamedNode":
4069
- case "Literal":
4070
- return Either.of(term);
4071
- default:
4072
- return Left(new Resource.MistypedTermValueError({
4073
- actualValue: term,
4074
- expectedValueType: "(NamedNode | Literal)",
4075
- focusResource: $resource,
4076
- propertyPath: PropertyShape.schema
4077
- .properties.hasValues
4078
- .path,
4079
- }));
4080
- }
4081
- })))
4082
- .map((values) => values.toArray())
4083
- .map((valuesArray) => Resource.Values.fromValue({
4084
- focusResource: $resource,
4085
- propertyPath: PropertyShape.schema.properties
4086
- .hasValues.path,
4087
- value: valuesArray,
4088
- })),
4089
- }).chain((hasValues) => $shaclPropertyFromRdf({
4090
- graph: _$options.graph,
4091
- resource: $resource,
4092
- propertySchema: NodeShape.schema.properties.ignoredProperties,
4093
- typeFromRdf: (resourceValues) => resourceValues
4094
- .chain((values) => values.chainMap((value) => value.toList({
3789
+ values: valueList.toArray(),
3790
+ })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
3791
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
3792
+ .map((values) => values.length > 0
3793
+ ? values.map((value) => Maybe.of(value))
3794
+ : Resource.Values.fromValue({
3795
+ focusResource: $resource,
3796
+ propertyPath: PropertyShape.schema.properties.and.path,
3797
+ value: Maybe.empty(),
3798
+ })),
3799
+ }),
3800
+ classes: $shaclPropertyFromRdf({
4095
3801
  graph: _$options.graph,
4096
- })))
4097
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4098
- focusResource: $resource,
4099
- propertyPath: NodeShape.schema.properties
4100
- .ignoredProperties.path,
4101
- values: valueList.toArray(),
4102
- })).chain((values) => values.chainMap((value) => value.toIri()))))
4103
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4104
- .map((values) => values.length > 0
4105
- ? values.map((value) => Maybe.of(value))
4106
- : Resource.Values.fromValue({
3802
+ resource: $resource,
3803
+ propertySchema: NodeShape.schema.properties.classes,
3804
+ typeFromRdf: (resourceValues) => resourceValues
3805
+ .chain((values) => values.chainMap((value) => value.toIri()))
3806
+ .map((values) => values.toArray())
3807
+ .map((valuesArray) => Resource.Values.fromValue({
4107
3808
  focusResource: $resource,
4108
- propertyPath: NodeShape.schema.properties
4109
- .ignoredProperties.path,
4110
- value: Maybe.empty(),
3809
+ propertyPath: PropertyShape.schema.properties.classes.path,
3810
+ value: valuesArray,
4111
3811
  })),
4112
- }).chain((ignoredProperties) => $shaclPropertyFromRdf({
4113
- graph: _$options.graph,
4114
- resource: $resource,
4115
- propertySchema: NodeShape.schema.properties.in_,
4116
- typeFromRdf: (resourceValues) => resourceValues
4117
- .chain((values) => values.chainMap((value) => value.toList({
3812
+ }),
3813
+ closed: $shaclPropertyFromRdf({
4118
3814
  graph: _$options.graph,
4119
- })))
4120
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4121
- focusResource: $resource,
4122
- propertyPath: PropertyShape.schema
4123
- .properties.in_.path,
4124
- values: valueList.toArray(),
4125
- })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
4126
- switch (term.termType) {
4127
- case "NamedNode":
4128
- case "Literal":
4129
- return Either.of(term);
4130
- default:
4131
- return Left(new Resource.MistypedTermValueError({
4132
- actualValue: term,
4133
- expectedValueType: "(NamedNode | Literal)",
4134
- focusResource: $resource,
4135
- propertyPath: PropertyShape
4136
- .schema
4137
- .properties.in_
4138
- .path,
4139
- }));
4140
- }
4141
- })))))
4142
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4143
- .map((values) => values.length > 0
4144
- ? values.map((value) => Maybe.of(value))
4145
- : Resource.Values.fromValue({
4146
- focusResource: $resource,
4147
- propertyPath: PropertyShape.schema
4148
- .properties.in_.path,
4149
- value: Maybe.empty(),
4150
- })),
4151
- }).chain((in_) => $shaclPropertyFromRdf({
4152
- graph: _$options.graph,
4153
- resource: $resource,
4154
- propertySchema: NodeShape.schema.properties.isDefinedBy,
4155
- typeFromRdf: (resourceValues) => resourceValues
4156
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
4157
- .map((values) => values.length > 0
4158
- ? values.map((value) => Maybe.of(value))
4159
- : Resource.Values.fromValue({
4160
- focusResource: $resource,
4161
- propertyPath: PropertyShape.schema
4162
- .properties.isDefinedBy
4163
- .path,
4164
- value: Maybe.empty(),
4165
- })),
4166
- }).chain((isDefinedBy) => $shaclPropertyFromRdf({
4167
- graph: _$options.graph,
4168
- resource: $resource,
4169
- propertySchema: NodeShape.schema.properties.label,
4170
- typeFromRdf: (resourceValues) => resourceValues
4171
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4172
- .chain((values) => values.chainMap((value) => value.toString()))
4173
- .map((values) => values.length > 0
4174
- ? values.map((value) => Maybe.of(value))
4175
- : Resource.Values.fromValue({
4176
- focusResource: $resource,
4177
- propertyPath: PropertyShape.schema
4178
- .properties.label.path,
4179
- value: Maybe.empty(),
4180
- })),
4181
- }).chain((label) => $shaclPropertyFromRdf({
4182
- graph: _$options.graph,
4183
- resource: $resource,
4184
- propertySchema: NodeShape.schema.properties.languageIn,
4185
- typeFromRdf: (resourceValues) => resourceValues
4186
- .chain((values) => values.chainMap((value) => value.toList({
3815
+ resource: $resource,
3816
+ propertySchema: NodeShape.schema.properties.closed,
3817
+ typeFromRdf: (resourceValues) => resourceValues
3818
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
3819
+ .map((values) => values.length > 0
3820
+ ? values.map((value) => Maybe.of(value))
3821
+ : Resource.Values.fromValue({
3822
+ focusResource: $resource,
3823
+ propertyPath: NodeShape.schema.properties.closed.path,
3824
+ value: Maybe.empty(),
3825
+ })),
3826
+ }),
3827
+ comment: $shaclPropertyFromRdf({
4187
3828
  graph: _$options.graph,
4188
- })))
4189
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4190
- focusResource: $resource,
4191
- propertyPath: PropertyShape.schema
4192
- .properties
4193
- .languageIn.path,
4194
- values: valueList.toArray(),
4195
- }))
4196
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4197
- .chain((values) => values.chainMap((value) => value.toString()))))
4198
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4199
- .map((values) => values.length > 0
4200
- ? values.map((value) => Maybe.of(value))
4201
- : Resource.Values.fromValue({
3829
+ resource: $resource,
3830
+ propertySchema: NodeShape.schema.properties.comment,
3831
+ typeFromRdf: (resourceValues) => resourceValues
3832
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
3833
+ .chain((values) => values.chainMap((value) => value.toString()))
3834
+ .map((values) => values.length > 0
3835
+ ? values.map((value) => Maybe.of(value))
3836
+ : Resource.Values.fromValue({
3837
+ focusResource: $resource,
3838
+ propertyPath: PropertyShape.schema.properties.comment.path,
3839
+ value: Maybe.empty(),
3840
+ })),
3841
+ }),
3842
+ datatype: $shaclPropertyFromRdf({
3843
+ graph: _$options.graph,
3844
+ resource: $resource,
3845
+ propertySchema: NodeShape.schema.properties.datatype,
3846
+ typeFromRdf: (resourceValues) => resourceValues
3847
+ .chain((values) => values.chainMap((value) => value.toIri()))
3848
+ .map((values) => values.length > 0
3849
+ ? values.map((value) => Maybe.of(value))
3850
+ : Resource.Values.fromValue({
3851
+ focusResource: $resource,
3852
+ propertyPath: PropertyShape.schema.properties.datatype.path,
3853
+ value: Maybe.empty(),
3854
+ })),
3855
+ }),
3856
+ deactivated: $shaclPropertyFromRdf({
3857
+ graph: _$options.graph,
3858
+ resource: $resource,
3859
+ propertySchema: NodeShape.schema.properties.deactivated,
3860
+ typeFromRdf: (resourceValues) => resourceValues
3861
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
3862
+ .map((values) => values.length > 0
3863
+ ? values.map((value) => Maybe.of(value))
3864
+ : Resource.Values.fromValue({
3865
+ focusResource: $resource,
3866
+ propertyPath: PropertyShape.schema.properties.deactivated.path,
3867
+ value: Maybe.empty(),
3868
+ })),
3869
+ }),
3870
+ discriminantValue: $shaclPropertyFromRdf({
3871
+ graph: _$options.graph,
3872
+ resource: $resource,
3873
+ propertySchema: NodeShape.schema.properties.discriminantValue,
3874
+ typeFromRdf: (resourceValues) => resourceValues
3875
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
3876
+ .chain((values) => values.chainMap((value) => value.toString()))
3877
+ .map((values) => values.length > 0
3878
+ ? values.map((value) => Maybe.of(value))
3879
+ : Resource.Values.fromValue({
3880
+ focusResource: $resource,
3881
+ propertyPath: NodeShape.schema.properties.discriminantValue.path,
3882
+ value: Maybe.empty(),
3883
+ })),
3884
+ }),
3885
+ extern: $shaclPropertyFromRdf({
3886
+ graph: _$options.graph,
3887
+ resource: $resource,
3888
+ propertySchema: NodeShape.schema.properties.extern,
3889
+ typeFromRdf: (resourceValues) => resourceValues
3890
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
3891
+ .map((values) => values.length > 0
3892
+ ? values.map((value) => Maybe.of(value))
3893
+ : Resource.Values.fromValue({
3894
+ focusResource: $resource,
3895
+ propertyPath: NodeShape.schema.properties.extern.path,
3896
+ value: Maybe.empty(),
3897
+ })),
3898
+ }),
3899
+ flags: $shaclPropertyFromRdf({
3900
+ graph: _$options.graph,
3901
+ resource: $resource,
3902
+ propertySchema: NodeShape.schema.properties.flags,
3903
+ typeFromRdf: (resourceValues) => resourceValues
3904
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
3905
+ .chain((values) => values.chainMap((value) => value.toString()))
3906
+ .map((values) => values.toArray())
3907
+ .map((valuesArray) => Resource.Values.fromValue({
4202
3908
  focusResource: $resource,
4203
- propertyPath: PropertyShape.schema
4204
- .properties.languageIn
4205
- .path,
4206
- value: Maybe.empty(),
3909
+ propertyPath: PropertyShape.schema.properties.flags.path,
3910
+ value: valuesArray,
4207
3911
  })),
4208
- }).chain((languageIn) => $shaclPropertyFromRdf({
4209
- graph: _$options.graph,
4210
- resource: $resource,
4211
- propertySchema: NodeShape.schema.properties.maxCount,
4212
- typeFromRdf: (resourceValues) => resourceValues
4213
- .chain((values) => values.chainMap((value) => value.toBigInt()))
4214
- .map((values) => values.length > 0
4215
- ? values.map((value) => Maybe.of(value))
4216
- : Resource.Values.fromValue({
3912
+ }),
3913
+ fromRdfType: $shaclPropertyFromRdf({
3914
+ graph: _$options.graph,
3915
+ resource: $resource,
3916
+ propertySchema: NodeShape.schema.properties.fromRdfType,
3917
+ typeFromRdf: (resourceValues) => resourceValues
3918
+ .chain((values) => values.chainMap((value) => value.toIri()))
3919
+ .map((values) => values.length > 0
3920
+ ? values.map((value) => Maybe.of(value))
3921
+ : Resource.Values.fromValue({
3922
+ focusResource: $resource,
3923
+ propertyPath: NodeShape.schema.properties.fromRdfType.path,
3924
+ value: Maybe.empty(),
3925
+ })),
3926
+ }),
3927
+ hasValues: $shaclPropertyFromRdf({
3928
+ graph: _$options.graph,
3929
+ resource: $resource,
3930
+ propertySchema: NodeShape.schema.properties.hasValues,
3931
+ typeFromRdf: (resourceValues) => resourceValues
3932
+ .chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
3933
+ switch (term.termType) {
3934
+ case "NamedNode":
3935
+ case "Literal":
3936
+ return Either.of(term);
3937
+ default:
3938
+ return Left(new Resource.MistypedTermValueError({
3939
+ actualValue: term,
3940
+ expectedValueType: "(NamedNode | Literal)",
3941
+ focusResource: $resource,
3942
+ propertyPath: PropertyShape.schema.properties.hasValues.path,
3943
+ }));
3944
+ }
3945
+ })))
3946
+ .map((values) => values.toArray())
3947
+ .map((valuesArray) => Resource.Values.fromValue({
4217
3948
  focusResource: $resource,
4218
- propertyPath: PropertyShape.schema
4219
- .properties.maxCount
4220
- .path,
4221
- value: Maybe.empty(),
3949
+ propertyPath: PropertyShape.schema.properties.hasValues.path,
3950
+ value: valuesArray,
4222
3951
  })),
4223
- }).chain((maxCount) => $shaclPropertyFromRdf({
4224
- graph: _$options.graph,
4225
- resource: $resource,
4226
- propertySchema: NodeShape.schema.properties.maxExclusive,
4227
- typeFromRdf: (resourceValues) => resourceValues
4228
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4229
- .chain((values) => values.chainMap((value) => value.toLiteral()))
4230
- .map((values) => values.length > 0
4231
- ? values.map((value) => Maybe.of(value))
4232
- : Resource.Values.fromValue({
3952
+ }),
3953
+ ignoredProperties: $shaclPropertyFromRdf({
3954
+ graph: _$options.graph,
3955
+ resource: $resource,
3956
+ propertySchema: NodeShape.schema.properties.ignoredProperties,
3957
+ typeFromRdf: (resourceValues) => resourceValues
3958
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
3959
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4233
3960
  focusResource: $resource,
4234
- propertyPath: PropertyShape.schema
4235
- .properties
4236
- .maxExclusive
4237
- .path,
4238
- value: Maybe.empty(),
4239
- })),
4240
- }).chain((maxExclusive) => $shaclPropertyFromRdf({
4241
- graph: _$options.graph,
4242
- resource: $resource,
4243
- propertySchema: NodeShape.schema.properties
4244
- .maxInclusive,
4245
- typeFromRdf: (resourceValues) => resourceValues
4246
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4247
- .chain((values) => values.chainMap((value) => value.toLiteral()))
4248
- .map((values) => values.length > 0
4249
- ? values.map((value) => Maybe.of(value))
4250
- : Resource.Values.fromValue({
3961
+ propertyPath: NodeShape.schema.properties.ignoredProperties.path,
3962
+ values: valueList.toArray(),
3963
+ })).chain((values) => values.chainMap((value) => value.toIri()))))
3964
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
3965
+ .map((values) => values.length > 0
3966
+ ? values.map((value) => Maybe.of(value))
3967
+ : Resource.Values.fromValue({
3968
+ focusResource: $resource,
3969
+ propertyPath: NodeShape.schema.properties.ignoredProperties.path,
3970
+ value: Maybe.empty(),
3971
+ })),
3972
+ }),
3973
+ in_: $shaclPropertyFromRdf({
3974
+ graph: _$options.graph,
3975
+ resource: $resource,
3976
+ propertySchema: NodeShape.schema.properties.in_,
3977
+ typeFromRdf: (resourceValues) => resourceValues
3978
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
3979
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4251
3980
  focusResource: $resource,
4252
- propertyPath: PropertyShape
4253
- .schema
4254
- .properties
4255
- .maxInclusive
4256
- .path,
4257
- value: Maybe.empty(),
4258
- })),
4259
- }).chain((maxInclusive) => $shaclPropertyFromRdf({
4260
- graph: _$options.graph,
4261
- resource: $resource,
4262
- propertySchema: NodeShape.schema.properties.maxLength,
4263
- typeFromRdf: (resourceValues) => resourceValues
4264
- .chain((values) => values.chainMap((value) => value.toBigInt()))
4265
- .map((values) => values.length > 0
4266
- ? values.map((value) => Maybe.of(value))
4267
- : Resource.Values.fromValue({
3981
+ propertyPath: PropertyShape.schema.properties.in_.path,
3982
+ values: valueList.toArray(),
3983
+ })).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
3984
+ switch (term.termType) {
3985
+ case "NamedNode":
3986
+ case "Literal":
3987
+ return Either.of(term);
3988
+ default:
3989
+ return Left(new Resource.MistypedTermValueError({
3990
+ actualValue: term,
3991
+ expectedValueType: "(NamedNode | Literal)",
3992
+ focusResource: $resource,
3993
+ propertyPath: PropertyShape.schema.properties.in_.path,
3994
+ }));
3995
+ }
3996
+ })))))
3997
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
3998
+ .map((values) => values.length > 0
3999
+ ? values.map((value) => Maybe.of(value))
4000
+ : Resource.Values.fromValue({
4001
+ focusResource: $resource,
4002
+ propertyPath: PropertyShape.schema.properties.in_.path,
4003
+ value: Maybe.empty(),
4004
+ })),
4005
+ }),
4006
+ isDefinedBy: $shaclPropertyFromRdf({
4007
+ graph: _$options.graph,
4008
+ resource: $resource,
4009
+ propertySchema: NodeShape.schema.properties.isDefinedBy,
4010
+ typeFromRdf: (resourceValues) => resourceValues
4011
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
4012
+ .map((values) => values.length > 0
4013
+ ? values.map((value) => Maybe.of(value))
4014
+ : Resource.Values.fromValue({
4015
+ focusResource: $resource,
4016
+ propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
4017
+ value: Maybe.empty(),
4018
+ })),
4019
+ }),
4020
+ label: $shaclPropertyFromRdf({
4021
+ graph: _$options.graph,
4022
+ resource: $resource,
4023
+ propertySchema: NodeShape.schema.properties.label,
4024
+ typeFromRdf: (resourceValues) => resourceValues
4025
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4026
+ .chain((values) => values.chainMap((value) => value.toString()))
4027
+ .map((values) => values.length > 0
4028
+ ? values.map((value) => Maybe.of(value))
4029
+ : Resource.Values.fromValue({
4030
+ focusResource: $resource,
4031
+ propertyPath: PropertyShape.schema.properties.label.path,
4032
+ value: Maybe.empty(),
4033
+ })),
4034
+ }),
4035
+ languageIn: $shaclPropertyFromRdf({
4036
+ graph: _$options.graph,
4037
+ resource: $resource,
4038
+ propertySchema: NodeShape.schema.properties.languageIn,
4039
+ typeFromRdf: (resourceValues) => resourceValues
4040
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
4041
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4268
4042
  focusResource: $resource,
4269
- propertyPath: PropertyShape
4270
- .schema
4271
- .properties
4272
- .maxLength
4273
- .path,
4274
- value: Maybe.empty(),
4275
- })),
4276
- }).chain((maxLength) => $shaclPropertyFromRdf({
4277
- graph: _$options.graph,
4278
- resource: $resource,
4279
- propertySchema: NodeShape.schema.properties
4280
- .minCount,
4281
- typeFromRdf: (resourceValues) => resourceValues
4282
- .chain((values) => values.chainMap((value) => value.toBigInt()))
4283
- .map((values) => values.length > 0
4284
- ? values.map((value) => Maybe.of(value))
4285
- : Resource.Values.fromValue({
4043
+ propertyPath: PropertyShape.schema.properties.languageIn.path,
4044
+ values: valueList.toArray(),
4045
+ }))
4046
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4047
+ .chain((values) => values.chainMap((value) => value.toString()))))
4048
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4049
+ .map((values) => values.length > 0
4050
+ ? values.map((value) => Maybe.of(value))
4051
+ : Resource.Values.fromValue({
4052
+ focusResource: $resource,
4053
+ propertyPath: PropertyShape.schema.properties.languageIn.path,
4054
+ value: Maybe.empty(),
4055
+ })),
4056
+ }),
4057
+ maxCount: $shaclPropertyFromRdf({
4058
+ graph: _$options.graph,
4059
+ resource: $resource,
4060
+ propertySchema: NodeShape.schema.properties.maxCount,
4061
+ typeFromRdf: (resourceValues) => resourceValues
4062
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
4063
+ .map((values) => values.length > 0
4064
+ ? values.map((value) => Maybe.of(value))
4065
+ : Resource.Values.fromValue({
4066
+ focusResource: $resource,
4067
+ propertyPath: PropertyShape.schema.properties.maxCount.path,
4068
+ value: Maybe.empty(),
4069
+ })),
4070
+ }),
4071
+ maxExclusive: $shaclPropertyFromRdf({
4072
+ graph: _$options.graph,
4073
+ resource: $resource,
4074
+ propertySchema: NodeShape.schema.properties.maxExclusive,
4075
+ typeFromRdf: (resourceValues) => resourceValues
4076
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4077
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
4078
+ .map((values) => values.length > 0
4079
+ ? values.map((value) => Maybe.of(value))
4080
+ : Resource.Values.fromValue({
4081
+ focusResource: $resource,
4082
+ propertyPath: PropertyShape.schema.properties.maxExclusive.path,
4083
+ value: Maybe.empty(),
4084
+ })),
4085
+ }),
4086
+ maxInclusive: $shaclPropertyFromRdf({
4087
+ graph: _$options.graph,
4088
+ resource: $resource,
4089
+ propertySchema: NodeShape.schema.properties.maxInclusive,
4090
+ typeFromRdf: (resourceValues) => resourceValues
4091
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4092
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
4093
+ .map((values) => values.length > 0
4094
+ ? values.map((value) => Maybe.of(value))
4095
+ : Resource.Values.fromValue({
4096
+ focusResource: $resource,
4097
+ propertyPath: PropertyShape.schema.properties.maxInclusive.path,
4098
+ value: Maybe.empty(),
4099
+ })),
4100
+ }),
4101
+ maxLength: $shaclPropertyFromRdf({
4102
+ graph: _$options.graph,
4103
+ resource: $resource,
4104
+ propertySchema: NodeShape.schema.properties.maxLength,
4105
+ typeFromRdf: (resourceValues) => resourceValues
4106
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
4107
+ .map((values) => values.length > 0
4108
+ ? values.map((value) => Maybe.of(value))
4109
+ : Resource.Values.fromValue({
4110
+ focusResource: $resource,
4111
+ propertyPath: PropertyShape.schema.properties.maxLength.path,
4112
+ value: Maybe.empty(),
4113
+ })),
4114
+ }),
4115
+ minCount: $shaclPropertyFromRdf({
4116
+ graph: _$options.graph,
4117
+ resource: $resource,
4118
+ propertySchema: NodeShape.schema.properties.minCount,
4119
+ typeFromRdf: (resourceValues) => resourceValues
4120
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
4121
+ .map((values) => values.length > 0
4122
+ ? values.map((value) => Maybe.of(value))
4123
+ : Resource.Values.fromValue({
4124
+ focusResource: $resource,
4125
+ propertyPath: PropertyShape.schema.properties.minCount.path,
4126
+ value: Maybe.empty(),
4127
+ })),
4128
+ }),
4129
+ minExclusive: $shaclPropertyFromRdf({
4130
+ graph: _$options.graph,
4131
+ resource: $resource,
4132
+ propertySchema: NodeShape.schema.properties.minExclusive,
4133
+ typeFromRdf: (resourceValues) => resourceValues
4134
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4135
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
4136
+ .map((values) => values.length > 0
4137
+ ? values.map((value) => Maybe.of(value))
4138
+ : Resource.Values.fromValue({
4139
+ focusResource: $resource,
4140
+ propertyPath: PropertyShape.schema.properties.minExclusive.path,
4141
+ value: Maybe.empty(),
4142
+ })),
4143
+ }),
4144
+ minInclusive: $shaclPropertyFromRdf({
4145
+ graph: _$options.graph,
4146
+ resource: $resource,
4147
+ propertySchema: NodeShape.schema.properties.minInclusive,
4148
+ typeFromRdf: (resourceValues) => resourceValues
4149
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4150
+ .chain((values) => values.chainMap((value) => value.toLiteral()))
4151
+ .map((values) => values.length > 0
4152
+ ? values.map((value) => Maybe.of(value))
4153
+ : Resource.Values.fromValue({
4154
+ focusResource: $resource,
4155
+ propertyPath: PropertyShape.schema.properties.minInclusive.path,
4156
+ value: Maybe.empty(),
4157
+ })),
4158
+ }),
4159
+ minLength: $shaclPropertyFromRdf({
4160
+ graph: _$options.graph,
4161
+ resource: $resource,
4162
+ propertySchema: NodeShape.schema.properties.minLength,
4163
+ typeFromRdf: (resourceValues) => resourceValues
4164
+ .chain((values) => values.chainMap((value) => value.toBigInt()))
4165
+ .map((values) => values.length > 0
4166
+ ? values.map((value) => Maybe.of(value))
4167
+ : Resource.Values.fromValue({
4168
+ focusResource: $resource,
4169
+ propertyPath: PropertyShape.schema.properties.minLength.path,
4170
+ value: Maybe.empty(),
4171
+ })),
4172
+ }),
4173
+ mutable: $shaclPropertyFromRdf({
4174
+ graph: _$options.graph,
4175
+ resource: $resource,
4176
+ propertySchema: NodeShape.schema.properties.mutable,
4177
+ typeFromRdf: (resourceValues) => resourceValues
4178
+ .chain((values) => values.chainMap((value) => value.toBoolean()))
4179
+ .map((values) => values.length > 0
4180
+ ? values.map((value) => Maybe.of(value))
4181
+ : Resource.Values.fromValue({
4182
+ focusResource: $resource,
4183
+ propertyPath: PropertyShape.schema.properties.mutable.path,
4184
+ value: Maybe.empty(),
4185
+ })),
4186
+ }),
4187
+ node: $shaclPropertyFromRdf({
4188
+ graph: _$options.graph,
4189
+ resource: $resource,
4190
+ propertySchema: NodeShape.schema.properties.node,
4191
+ typeFromRdf: (resourceValues) => resourceValues
4192
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
4193
+ .map((values) => values.length > 0
4194
+ ? values.map((value) => Maybe.of(value))
4195
+ : Resource.Values.fromValue({
4196
+ focusResource: $resource,
4197
+ propertyPath: PropertyShape.schema.properties.node.path,
4198
+ value: Maybe.empty(),
4199
+ })),
4200
+ }),
4201
+ nodeKind: $shaclPropertyFromRdf({
4202
+ graph: _$options.graph,
4203
+ resource: $resource,
4204
+ propertySchema: NodeShape.schema.properties.nodeKind,
4205
+ typeFromRdf: (resourceValues) => resourceValues
4206
+ .chain((values) => values.chainMap((value) => value.toIri([
4207
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
4208
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
4209
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
4210
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
4211
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
4212
+ dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
4213
+ ])))
4214
+ .map((values) => values.length > 0
4215
+ ? values.map((value) => Maybe.of(value))
4216
+ : Resource.Values.fromValue({
4217
+ focusResource: $resource,
4218
+ propertyPath: PropertyShape.schema.properties.nodeKind.path,
4219
+ value: Maybe.empty(),
4220
+ })),
4221
+ }),
4222
+ not: $shaclPropertyFromRdf({
4223
+ graph: _$options.graph,
4224
+ resource: $resource,
4225
+ propertySchema: NodeShape.schema.properties.not,
4226
+ typeFromRdf: (resourceValues) => resourceValues
4227
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
4228
+ .map((values) => values.toArray())
4229
+ .map((valuesArray) => Resource.Values.fromValue({
4286
4230
  focusResource: $resource,
4287
- propertyPath: PropertyShape
4288
- .schema
4289
- .properties
4290
- .minCount
4291
- .path,
4292
- value: Maybe.empty(),
4231
+ propertyPath: PropertyShape.schema.properties.not.path,
4232
+ value: valuesArray,
4293
4233
  })),
4294
- }).chain((minCount) => $shaclPropertyFromRdf({
4295
- graph: _$options.graph,
4296
- resource: $resource,
4297
- propertySchema: NodeShape.schema.properties
4298
- .minExclusive,
4299
- typeFromRdf: (resourceValues) => resourceValues
4300
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4301
- .chain((values) => values.chainMap((value) => value.toLiteral()))
4302
- .map((values) => values.length > 0
4303
- ? values.map((value) => Maybe.of(value))
4304
- : Resource.Values.fromValue({
4234
+ }),
4235
+ or: $shaclPropertyFromRdf({
4236
+ graph: _$options.graph,
4237
+ resource: $resource,
4238
+ propertySchema: NodeShape.schema.properties.or,
4239
+ typeFromRdf: (resourceValues) => resourceValues
4240
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
4241
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4305
4242
  focusResource: $resource,
4306
- propertyPath: PropertyShape
4307
- .schema
4308
- .properties
4309
- .minExclusive
4310
- .path,
4311
- value: Maybe.empty(),
4312
- })),
4313
- }).chain((minExclusive) => $shaclPropertyFromRdf({
4314
- graph: _$options.graph,
4315
- resource: $resource,
4316
- propertySchema: NodeShape.schema.properties
4317
- .minInclusive,
4318
- typeFromRdf: (resourceValues) => resourceValues
4319
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4320
- .chain((values) => values.chainMap((value) => value.toLiteral()))
4321
- .map((values) => values.length > 0
4322
- ? values.map((value) => Maybe.of(value))
4323
- : Resource.Values.fromValue({
4243
+ propertyPath: PropertyShape.schema.properties.or.path,
4244
+ values: valueList.toArray(),
4245
+ })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
4246
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4247
+ .map((values) => values.length > 0
4248
+ ? values.map((value) => Maybe.of(value))
4249
+ : Resource.Values.fromValue({
4250
+ focusResource: $resource,
4251
+ propertyPath: PropertyShape.schema.properties.or.path,
4252
+ value: Maybe.empty(),
4253
+ })),
4254
+ }),
4255
+ patterns: $shaclPropertyFromRdf({
4256
+ graph: _$options.graph,
4257
+ resource: $resource,
4258
+ propertySchema: NodeShape.schema.properties.patterns,
4259
+ typeFromRdf: (resourceValues) => resourceValues
4260
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4261
+ .chain((values) => values.chainMap((value) => value.toString()))
4262
+ .map((values) => values.toArray())
4263
+ .map((valuesArray) => Resource.Values.fromValue({
4324
4264
  focusResource: $resource,
4325
- propertyPath: PropertyShape
4326
- .schema
4327
- .properties
4328
- .minInclusive
4329
- .path,
4330
- value: Maybe.empty(),
4265
+ propertyPath: PropertyShape.schema.properties.patterns.path,
4266
+ value: valuesArray,
4331
4267
  })),
4332
- }).chain((minInclusive) => $shaclPropertyFromRdf({
4333
- graph: _$options.graph,
4334
- resource: $resource,
4335
- propertySchema: NodeShape.schema.properties
4336
- .minLength,
4337
- typeFromRdf: (resourceValues) => resourceValues
4338
- .chain((values) => values.chainMap((value) => value.toBigInt()))
4339
- .map((values) => values.length >
4340
- 0
4341
- ? values.map((value) => Maybe.of(value))
4342
- : Resource.Values.fromValue({
4268
+ }),
4269
+ properties: $shaclPropertyFromRdf({
4270
+ graph: _$options.graph,
4271
+ resource: $resource,
4272
+ propertySchema: NodeShape.schema.properties.properties,
4273
+ typeFromRdf: (resourceValues) => resourceValues
4274
+ .chain((values) => values.chainMap((value) => value.toIdentifier()))
4275
+ .map((values) => values.toArray())
4276
+ .map((valuesArray) => Resource.Values.fromValue({
4343
4277
  focusResource: $resource,
4344
- propertyPath: PropertyShape
4345
- .schema
4346
- .properties
4347
- .minLength
4348
- .path,
4349
- value: Maybe.empty(),
4278
+ propertyPath: NodeShape.schema.properties.properties.path,
4279
+ value: valuesArray,
4350
4280
  })),
4351
- }).chain((minLength) => $shaclPropertyFromRdf({
4352
- graph: _$options.graph,
4353
- resource: $resource,
4354
- propertySchema: NodeShape.schema
4355
- .properties
4356
- .mutable,
4357
- typeFromRdf: (resourceValues) => resourceValues
4358
- .chain((values) => values.chainMap((value) => value.toBoolean()))
4359
- .map((values) => values.length >
4360
- 0
4361
- ? values.map((value) => Maybe.of(value))
4362
- : Resource.Values.fromValue({
4281
+ }),
4282
+ rdfType: $shaclPropertyFromRdf({
4283
+ graph: _$options.graph,
4284
+ resource: $resource,
4285
+ propertySchema: NodeShape.schema.properties.rdfType,
4286
+ typeFromRdf: (resourceValues) => resourceValues
4287
+ .chain((values) => values.chainMap((value) => value.toIri()))
4288
+ .map((values) => values.length > 0
4289
+ ? values.map((value) => Maybe.of(value))
4290
+ : Resource.Values.fromValue({
4291
+ focusResource: $resource,
4292
+ propertyPath: NodeShape.schema.properties.rdfType.path,
4293
+ value: Maybe.empty(),
4294
+ })),
4295
+ }),
4296
+ shaclmateName: $shaclPropertyFromRdf({
4297
+ graph: _$options.graph,
4298
+ resource: $resource,
4299
+ propertySchema: NodeShape.schema.properties.shaclmateName,
4300
+ typeFromRdf: (resourceValues) => resourceValues
4301
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4302
+ .chain((values) => values.chainMap((value) => value.toString()))
4303
+ .map((values) => values.length > 0
4304
+ ? values.map((value) => Maybe.of(value))
4305
+ : Resource.Values.fromValue({
4306
+ focusResource: $resource,
4307
+ propertyPath: PropertyShape.schema.properties.shaclmateName.path,
4308
+ value: Maybe.empty(),
4309
+ })),
4310
+ }),
4311
+ subClassOf: $shaclPropertyFromRdf({
4312
+ graph: _$options.graph,
4313
+ resource: $resource,
4314
+ propertySchema: NodeShape.schema.properties.subClassOf,
4315
+ typeFromRdf: (resourceValues) => resourceValues
4316
+ .chain((values) => values.chainMap((value) => value.toIri()))
4317
+ .map((values) => values.toArray())
4318
+ .map((valuesArray) => Resource.Values.fromValue({
4363
4319
  focusResource: $resource,
4364
- propertyPath: PropertyShape
4365
- .schema
4366
- .properties
4367
- .mutable
4368
- .path,
4369
- value: Maybe.empty(),
4320
+ propertyPath: NodeShape.schema.properties.subClassOf.path,
4321
+ value: valuesArray,
4370
4322
  })),
4371
- }).chain((mutable) => $shaclPropertyFromRdf({
4372
- graph: _$options.graph,
4373
- resource: $resource,
4374
- propertySchema: NodeShape.schema
4375
- .properties
4376
- .node,
4377
- typeFromRdf: (resourceValues) => resourceValues
4378
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
4379
- .map((values) => values.length >
4380
- 0
4381
- ? values.map((value) => Maybe.of(value))
4382
- : Resource.Values.fromValue({
4323
+ }),
4324
+ toRdfTypes: $shaclPropertyFromRdf({
4325
+ graph: _$options.graph,
4326
+ resource: $resource,
4327
+ propertySchema: NodeShape.schema.properties.toRdfTypes,
4328
+ typeFromRdf: (resourceValues) => resourceValues
4329
+ .chain((values) => values.chainMap((value) => value.toIri()))
4330
+ .map((values) => values.toArray())
4331
+ .map((valuesArray) => Resource.Values.fromValue({
4383
4332
  focusResource: $resource,
4384
- propertyPath: PropertyShape
4385
- .schema
4386
- .properties
4387
- .node
4388
- .path,
4389
- value: Maybe.empty(),
4333
+ propertyPath: NodeShape.schema.properties.toRdfTypes.path,
4334
+ value: valuesArray,
4390
4335
  })),
4391
- }).chain((node) => $shaclPropertyFromRdf({
4392
- graph: _$options.graph,
4393
- resource: $resource,
4394
- propertySchema: NodeShape.schema
4395
- .properties
4396
- .nodeKind,
4397
- typeFromRdf: (resourceValues) => resourceValues
4398
- .chain((values) => values.chainMap((value) => value.toIri([
4399
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
4400
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
4401
- dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
4402
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
4403
- dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
4404
- dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
4405
- ])))
4406
- .map((values) => values.length >
4407
- 0
4408
- ? values.map((value) => Maybe.of(value))
4409
- : Resource.Values.fromValue({
4336
+ }),
4337
+ tsFeatureExcludes: $shaclPropertyFromRdf({
4338
+ graph: _$options.graph,
4339
+ resource: $resource,
4340
+ propertySchema: NodeShape.schema.properties.tsFeatureExcludes,
4341
+ typeFromRdf: (resourceValues) => resourceValues
4342
+ .chain((values) => values.chainMap((value) => value.toIri([
4343
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
4344
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
4345
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
4346
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
4347
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
4348
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
4349
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
4350
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
4351
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
4352
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
4353
+ ])))
4354
+ .map((values) => values.toArray())
4355
+ .map((valuesArray) => Resource.Values.fromValue({
4410
4356
  focusResource: $resource,
4411
- propertyPath: PropertyShape
4412
- .schema
4413
- .properties
4414
- .nodeKind
4415
- .path,
4416
- value: Maybe.empty(),
4357
+ propertyPath: Ontology.schema.properties.tsFeatureExcludes.path,
4358
+ value: valuesArray,
4417
4359
  })),
4418
- }).chain((nodeKind) => $shaclPropertyFromRdf({
4419
- graph: _$options.graph,
4420
- resource: $resource,
4421
- propertySchema: NodeShape.schema
4422
- .properties
4423
- .not,
4424
- typeFromRdf: (resourceValues) => resourceValues
4425
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
4426
- .map((values) => values.toArray())
4427
- .map((valuesArray) => Resource.Values.fromValue({
4428
- focusResource: $resource,
4429
- propertyPath: PropertyShape
4430
- .schema
4431
- .properties
4432
- .not
4433
- .path,
4434
- value: valuesArray,
4435
- })),
4436
- }).chain((not) => $shaclPropertyFromRdf({
4437
- graph: _$options.graph,
4438
- resource: $resource,
4439
- propertySchema: NodeShape.schema
4440
- .properties
4441
- .or,
4442
- typeFromRdf: (resourceValues) => resourceValues
4443
- .chain((values) => values.chainMap((value) => value.toList({
4360
+ }),
4361
+ tsFeatureIncludes: $shaclPropertyFromRdf({
4444
4362
  graph: _$options.graph,
4445
- })))
4446
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4447
- focusResource: $resource,
4448
- propertyPath: PropertyShape
4449
- .schema
4450
- .properties
4451
- .or
4452
- .path,
4453
- values: valueList.toArray(),
4454
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
4455
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4456
- .map((values) => values.length >
4457
- 0
4458
- ? values.map((value) => Maybe.of(value))
4459
- : Resource.Values.fromValue({
4363
+ resource: $resource,
4364
+ propertySchema: NodeShape.schema.properties.tsFeatureIncludes,
4365
+ typeFromRdf: (resourceValues) => resourceValues
4366
+ .chain((values) => values.chainMap((value) => value.toIri([
4367
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
4368
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
4369
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
4370
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
4371
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
4372
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
4373
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
4374
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
4375
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
4376
+ dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
4377
+ ])))
4378
+ .map((values) => values.toArray())
4379
+ .map((valuesArray) => Resource.Values.fromValue({
4460
4380
  focusResource: $resource,
4461
- propertyPath: PropertyShape
4462
- .schema
4463
- .properties
4464
- .or
4465
- .path,
4466
- value: Maybe.empty(),
4381
+ propertyPath: Ontology.schema.properties.tsFeatureIncludes.path,
4382
+ value: valuesArray,
4467
4383
  })),
4468
- }).chain((or) => $shaclPropertyFromRdf({
4469
- graph: _$options.graph,
4470
- resource: $resource,
4471
- propertySchema: NodeShape.schema
4472
- .properties
4473
- .patterns,
4474
- typeFromRdf: (resourceValues) => resourceValues
4475
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4476
- .chain((values) => values.chainMap((value) => value.toString()))
4477
- .map((values) => values.toArray())
4478
- .map((valuesArray) => Resource.Values.fromValue({
4479
- focusResource: $resource,
4480
- propertyPath: PropertyShape
4481
- .schema
4482
- .properties
4483
- .patterns
4484
- .path,
4485
- value: valuesArray,
4486
- })),
4487
- }).chain((patterns) => $shaclPropertyFromRdf({
4488
- graph: _$options.graph,
4489
- resource: $resource,
4490
- propertySchema: NodeShape.schema
4491
- .properties
4492
- .properties,
4493
- typeFromRdf: (resourceValues) => resourceValues
4494
- .chain((values) => values.chainMap((value) => value.toIdentifier()))
4495
- .map((values) => values.toArray())
4496
- .map((valuesArray) => Resource.Values.fromValue({
4497
- focusResource: $resource,
4498
- propertyPath: NodeShape
4499
- .schema
4500
- .properties
4501
- .properties
4502
- .path,
4503
- value: valuesArray,
4504
- })),
4505
- }).chain((properties) => $shaclPropertyFromRdf({
4506
- graph: _$options.graph,
4507
- resource: $resource,
4508
- propertySchema: NodeShape.schema
4509
- .properties
4510
- .rdfType,
4511
- typeFromRdf: (resourceValues) => resourceValues
4512
- .chain((values) => values.chainMap((value) => value.toIri()))
4513
- .map((values) => values.length >
4514
- 0
4515
- ? values.map((value) => Maybe.of(value))
4516
- : Resource.Values.fromValue({
4384
+ }),
4385
+ tsImports: $shaclPropertyFromRdf({
4386
+ graph: _$options.graph,
4387
+ resource: $resource,
4388
+ propertySchema: NodeShape.schema.properties.tsImports,
4389
+ typeFromRdf: (resourceValues) => resourceValues
4390
+ .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4391
+ .chain((values) => values.chainMap((value) => value.toString()))
4392
+ .map((values) => values.toArray())
4393
+ .map((valuesArray) => Resource.Values.fromValue({
4517
4394
  focusResource: $resource,
4518
- propertyPath: NodeShape
4519
- .schema
4520
- .properties
4521
- .rdfType
4522
- .path,
4523
- value: Maybe.empty(),
4395
+ propertyPath: Ontology.schema.properties.tsImports.path,
4396
+ value: valuesArray,
4524
4397
  })),
4525
- }).chain((rdfType) => $shaclPropertyFromRdf({
4526
- graph: _$options.graph,
4527
- resource: $resource,
4528
- propertySchema: NodeShape.schema
4529
- .properties
4530
- .shaclmateName,
4531
- typeFromRdf: (resourceValues) => resourceValues
4532
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4533
- .chain((values) => values.chainMap((value) => value.toString()))
4534
- .map((values) => values.length >
4535
- 0
4536
- ? values.map((value) => Maybe.of(value))
4537
- : Resource.Values.fromValue({
4398
+ }),
4399
+ types: $shaclPropertyFromRdf({
4400
+ graph: _$options.graph,
4401
+ resource: $resource,
4402
+ propertySchema: NodeShape.schema.properties.types,
4403
+ typeFromRdf: (resourceValues) => resourceValues
4404
+ .chain((values) => values.chainMap((value) => value.toIri()))
4405
+ .map((values) => values.toArray())
4406
+ .map((valuesArray) => Resource.Values.fromValue({
4538
4407
  focusResource: $resource,
4539
- propertyPath: PropertyShape
4540
- .schema
4541
- .properties
4542
- .shaclmateName
4543
- .path,
4544
- value: Maybe.empty(),
4408
+ propertyPath: NodeShape.schema.properties.types.path,
4409
+ value: valuesArray,
4545
4410
  })),
4546
- }).chain((shaclmateName) => $shaclPropertyFromRdf({
4547
- graph: _$options.graph,
4548
- resource: $resource,
4549
- propertySchema: NodeShape.schema
4550
- .properties
4551
- .subClassOf,
4552
- typeFromRdf: (resourceValues) => resourceValues
4553
- .chain((values) => values.chainMap((value) => value.toIri()))
4554
- .map((values) => values.toArray())
4555
- .map((valuesArray) => Resource.Values.fromValue({
4556
- focusResource: $resource,
4557
- propertyPath: NodeShape
4558
- .schema
4559
- .properties
4560
- .subClassOf
4561
- .path,
4562
- value: valuesArray,
4563
- })),
4564
- }).chain((subClassOf) => $shaclPropertyFromRdf({
4565
- graph: _$options.graph,
4566
- resource: $resource,
4567
- propertySchema: NodeShape.schema
4568
- .properties
4569
- .toRdfTypes,
4570
- typeFromRdf: (resourceValues) => resourceValues
4571
- .chain((values) => values.chainMap((value) => value.toIri()))
4572
- .map((values) => values.toArray())
4573
- .map((valuesArray) => Resource.Values.fromValue({
4574
- focusResource: $resource,
4575
- propertyPath: NodeShape
4576
- .schema
4577
- .properties
4578
- .toRdfTypes
4579
- .path,
4580
- value: valuesArray,
4581
- })),
4582
- }).chain((toRdfTypes) => $shaclPropertyFromRdf({
4583
- graph: _$options.graph,
4584
- resource: $resource,
4585
- propertySchema: NodeShape.schema
4586
- .properties
4587
- .tsFeatureExcludes,
4588
- typeFromRdf: (resourceValues) => resourceValues
4589
- .chain((values) => values.chainMap((value) => value.toIri([
4590
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
4591
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
4592
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
4593
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
4594
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
4595
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
4596
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
4597
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
4598
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
4599
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
4600
- ])))
4601
- .map((values) => values.toArray())
4602
- .map((valuesArray) => Resource.Values.fromValue({
4603
- focusResource: $resource,
4604
- propertyPath: Ontology
4605
- .schema
4606
- .properties
4607
- .tsFeatureExcludes
4608
- .path,
4609
- value: valuesArray,
4610
- })),
4611
- }).chain((tsFeatureExcludes) => $shaclPropertyFromRdf({
4612
- graph: _$options.graph,
4613
- resource: $resource,
4614
- propertySchema: NodeShape.schema
4615
- .properties
4616
- .tsFeatureIncludes,
4617
- typeFromRdf: (resourceValues) => resourceValues
4618
- .chain((values) => values.chainMap((value) => value.toIri([
4619
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_All"),
4620
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Create"),
4621
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_Default"),
4622
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Equals"),
4623
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Graphql"),
4624
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Hash"),
4625
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Json"),
4626
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeatures_None"),
4627
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Rdf"),
4628
- dataFactory.namedNode("http://purl.org/shaclmate/ontology#_TsFeature_Sparql"),
4629
- ])))
4630
- .map((values) => values.toArray())
4631
- .map((valuesArray) => Resource.Values.fromValue({
4632
- focusResource: $resource,
4633
- propertyPath: Ontology
4634
- .schema
4635
- .properties
4636
- .tsFeatureIncludes
4637
- .path,
4638
- value: valuesArray,
4639
- })),
4640
- }).chain((tsFeatureIncludes) => $shaclPropertyFromRdf({
4641
- graph: _$options.graph,
4642
- resource: $resource,
4643
- propertySchema: NodeShape.schema
4644
- .properties
4645
- .tsImports,
4646
- typeFromRdf: (resourceValues) => resourceValues
4647
- .chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
4648
- .chain((values) => values.chainMap((value) => value.toString()))
4649
- .map((values) => values.toArray())
4650
- .map((valuesArray) => Resource.Values.fromValue({
4651
- focusResource: $resource,
4652
- propertyPath: Ontology
4653
- .schema
4654
- .properties
4655
- .tsImports
4656
- .path,
4657
- value: valuesArray,
4658
- })),
4659
- }).chain((tsImports) => $shaclPropertyFromRdf({
4660
- graph: _$options.graph,
4661
- resource: $resource,
4662
- propertySchema: NodeShape.schema
4663
- .properties
4664
- .types,
4665
- typeFromRdf: (resourceValues) => resourceValues
4666
- .chain((values) => values.chainMap((value) => value.toIri()))
4667
- .map((values) => values.toArray())
4668
- .map((valuesArray) => Resource.Values.fromValue({
4669
- focusResource: $resource,
4670
- propertyPath: NodeShape
4671
- .schema
4672
- .properties
4673
- .types
4674
- .path,
4675
- value: valuesArray,
4676
- })),
4677
- }).chain((types) => $shaclPropertyFromRdf({
4678
- graph: _$options.graph,
4679
- resource: $resource,
4680
- propertySchema: NodeShape.schema
4681
- .properties
4682
- .xone,
4683
- typeFromRdf: (resourceValues) => resourceValues
4684
- .chain((values) => values.chainMap((value) => value.toList({
4411
+ }),
4412
+ xone: $shaclPropertyFromRdf({
4685
4413
  graph: _$options.graph,
4686
- })))
4687
- .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4688
- focusResource: $resource,
4689
- propertyPath: PropertyShape
4690
- .schema
4691
- .properties
4692
- .xone
4693
- .path,
4694
- values: valueList.toArray(),
4695
- })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
4696
- .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4697
- .map((values) => values.length >
4698
- 0
4699
- ? values.map((value) => Maybe.of(value))
4700
- : Resource.Values.fromValue({
4414
+ resource: $resource,
4415
+ propertySchema: NodeShape.schema.properties.xone,
4416
+ typeFromRdf: (resourceValues) => resourceValues
4417
+ .chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
4418
+ .chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
4701
4419
  focusResource: $resource,
4702
- propertyPath: PropertyShape
4703
- .schema
4704
- .properties
4705
- .xone
4706
- .path,
4707
- value: Maybe.empty(),
4708
- })),
4709
- }).map((xone) => create({
4710
- $identifier,
4711
- and,
4712
- classes,
4713
- closed,
4714
- comment,
4715
- datatype,
4716
- deactivated,
4717
- discriminantValue,
4718
- extern,
4719
- flags,
4720
- fromRdfType,
4721
- hasValues,
4722
- ignoredProperties,
4723
- in_,
4724
- isDefinedBy,
4725
- label,
4726
- languageIn,
4727
- maxCount,
4728
- maxExclusive,
4729
- maxInclusive,
4730
- maxLength,
4731
- minCount,
4732
- minExclusive,
4733
- minInclusive,
4734
- minLength,
4735
- mutable,
4736
- node,
4737
- nodeKind,
4738
- not,
4739
- or,
4740
- patterns,
4741
- properties,
4742
- rdfType,
4743
- shaclmateName,
4744
- subClassOf,
4745
- toRdfTypes,
4746
- tsFeatureExcludes,
4747
- tsFeatureIncludes,
4748
- tsImports,
4749
- types,
4750
- xone,
4751
- })))))))))))))))))))))))))))))))))))))))))));
4420
+ propertyPath: PropertyShape.schema.properties.xone.path,
4421
+ values: valueList.toArray(),
4422
+ })).chain((values) => values.chainMap((value) => value.toIdentifier()))))
4423
+ .map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
4424
+ .map((values) => values.length > 0
4425
+ ? values.map((value) => Maybe.of(value))
4426
+ : Resource.Values.fromValue({
4427
+ focusResource: $resource,
4428
+ propertyPath: PropertyShape.schema.properties.xone.path,
4429
+ value: Maybe.empty(),
4430
+ })),
4431
+ }),
4432
+ }).map((properties) => create(properties)));
4752
4433
  };
4753
4434
  NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
4754
4435
  NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value