@shaclmate/shacl-ast 4.0.29 → 4.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AbstractShapesGraph.d.ts +2 -2
- package/dist/AbstractShapesGraph.js +8 -8
- package/dist/ShapesGraph.d.ts +4 -4
- package/dist/ShapesGraph.js +4 -4
- package/dist/generated.d.ts +162 -163
- package/dist/generated.js +375 -379
- package/package.json +1 -1
package/dist/generated.js
CHANGED
|
@@ -191,16 +191,16 @@ const $literalFactory = new LiteralFactory({ dataFactory: dataFactory });
|
|
|
191
191
|
const $parseIdentifier = NTriplesIdentifier.parser(dataFactory);
|
|
192
192
|
export var $PropertyPath;
|
|
193
193
|
(function ($PropertyPath) {
|
|
194
|
-
function
|
|
194
|
+
function filter(_filter, _value) {
|
|
195
195
|
return true;
|
|
196
196
|
}
|
|
197
|
-
$PropertyPath
|
|
198
|
-
$PropertyPath
|
|
199
|
-
$PropertyPath
|
|
197
|
+
$PropertyPath.filter = filter;
|
|
198
|
+
$PropertyPath.fromRdfResource = RdfxResourcePropertyPath.fromResource;
|
|
199
|
+
$PropertyPath.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
200
200
|
.toResource()
|
|
201
|
-
.chain((resource) => $PropertyPath
|
|
202
|
-
$PropertyPath
|
|
203
|
-
$PropertyPath
|
|
201
|
+
.chain((resource) => $PropertyPath.fromRdfResource(resource, options))));
|
|
202
|
+
$PropertyPath.schema = {};
|
|
203
|
+
$PropertyPath.toRdfResource = RdfxResourcePropertyPath.toResource;
|
|
204
204
|
$PropertyPath.$toString = RdfxResourcePropertyPath.toString;
|
|
205
205
|
})($PropertyPath || ($PropertyPath = {}));
|
|
206
206
|
var $RdfVocabularies;
|
|
@@ -246,7 +246,7 @@ function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }
|
|
|
246
246
|
}
|
|
247
247
|
export var PropertyShape;
|
|
248
248
|
(function (PropertyShape) {
|
|
249
|
-
function
|
|
249
|
+
function create(parameters) {
|
|
250
250
|
const $identifierParameter = parameters.$identifier;
|
|
251
251
|
let $identifier;
|
|
252
252
|
if (typeof $identifierParameter === "function") {
|
|
@@ -835,13 +835,13 @@ export var PropertyShape;
|
|
|
835
835
|
xone,
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
|
-
PropertyShape
|
|
839
|
-
let
|
|
840
|
-
(function (
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
})(
|
|
844
|
-
function
|
|
838
|
+
PropertyShape.create = create;
|
|
839
|
+
let Identifier;
|
|
840
|
+
(function (Identifier) {
|
|
841
|
+
Identifier.parse = $parseIdentifier;
|
|
842
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
843
|
+
})(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
|
|
844
|
+
function filter(filter, value) {
|
|
845
845
|
if (filter.$identifier !== undefined &&
|
|
846
846
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
847
847
|
return false;
|
|
@@ -959,7 +959,7 @@ export var PropertyShape;
|
|
|
959
959
|
return false;
|
|
960
960
|
}
|
|
961
961
|
if (filter.path !== undefined &&
|
|
962
|
-
!$PropertyPath
|
|
962
|
+
!$PropertyPath.filter(filter.path, value.path)) {
|
|
963
963
|
return false;
|
|
964
964
|
}
|
|
965
965
|
if (filter.patterns !== undefined &&
|
|
@@ -976,24 +976,24 @@ export var PropertyShape;
|
|
|
976
976
|
}
|
|
977
977
|
return true;
|
|
978
978
|
}
|
|
979
|
-
PropertyShape
|
|
980
|
-
PropertyShape
|
|
979
|
+
PropertyShape.filter = filter;
|
|
980
|
+
PropertyShape.fromRdfResource = (resource, options) => {
|
|
981
981
|
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
982
982
|
if (!objectSet) {
|
|
983
983
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
984
984
|
}
|
|
985
|
-
return PropertyShape
|
|
985
|
+
return PropertyShape.propertiesFromRdfResource(resource, {
|
|
986
986
|
context,
|
|
987
987
|
graph,
|
|
988
988
|
ignoreRdfType,
|
|
989
989
|
objectSet,
|
|
990
990
|
preferredLanguages,
|
|
991
|
-
}).map(
|
|
991
|
+
}).map(create);
|
|
992
992
|
};
|
|
993
|
-
PropertyShape
|
|
993
|
+
PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
994
994
|
.toResource()
|
|
995
|
-
.chain((resource) => PropertyShape
|
|
996
|
-
PropertyShape
|
|
995
|
+
.chain((resource) => PropertyShape.fromRdfResource(resource, options))));
|
|
996
|
+
PropertyShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
|
|
997
997
|
function isPropertyShape(object) {
|
|
998
998
|
switch (object.$type) {
|
|
999
999
|
case "PropertyShape":
|
|
@@ -1003,7 +1003,7 @@ export var PropertyShape;
|
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
PropertyShape.isPropertyShape = isPropertyShape;
|
|
1006
|
-
PropertyShape
|
|
1006
|
+
PropertyShape.propertiesFromRdfResource = ($resource, _$options) => {
|
|
1007
1007
|
return (!_$options.ignoreRdfType
|
|
1008
1008
|
? $resource
|
|
1009
1009
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -1015,7 +1015,7 @@ export var PropertyShape;
|
|
|
1015
1015
|
return Right(true);
|
|
1016
1016
|
}
|
|
1017
1017
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
1018
|
-
if ($resource.isInstanceOf(PropertyShape
|
|
1018
|
+
if ($resource.isInstanceOf(PropertyShape.fromRdfType, {
|
|
1019
1019
|
graph: _$options.graph,
|
|
1020
1020
|
})) {
|
|
1021
1021
|
return Right(true);
|
|
@@ -1033,12 +1033,12 @@ export var PropertyShape;
|
|
|
1033
1033
|
.chain(($identifier) => Right("PropertyShape").chain(($type) => $shaclPropertyFromRdf({
|
|
1034
1034
|
graph: _$options.graph,
|
|
1035
1035
|
resource: $resource,
|
|
1036
|
-
propertySchema: PropertyShape
|
|
1036
|
+
propertySchema: PropertyShape.schema.properties.and,
|
|
1037
1037
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1038
1038
|
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1039
1039
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1040
1040
|
focusResource: $resource,
|
|
1041
|
-
propertyPath: PropertyShape
|
|
1041
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1042
1042
|
values: valueList.toArray(),
|
|
1043
1043
|
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
1044
1044
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
@@ -1046,25 +1046,25 @@ export var PropertyShape;
|
|
|
1046
1046
|
? values.map((value) => Maybe.of(value))
|
|
1047
1047
|
: Resource.Values.fromValue({
|
|
1048
1048
|
focusResource: $resource,
|
|
1049
|
-
propertyPath: PropertyShape
|
|
1049
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1050
1050
|
value: Maybe.empty(),
|
|
1051
1051
|
})),
|
|
1052
1052
|
}).chain((and) => $shaclPropertyFromRdf({
|
|
1053
1053
|
graph: _$options.graph,
|
|
1054
1054
|
resource: $resource,
|
|
1055
|
-
propertySchema: PropertyShape
|
|
1055
|
+
propertySchema: PropertyShape.schema.properties.classes,
|
|
1056
1056
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1057
1057
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1058
1058
|
.map((values) => values.toArray())
|
|
1059
1059
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1060
1060
|
focusResource: $resource,
|
|
1061
|
-
propertyPath: PropertyShape
|
|
1061
|
+
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
1062
1062
|
value: valuesArray,
|
|
1063
1063
|
})),
|
|
1064
1064
|
}).chain((classes) => $shaclPropertyFromRdf({
|
|
1065
1065
|
graph: _$options.graph,
|
|
1066
1066
|
resource: $resource,
|
|
1067
|
-
propertySchema: PropertyShape
|
|
1067
|
+
propertySchema: PropertyShape.schema.properties.comment,
|
|
1068
1068
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1069
1069
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1070
1070
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -1072,41 +1072,40 @@ export var PropertyShape;
|
|
|
1072
1072
|
? values.map((value) => Maybe.of(value))
|
|
1073
1073
|
: Resource.Values.fromValue({
|
|
1074
1074
|
focusResource: $resource,
|
|
1075
|
-
propertyPath: PropertyShape
|
|
1075
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
1076
1076
|
value: Maybe.empty(),
|
|
1077
1077
|
})),
|
|
1078
1078
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
1079
1079
|
graph: _$options.graph,
|
|
1080
1080
|
resource: $resource,
|
|
1081
|
-
propertySchema: PropertyShape
|
|
1081
|
+
propertySchema: PropertyShape.schema.properties.datatype,
|
|
1082
1082
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1083
1083
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1084
1084
|
.map((values) => values.length > 0
|
|
1085
1085
|
? values.map((value) => Maybe.of(value))
|
|
1086
1086
|
: Resource.Values.fromValue({
|
|
1087
1087
|
focusResource: $resource,
|
|
1088
|
-
propertyPath: PropertyShape
|
|
1089
|
-
.path,
|
|
1088
|
+
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
1090
1089
|
value: Maybe.empty(),
|
|
1091
1090
|
})),
|
|
1092
1091
|
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
1093
1092
|
graph: _$options.graph,
|
|
1094
1093
|
resource: $resource,
|
|
1095
|
-
propertySchema: PropertyShape
|
|
1094
|
+
propertySchema: PropertyShape.schema.properties.deactivated,
|
|
1096
1095
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1097
1096
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1098
1097
|
.map((values) => values.length > 0
|
|
1099
1098
|
? values.map((value) => Maybe.of(value))
|
|
1100
1099
|
: Resource.Values.fromValue({
|
|
1101
1100
|
focusResource: $resource,
|
|
1102
|
-
propertyPath: PropertyShape
|
|
1101
|
+
propertyPath: PropertyShape.schema.properties.deactivated
|
|
1103
1102
|
.path,
|
|
1104
1103
|
value: Maybe.empty(),
|
|
1105
1104
|
})),
|
|
1106
1105
|
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
1107
1106
|
graph: _$options.graph,
|
|
1108
1107
|
resource: $resource,
|
|
1109
|
-
propertySchema: PropertyShape
|
|
1108
|
+
propertySchema: PropertyShape.schema.properties.defaultValue,
|
|
1110
1109
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1111
1110
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1112
1111
|
switch (term.termType) {
|
|
@@ -1118,7 +1117,7 @@ export var PropertyShape;
|
|
|
1118
1117
|
actualValue: term,
|
|
1119
1118
|
expectedValueType: "(NamedNode | Literal)",
|
|
1120
1119
|
focusResource: $resource,
|
|
1121
|
-
propertyPath: PropertyShape
|
|
1120
|
+
propertyPath: PropertyShape.schema.properties
|
|
1122
1121
|
.defaultValue.path,
|
|
1123
1122
|
}));
|
|
1124
1123
|
}
|
|
@@ -1127,14 +1126,14 @@ export var PropertyShape;
|
|
|
1127
1126
|
? values.map((value) => Maybe.of(value))
|
|
1128
1127
|
: Resource.Values.fromValue({
|
|
1129
1128
|
focusResource: $resource,
|
|
1130
|
-
propertyPath: PropertyShape
|
|
1129
|
+
propertyPath: PropertyShape.schema.properties
|
|
1131
1130
|
.defaultValue.path,
|
|
1132
1131
|
value: Maybe.empty(),
|
|
1133
1132
|
})),
|
|
1134
1133
|
}).chain((defaultValue) => $shaclPropertyFromRdf({
|
|
1135
1134
|
graph: _$options.graph,
|
|
1136
1135
|
resource: $resource,
|
|
1137
|
-
propertySchema: PropertyShape
|
|
1136
|
+
propertySchema: PropertyShape.schema.properties.description,
|
|
1138
1137
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1139
1138
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1140
1139
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -1142,41 +1141,41 @@ export var PropertyShape;
|
|
|
1142
1141
|
? values.map((value) => Maybe.of(value))
|
|
1143
1142
|
: Resource.Values.fromValue({
|
|
1144
1143
|
focusResource: $resource,
|
|
1145
|
-
propertyPath: PropertyShape
|
|
1144
|
+
propertyPath: PropertyShape.schema.properties
|
|
1146
1145
|
.description.path,
|
|
1147
1146
|
value: Maybe.empty(),
|
|
1148
1147
|
})),
|
|
1149
1148
|
}).chain((description) => $shaclPropertyFromRdf({
|
|
1150
1149
|
graph: _$options.graph,
|
|
1151
1150
|
resource: $resource,
|
|
1152
|
-
propertySchema: PropertyShape
|
|
1151
|
+
propertySchema: PropertyShape.schema.properties.flags,
|
|
1153
1152
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1154
1153
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1155
1154
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1156
1155
|
.map((values) => values.toArray())
|
|
1157
1156
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1158
1157
|
focusResource: $resource,
|
|
1159
|
-
propertyPath: PropertyShape
|
|
1158
|
+
propertyPath: PropertyShape.schema.properties.flags
|
|
1160
1159
|
.path,
|
|
1161
1160
|
value: valuesArray,
|
|
1162
1161
|
})),
|
|
1163
1162
|
}).chain((flags) => $shaclPropertyFromRdf({
|
|
1164
1163
|
graph: _$options.graph,
|
|
1165
1164
|
resource: $resource,
|
|
1166
|
-
propertySchema: PropertyShape
|
|
1165
|
+
propertySchema: PropertyShape.schema.properties.groups,
|
|
1167
1166
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1168
1167
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1169
1168
|
.map((values) => values.toArray())
|
|
1170
1169
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1171
1170
|
focusResource: $resource,
|
|
1172
|
-
propertyPath: PropertyShape
|
|
1171
|
+
propertyPath: PropertyShape.schema.properties.groups
|
|
1173
1172
|
.path,
|
|
1174
1173
|
value: valuesArray,
|
|
1175
1174
|
})),
|
|
1176
1175
|
}).chain((groups) => $shaclPropertyFromRdf({
|
|
1177
1176
|
graph: _$options.graph,
|
|
1178
1177
|
resource: $resource,
|
|
1179
|
-
propertySchema: PropertyShape
|
|
1178
|
+
propertySchema: PropertyShape.schema.properties.hasValues,
|
|
1180
1179
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1181
1180
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1182
1181
|
switch (term.termType) {
|
|
@@ -1188,7 +1187,7 @@ export var PropertyShape;
|
|
|
1188
1187
|
actualValue: term,
|
|
1189
1188
|
expectedValueType: "(NamedNode | Literal)",
|
|
1190
1189
|
focusResource: $resource,
|
|
1191
|
-
propertyPath: PropertyShape
|
|
1190
|
+
propertyPath: PropertyShape.schema
|
|
1192
1191
|
.properties.hasValues
|
|
1193
1192
|
.path,
|
|
1194
1193
|
}));
|
|
@@ -1197,21 +1196,21 @@ export var PropertyShape;
|
|
|
1197
1196
|
.map((values) => values.toArray())
|
|
1198
1197
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1199
1198
|
focusResource: $resource,
|
|
1200
|
-
propertyPath: PropertyShape
|
|
1199
|
+
propertyPath: PropertyShape.schema.properties
|
|
1201
1200
|
.hasValues.path,
|
|
1202
1201
|
value: valuesArray,
|
|
1203
1202
|
})),
|
|
1204
1203
|
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
1205
1204
|
graph: _$options.graph,
|
|
1206
1205
|
resource: $resource,
|
|
1207
|
-
propertySchema: PropertyShape
|
|
1206
|
+
propertySchema: PropertyShape.schema.properties.in_,
|
|
1208
1207
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1209
1208
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
1210
1209
|
graph: _$options.graph,
|
|
1211
1210
|
})))
|
|
1212
1211
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1213
1212
|
focusResource: $resource,
|
|
1214
|
-
propertyPath: PropertyShape
|
|
1213
|
+
propertyPath: PropertyShape.schema.properties
|
|
1215
1214
|
.in_.path,
|
|
1216
1215
|
values: valueList.toArray(),
|
|
1217
1216
|
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
@@ -1224,8 +1223,7 @@ export var PropertyShape;
|
|
|
1224
1223
|
actualValue: term,
|
|
1225
1224
|
expectedValueType: "(NamedNode | Literal)",
|
|
1226
1225
|
focusResource: $resource,
|
|
1227
|
-
propertyPath: PropertyShape
|
|
1228
|
-
.$schema
|
|
1226
|
+
propertyPath: PropertyShape.schema
|
|
1229
1227
|
.properties.in_
|
|
1230
1228
|
.path,
|
|
1231
1229
|
}));
|
|
@@ -1236,21 +1234,21 @@ export var PropertyShape;
|
|
|
1236
1234
|
? values.map((value) => Maybe.of(value))
|
|
1237
1235
|
: Resource.Values.fromValue({
|
|
1238
1236
|
focusResource: $resource,
|
|
1239
|
-
propertyPath: PropertyShape
|
|
1237
|
+
propertyPath: PropertyShape.schema.properties
|
|
1240
1238
|
.in_.path,
|
|
1241
1239
|
value: Maybe.empty(),
|
|
1242
1240
|
})),
|
|
1243
1241
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
1244
1242
|
graph: _$options.graph,
|
|
1245
1243
|
resource: $resource,
|
|
1246
|
-
propertySchema: PropertyShape
|
|
1244
|
+
propertySchema: PropertyShape.schema.properties.isDefinedBy,
|
|
1247
1245
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1248
1246
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1249
1247
|
.map((values) => values.length > 0
|
|
1250
1248
|
? values.map((value) => Maybe.of(value))
|
|
1251
1249
|
: Resource.Values.fromValue({
|
|
1252
1250
|
focusResource: $resource,
|
|
1253
|
-
propertyPath: PropertyShape
|
|
1251
|
+
propertyPath: PropertyShape.schema
|
|
1254
1252
|
.properties.isDefinedBy
|
|
1255
1253
|
.path,
|
|
1256
1254
|
value: Maybe.empty(),
|
|
@@ -1258,7 +1256,7 @@ export var PropertyShape;
|
|
|
1258
1256
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
1259
1257
|
graph: _$options.graph,
|
|
1260
1258
|
resource: $resource,
|
|
1261
|
-
propertySchema: PropertyShape
|
|
1259
|
+
propertySchema: PropertyShape.schema.properties.label,
|
|
1262
1260
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1263
1261
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1264
1262
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -1266,21 +1264,21 @@ export var PropertyShape;
|
|
|
1266
1264
|
? values.map((value) => Maybe.of(value))
|
|
1267
1265
|
: Resource.Values.fromValue({
|
|
1268
1266
|
focusResource: $resource,
|
|
1269
|
-
propertyPath: PropertyShape
|
|
1267
|
+
propertyPath: PropertyShape.schema
|
|
1270
1268
|
.properties.label.path,
|
|
1271
1269
|
value: Maybe.empty(),
|
|
1272
1270
|
})),
|
|
1273
1271
|
}).chain((label) => $shaclPropertyFromRdf({
|
|
1274
1272
|
graph: _$options.graph,
|
|
1275
1273
|
resource: $resource,
|
|
1276
|
-
propertySchema: PropertyShape
|
|
1274
|
+
propertySchema: PropertyShape.schema.properties.languageIn,
|
|
1277
1275
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1278
1276
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
1279
1277
|
graph: _$options.graph,
|
|
1280
1278
|
})))
|
|
1281
1279
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1282
1280
|
focusResource: $resource,
|
|
1283
|
-
propertyPath: PropertyShape
|
|
1281
|
+
propertyPath: PropertyShape.schema
|
|
1284
1282
|
.properties.languageIn
|
|
1285
1283
|
.path,
|
|
1286
1284
|
values: valueList.toArray(),
|
|
@@ -1292,7 +1290,7 @@ export var PropertyShape;
|
|
|
1292
1290
|
? values.map((value) => Maybe.of(value))
|
|
1293
1291
|
: Resource.Values.fromValue({
|
|
1294
1292
|
focusResource: $resource,
|
|
1295
|
-
propertyPath: PropertyShape
|
|
1293
|
+
propertyPath: PropertyShape.schema
|
|
1296
1294
|
.properties.languageIn
|
|
1297
1295
|
.path,
|
|
1298
1296
|
value: Maybe.empty(),
|
|
@@ -1300,14 +1298,14 @@ export var PropertyShape;
|
|
|
1300
1298
|
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
1301
1299
|
graph: _$options.graph,
|
|
1302
1300
|
resource: $resource,
|
|
1303
|
-
propertySchema: PropertyShape
|
|
1301
|
+
propertySchema: PropertyShape.schema.properties.maxCount,
|
|
1304
1302
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1305
1303
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1306
1304
|
.map((values) => values.length > 0
|
|
1307
1305
|
? values.map((value) => Maybe.of(value))
|
|
1308
1306
|
: Resource.Values.fromValue({
|
|
1309
1307
|
focusResource: $resource,
|
|
1310
|
-
propertyPath: PropertyShape
|
|
1308
|
+
propertyPath: PropertyShape.schema
|
|
1311
1309
|
.properties.maxCount
|
|
1312
1310
|
.path,
|
|
1313
1311
|
value: Maybe.empty(),
|
|
@@ -1315,7 +1313,7 @@ export var PropertyShape;
|
|
|
1315
1313
|
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
1316
1314
|
graph: _$options.graph,
|
|
1317
1315
|
resource: $resource,
|
|
1318
|
-
propertySchema: PropertyShape
|
|
1316
|
+
propertySchema: PropertyShape.schema.properties.maxExclusive,
|
|
1319
1317
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1320
1318
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1321
1319
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -1323,7 +1321,7 @@ export var PropertyShape;
|
|
|
1323
1321
|
? values.map((value) => Maybe.of(value))
|
|
1324
1322
|
: Resource.Values.fromValue({
|
|
1325
1323
|
focusResource: $resource,
|
|
1326
|
-
propertyPath: PropertyShape
|
|
1324
|
+
propertyPath: PropertyShape.schema
|
|
1327
1325
|
.properties
|
|
1328
1326
|
.maxExclusive.path,
|
|
1329
1327
|
value: Maybe.empty(),
|
|
@@ -1331,7 +1329,7 @@ export var PropertyShape;
|
|
|
1331
1329
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
1332
1330
|
graph: _$options.graph,
|
|
1333
1331
|
resource: $resource,
|
|
1334
|
-
propertySchema: PropertyShape
|
|
1332
|
+
propertySchema: PropertyShape.schema.properties.maxInclusive,
|
|
1335
1333
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1336
1334
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1337
1335
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -1339,8 +1337,7 @@ export var PropertyShape;
|
|
|
1339
1337
|
? values.map((value) => Maybe.of(value))
|
|
1340
1338
|
: Resource.Values.fromValue({
|
|
1341
1339
|
focusResource: $resource,
|
|
1342
|
-
propertyPath: PropertyShape
|
|
1343
|
-
.$schema
|
|
1340
|
+
propertyPath: PropertyShape.schema
|
|
1344
1341
|
.properties
|
|
1345
1342
|
.maxInclusive
|
|
1346
1343
|
.path,
|
|
@@ -1349,7 +1346,7 @@ export var PropertyShape;
|
|
|
1349
1346
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
1350
1347
|
graph: _$options.graph,
|
|
1351
1348
|
resource: $resource,
|
|
1352
|
-
propertySchema: PropertyShape
|
|
1349
|
+
propertySchema: PropertyShape.schema.properties.maxLength,
|
|
1353
1350
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1354
1351
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1355
1352
|
.map((values) => values.length > 0
|
|
@@ -1357,7 +1354,7 @@ export var PropertyShape;
|
|
|
1357
1354
|
: Resource.Values.fromValue({
|
|
1358
1355
|
focusResource: $resource,
|
|
1359
1356
|
propertyPath: PropertyShape
|
|
1360
|
-
|
|
1357
|
+
.schema
|
|
1361
1358
|
.properties
|
|
1362
1359
|
.maxLength.path,
|
|
1363
1360
|
value: Maybe.empty(),
|
|
@@ -1365,7 +1362,7 @@ export var PropertyShape;
|
|
|
1365
1362
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
1366
1363
|
graph: _$options.graph,
|
|
1367
1364
|
resource: $resource,
|
|
1368
|
-
propertySchema: PropertyShape
|
|
1365
|
+
propertySchema: PropertyShape.schema.properties.minCount,
|
|
1369
1366
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1370
1367
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
1371
1368
|
.map((values) => values.length > 0
|
|
@@ -1373,7 +1370,7 @@ export var PropertyShape;
|
|
|
1373
1370
|
: Resource.Values.fromValue({
|
|
1374
1371
|
focusResource: $resource,
|
|
1375
1372
|
propertyPath: PropertyShape
|
|
1376
|
-
|
|
1373
|
+
.schema
|
|
1377
1374
|
.properties
|
|
1378
1375
|
.minCount
|
|
1379
1376
|
.path,
|
|
@@ -1382,7 +1379,7 @@ export var PropertyShape;
|
|
|
1382
1379
|
}).chain((minCount) => $shaclPropertyFromRdf({
|
|
1383
1380
|
graph: _$options.graph,
|
|
1384
1381
|
resource: $resource,
|
|
1385
|
-
propertySchema: PropertyShape
|
|
1382
|
+
propertySchema: PropertyShape.schema.properties
|
|
1386
1383
|
.minExclusive,
|
|
1387
1384
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1388
1385
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -1392,7 +1389,7 @@ export var PropertyShape;
|
|
|
1392
1389
|
: Resource.Values.fromValue({
|
|
1393
1390
|
focusResource: $resource,
|
|
1394
1391
|
propertyPath: PropertyShape
|
|
1395
|
-
|
|
1392
|
+
.schema
|
|
1396
1393
|
.properties
|
|
1397
1394
|
.minExclusive
|
|
1398
1395
|
.path,
|
|
@@ -1401,7 +1398,7 @@ export var PropertyShape;
|
|
|
1401
1398
|
}).chain((minExclusive) => $shaclPropertyFromRdf({
|
|
1402
1399
|
graph: _$options.graph,
|
|
1403
1400
|
resource: $resource,
|
|
1404
|
-
propertySchema: PropertyShape
|
|
1401
|
+
propertySchema: PropertyShape.schema.properties
|
|
1405
1402
|
.minInclusive,
|
|
1406
1403
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1407
1404
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -1411,7 +1408,7 @@ export var PropertyShape;
|
|
|
1411
1408
|
: Resource.Values.fromValue({
|
|
1412
1409
|
focusResource: $resource,
|
|
1413
1410
|
propertyPath: PropertyShape
|
|
1414
|
-
|
|
1411
|
+
.schema
|
|
1415
1412
|
.properties
|
|
1416
1413
|
.minInclusive
|
|
1417
1414
|
.path,
|
|
@@ -1420,7 +1417,7 @@ export var PropertyShape;
|
|
|
1420
1417
|
}).chain((minInclusive) => $shaclPropertyFromRdf({
|
|
1421
1418
|
graph: _$options.graph,
|
|
1422
1419
|
resource: $resource,
|
|
1423
|
-
propertySchema: PropertyShape
|
|
1420
|
+
propertySchema: PropertyShape.schema.properties
|
|
1424
1421
|
.minLength,
|
|
1425
1422
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1426
1423
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
@@ -1429,7 +1426,7 @@ export var PropertyShape;
|
|
|
1429
1426
|
: Resource.Values.fromValue({
|
|
1430
1427
|
focusResource: $resource,
|
|
1431
1428
|
propertyPath: PropertyShape
|
|
1432
|
-
|
|
1429
|
+
.schema
|
|
1433
1430
|
.properties
|
|
1434
1431
|
.minLength
|
|
1435
1432
|
.path,
|
|
@@ -1438,7 +1435,7 @@ export var PropertyShape;
|
|
|
1438
1435
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
1439
1436
|
graph: _$options.graph,
|
|
1440
1437
|
resource: $resource,
|
|
1441
|
-
propertySchema: PropertyShape
|
|
1438
|
+
propertySchema: PropertyShape.schema.properties
|
|
1442
1439
|
.name,
|
|
1443
1440
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1444
1441
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -1449,7 +1446,7 @@ export var PropertyShape;
|
|
|
1449
1446
|
: Resource.Values.fromValue({
|
|
1450
1447
|
focusResource: $resource,
|
|
1451
1448
|
propertyPath: PropertyShape
|
|
1452
|
-
|
|
1449
|
+
.schema
|
|
1453
1450
|
.properties
|
|
1454
1451
|
.name
|
|
1455
1452
|
.path,
|
|
@@ -1458,7 +1455,7 @@ export var PropertyShape;
|
|
|
1458
1455
|
}).chain((name) => $shaclPropertyFromRdf({
|
|
1459
1456
|
graph: _$options.graph,
|
|
1460
1457
|
resource: $resource,
|
|
1461
|
-
propertySchema: PropertyShape
|
|
1458
|
+
propertySchema: PropertyShape.schema
|
|
1462
1459
|
.properties
|
|
1463
1460
|
.node,
|
|
1464
1461
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1469,7 +1466,7 @@ export var PropertyShape;
|
|
|
1469
1466
|
: Resource.Values.fromValue({
|
|
1470
1467
|
focusResource: $resource,
|
|
1471
1468
|
propertyPath: PropertyShape
|
|
1472
|
-
|
|
1469
|
+
.schema
|
|
1473
1470
|
.properties
|
|
1474
1471
|
.node
|
|
1475
1472
|
.path,
|
|
@@ -1478,7 +1475,7 @@ export var PropertyShape;
|
|
|
1478
1475
|
}).chain((node) => $shaclPropertyFromRdf({
|
|
1479
1476
|
graph: _$options.graph,
|
|
1480
1477
|
resource: $resource,
|
|
1481
|
-
propertySchema: PropertyShape
|
|
1478
|
+
propertySchema: PropertyShape.schema
|
|
1482
1479
|
.properties
|
|
1483
1480
|
.nodeKind,
|
|
1484
1481
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1496,7 +1493,7 @@ export var PropertyShape;
|
|
|
1496
1493
|
: Resource.Values.fromValue({
|
|
1497
1494
|
focusResource: $resource,
|
|
1498
1495
|
propertyPath: PropertyShape
|
|
1499
|
-
|
|
1496
|
+
.schema
|
|
1500
1497
|
.properties
|
|
1501
1498
|
.nodeKind
|
|
1502
1499
|
.path,
|
|
@@ -1505,7 +1502,7 @@ export var PropertyShape;
|
|
|
1505
1502
|
}).chain((nodeKind) => $shaclPropertyFromRdf({
|
|
1506
1503
|
graph: _$options.graph,
|
|
1507
1504
|
resource: $resource,
|
|
1508
|
-
propertySchema: PropertyShape
|
|
1505
|
+
propertySchema: PropertyShape.schema
|
|
1509
1506
|
.properties
|
|
1510
1507
|
.not,
|
|
1511
1508
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1514,7 +1511,7 @@ export var PropertyShape;
|
|
|
1514
1511
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1515
1512
|
focusResource: $resource,
|
|
1516
1513
|
propertyPath: PropertyShape
|
|
1517
|
-
|
|
1514
|
+
.schema
|
|
1518
1515
|
.properties
|
|
1519
1516
|
.not
|
|
1520
1517
|
.path,
|
|
@@ -1523,7 +1520,7 @@ export var PropertyShape;
|
|
|
1523
1520
|
}).chain((not) => $shaclPropertyFromRdf({
|
|
1524
1521
|
graph: _$options.graph,
|
|
1525
1522
|
resource: $resource,
|
|
1526
|
-
propertySchema: PropertyShape
|
|
1523
|
+
propertySchema: PropertyShape.schema
|
|
1527
1524
|
.properties
|
|
1528
1525
|
.or,
|
|
1529
1526
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1533,7 +1530,7 @@ export var PropertyShape;
|
|
|
1533
1530
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1534
1531
|
focusResource: $resource,
|
|
1535
1532
|
propertyPath: PropertyShape
|
|
1536
|
-
|
|
1533
|
+
.schema
|
|
1537
1534
|
.properties
|
|
1538
1535
|
.or
|
|
1539
1536
|
.path,
|
|
@@ -1546,7 +1543,7 @@ export var PropertyShape;
|
|
|
1546
1543
|
: Resource.Values.fromValue({
|
|
1547
1544
|
focusResource: $resource,
|
|
1548
1545
|
propertyPath: PropertyShape
|
|
1549
|
-
|
|
1546
|
+
.schema
|
|
1550
1547
|
.properties
|
|
1551
1548
|
.or
|
|
1552
1549
|
.path,
|
|
@@ -1555,7 +1552,7 @@ export var PropertyShape;
|
|
|
1555
1552
|
}).chain((or) => $shaclPropertyFromRdf({
|
|
1556
1553
|
graph: _$options.graph,
|
|
1557
1554
|
resource: $resource,
|
|
1558
|
-
propertySchema: PropertyShape
|
|
1555
|
+
propertySchema: PropertyShape.schema
|
|
1559
1556
|
.properties
|
|
1560
1557
|
.order,
|
|
1561
1558
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1566,7 +1563,7 @@ export var PropertyShape;
|
|
|
1566
1563
|
: Resource.Values.fromValue({
|
|
1567
1564
|
focusResource: $resource,
|
|
1568
1565
|
propertyPath: PropertyShape
|
|
1569
|
-
|
|
1566
|
+
.schema
|
|
1570
1567
|
.properties
|
|
1571
1568
|
.order
|
|
1572
1569
|
.path,
|
|
@@ -1575,10 +1572,10 @@ export var PropertyShape;
|
|
|
1575
1572
|
}).chain((order) => $shaclPropertyFromRdf({
|
|
1576
1573
|
graph: _$options.graph,
|
|
1577
1574
|
resource: $resource,
|
|
1578
|
-
propertySchema: PropertyShape
|
|
1575
|
+
propertySchema: PropertyShape.schema
|
|
1579
1576
|
.properties
|
|
1580
1577
|
.path,
|
|
1581
|
-
typeFromRdf: (resourceValues) => $PropertyPath
|
|
1578
|
+
typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
|
|
1582
1579
|
context: _$options.context,
|
|
1583
1580
|
graph: _$options.graph,
|
|
1584
1581
|
preferredLanguages: _$options.preferredLanguages,
|
|
@@ -1586,7 +1583,7 @@ export var PropertyShape;
|
|
|
1586
1583
|
resource: $resource,
|
|
1587
1584
|
ignoreRdfType: true,
|
|
1588
1585
|
propertyPath: PropertyShape
|
|
1589
|
-
|
|
1586
|
+
.schema
|
|
1590
1587
|
.properties
|
|
1591
1588
|
.path
|
|
1592
1589
|
.path,
|
|
@@ -1594,7 +1591,7 @@ export var PropertyShape;
|
|
|
1594
1591
|
}).chain((path) => $shaclPropertyFromRdf({
|
|
1595
1592
|
graph: _$options.graph,
|
|
1596
1593
|
resource: $resource,
|
|
1597
|
-
propertySchema: PropertyShape
|
|
1594
|
+
propertySchema: PropertyShape.schema
|
|
1598
1595
|
.properties
|
|
1599
1596
|
.patterns,
|
|
1600
1597
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1604,7 +1601,7 @@ export var PropertyShape;
|
|
|
1604
1601
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1605
1602
|
focusResource: $resource,
|
|
1606
1603
|
propertyPath: PropertyShape
|
|
1607
|
-
|
|
1604
|
+
.schema
|
|
1608
1605
|
.properties
|
|
1609
1606
|
.patterns
|
|
1610
1607
|
.path,
|
|
@@ -1613,7 +1610,7 @@ export var PropertyShape;
|
|
|
1613
1610
|
}).chain((patterns) => $shaclPropertyFromRdf({
|
|
1614
1611
|
graph: _$options.graph,
|
|
1615
1612
|
resource: $resource,
|
|
1616
|
-
propertySchema: PropertyShape
|
|
1613
|
+
propertySchema: PropertyShape.schema
|
|
1617
1614
|
.properties
|
|
1618
1615
|
.uniqueLang,
|
|
1619
1616
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1624,7 +1621,7 @@ export var PropertyShape;
|
|
|
1624
1621
|
: Resource.Values.fromValue({
|
|
1625
1622
|
focusResource: $resource,
|
|
1626
1623
|
propertyPath: PropertyShape
|
|
1627
|
-
|
|
1624
|
+
.schema
|
|
1628
1625
|
.properties
|
|
1629
1626
|
.uniqueLang
|
|
1630
1627
|
.path,
|
|
@@ -1633,7 +1630,7 @@ export var PropertyShape;
|
|
|
1633
1630
|
}).chain((uniqueLang) => $shaclPropertyFromRdf({
|
|
1634
1631
|
graph: _$options.graph,
|
|
1635
1632
|
resource: $resource,
|
|
1636
|
-
propertySchema: PropertyShape
|
|
1633
|
+
propertySchema: PropertyShape.schema
|
|
1637
1634
|
.properties
|
|
1638
1635
|
.xone,
|
|
1639
1636
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -1643,7 +1640,7 @@ export var PropertyShape;
|
|
|
1643
1640
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1644
1641
|
focusResource: $resource,
|
|
1645
1642
|
propertyPath: PropertyShape
|
|
1646
|
-
|
|
1643
|
+
.schema
|
|
1647
1644
|
.properties
|
|
1648
1645
|
.xone
|
|
1649
1646
|
.path,
|
|
@@ -1656,7 +1653,7 @@ export var PropertyShape;
|
|
|
1656
1653
|
: Resource.Values.fromValue({
|
|
1657
1654
|
focusResource: $resource,
|
|
1658
1655
|
propertyPath: PropertyShape
|
|
1659
|
-
|
|
1656
|
+
.schema
|
|
1660
1657
|
.properties
|
|
1661
1658
|
.xone
|
|
1662
1659
|
.path,
|
|
@@ -1699,7 +1696,7 @@ export var PropertyShape;
|
|
|
1699
1696
|
xone,
|
|
1700
1697
|
}))))))))))))))))))))))))))))))))))));
|
|
1701
1698
|
};
|
|
1702
|
-
PropertyShape
|
|
1699
|
+
PropertyShape.schema = {
|
|
1703
1700
|
properties: {
|
|
1704
1701
|
$identifier: {
|
|
1705
1702
|
kind: "Identifier",
|
|
@@ -1960,7 +1957,7 @@ export var PropertyShape;
|
|
|
1960
1957
|
},
|
|
1961
1958
|
path: {
|
|
1962
1959
|
kind: "Shacl",
|
|
1963
|
-
type: () => $PropertyPath
|
|
1960
|
+
type: () => $PropertyPath.schema,
|
|
1964
1961
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
|
|
1965
1962
|
},
|
|
1966
1963
|
patterns: {
|
|
@@ -1992,7 +1989,7 @@ export var PropertyShape;
|
|
|
1992
1989
|
},
|
|
1993
1990
|
},
|
|
1994
1991
|
};
|
|
1995
|
-
function
|
|
1992
|
+
function toRdfResource(_propertyShape, options) {
|
|
1996
1993
|
const resourceSet = options?.resourceSet ??
|
|
1997
1994
|
new ResourceSet({
|
|
1998
1995
|
dataFactory: dataFactory,
|
|
@@ -2147,7 +2144,7 @@ export var PropertyShape;
|
|
|
2147
2144
|
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
2148
2145
|
]), options?.graph);
|
|
2149
2146
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#path"), [
|
|
2150
|
-
$PropertyPath
|
|
2147
|
+
$PropertyPath.toRdfResource(_propertyShape.path, {
|
|
2151
2148
|
graph: options?.graph,
|
|
2152
2149
|
resourceSet: resourceSet,
|
|
2153
2150
|
}).identifier,
|
|
@@ -2182,8 +2179,8 @@ export var PropertyShape;
|
|
|
2182
2179
|
]), options?.graph);
|
|
2183
2180
|
return resource;
|
|
2184
2181
|
}
|
|
2185
|
-
PropertyShape
|
|
2186
|
-
function
|
|
2182
|
+
PropertyShape.toRdfResource = toRdfResource;
|
|
2183
|
+
function propertiesToStrings(_propertyShape) {
|
|
2187
2184
|
return $compactRecord({
|
|
2188
2185
|
$identifier: _propertyShape.$identifier().toString(),
|
|
2189
2186
|
label: _propertyShape.label.map((item) => item.toString()).extract(),
|
|
@@ -2191,15 +2188,15 @@ export var PropertyShape;
|
|
|
2191
2188
|
path: $PropertyPath.$toString(_propertyShape.path),
|
|
2192
2189
|
});
|
|
2193
2190
|
}
|
|
2194
|
-
PropertyShape
|
|
2191
|
+
PropertyShape.propertiesToStrings = propertiesToStrings;
|
|
2195
2192
|
function $toString(_propertyShape) {
|
|
2196
|
-
return `PropertyShape(${JSON.stringify(
|
|
2193
|
+
return `PropertyShape(${JSON.stringify(propertiesToStrings((_propertyShape ?? this)))})`;
|
|
2197
2194
|
}
|
|
2198
2195
|
PropertyShape.$toString = $toString;
|
|
2199
2196
|
})(PropertyShape || (PropertyShape = {}));
|
|
2200
2197
|
export var PropertyGroup;
|
|
2201
2198
|
(function (PropertyGroup) {
|
|
2202
|
-
function
|
|
2199
|
+
function create(parameters) {
|
|
2203
2200
|
const $identifierParameter = parameters?.$identifier;
|
|
2204
2201
|
let $identifier;
|
|
2205
2202
|
if (typeof $identifierParameter === "function") {
|
|
@@ -2247,13 +2244,13 @@ export var PropertyGroup;
|
|
|
2247
2244
|
}
|
|
2248
2245
|
return { $identifier, $type, comment, label };
|
|
2249
2246
|
}
|
|
2250
|
-
PropertyGroup
|
|
2251
|
-
let
|
|
2252
|
-
(function (
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
})(
|
|
2256
|
-
function
|
|
2247
|
+
PropertyGroup.create = create;
|
|
2248
|
+
let Identifier;
|
|
2249
|
+
(function (Identifier) {
|
|
2250
|
+
Identifier.parse = $parseIdentifier;
|
|
2251
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
2252
|
+
})(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
|
|
2253
|
+
function filter(filter, value) {
|
|
2257
2254
|
if (filter.$identifier !== undefined &&
|
|
2258
2255
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
2259
2256
|
return false;
|
|
@@ -2268,24 +2265,24 @@ export var PropertyGroup;
|
|
|
2268
2265
|
}
|
|
2269
2266
|
return true;
|
|
2270
2267
|
}
|
|
2271
|
-
PropertyGroup
|
|
2272
|
-
PropertyGroup
|
|
2268
|
+
PropertyGroup.filter = filter;
|
|
2269
|
+
PropertyGroup.fromRdfResource = (resource, options) => {
|
|
2273
2270
|
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2274
2271
|
if (!objectSet) {
|
|
2275
2272
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
2276
2273
|
}
|
|
2277
|
-
return PropertyGroup
|
|
2274
|
+
return PropertyGroup.propertiesFromRdfResource(resource, {
|
|
2278
2275
|
context,
|
|
2279
2276
|
graph,
|
|
2280
2277
|
ignoreRdfType,
|
|
2281
2278
|
objectSet,
|
|
2282
2279
|
preferredLanguages,
|
|
2283
|
-
}).map(
|
|
2280
|
+
}).map(create);
|
|
2284
2281
|
};
|
|
2285
|
-
PropertyGroup
|
|
2282
|
+
PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2286
2283
|
.toResource()
|
|
2287
|
-
.chain((resource) => PropertyGroup
|
|
2288
|
-
PropertyGroup
|
|
2284
|
+
.chain((resource) => PropertyGroup.fromRdfResource(resource, options))));
|
|
2285
|
+
PropertyGroup.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
|
|
2289
2286
|
function isPropertyGroup(object) {
|
|
2290
2287
|
switch (object.$type) {
|
|
2291
2288
|
case "PropertyGroup":
|
|
@@ -2295,7 +2292,7 @@ export var PropertyGroup;
|
|
|
2295
2292
|
}
|
|
2296
2293
|
}
|
|
2297
2294
|
PropertyGroup.isPropertyGroup = isPropertyGroup;
|
|
2298
|
-
PropertyGroup
|
|
2295
|
+
PropertyGroup.propertiesFromRdfResource = ($resource, _$options) => {
|
|
2299
2296
|
return (!_$options.ignoreRdfType
|
|
2300
2297
|
? $resource
|
|
2301
2298
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -2307,7 +2304,7 @@ export var PropertyGroup;
|
|
|
2307
2304
|
return Right(true);
|
|
2308
2305
|
}
|
|
2309
2306
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
2310
|
-
if ($resource.isInstanceOf(PropertyGroup
|
|
2307
|
+
if ($resource.isInstanceOf(PropertyGroup.fromRdfType, {
|
|
2311
2308
|
graph: _$options.graph,
|
|
2312
2309
|
})) {
|
|
2313
2310
|
return Right(true);
|
|
@@ -2325,7 +2322,7 @@ export var PropertyGroup;
|
|
|
2325
2322
|
.chain(($identifier) => Right("PropertyGroup").chain(($type) => $shaclPropertyFromRdf({
|
|
2326
2323
|
graph: _$options.graph,
|
|
2327
2324
|
resource: $resource,
|
|
2328
|
-
propertySchema: PropertyGroup
|
|
2325
|
+
propertySchema: PropertyGroup.schema.properties.comment,
|
|
2329
2326
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2330
2327
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2331
2328
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2333,13 +2330,13 @@ export var PropertyGroup;
|
|
|
2333
2330
|
? values.map((value) => Maybe.of(value))
|
|
2334
2331
|
: Resource.Values.fromValue({
|
|
2335
2332
|
focusResource: $resource,
|
|
2336
|
-
propertyPath: PropertyShape
|
|
2333
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
2337
2334
|
value: Maybe.empty(),
|
|
2338
2335
|
})),
|
|
2339
2336
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
2340
2337
|
graph: _$options.graph,
|
|
2341
2338
|
resource: $resource,
|
|
2342
|
-
propertySchema: PropertyGroup
|
|
2339
|
+
propertySchema: PropertyGroup.schema.properties.label,
|
|
2343
2340
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2344
2341
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2345
2342
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2347,12 +2344,12 @@ export var PropertyGroup;
|
|
|
2347
2344
|
? values.map((value) => Maybe.of(value))
|
|
2348
2345
|
: Resource.Values.fromValue({
|
|
2349
2346
|
focusResource: $resource,
|
|
2350
|
-
propertyPath: PropertyShape
|
|
2347
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2351
2348
|
value: Maybe.empty(),
|
|
2352
2349
|
})),
|
|
2353
2350
|
}).map((label) => ({ $identifier, $type, comment, label }))))));
|
|
2354
2351
|
};
|
|
2355
|
-
PropertyGroup
|
|
2352
|
+
PropertyGroup.schema = {
|
|
2356
2353
|
properties: {
|
|
2357
2354
|
$identifier: {
|
|
2358
2355
|
kind: "Identifier",
|
|
@@ -2383,7 +2380,7 @@ export var PropertyGroup;
|
|
|
2383
2380
|
},
|
|
2384
2381
|
},
|
|
2385
2382
|
};
|
|
2386
|
-
function
|
|
2383
|
+
function toRdfResource(_propertyGroup, options) {
|
|
2387
2384
|
const resourceSet = options?.resourceSet ??
|
|
2388
2385
|
new ResourceSet({
|
|
2389
2386
|
dataFactory: dataFactory,
|
|
@@ -2401,22 +2398,22 @@ export var PropertyGroup;
|
|
|
2401
2398
|
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
2402
2399
|
return resource;
|
|
2403
2400
|
}
|
|
2404
|
-
PropertyGroup
|
|
2405
|
-
function
|
|
2401
|
+
PropertyGroup.toRdfResource = toRdfResource;
|
|
2402
|
+
function propertiesToStrings(_propertyGroup) {
|
|
2406
2403
|
return $compactRecord({
|
|
2407
2404
|
$identifier: _propertyGroup.$identifier().toString(),
|
|
2408
2405
|
label: _propertyGroup.label.map((item) => item.toString()).extract(),
|
|
2409
2406
|
});
|
|
2410
2407
|
}
|
|
2411
|
-
PropertyGroup
|
|
2408
|
+
PropertyGroup.propertiesToStrings = propertiesToStrings;
|
|
2412
2409
|
function $toString(_propertyGroup) {
|
|
2413
|
-
return `PropertyGroup(${JSON.stringify(
|
|
2410
|
+
return `PropertyGroup(${JSON.stringify(propertiesToStrings((_propertyGroup ?? this)))})`;
|
|
2414
2411
|
}
|
|
2415
2412
|
PropertyGroup.$toString = $toString;
|
|
2416
2413
|
})(PropertyGroup || (PropertyGroup = {}));
|
|
2417
2414
|
export var Ontology;
|
|
2418
2415
|
(function (Ontology) {
|
|
2419
|
-
function
|
|
2416
|
+
function create(parameters) {
|
|
2420
2417
|
const $identifierParameter = parameters?.$identifier;
|
|
2421
2418
|
let $identifier;
|
|
2422
2419
|
if (typeof $identifierParameter === "function") {
|
|
@@ -2464,13 +2461,13 @@ export var Ontology;
|
|
|
2464
2461
|
}
|
|
2465
2462
|
return { $identifier, $type, comment, label };
|
|
2466
2463
|
}
|
|
2467
|
-
Ontology
|
|
2468
|
-
let
|
|
2469
|
-
(function (
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
})(
|
|
2473
|
-
function
|
|
2464
|
+
Ontology.create = create;
|
|
2465
|
+
let Identifier;
|
|
2466
|
+
(function (Identifier) {
|
|
2467
|
+
Identifier.parse = $parseIdentifier;
|
|
2468
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
2469
|
+
})(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
|
|
2470
|
+
function filter(filter, value) {
|
|
2474
2471
|
if (filter.$identifier !== undefined &&
|
|
2475
2472
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
2476
2473
|
return false;
|
|
@@ -2485,24 +2482,24 @@ export var Ontology;
|
|
|
2485
2482
|
}
|
|
2486
2483
|
return true;
|
|
2487
2484
|
}
|
|
2488
|
-
Ontology
|
|
2489
|
-
Ontology
|
|
2485
|
+
Ontology.filter = filter;
|
|
2486
|
+
Ontology.fromRdfResource = (resource, options) => {
|
|
2490
2487
|
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2491
2488
|
if (!objectSet) {
|
|
2492
2489
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
2493
2490
|
}
|
|
2494
|
-
return Ontology
|
|
2491
|
+
return Ontology.propertiesFromRdfResource(resource, {
|
|
2495
2492
|
context,
|
|
2496
2493
|
graph,
|
|
2497
2494
|
ignoreRdfType,
|
|
2498
2495
|
objectSet,
|
|
2499
2496
|
preferredLanguages,
|
|
2500
|
-
}).map(
|
|
2497
|
+
}).map(create);
|
|
2501
2498
|
};
|
|
2502
|
-
Ontology
|
|
2499
|
+
Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2503
2500
|
.toResource()
|
|
2504
|
-
.chain((resource) => Ontology
|
|
2505
|
-
Ontology
|
|
2501
|
+
.chain((resource) => Ontology.fromRdfResource(resource, options))));
|
|
2502
|
+
Ontology.fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
|
|
2506
2503
|
function isOntology(object) {
|
|
2507
2504
|
switch (object.$type) {
|
|
2508
2505
|
case "Ontology":
|
|
@@ -2512,7 +2509,7 @@ export var Ontology;
|
|
|
2512
2509
|
}
|
|
2513
2510
|
}
|
|
2514
2511
|
Ontology.isOntology = isOntology;
|
|
2515
|
-
Ontology
|
|
2512
|
+
Ontology.propertiesFromRdfResource = ($resource, _$options) => {
|
|
2516
2513
|
return (!_$options.ignoreRdfType
|
|
2517
2514
|
? $resource
|
|
2518
2515
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -2524,7 +2521,7 @@ export var Ontology;
|
|
|
2524
2521
|
return Right(true);
|
|
2525
2522
|
}
|
|
2526
2523
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
2527
|
-
if ($resource.isInstanceOf(Ontology
|
|
2524
|
+
if ($resource.isInstanceOf(Ontology.fromRdfType, {
|
|
2528
2525
|
graph: _$options.graph,
|
|
2529
2526
|
})) {
|
|
2530
2527
|
return Right(true);
|
|
@@ -2542,7 +2539,7 @@ export var Ontology;
|
|
|
2542
2539
|
.chain(($identifier) => Right("Ontology").chain(($type) => $shaclPropertyFromRdf({
|
|
2543
2540
|
graph: _$options.graph,
|
|
2544
2541
|
resource: $resource,
|
|
2545
|
-
propertySchema: Ontology
|
|
2542
|
+
propertySchema: Ontology.schema.properties.comment,
|
|
2546
2543
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2547
2544
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2548
2545
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2550,13 +2547,13 @@ export var Ontology;
|
|
|
2550
2547
|
? values.map((value) => Maybe.of(value))
|
|
2551
2548
|
: Resource.Values.fromValue({
|
|
2552
2549
|
focusResource: $resource,
|
|
2553
|
-
propertyPath: PropertyShape
|
|
2550
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
2554
2551
|
value: Maybe.empty(),
|
|
2555
2552
|
})),
|
|
2556
2553
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
2557
2554
|
graph: _$options.graph,
|
|
2558
2555
|
resource: $resource,
|
|
2559
|
-
propertySchema: Ontology
|
|
2556
|
+
propertySchema: Ontology.schema.properties.label,
|
|
2560
2557
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2561
2558
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2562
2559
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -2564,12 +2561,12 @@ export var Ontology;
|
|
|
2564
2561
|
? values.map((value) => Maybe.of(value))
|
|
2565
2562
|
: Resource.Values.fromValue({
|
|
2566
2563
|
focusResource: $resource,
|
|
2567
|
-
propertyPath: PropertyShape
|
|
2564
|
+
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2568
2565
|
value: Maybe.empty(),
|
|
2569
2566
|
})),
|
|
2570
2567
|
}).map((label) => ({ $identifier, $type, comment, label }))))));
|
|
2571
2568
|
};
|
|
2572
|
-
Ontology
|
|
2569
|
+
Ontology.schema = {
|
|
2573
2570
|
properties: {
|
|
2574
2571
|
$identifier: {
|
|
2575
2572
|
kind: "Identifier",
|
|
@@ -2600,7 +2597,7 @@ export var Ontology;
|
|
|
2600
2597
|
},
|
|
2601
2598
|
},
|
|
2602
2599
|
};
|
|
2603
|
-
function
|
|
2600
|
+
function toRdfResource(_ontology, options) {
|
|
2604
2601
|
const resourceSet = options?.resourceSet ??
|
|
2605
2602
|
new ResourceSet({
|
|
2606
2603
|
dataFactory: dataFactory,
|
|
@@ -2618,22 +2615,22 @@ export var Ontology;
|
|
|
2618
2615
|
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
2619
2616
|
return resource;
|
|
2620
2617
|
}
|
|
2621
|
-
Ontology
|
|
2622
|
-
function
|
|
2618
|
+
Ontology.toRdfResource = toRdfResource;
|
|
2619
|
+
function propertiesToStrings(_ontology) {
|
|
2623
2620
|
return $compactRecord({
|
|
2624
2621
|
$identifier: _ontology.$identifier().toString(),
|
|
2625
2622
|
label: _ontology.label.map((item) => item.toString()).extract(),
|
|
2626
2623
|
});
|
|
2627
2624
|
}
|
|
2628
|
-
Ontology
|
|
2625
|
+
Ontology.propertiesToStrings = propertiesToStrings;
|
|
2629
2626
|
function $toString(_ontology) {
|
|
2630
|
-
return `Ontology(${JSON.stringify(
|
|
2627
|
+
return `Ontology(${JSON.stringify(propertiesToStrings((_ontology ?? this)))})`;
|
|
2631
2628
|
}
|
|
2632
2629
|
Ontology.$toString = $toString;
|
|
2633
2630
|
})(Ontology || (Ontology = {}));
|
|
2634
2631
|
export var NodeShape;
|
|
2635
2632
|
(function (NodeShape) {
|
|
2636
|
-
function
|
|
2633
|
+
function create(parameters) {
|
|
2637
2634
|
const $identifierParameter = parameters?.$identifier;
|
|
2638
2635
|
let $identifier;
|
|
2639
2636
|
if (typeof $identifierParameter === "function") {
|
|
@@ -3193,13 +3190,13 @@ export var NodeShape;
|
|
|
3193
3190
|
xone,
|
|
3194
3191
|
};
|
|
3195
3192
|
}
|
|
3196
|
-
NodeShape
|
|
3197
|
-
let
|
|
3198
|
-
(function (
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
})(
|
|
3202
|
-
function
|
|
3193
|
+
NodeShape.create = create;
|
|
3194
|
+
let Identifier;
|
|
3195
|
+
(function (Identifier) {
|
|
3196
|
+
Identifier.parse = $parseIdentifier;
|
|
3197
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
3198
|
+
})(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
|
|
3199
|
+
function filter(filter, value) {
|
|
3203
3200
|
if (filter.$identifier !== undefined &&
|
|
3204
3201
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
3205
3202
|
return false;
|
|
@@ -3326,24 +3323,24 @@ export var NodeShape;
|
|
|
3326
3323
|
}
|
|
3327
3324
|
return true;
|
|
3328
3325
|
}
|
|
3329
|
-
NodeShape
|
|
3330
|
-
NodeShape
|
|
3326
|
+
NodeShape.filter = filter;
|
|
3327
|
+
NodeShape.fromRdfResource = (resource, options) => {
|
|
3331
3328
|
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
3332
3329
|
if (!objectSet) {
|
|
3333
3330
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
3334
3331
|
}
|
|
3335
|
-
return NodeShape
|
|
3332
|
+
return NodeShape.propertiesFromRdfResource(resource, {
|
|
3336
3333
|
context,
|
|
3337
3334
|
graph,
|
|
3338
3335
|
ignoreRdfType,
|
|
3339
3336
|
objectSet,
|
|
3340
3337
|
preferredLanguages,
|
|
3341
|
-
}).map(
|
|
3338
|
+
}).map(create);
|
|
3342
3339
|
};
|
|
3343
|
-
NodeShape
|
|
3340
|
+
NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
3344
3341
|
.toResource()
|
|
3345
|
-
.chain((resource) => NodeShape
|
|
3346
|
-
NodeShape
|
|
3342
|
+
.chain((resource) => NodeShape.fromRdfResource(resource, options))));
|
|
3343
|
+
NodeShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
|
|
3347
3344
|
function isNodeShape(object) {
|
|
3348
3345
|
switch (object.$type) {
|
|
3349
3346
|
case "NodeShape":
|
|
@@ -3353,7 +3350,7 @@ export var NodeShape;
|
|
|
3353
3350
|
}
|
|
3354
3351
|
}
|
|
3355
3352
|
NodeShape.isNodeShape = isNodeShape;
|
|
3356
|
-
NodeShape
|
|
3353
|
+
NodeShape.propertiesFromRdfResource = ($resource, _$options) => {
|
|
3357
3354
|
return (!_$options.ignoreRdfType
|
|
3358
3355
|
? $resource
|
|
3359
3356
|
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
@@ -3365,7 +3362,7 @@ export var NodeShape;
|
|
|
3365
3362
|
return Right(true);
|
|
3366
3363
|
}
|
|
3367
3364
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
3368
|
-
if ($resource.isInstanceOf(NodeShape
|
|
3365
|
+
if ($resource.isInstanceOf(NodeShape.fromRdfType, {
|
|
3369
3366
|
graph: _$options.graph,
|
|
3370
3367
|
})) {
|
|
3371
3368
|
return Right(true);
|
|
@@ -3383,12 +3380,12 @@ export var NodeShape;
|
|
|
3383
3380
|
.chain(($identifier) => Right("NodeShape").chain(($type) => $shaclPropertyFromRdf({
|
|
3384
3381
|
graph: _$options.graph,
|
|
3385
3382
|
resource: $resource,
|
|
3386
|
-
propertySchema: NodeShape
|
|
3383
|
+
propertySchema: NodeShape.schema.properties.and,
|
|
3387
3384
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3388
3385
|
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3389
3386
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3390
3387
|
focusResource: $resource,
|
|
3391
|
-
propertyPath: PropertyShape
|
|
3388
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3392
3389
|
values: valueList.toArray(),
|
|
3393
3390
|
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
3394
3391
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
@@ -3396,38 +3393,38 @@ export var NodeShape;
|
|
|
3396
3393
|
? values.map((value) => Maybe.of(value))
|
|
3397
3394
|
: Resource.Values.fromValue({
|
|
3398
3395
|
focusResource: $resource,
|
|
3399
|
-
propertyPath: PropertyShape
|
|
3396
|
+
propertyPath: PropertyShape.schema.properties.and.path,
|
|
3400
3397
|
value: Maybe.empty(),
|
|
3401
3398
|
})),
|
|
3402
3399
|
}).chain((and) => $shaclPropertyFromRdf({
|
|
3403
3400
|
graph: _$options.graph,
|
|
3404
3401
|
resource: $resource,
|
|
3405
|
-
propertySchema: NodeShape
|
|
3402
|
+
propertySchema: NodeShape.schema.properties.classes,
|
|
3406
3403
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3407
3404
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3408
3405
|
.map((values) => values.toArray())
|
|
3409
3406
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3410
3407
|
focusResource: $resource,
|
|
3411
|
-
propertyPath: PropertyShape
|
|
3408
|
+
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
3412
3409
|
value: valuesArray,
|
|
3413
3410
|
})),
|
|
3414
3411
|
}).chain((classes) => $shaclPropertyFromRdf({
|
|
3415
3412
|
graph: _$options.graph,
|
|
3416
3413
|
resource: $resource,
|
|
3417
|
-
propertySchema: NodeShape
|
|
3414
|
+
propertySchema: NodeShape.schema.properties.closed,
|
|
3418
3415
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3419
3416
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3420
3417
|
.map((values) => values.length > 0
|
|
3421
3418
|
? values.map((value) => Maybe.of(value))
|
|
3422
3419
|
: Resource.Values.fromValue({
|
|
3423
3420
|
focusResource: $resource,
|
|
3424
|
-
propertyPath: NodeShape
|
|
3421
|
+
propertyPath: NodeShape.schema.properties.closed.path,
|
|
3425
3422
|
value: Maybe.empty(),
|
|
3426
3423
|
})),
|
|
3427
3424
|
}).chain((closed) => $shaclPropertyFromRdf({
|
|
3428
3425
|
graph: _$options.graph,
|
|
3429
3426
|
resource: $resource,
|
|
3430
|
-
propertySchema: NodeShape
|
|
3427
|
+
propertySchema: NodeShape.schema.properties.comment,
|
|
3431
3428
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3432
3429
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3433
3430
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -3435,54 +3432,54 @@ export var NodeShape;
|
|
|
3435
3432
|
? values.map((value) => Maybe.of(value))
|
|
3436
3433
|
: Resource.Values.fromValue({
|
|
3437
3434
|
focusResource: $resource,
|
|
3438
|
-
propertyPath: PropertyShape
|
|
3435
|
+
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
3439
3436
|
value: Maybe.empty(),
|
|
3440
3437
|
})),
|
|
3441
3438
|
}).chain((comment) => $shaclPropertyFromRdf({
|
|
3442
3439
|
graph: _$options.graph,
|
|
3443
3440
|
resource: $resource,
|
|
3444
|
-
propertySchema: NodeShape
|
|
3441
|
+
propertySchema: NodeShape.schema.properties.datatype,
|
|
3445
3442
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3446
3443
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3447
3444
|
.map((values) => values.length > 0
|
|
3448
3445
|
? values.map((value) => Maybe.of(value))
|
|
3449
3446
|
: Resource.Values.fromValue({
|
|
3450
3447
|
focusResource: $resource,
|
|
3451
|
-
propertyPath: PropertyShape
|
|
3448
|
+
propertyPath: PropertyShape.schema.properties.datatype
|
|
3452
3449
|
.path,
|
|
3453
3450
|
value: Maybe.empty(),
|
|
3454
3451
|
})),
|
|
3455
3452
|
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
3456
3453
|
graph: _$options.graph,
|
|
3457
3454
|
resource: $resource,
|
|
3458
|
-
propertySchema: NodeShape
|
|
3455
|
+
propertySchema: NodeShape.schema.properties.deactivated,
|
|
3459
3456
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3460
3457
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
3461
3458
|
.map((values) => values.length > 0
|
|
3462
3459
|
? values.map((value) => Maybe.of(value))
|
|
3463
3460
|
: Resource.Values.fromValue({
|
|
3464
3461
|
focusResource: $resource,
|
|
3465
|
-
propertyPath: PropertyShape
|
|
3462
|
+
propertyPath: PropertyShape.schema.properties
|
|
3466
3463
|
.deactivated.path,
|
|
3467
3464
|
value: Maybe.empty(),
|
|
3468
3465
|
})),
|
|
3469
3466
|
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
3470
3467
|
graph: _$options.graph,
|
|
3471
3468
|
resource: $resource,
|
|
3472
|
-
propertySchema: NodeShape
|
|
3469
|
+
propertySchema: NodeShape.schema.properties.flags,
|
|
3473
3470
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3474
3471
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3475
3472
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3476
3473
|
.map((values) => values.toArray())
|
|
3477
3474
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3478
3475
|
focusResource: $resource,
|
|
3479
|
-
propertyPath: PropertyShape
|
|
3476
|
+
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
3480
3477
|
value: valuesArray,
|
|
3481
3478
|
})),
|
|
3482
3479
|
}).chain((flags) => $shaclPropertyFromRdf({
|
|
3483
3480
|
graph: _$options.graph,
|
|
3484
3481
|
resource: $resource,
|
|
3485
|
-
propertySchema: NodeShape
|
|
3482
|
+
propertySchema: NodeShape.schema.properties.hasValues,
|
|
3486
3483
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3487
3484
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
3488
3485
|
switch (term.termType) {
|
|
@@ -3494,7 +3491,7 @@ export var NodeShape;
|
|
|
3494
3491
|
actualValue: term,
|
|
3495
3492
|
expectedValueType: "(NamedNode | Literal)",
|
|
3496
3493
|
focusResource: $resource,
|
|
3497
|
-
propertyPath: PropertyShape
|
|
3494
|
+
propertyPath: PropertyShape.schema
|
|
3498
3495
|
.properties.hasValues.path,
|
|
3499
3496
|
}));
|
|
3500
3497
|
}
|
|
@@ -3502,19 +3499,19 @@ export var NodeShape;
|
|
|
3502
3499
|
.map((values) => values.toArray())
|
|
3503
3500
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3504
3501
|
focusResource: $resource,
|
|
3505
|
-
propertyPath: PropertyShape
|
|
3502
|
+
propertyPath: PropertyShape.schema.properties.hasValues
|
|
3506
3503
|
.path,
|
|
3507
3504
|
value: valuesArray,
|
|
3508
3505
|
})),
|
|
3509
3506
|
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
3510
3507
|
graph: _$options.graph,
|
|
3511
3508
|
resource: $resource,
|
|
3512
|
-
propertySchema: NodeShape
|
|
3509
|
+
propertySchema: NodeShape.schema.properties.ignoredProperties,
|
|
3513
3510
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3514
3511
|
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
3515
3512
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3516
3513
|
focusResource: $resource,
|
|
3517
|
-
propertyPath: NodeShape
|
|
3514
|
+
propertyPath: NodeShape.schema.properties
|
|
3518
3515
|
.ignoredProperties.path,
|
|
3519
3516
|
values: valueList.toArray(),
|
|
3520
3517
|
})).chain((values) => values.chainMap((value) => value.toIri()))))
|
|
@@ -3523,21 +3520,21 @@ export var NodeShape;
|
|
|
3523
3520
|
? values.map((value) => Maybe.of(value))
|
|
3524
3521
|
: Resource.Values.fromValue({
|
|
3525
3522
|
focusResource: $resource,
|
|
3526
|
-
propertyPath: NodeShape
|
|
3523
|
+
propertyPath: NodeShape.schema.properties
|
|
3527
3524
|
.ignoredProperties.path,
|
|
3528
3525
|
value: Maybe.empty(),
|
|
3529
3526
|
})),
|
|
3530
3527
|
}).chain((ignoredProperties) => $shaclPropertyFromRdf({
|
|
3531
3528
|
graph: _$options.graph,
|
|
3532
3529
|
resource: $resource,
|
|
3533
|
-
propertySchema: NodeShape
|
|
3530
|
+
propertySchema: NodeShape.schema.properties.in_,
|
|
3534
3531
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3535
3532
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
3536
3533
|
graph: _$options.graph,
|
|
3537
3534
|
})))
|
|
3538
3535
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3539
3536
|
focusResource: $resource,
|
|
3540
|
-
propertyPath: PropertyShape
|
|
3537
|
+
propertyPath: PropertyShape.schema.properties
|
|
3541
3538
|
.in_.path,
|
|
3542
3539
|
values: valueList.toArray(),
|
|
3543
3540
|
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
@@ -3550,7 +3547,7 @@ export var NodeShape;
|
|
|
3550
3547
|
actualValue: term,
|
|
3551
3548
|
expectedValueType: "(NamedNode | Literal)",
|
|
3552
3549
|
focusResource: $resource,
|
|
3553
|
-
propertyPath: PropertyShape
|
|
3550
|
+
propertyPath: PropertyShape.schema
|
|
3554
3551
|
.properties.in_
|
|
3555
3552
|
.path,
|
|
3556
3553
|
}));
|
|
@@ -3561,28 +3558,28 @@ export var NodeShape;
|
|
|
3561
3558
|
? values.map((value) => Maybe.of(value))
|
|
3562
3559
|
: Resource.Values.fromValue({
|
|
3563
3560
|
focusResource: $resource,
|
|
3564
|
-
propertyPath: PropertyShape
|
|
3561
|
+
propertyPath: PropertyShape.schema.properties
|
|
3565
3562
|
.in_.path,
|
|
3566
3563
|
value: Maybe.empty(),
|
|
3567
3564
|
})),
|
|
3568
3565
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
3569
3566
|
graph: _$options.graph,
|
|
3570
3567
|
resource: $resource,
|
|
3571
|
-
propertySchema: NodeShape
|
|
3568
|
+
propertySchema: NodeShape.schema.properties.isDefinedBy,
|
|
3572
3569
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3573
3570
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3574
3571
|
.map((values) => values.length > 0
|
|
3575
3572
|
? values.map((value) => Maybe.of(value))
|
|
3576
3573
|
: Resource.Values.fromValue({
|
|
3577
3574
|
focusResource: $resource,
|
|
3578
|
-
propertyPath: PropertyShape
|
|
3575
|
+
propertyPath: PropertyShape.schema.properties
|
|
3579
3576
|
.isDefinedBy.path,
|
|
3580
3577
|
value: Maybe.empty(),
|
|
3581
3578
|
})),
|
|
3582
3579
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
3583
3580
|
graph: _$options.graph,
|
|
3584
3581
|
resource: $resource,
|
|
3585
|
-
propertySchema: NodeShape
|
|
3582
|
+
propertySchema: NodeShape.schema.properties.label,
|
|
3586
3583
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3587
3584
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3588
3585
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
@@ -3590,21 +3587,21 @@ export var NodeShape;
|
|
|
3590
3587
|
? values.map((value) => Maybe.of(value))
|
|
3591
3588
|
: Resource.Values.fromValue({
|
|
3592
3589
|
focusResource: $resource,
|
|
3593
|
-
propertyPath: PropertyShape
|
|
3590
|
+
propertyPath: PropertyShape.schema
|
|
3594
3591
|
.properties.label.path,
|
|
3595
3592
|
value: Maybe.empty(),
|
|
3596
3593
|
})),
|
|
3597
3594
|
}).chain((label) => $shaclPropertyFromRdf({
|
|
3598
3595
|
graph: _$options.graph,
|
|
3599
3596
|
resource: $resource,
|
|
3600
|
-
propertySchema: NodeShape
|
|
3597
|
+
propertySchema: NodeShape.schema.properties.languageIn,
|
|
3601
3598
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3602
3599
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
3603
3600
|
graph: _$options.graph,
|
|
3604
3601
|
})))
|
|
3605
3602
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3606
3603
|
focusResource: $resource,
|
|
3607
|
-
propertyPath: PropertyShape
|
|
3604
|
+
propertyPath: PropertyShape.schema
|
|
3608
3605
|
.properties.languageIn
|
|
3609
3606
|
.path,
|
|
3610
3607
|
values: valueList.toArray(),
|
|
@@ -3616,7 +3613,7 @@ export var NodeShape;
|
|
|
3616
3613
|
? values.map((value) => Maybe.of(value))
|
|
3617
3614
|
: Resource.Values.fromValue({
|
|
3618
3615
|
focusResource: $resource,
|
|
3619
|
-
propertyPath: PropertyShape
|
|
3616
|
+
propertyPath: PropertyShape.schema
|
|
3620
3617
|
.properties.languageIn
|
|
3621
3618
|
.path,
|
|
3622
3619
|
value: Maybe.empty(),
|
|
@@ -3624,14 +3621,14 @@ export var NodeShape;
|
|
|
3624
3621
|
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
3625
3622
|
graph: _$options.graph,
|
|
3626
3623
|
resource: $resource,
|
|
3627
|
-
propertySchema: NodeShape
|
|
3624
|
+
propertySchema: NodeShape.schema.properties.maxCount,
|
|
3628
3625
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3629
3626
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3630
3627
|
.map((values) => values.length > 0
|
|
3631
3628
|
? values.map((value) => Maybe.of(value))
|
|
3632
3629
|
: Resource.Values.fromValue({
|
|
3633
3630
|
focusResource: $resource,
|
|
3634
|
-
propertyPath: PropertyShape
|
|
3631
|
+
propertyPath: PropertyShape.schema
|
|
3635
3632
|
.properties.maxCount
|
|
3636
3633
|
.path,
|
|
3637
3634
|
value: Maybe.empty(),
|
|
@@ -3639,7 +3636,7 @@ export var NodeShape;
|
|
|
3639
3636
|
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
3640
3637
|
graph: _$options.graph,
|
|
3641
3638
|
resource: $resource,
|
|
3642
|
-
propertySchema: NodeShape
|
|
3639
|
+
propertySchema: NodeShape.schema.properties.maxExclusive,
|
|
3643
3640
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3644
3641
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3645
3642
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -3647,7 +3644,7 @@ export var NodeShape;
|
|
|
3647
3644
|
? values.map((value) => Maybe.of(value))
|
|
3648
3645
|
: Resource.Values.fromValue({
|
|
3649
3646
|
focusResource: $resource,
|
|
3650
|
-
propertyPath: PropertyShape
|
|
3647
|
+
propertyPath: PropertyShape.schema
|
|
3651
3648
|
.properties
|
|
3652
3649
|
.maxExclusive.path,
|
|
3653
3650
|
value: Maybe.empty(),
|
|
@@ -3655,7 +3652,7 @@ export var NodeShape;
|
|
|
3655
3652
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
3656
3653
|
graph: _$options.graph,
|
|
3657
3654
|
resource: $resource,
|
|
3658
|
-
propertySchema: NodeShape
|
|
3655
|
+
propertySchema: NodeShape.schema.properties.maxInclusive,
|
|
3659
3656
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3660
3657
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3661
3658
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
@@ -3663,7 +3660,7 @@ export var NodeShape;
|
|
|
3663
3660
|
? values.map((value) => Maybe.of(value))
|
|
3664
3661
|
: Resource.Values.fromValue({
|
|
3665
3662
|
focusResource: $resource,
|
|
3666
|
-
propertyPath: PropertyShape
|
|
3663
|
+
propertyPath: PropertyShape.schema
|
|
3667
3664
|
.properties
|
|
3668
3665
|
.maxInclusive.path,
|
|
3669
3666
|
value: Maybe.empty(),
|
|
@@ -3671,15 +3668,14 @@ export var NodeShape;
|
|
|
3671
3668
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
3672
3669
|
graph: _$options.graph,
|
|
3673
3670
|
resource: $resource,
|
|
3674
|
-
propertySchema: NodeShape
|
|
3671
|
+
propertySchema: NodeShape.schema.properties.maxLength,
|
|
3675
3672
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3676
3673
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3677
3674
|
.map((values) => values.length > 0
|
|
3678
3675
|
? values.map((value) => Maybe.of(value))
|
|
3679
3676
|
: Resource.Values.fromValue({
|
|
3680
3677
|
focusResource: $resource,
|
|
3681
|
-
propertyPath: PropertyShape
|
|
3682
|
-
.$schema
|
|
3678
|
+
propertyPath: PropertyShape.schema
|
|
3683
3679
|
.properties
|
|
3684
3680
|
.maxLength.path,
|
|
3685
3681
|
value: Maybe.empty(),
|
|
@@ -3687,7 +3683,7 @@ export var NodeShape;
|
|
|
3687
3683
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
3688
3684
|
graph: _$options.graph,
|
|
3689
3685
|
resource: $resource,
|
|
3690
|
-
propertySchema: NodeShape
|
|
3686
|
+
propertySchema: NodeShape.schema.properties.minCount,
|
|
3691
3687
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3692
3688
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
3693
3689
|
.map((values) => values.length > 0
|
|
@@ -3695,7 +3691,7 @@ export var NodeShape;
|
|
|
3695
3691
|
: Resource.Values.fromValue({
|
|
3696
3692
|
focusResource: $resource,
|
|
3697
3693
|
propertyPath: PropertyShape
|
|
3698
|
-
|
|
3694
|
+
.schema
|
|
3699
3695
|
.properties
|
|
3700
3696
|
.minCount.path,
|
|
3701
3697
|
value: Maybe.empty(),
|
|
@@ -3703,7 +3699,7 @@ export var NodeShape;
|
|
|
3703
3699
|
}).chain((minCount) => $shaclPropertyFromRdf({
|
|
3704
3700
|
graph: _$options.graph,
|
|
3705
3701
|
resource: $resource,
|
|
3706
|
-
propertySchema: NodeShape
|
|
3702
|
+
propertySchema: NodeShape.schema.properties
|
|
3707
3703
|
.minExclusive,
|
|
3708
3704
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3709
3705
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -3713,7 +3709,7 @@ export var NodeShape;
|
|
|
3713
3709
|
: Resource.Values.fromValue({
|
|
3714
3710
|
focusResource: $resource,
|
|
3715
3711
|
propertyPath: PropertyShape
|
|
3716
|
-
|
|
3712
|
+
.schema
|
|
3717
3713
|
.properties
|
|
3718
3714
|
.minExclusive
|
|
3719
3715
|
.path,
|
|
@@ -3722,7 +3718,7 @@ export var NodeShape;
|
|
|
3722
3718
|
}).chain((minExclusive) => $shaclPropertyFromRdf({
|
|
3723
3719
|
graph: _$options.graph,
|
|
3724
3720
|
resource: $resource,
|
|
3725
|
-
propertySchema: NodeShape
|
|
3721
|
+
propertySchema: NodeShape.schema.properties
|
|
3726
3722
|
.minInclusive,
|
|
3727
3723
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3728
3724
|
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
@@ -3732,7 +3728,7 @@ export var NodeShape;
|
|
|
3732
3728
|
: Resource.Values.fromValue({
|
|
3733
3729
|
focusResource: $resource,
|
|
3734
3730
|
propertyPath: PropertyShape
|
|
3735
|
-
|
|
3731
|
+
.schema
|
|
3736
3732
|
.properties
|
|
3737
3733
|
.minInclusive
|
|
3738
3734
|
.path,
|
|
@@ -3741,7 +3737,7 @@ export var NodeShape;
|
|
|
3741
3737
|
}).chain((minInclusive) => $shaclPropertyFromRdf({
|
|
3742
3738
|
graph: _$options.graph,
|
|
3743
3739
|
resource: $resource,
|
|
3744
|
-
propertySchema: NodeShape
|
|
3740
|
+
propertySchema: NodeShape.schema.properties
|
|
3745
3741
|
.minLength,
|
|
3746
3742
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3747
3743
|
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
@@ -3750,7 +3746,7 @@ export var NodeShape;
|
|
|
3750
3746
|
: Resource.Values.fromValue({
|
|
3751
3747
|
focusResource: $resource,
|
|
3752
3748
|
propertyPath: PropertyShape
|
|
3753
|
-
|
|
3749
|
+
.schema
|
|
3754
3750
|
.properties
|
|
3755
3751
|
.minLength
|
|
3756
3752
|
.path,
|
|
@@ -3759,7 +3755,7 @@ export var NodeShape;
|
|
|
3759
3755
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
3760
3756
|
graph: _$options.graph,
|
|
3761
3757
|
resource: $resource,
|
|
3762
|
-
propertySchema: NodeShape
|
|
3758
|
+
propertySchema: NodeShape.schema.properties
|
|
3763
3759
|
.node,
|
|
3764
3760
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3765
3761
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
@@ -3768,7 +3764,7 @@ export var NodeShape;
|
|
|
3768
3764
|
: Resource.Values.fromValue({
|
|
3769
3765
|
focusResource: $resource,
|
|
3770
3766
|
propertyPath: PropertyShape
|
|
3771
|
-
|
|
3767
|
+
.schema
|
|
3772
3768
|
.properties
|
|
3773
3769
|
.node
|
|
3774
3770
|
.path,
|
|
@@ -3777,7 +3773,7 @@ export var NodeShape;
|
|
|
3777
3773
|
}).chain((node) => $shaclPropertyFromRdf({
|
|
3778
3774
|
graph: _$options.graph,
|
|
3779
3775
|
resource: $resource,
|
|
3780
|
-
propertySchema: NodeShape
|
|
3776
|
+
propertySchema: NodeShape.schema.properties
|
|
3781
3777
|
.nodeKind,
|
|
3782
3778
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3783
3779
|
.chain((values) => values.chainMap((value) => value.toIri([
|
|
@@ -3794,7 +3790,7 @@ export var NodeShape;
|
|
|
3794
3790
|
: Resource.Values.fromValue({
|
|
3795
3791
|
focusResource: $resource,
|
|
3796
3792
|
propertyPath: PropertyShape
|
|
3797
|
-
|
|
3793
|
+
.schema
|
|
3798
3794
|
.properties
|
|
3799
3795
|
.nodeKind
|
|
3800
3796
|
.path,
|
|
@@ -3803,7 +3799,7 @@ export var NodeShape;
|
|
|
3803
3799
|
}).chain((nodeKind) => $shaclPropertyFromRdf({
|
|
3804
3800
|
graph: _$options.graph,
|
|
3805
3801
|
resource: $resource,
|
|
3806
|
-
propertySchema: NodeShape
|
|
3802
|
+
propertySchema: NodeShape.schema
|
|
3807
3803
|
.properties
|
|
3808
3804
|
.not,
|
|
3809
3805
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3812,7 +3808,7 @@ export var NodeShape;
|
|
|
3812
3808
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3813
3809
|
focusResource: $resource,
|
|
3814
3810
|
propertyPath: PropertyShape
|
|
3815
|
-
|
|
3811
|
+
.schema
|
|
3816
3812
|
.properties
|
|
3817
3813
|
.not
|
|
3818
3814
|
.path,
|
|
@@ -3821,7 +3817,7 @@ export var NodeShape;
|
|
|
3821
3817
|
}).chain((not) => $shaclPropertyFromRdf({
|
|
3822
3818
|
graph: _$options.graph,
|
|
3823
3819
|
resource: $resource,
|
|
3824
|
-
propertySchema: NodeShape
|
|
3820
|
+
propertySchema: NodeShape.schema
|
|
3825
3821
|
.properties
|
|
3826
3822
|
.or,
|
|
3827
3823
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3831,7 +3827,7 @@ export var NodeShape;
|
|
|
3831
3827
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3832
3828
|
focusResource: $resource,
|
|
3833
3829
|
propertyPath: PropertyShape
|
|
3834
|
-
|
|
3830
|
+
.schema
|
|
3835
3831
|
.properties
|
|
3836
3832
|
.or
|
|
3837
3833
|
.path,
|
|
@@ -3844,7 +3840,7 @@ export var NodeShape;
|
|
|
3844
3840
|
: Resource.Values.fromValue({
|
|
3845
3841
|
focusResource: $resource,
|
|
3846
3842
|
propertyPath: PropertyShape
|
|
3847
|
-
|
|
3843
|
+
.schema
|
|
3848
3844
|
.properties
|
|
3849
3845
|
.or
|
|
3850
3846
|
.path,
|
|
@@ -3853,7 +3849,7 @@ export var NodeShape;
|
|
|
3853
3849
|
}).chain((or) => $shaclPropertyFromRdf({
|
|
3854
3850
|
graph: _$options.graph,
|
|
3855
3851
|
resource: $resource,
|
|
3856
|
-
propertySchema: NodeShape
|
|
3852
|
+
propertySchema: NodeShape.schema
|
|
3857
3853
|
.properties
|
|
3858
3854
|
.patterns,
|
|
3859
3855
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3863,7 +3859,7 @@ export var NodeShape;
|
|
|
3863
3859
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3864
3860
|
focusResource: $resource,
|
|
3865
3861
|
propertyPath: PropertyShape
|
|
3866
|
-
|
|
3862
|
+
.schema
|
|
3867
3863
|
.properties
|
|
3868
3864
|
.patterns
|
|
3869
3865
|
.path,
|
|
@@ -3872,7 +3868,7 @@ export var NodeShape;
|
|
|
3872
3868
|
}).chain((patterns) => $shaclPropertyFromRdf({
|
|
3873
3869
|
graph: _$options.graph,
|
|
3874
3870
|
resource: $resource,
|
|
3875
|
-
propertySchema: NodeShape
|
|
3871
|
+
propertySchema: NodeShape.schema
|
|
3876
3872
|
.properties
|
|
3877
3873
|
.properties,
|
|
3878
3874
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3881,7 +3877,7 @@ export var NodeShape;
|
|
|
3881
3877
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3882
3878
|
focusResource: $resource,
|
|
3883
3879
|
propertyPath: NodeShape
|
|
3884
|
-
|
|
3880
|
+
.schema
|
|
3885
3881
|
.properties
|
|
3886
3882
|
.properties
|
|
3887
3883
|
.path,
|
|
@@ -3890,7 +3886,7 @@ export var NodeShape;
|
|
|
3890
3886
|
}).chain((properties) => $shaclPropertyFromRdf({
|
|
3891
3887
|
graph: _$options.graph,
|
|
3892
3888
|
resource: $resource,
|
|
3893
|
-
propertySchema: NodeShape
|
|
3889
|
+
propertySchema: NodeShape.schema
|
|
3894
3890
|
.properties
|
|
3895
3891
|
.subClassOf,
|
|
3896
3892
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3899,7 +3895,7 @@ export var NodeShape;
|
|
|
3899
3895
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3900
3896
|
focusResource: $resource,
|
|
3901
3897
|
propertyPath: NodeShape
|
|
3902
|
-
|
|
3898
|
+
.schema
|
|
3903
3899
|
.properties
|
|
3904
3900
|
.subClassOf
|
|
3905
3901
|
.path,
|
|
@@ -3908,7 +3904,7 @@ export var NodeShape;
|
|
|
3908
3904
|
}).chain((subClassOf) => $shaclPropertyFromRdf({
|
|
3909
3905
|
graph: _$options.graph,
|
|
3910
3906
|
resource: $resource,
|
|
3911
|
-
propertySchema: NodeShape
|
|
3907
|
+
propertySchema: NodeShape.schema
|
|
3912
3908
|
.properties
|
|
3913
3909
|
.types,
|
|
3914
3910
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3917,7 +3913,7 @@ export var NodeShape;
|
|
|
3917
3913
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3918
3914
|
focusResource: $resource,
|
|
3919
3915
|
propertyPath: NodeShape
|
|
3920
|
-
|
|
3916
|
+
.schema
|
|
3921
3917
|
.properties
|
|
3922
3918
|
.types
|
|
3923
3919
|
.path,
|
|
@@ -3926,7 +3922,7 @@ export var NodeShape;
|
|
|
3926
3922
|
}).chain((types) => $shaclPropertyFromRdf({
|
|
3927
3923
|
graph: _$options.graph,
|
|
3928
3924
|
resource: $resource,
|
|
3929
|
-
propertySchema: NodeShape
|
|
3925
|
+
propertySchema: NodeShape.schema
|
|
3930
3926
|
.properties
|
|
3931
3927
|
.xone,
|
|
3932
3928
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -3936,7 +3932,7 @@ export var NodeShape;
|
|
|
3936
3932
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3937
3933
|
focusResource: $resource,
|
|
3938
3934
|
propertyPath: PropertyShape
|
|
3939
|
-
|
|
3935
|
+
.schema
|
|
3940
3936
|
.properties
|
|
3941
3937
|
.xone
|
|
3942
3938
|
.path,
|
|
@@ -3949,7 +3945,7 @@ export var NodeShape;
|
|
|
3949
3945
|
: Resource.Values.fromValue({
|
|
3950
3946
|
focusResource: $resource,
|
|
3951
3947
|
propertyPath: PropertyShape
|
|
3952
|
-
|
|
3948
|
+
.schema
|
|
3953
3949
|
.properties
|
|
3954
3950
|
.xone
|
|
3955
3951
|
.path,
|
|
@@ -3990,7 +3986,7 @@ export var NodeShape;
|
|
|
3990
3986
|
xone,
|
|
3991
3987
|
}))))))))))))))))))))))))))))))))));
|
|
3992
3988
|
};
|
|
3993
|
-
NodeShape
|
|
3989
|
+
NodeShape.schema = {
|
|
3994
3990
|
properties: {
|
|
3995
3991
|
$identifier: {
|
|
3996
3992
|
kind: "Identifier",
|
|
@@ -4273,7 +4269,7 @@ export var NodeShape;
|
|
|
4273
4269
|
},
|
|
4274
4270
|
},
|
|
4275
4271
|
};
|
|
4276
|
-
function
|
|
4272
|
+
function toRdfResource(_nodeShape, options) {
|
|
4277
4273
|
const resourceSet = options?.resourceSet ??
|
|
4278
4274
|
new ResourceSet({
|
|
4279
4275
|
dataFactory: dataFactory,
|
|
@@ -4469,50 +4465,59 @@ export var NodeShape;
|
|
|
4469
4465
|
]), options?.graph);
|
|
4470
4466
|
return resource;
|
|
4471
4467
|
}
|
|
4472
|
-
NodeShape
|
|
4473
|
-
function
|
|
4468
|
+
NodeShape.toRdfResource = toRdfResource;
|
|
4469
|
+
function propertiesToStrings(_nodeShape) {
|
|
4474
4470
|
return $compactRecord({
|
|
4475
4471
|
$identifier: _nodeShape.$identifier().toString(),
|
|
4476
4472
|
label: _nodeShape.label.map((item) => item.toString()).extract(),
|
|
4477
4473
|
});
|
|
4478
4474
|
}
|
|
4479
|
-
NodeShape
|
|
4475
|
+
NodeShape.propertiesToStrings = propertiesToStrings;
|
|
4480
4476
|
function $toString(_nodeShape) {
|
|
4481
|
-
return `NodeShape(${JSON.stringify(
|
|
4477
|
+
return `NodeShape(${JSON.stringify(propertiesToStrings((_nodeShape ?? this)))})`;
|
|
4482
4478
|
}
|
|
4483
4479
|
NodeShape.$toString = $toString;
|
|
4484
4480
|
})(NodeShape || (NodeShape = {}));
|
|
4485
4481
|
export var Shape;
|
|
4486
4482
|
(function (Shape) {
|
|
4487
|
-
Shape.$
|
|
4483
|
+
Shape.$toString = (value) => {
|
|
4484
|
+
if (NodeShape.isNodeShape(value)) {
|
|
4485
|
+
return NodeShape.$toString(value);
|
|
4486
|
+
}
|
|
4487
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
4488
|
+
return PropertyShape.$toString(value);
|
|
4489
|
+
}
|
|
4490
|
+
throw new Error("unable to serialize to string");
|
|
4491
|
+
};
|
|
4492
|
+
Shape.filter = (filter, value) => {
|
|
4488
4493
|
if (filter.$identifier !== undefined &&
|
|
4489
4494
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
4490
4495
|
return false;
|
|
4491
4496
|
}
|
|
4492
4497
|
if (filter.on?.["NodeShape"] !== undefined &&
|
|
4493
4498
|
NodeShape.isNodeShape(value)) {
|
|
4494
|
-
if (!NodeShape
|
|
4499
|
+
if (!NodeShape.filter(filter.on["NodeShape"], value)) {
|
|
4495
4500
|
return false;
|
|
4496
4501
|
}
|
|
4497
4502
|
}
|
|
4498
4503
|
if (filter.on?.["PropertyShape"] !== undefined &&
|
|
4499
4504
|
PropertyShape.isPropertyShape(value)) {
|
|
4500
|
-
if (!PropertyShape
|
|
4505
|
+
if (!PropertyShape.filter(filter.on["PropertyShape"], value)) {
|
|
4501
4506
|
return false;
|
|
4502
4507
|
}
|
|
4503
4508
|
}
|
|
4504
4509
|
return true;
|
|
4505
4510
|
};
|
|
4506
|
-
Shape
|
|
4511
|
+
Shape.fromRdfResource = (resource, options) => NodeShape.fromRdfResource(resource, {
|
|
4507
4512
|
...options,
|
|
4508
4513
|
ignoreRdfType: false,
|
|
4509
|
-
}).altLazy(() => PropertyShape
|
|
4514
|
+
}).altLazy(() => PropertyShape.fromRdfResource(resource, {
|
|
4510
4515
|
...options,
|
|
4511
4516
|
ignoreRdfType: false,
|
|
4512
4517
|
}));
|
|
4513
|
-
Shape
|
|
4518
|
+
Shape.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
|
|
4514
4519
|
const valueAsValues = Right(value.toValues());
|
|
4515
|
-
return NodeShape
|
|
4520
|
+
return NodeShape.fromRdfResourceValues(valueAsValues, {
|
|
4516
4521
|
context: _options.context,
|
|
4517
4522
|
graph: _options.graph,
|
|
4518
4523
|
ignoreRdfType: false,
|
|
@@ -4521,7 +4526,7 @@ export var Shape;
|
|
|
4521
4526
|
propertyPath: _options.propertyPath,
|
|
4522
4527
|
resource: _options.resource,
|
|
4523
4528
|
})
|
|
4524
|
-
.altLazy(() => PropertyShape
|
|
4529
|
+
.altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
|
|
4525
4530
|
context: _options.context,
|
|
4526
4531
|
graph: _options.graph,
|
|
4527
4532
|
ignoreRdfType: false,
|
|
@@ -4532,18 +4537,22 @@ export var Shape;
|
|
|
4532
4537
|
}))
|
|
4533
4538
|
.chain((values) => values.head());
|
|
4534
4539
|
})));
|
|
4535
|
-
let
|
|
4536
|
-
(function (
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
})(
|
|
4540
|
-
|
|
4540
|
+
let Identifier;
|
|
4541
|
+
(function (Identifier) {
|
|
4542
|
+
Identifier.parse = $parseIdentifier;
|
|
4543
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
4544
|
+
})(Identifier = Shape.Identifier || (Shape.Identifier = {}));
|
|
4545
|
+
function isShape(object) {
|
|
4546
|
+
return (NodeShape.isNodeShape(object) || PropertyShape.isPropertyShape(object));
|
|
4547
|
+
}
|
|
4548
|
+
Shape.isShape = isShape;
|
|
4549
|
+
Shape.schema = {
|
|
4541
4550
|
kind: "NamedObjectUnion",
|
|
4542
4551
|
members: {
|
|
4543
|
-
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape
|
|
4552
|
+
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.schema },
|
|
4544
4553
|
PropertyShape: {
|
|
4545
4554
|
discriminantValues: ["PropertyShape"],
|
|
4546
|
-
type: PropertyShape
|
|
4555
|
+
type: PropertyShape.schema,
|
|
4547
4556
|
},
|
|
4548
4557
|
},
|
|
4549
4558
|
properties: {
|
|
@@ -4774,19 +4783,19 @@ export var Shape;
|
|
|
4774
4783
|
},
|
|
4775
4784
|
},
|
|
4776
4785
|
};
|
|
4777
|
-
Shape
|
|
4786
|
+
Shape.toRdfResource = (value, options) => {
|
|
4778
4787
|
if (NodeShape.isNodeShape(value)) {
|
|
4779
|
-
return NodeShape
|
|
4788
|
+
return NodeShape.toRdfResource(value, options);
|
|
4780
4789
|
}
|
|
4781
4790
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4782
|
-
return PropertyShape
|
|
4791
|
+
return PropertyShape.toRdfResource(value, options);
|
|
4783
4792
|
}
|
|
4784
4793
|
throw new Error("unrecognized type");
|
|
4785
4794
|
};
|
|
4786
|
-
Shape
|
|
4795
|
+
Shape.toRdfResourceValues = ((value, _options) => {
|
|
4787
4796
|
if (NodeShape.isNodeShape(value)) {
|
|
4788
4797
|
return [
|
|
4789
|
-
NodeShape
|
|
4798
|
+
NodeShape.toRdfResource(value, {
|
|
4790
4799
|
graph: _options.graph,
|
|
4791
4800
|
resourceSet: _options.resourceSet,
|
|
4792
4801
|
}).identifier,
|
|
@@ -4794,7 +4803,7 @@ export var Shape;
|
|
|
4794
4803
|
}
|
|
4795
4804
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4796
4805
|
return [
|
|
4797
|
-
PropertyShape
|
|
4806
|
+
PropertyShape.toRdfResource(value, {
|
|
4798
4807
|
graph: _options.graph,
|
|
4799
4808
|
resourceSet: _options.resourceSet,
|
|
4800
4809
|
}).identifier,
|
|
@@ -4802,71 +4811,73 @@ export var Shape;
|
|
|
4802
4811
|
}
|
|
4803
4812
|
throw new Error("unable to serialize to RDF");
|
|
4804
4813
|
});
|
|
4805
|
-
|
|
4814
|
+
})(Shape || (Shape = {}));
|
|
4815
|
+
export var $Object;
|
|
4816
|
+
(function ($Object) {
|
|
4817
|
+
$Object.$toString = (value) => {
|
|
4806
4818
|
if (NodeShape.isNodeShape(value)) {
|
|
4807
4819
|
return NodeShape.$toString(value);
|
|
4808
4820
|
}
|
|
4821
|
+
if (Ontology.isOntology(value)) {
|
|
4822
|
+
return Ontology.$toString(value);
|
|
4823
|
+
}
|
|
4824
|
+
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4825
|
+
return PropertyGroup.$toString(value);
|
|
4826
|
+
}
|
|
4809
4827
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4810
4828
|
return PropertyShape.$toString(value);
|
|
4811
4829
|
}
|
|
4812
4830
|
throw new Error("unable to serialize to string");
|
|
4813
4831
|
};
|
|
4814
|
-
|
|
4815
|
-
return (NodeShape.isNodeShape(object) || PropertyShape.isPropertyShape(object));
|
|
4816
|
-
}
|
|
4817
|
-
Shape.isShape = isShape;
|
|
4818
|
-
})(Shape || (Shape = {}));
|
|
4819
|
-
export var $Object;
|
|
4820
|
-
(function ($Object) {
|
|
4821
|
-
$Object.$filter = (filter, value) => {
|
|
4832
|
+
$Object.filter = (filter, value) => {
|
|
4822
4833
|
if (filter.$identifier !== undefined &&
|
|
4823
4834
|
!$filterIdentifier(filter.$identifier, value.$identifier())) {
|
|
4824
4835
|
return false;
|
|
4825
4836
|
}
|
|
4826
4837
|
if (filter.on?.["NodeShape"] !== undefined &&
|
|
4827
4838
|
NodeShape.isNodeShape(value)) {
|
|
4828
|
-
if (!NodeShape
|
|
4839
|
+
if (!NodeShape.filter(filter.on["NodeShape"], value)) {
|
|
4829
4840
|
return false;
|
|
4830
4841
|
}
|
|
4831
4842
|
}
|
|
4832
4843
|
if (filter.on?.["Ontology"] !== undefined && Ontology.isOntology(value)) {
|
|
4833
|
-
if (!Ontology
|
|
4844
|
+
if (!Ontology.filter(filter.on["Ontology"], value)) {
|
|
4834
4845
|
return false;
|
|
4835
4846
|
}
|
|
4836
4847
|
}
|
|
4837
4848
|
if (filter.on?.["PropertyGroup"] !== undefined &&
|
|
4838
4849
|
PropertyGroup.isPropertyGroup(value)) {
|
|
4839
|
-
if (!PropertyGroup
|
|
4850
|
+
if (!PropertyGroup.filter(filter.on["PropertyGroup"], value)) {
|
|
4840
4851
|
return false;
|
|
4841
4852
|
}
|
|
4842
4853
|
}
|
|
4843
4854
|
if (filter.on?.["PropertyShape"] !== undefined &&
|
|
4844
4855
|
PropertyShape.isPropertyShape(value)) {
|
|
4845
|
-
if (!PropertyShape
|
|
4856
|
+
if (!PropertyShape.filter(filter.on["PropertyShape"], value)) {
|
|
4846
4857
|
return false;
|
|
4847
4858
|
}
|
|
4848
4859
|
}
|
|
4849
4860
|
return true;
|
|
4850
4861
|
};
|
|
4851
|
-
$Object
|
|
4862
|
+
$Object.fromRdfResource = (resource, options) => NodeShape.fromRdfResource(resource, {
|
|
4852
4863
|
...options,
|
|
4853
4864
|
ignoreRdfType: false,
|
|
4854
4865
|
})
|
|
4855
|
-
.altLazy(() => Ontology
|
|
4866
|
+
.altLazy(() => Ontology.fromRdfResource(resource, {
|
|
4856
4867
|
...options,
|
|
4857
4868
|
ignoreRdfType: false,
|
|
4858
4869
|
}))
|
|
4859
|
-
.altLazy(() => PropertyGroup
|
|
4870
|
+
.altLazy(() => PropertyGroup.fromRdfResource(resource, {
|
|
4860
4871
|
...options,
|
|
4861
4872
|
ignoreRdfType: false,
|
|
4862
4873
|
}))
|
|
4863
|
-
.altLazy(() => PropertyShape
|
|
4874
|
+
.altLazy(() => PropertyShape.fromRdfResource(resource, {
|
|
4864
4875
|
...options,
|
|
4865
4876
|
ignoreRdfType: false,
|
|
4866
4877
|
}));
|
|
4867
|
-
$Object
|
|
4878
|
+
$Object.fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
|
|
4868
4879
|
const valueAsValues = Right(value.toValues());
|
|
4869
|
-
return NodeShape
|
|
4880
|
+
return NodeShape.fromRdfResourceValues(valueAsValues, {
|
|
4870
4881
|
context: _options.context,
|
|
4871
4882
|
graph: _options.graph,
|
|
4872
4883
|
ignoreRdfType: false,
|
|
@@ -4875,7 +4886,7 @@ export var $Object;
|
|
|
4875
4886
|
propertyPath: _options.propertyPath,
|
|
4876
4887
|
resource: _options.resource,
|
|
4877
4888
|
})
|
|
4878
|
-
.altLazy(() => Ontology
|
|
4889
|
+
.altLazy(() => Ontology.fromRdfResourceValues(valueAsValues, {
|
|
4879
4890
|
context: _options.context,
|
|
4880
4891
|
graph: _options.graph,
|
|
4881
4892
|
ignoreRdfType: false,
|
|
@@ -4884,7 +4895,7 @@ export var $Object;
|
|
|
4884
4895
|
propertyPath: _options.propertyPath,
|
|
4885
4896
|
resource: _options.resource,
|
|
4886
4897
|
}))
|
|
4887
|
-
.altLazy(() => PropertyGroup
|
|
4898
|
+
.altLazy(() => PropertyGroup.fromRdfResourceValues(valueAsValues, {
|
|
4888
4899
|
context: _options.context,
|
|
4889
4900
|
graph: _options.graph,
|
|
4890
4901
|
ignoreRdfType: false,
|
|
@@ -4893,7 +4904,7 @@ export var $Object;
|
|
|
4893
4904
|
propertyPath: _options.propertyPath,
|
|
4894
4905
|
resource: _options.resource,
|
|
4895
4906
|
}))
|
|
4896
|
-
.altLazy(() => PropertyShape
|
|
4907
|
+
.altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
|
|
4897
4908
|
context: _options.context,
|
|
4898
4909
|
graph: _options.graph,
|
|
4899
4910
|
ignoreRdfType: false,
|
|
@@ -4904,23 +4915,23 @@ export var $Object;
|
|
|
4904
4915
|
}))
|
|
4905
4916
|
.chain((values) => values.head());
|
|
4906
4917
|
})));
|
|
4907
|
-
let
|
|
4908
|
-
(function (
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
})(
|
|
4912
|
-
$Object
|
|
4918
|
+
let Identifier;
|
|
4919
|
+
(function (Identifier) {
|
|
4920
|
+
Identifier.parse = $parseIdentifier;
|
|
4921
|
+
Identifier.stringify = NTriplesTerm.stringify;
|
|
4922
|
+
})(Identifier = $Object.Identifier || ($Object.Identifier = {}));
|
|
4923
|
+
$Object.schema = {
|
|
4913
4924
|
kind: "NamedObjectUnion",
|
|
4914
4925
|
members: {
|
|
4915
|
-
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape
|
|
4916
|
-
Ontology: { discriminantValues: ["Ontology"], type: Ontology
|
|
4926
|
+
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.schema },
|
|
4927
|
+
Ontology: { discriminantValues: ["Ontology"], type: Ontology.schema },
|
|
4917
4928
|
PropertyGroup: {
|
|
4918
4929
|
discriminantValues: ["PropertyGroup"],
|
|
4919
|
-
type: PropertyGroup
|
|
4930
|
+
type: PropertyGroup.schema,
|
|
4920
4931
|
},
|
|
4921
4932
|
PropertyShape: {
|
|
4922
4933
|
discriminantValues: ["PropertyShape"],
|
|
4923
|
-
type: PropertyShape
|
|
4934
|
+
type: PropertyShape.schema,
|
|
4924
4935
|
},
|
|
4925
4936
|
},
|
|
4926
4937
|
properties: {
|
|
@@ -4942,25 +4953,25 @@ export var $Object;
|
|
|
4942
4953
|
},
|
|
4943
4954
|
},
|
|
4944
4955
|
};
|
|
4945
|
-
$Object
|
|
4956
|
+
$Object.toRdfResource = (value, options) => {
|
|
4946
4957
|
if (NodeShape.isNodeShape(value)) {
|
|
4947
|
-
return NodeShape
|
|
4958
|
+
return NodeShape.toRdfResource(value, options);
|
|
4948
4959
|
}
|
|
4949
4960
|
if (Ontology.isOntology(value)) {
|
|
4950
|
-
return Ontology
|
|
4961
|
+
return Ontology.toRdfResource(value, options);
|
|
4951
4962
|
}
|
|
4952
4963
|
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4953
|
-
return PropertyGroup
|
|
4964
|
+
return PropertyGroup.toRdfResource(value, options);
|
|
4954
4965
|
}
|
|
4955
4966
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4956
|
-
return PropertyShape
|
|
4967
|
+
return PropertyShape.toRdfResource(value, options);
|
|
4957
4968
|
}
|
|
4958
4969
|
throw new Error("unrecognized type");
|
|
4959
4970
|
};
|
|
4960
|
-
$Object
|
|
4971
|
+
$Object.toRdfResourceValues = ((value, _options) => {
|
|
4961
4972
|
if (NodeShape.isNodeShape(value)) {
|
|
4962
4973
|
return [
|
|
4963
|
-
NodeShape
|
|
4974
|
+
NodeShape.toRdfResource(value, {
|
|
4964
4975
|
graph: _options.graph,
|
|
4965
4976
|
resourceSet: _options.resourceSet,
|
|
4966
4977
|
}).identifier,
|
|
@@ -4968,7 +4979,7 @@ export var $Object;
|
|
|
4968
4979
|
}
|
|
4969
4980
|
if (Ontology.isOntology(value)) {
|
|
4970
4981
|
return [
|
|
4971
|
-
Ontology
|
|
4982
|
+
Ontology.toRdfResource(value, {
|
|
4972
4983
|
graph: _options.graph,
|
|
4973
4984
|
resourceSet: _options.resourceSet,
|
|
4974
4985
|
}).identifier,
|
|
@@ -4976,7 +4987,7 @@ export var $Object;
|
|
|
4976
4987
|
}
|
|
4977
4988
|
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4978
4989
|
return [
|
|
4979
|
-
PropertyGroup
|
|
4990
|
+
PropertyGroup.toRdfResource(value, {
|
|
4980
4991
|
graph: _options.graph,
|
|
4981
4992
|
resourceSet: _options.resourceSet,
|
|
4982
4993
|
}).identifier,
|
|
@@ -4984,7 +4995,7 @@ export var $Object;
|
|
|
4984
4995
|
}
|
|
4985
4996
|
if (PropertyShape.isPropertyShape(value)) {
|
|
4986
4997
|
return [
|
|
4987
|
-
PropertyShape
|
|
4998
|
+
PropertyShape.toRdfResource(value, {
|
|
4988
4999
|
graph: _options.graph,
|
|
4989
5000
|
resourceSet: _options.resourceSet,
|
|
4990
5001
|
}).identifier,
|
|
@@ -4992,28 +5003,13 @@ export var $Object;
|
|
|
4992
5003
|
}
|
|
4993
5004
|
throw new Error("unable to serialize to RDF");
|
|
4994
5005
|
});
|
|
4995
|
-
$Object.$toString = (value) => {
|
|
4996
|
-
if (NodeShape.isNodeShape(value)) {
|
|
4997
|
-
return NodeShape.$toString(value);
|
|
4998
|
-
}
|
|
4999
|
-
if (Ontology.isOntology(value)) {
|
|
5000
|
-
return Ontology.$toString(value);
|
|
5001
|
-
}
|
|
5002
|
-
if (PropertyGroup.isPropertyGroup(value)) {
|
|
5003
|
-
return PropertyGroup.$toString(value);
|
|
5004
|
-
}
|
|
5005
|
-
if (PropertyShape.isPropertyShape(value)) {
|
|
5006
|
-
return PropertyShape.$toString(value);
|
|
5007
|
-
}
|
|
5008
|
-
throw new Error("unable to serialize to string");
|
|
5009
|
-
};
|
|
5010
5006
|
})($Object || ($Object = {}));
|
|
5011
5007
|
export class $RdfjsDatasetObjectSet {
|
|
5012
|
-
$graph;
|
|
5013
5008
|
#dataset;
|
|
5009
|
+
#graph;
|
|
5014
5010
|
constructor(dataset, options) {
|
|
5015
5011
|
this.#dataset = dataset;
|
|
5016
|
-
this
|
|
5012
|
+
this.#graph = options?.graph;
|
|
5017
5013
|
}
|
|
5018
5014
|
$dataset() {
|
|
5019
5015
|
if (typeof this.#dataset === "object") {
|
|
@@ -5053,9 +5049,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5053
5049
|
}
|
|
5054
5050
|
nodeShapesSync(query) {
|
|
5055
5051
|
return this.#objectsSync({
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5052
|
+
filter: NodeShape.filter,
|
|
5053
|
+
fromRdfResource: NodeShape.fromRdfResource,
|
|
5054
|
+
fromRdfTypes: [NodeShape.fromRdfType],
|
|
5059
5055
|
}, query);
|
|
5060
5056
|
}
|
|
5061
5057
|
async ontology(identifier, options) {
|
|
@@ -5084,9 +5080,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5084
5080
|
}
|
|
5085
5081
|
ontologiesSync(query) {
|
|
5086
5082
|
return this.#objectsSync({
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5083
|
+
filter: Ontology.filter,
|
|
5084
|
+
fromRdfResource: Ontology.fromRdfResource,
|
|
5085
|
+
fromRdfTypes: [Ontology.fromRdfType],
|
|
5090
5086
|
}, query);
|
|
5091
5087
|
}
|
|
5092
5088
|
async propertyGroup(identifier, options) {
|
|
@@ -5115,9 +5111,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5115
5111
|
}
|
|
5116
5112
|
propertyGroupsSync(query) {
|
|
5117
5113
|
return this.#objectsSync({
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5114
|
+
filter: PropertyGroup.filter,
|
|
5115
|
+
fromRdfResource: PropertyGroup.fromRdfResource,
|
|
5116
|
+
fromRdfTypes: [PropertyGroup.fromRdfType],
|
|
5121
5117
|
}, query);
|
|
5122
5118
|
}
|
|
5123
5119
|
async propertyShape(identifier, options) {
|
|
@@ -5146,9 +5142,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5146
5142
|
}
|
|
5147
5143
|
propertyShapesSync(query) {
|
|
5148
5144
|
return this.#objectsSync({
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5145
|
+
filter: PropertyShape.filter,
|
|
5146
|
+
fromRdfResource: PropertyShape.fromRdfResource,
|
|
5147
|
+
fromRdfTypes: [PropertyShape.fromRdfType],
|
|
5152
5148
|
}, query);
|
|
5153
5149
|
}
|
|
5154
5150
|
async shape(identifier, options) {
|
|
@@ -5178,14 +5174,14 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5178
5174
|
shapesSync(query) {
|
|
5179
5175
|
return this.#objectUnionsSync([
|
|
5180
5176
|
{
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5177
|
+
filter: Shape.filter,
|
|
5178
|
+
fromRdfResource: NodeShape.fromRdfResource,
|
|
5179
|
+
fromRdfTypes: [NodeShape.fromRdfType],
|
|
5184
5180
|
},
|
|
5185
5181
|
{
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5182
|
+
filter: Shape.filter,
|
|
5183
|
+
fromRdfResource: PropertyShape.fromRdfResource,
|
|
5184
|
+
fromRdfTypes: [PropertyShape.fromRdfType],
|
|
5189
5185
|
},
|
|
5190
5186
|
], query);
|
|
5191
5187
|
}
|
|
@@ -5216,29 +5212,29 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5216
5212
|
$objectsSync(query) {
|
|
5217
5213
|
return this.#objectUnionsSync([
|
|
5218
5214
|
{
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5215
|
+
filter: $Object.filter,
|
|
5216
|
+
fromRdfResource: NodeShape.fromRdfResource,
|
|
5217
|
+
fromRdfTypes: [NodeShape.fromRdfType],
|
|
5222
5218
|
},
|
|
5223
5219
|
{
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5220
|
+
filter: $Object.filter,
|
|
5221
|
+
fromRdfResource: Ontology.fromRdfResource,
|
|
5222
|
+
fromRdfTypes: [Ontology.fromRdfType],
|
|
5227
5223
|
},
|
|
5228
5224
|
{
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5225
|
+
filter: $Object.filter,
|
|
5226
|
+
fromRdfResource: PropertyGroup.fromRdfResource,
|
|
5227
|
+
fromRdfTypes: [PropertyGroup.fromRdfType],
|
|
5232
5228
|
},
|
|
5233
5229
|
{
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5230
|
+
filter: $Object.filter,
|
|
5231
|
+
fromRdfResource: PropertyShape.fromRdfResource,
|
|
5232
|
+
fromRdfTypes: [PropertyShape.fromRdfType],
|
|
5237
5233
|
},
|
|
5238
5234
|
], query);
|
|
5239
5235
|
}
|
|
5240
5236
|
#objectsSync(namedObjectType, query) {
|
|
5241
|
-
const graph = query?.graph ?? this
|
|
5237
|
+
const graph = query?.graph ?? this.#graph;
|
|
5242
5238
|
const limit = query?.limit ?? Number.MAX_SAFE_INTEGER;
|
|
5243
5239
|
if (limit <= 0) {
|
|
5244
5240
|
return Right([]);
|
|
@@ -5261,11 +5257,11 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5261
5257
|
}));
|
|
5262
5258
|
sortResources = false;
|
|
5263
5259
|
}
|
|
5264
|
-
else if (namedObjectType
|
|
5260
|
+
else if (namedObjectType.fromRdfTypes.length > 0) {
|
|
5265
5261
|
const identifierSet = new $IdentifierSet();
|
|
5266
5262
|
resources = [];
|
|
5267
5263
|
sortResources = true;
|
|
5268
|
-
for (const fromRdfType of namedObjectType
|
|
5264
|
+
for (const fromRdfType of namedObjectType.fromRdfTypes) {
|
|
5269
5265
|
for (const resource of resourceSet.instancesOf(fromRdfType, {
|
|
5270
5266
|
graph,
|
|
5271
5267
|
})) {
|
|
@@ -5298,7 +5294,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5298
5294
|
const resource = resourceSet.resource(quad.subject);
|
|
5299
5295
|
// Eagerly eliminate the majority of resources that won't match the object type
|
|
5300
5296
|
namedObjectType
|
|
5301
|
-
|
|
5297
|
+
.fromRdfResource(resource, fromRdfResourceOptions)
|
|
5302
5298
|
.ifRight((object) => {
|
|
5303
5299
|
resources.push({ object, resource });
|
|
5304
5300
|
});
|
|
@@ -5312,13 +5308,13 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5312
5308
|
const objects = [];
|
|
5313
5309
|
for (let { object, resource } of resources) {
|
|
5314
5310
|
if (!object) {
|
|
5315
|
-
const objectEither = namedObjectType
|
|
5311
|
+
const objectEither = namedObjectType.fromRdfResource(resource, fromRdfResourceOptions);
|
|
5316
5312
|
if (objectEither.isLeft()) {
|
|
5317
5313
|
return objectEither;
|
|
5318
5314
|
}
|
|
5319
5315
|
object = objectEither.unsafeCoerce();
|
|
5320
5316
|
}
|
|
5321
|
-
if (query?.filter && !namedObjectType
|
|
5317
|
+
if (query?.filter && !namedObjectType.filter(query.filter, object)) {
|
|
5322
5318
|
continue;
|
|
5323
5319
|
}
|
|
5324
5320
|
if (objectI++ >= offset) {
|
|
@@ -5331,7 +5327,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5331
5327
|
return Right(objects);
|
|
5332
5328
|
}
|
|
5333
5329
|
#objectUnionsSync(namedObjectTypes, query) {
|
|
5334
|
-
const graph = query?.graph ?? this
|
|
5330
|
+
const graph = query?.graph ?? this.#graph;
|
|
5335
5331
|
const limit = query?.limit ?? Number.MAX_SAFE_INTEGER;
|
|
5336
5332
|
if (limit <= 0) {
|
|
5337
5333
|
return Right([]);
|
|
@@ -5354,12 +5350,12 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5354
5350
|
}));
|
|
5355
5351
|
sortResources = false;
|
|
5356
5352
|
}
|
|
5357
|
-
else if (namedObjectTypes.every((namedObjectType) => namedObjectType
|
|
5353
|
+
else if (namedObjectTypes.every((namedObjectType) => namedObjectType.fromRdfTypes.length > 0)) {
|
|
5358
5354
|
const identifierSet = new $IdentifierSet();
|
|
5359
5355
|
resources = [];
|
|
5360
5356
|
sortResources = true;
|
|
5361
5357
|
for (const namedObjectType of namedObjectTypes) {
|
|
5362
|
-
for (const fromRdfType of namedObjectType
|
|
5358
|
+
for (const fromRdfType of namedObjectType.fromRdfTypes) {
|
|
5363
5359
|
for (const resource of resourceSet.instancesOf(fromRdfType, {
|
|
5364
5360
|
graph,
|
|
5365
5361
|
})) {
|
|
@@ -5394,7 +5390,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5394
5390
|
const resource = resourceSet.resource(quad.subject);
|
|
5395
5391
|
for (const namedObjectType of namedObjectTypes) {
|
|
5396
5392
|
if (namedObjectType
|
|
5397
|
-
|
|
5393
|
+
.fromRdfResource(resource, fromRdfResourceOptions)
|
|
5398
5394
|
.ifRight((object) => {
|
|
5399
5395
|
resources.push({ object, namedObjectType, resource });
|
|
5400
5396
|
})
|
|
@@ -5414,12 +5410,12 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5414
5410
|
if (!object) {
|
|
5415
5411
|
let objectEither;
|
|
5416
5412
|
if (namedObjectType) {
|
|
5417
|
-
objectEither = namedObjectType
|
|
5413
|
+
objectEither = namedObjectType.fromRdfResource(resource, fromRdfResourceOptions);
|
|
5418
5414
|
}
|
|
5419
5415
|
else {
|
|
5420
5416
|
objectEither = Left(new Error("no object types"));
|
|
5421
5417
|
for (const tryObjectType of namedObjectTypes) {
|
|
5422
|
-
objectEither = tryObjectType
|
|
5418
|
+
objectEither = tryObjectType.fromRdfResource(resource, fromRdfResourceOptions);
|
|
5423
5419
|
if (objectEither.isRight()) {
|
|
5424
5420
|
namedObjectType = tryObjectType;
|
|
5425
5421
|
break;
|
|
@@ -5434,7 +5430,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
5434
5430
|
if (!namedObjectType) {
|
|
5435
5431
|
throw new Error("namedObjectType should be set here");
|
|
5436
5432
|
}
|
|
5437
|
-
if (query?.filter && !namedObjectType
|
|
5433
|
+
if (query?.filter && !namedObjectType.filter(query.filter, object)) {
|
|
5438
5434
|
continue;
|
|
5439
5435
|
}
|
|
5440
5436
|
if (objectI++ >= offset) {
|