n3 1.23.1 → 1.23.2
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/browser/n3.min.js +1 -1
- package/lib/N3Store.js +20 -18
- package/package.json +2 -2
- package/src/N3Store.js +19 -18
package/lib/N3Store.js
CHANGED
|
@@ -1083,26 +1083,28 @@ class DatasetCoreAndReadableStream extends _readableStream.Readable {
|
|
|
1083
1083
|
if (subject && !(subjectId = newStore._termToNumericId(subject)) || predicate && !(predicateId = newStore._termToNumericId(predicate)) || object && !(objectId = newStore._termToNumericId(object))) return newStore;
|
|
1084
1084
|
const graphs = n3Store._getGraphs(graph);
|
|
1085
1085
|
for (const graphKey in graphs) {
|
|
1086
|
-
let subjects, predicates, objects;
|
|
1087
|
-
if (
|
|
1088
|
-
if (
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1086
|
+
let subjects, predicates, objects, content;
|
|
1087
|
+
if (content = graphs[graphKey]) {
|
|
1088
|
+
if (!subjectId && predicateId) {
|
|
1089
|
+
if (predicates = indexMatch(content.predicates, [predicateId, objectId, subjectId])) {
|
|
1090
|
+
subjects = indexMatch(content.subjects, [subjectId, predicateId, objectId]);
|
|
1091
|
+
objects = indexMatch(content.objects, [objectId, subjectId, predicateId]);
|
|
1092
|
+
}
|
|
1093
|
+
} else if (objectId) {
|
|
1094
|
+
if (objects = indexMatch(content.objects, [objectId, subjectId, predicateId])) {
|
|
1095
|
+
subjects = indexMatch(content.subjects, [subjectId, predicateId, objectId]);
|
|
1096
|
+
predicates = indexMatch(content.predicates, [predicateId, objectId, subjectId]);
|
|
1097
|
+
}
|
|
1098
|
+
} else if (subjects = indexMatch(content.subjects, [subjectId, predicateId, objectId])) {
|
|
1099
|
+
predicates = indexMatch(content.predicates, [predicateId, objectId, subjectId]);
|
|
1100
|
+
objects = indexMatch(content.objects, [objectId, subjectId, predicateId]);
|
|
1096
1101
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1102
|
+
if (subjects) newStore._graphs[graphKey] = {
|
|
1103
|
+
subjects,
|
|
1104
|
+
predicates,
|
|
1105
|
+
objects
|
|
1106
|
+
};
|
|
1100
1107
|
}
|
|
1101
|
-
if (subjects) newStore._graphs[graphKey] = {
|
|
1102
|
-
subjects,
|
|
1103
|
-
predicates,
|
|
1104
|
-
objects
|
|
1105
|
-
};
|
|
1106
1108
|
}
|
|
1107
1109
|
newStore._size = null;
|
|
1108
1110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n3",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.2",
|
|
4
4
|
"description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.",
|
|
5
5
|
"author": "Ruben Verborgh <ruben.verborgh@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint-plugin-jest": "^28.8.3",
|
|
44
44
|
"jest": "^29.7.0",
|
|
45
45
|
"pre-commit": "^1.2.2",
|
|
46
|
-
"rdf-isomorphic": "^
|
|
46
|
+
"rdf-isomorphic": "^2.0.0",
|
|
47
47
|
"rdf-test-suite": "^1.25.0",
|
|
48
48
|
"streamify-string": "^1.0.1",
|
|
49
49
|
"uglify-js": "^3.14.3"
|
package/src/N3Store.js
CHANGED
|
@@ -1134,27 +1134,28 @@ class DatasetCoreAndReadableStream extends Readable {
|
|
|
1134
1134
|
|
|
1135
1135
|
const graphs = n3Store._getGraphs(graph);
|
|
1136
1136
|
for (const graphKey in graphs) {
|
|
1137
|
-
let subjects, predicates, objects;
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1137
|
+
let subjects, predicates, objects, content;
|
|
1138
|
+
if (content = graphs[graphKey]) {
|
|
1139
|
+
if (!subjectId && predicateId) {
|
|
1140
|
+
if (predicates = indexMatch(content.predicates, [predicateId, objectId, subjectId])) {
|
|
1141
|
+
subjects = indexMatch(content.subjects, [subjectId, predicateId, objectId]);
|
|
1142
|
+
objects = indexMatch(content.objects, [objectId, subjectId, predicateId]);
|
|
1143
|
+
}
|
|
1143
1144
|
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1145
|
+
else if (objectId) {
|
|
1146
|
+
if (objects = indexMatch(content.objects, [objectId, subjectId, predicateId])) {
|
|
1147
|
+
subjects = indexMatch(content.subjects, [subjectId, predicateId, objectId]);
|
|
1148
|
+
predicates = indexMatch(content.predicates, [predicateId, objectId, subjectId]);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
else if (subjects = indexMatch(content.subjects, [subjectId, predicateId, objectId])) {
|
|
1152
|
+
predicates = indexMatch(content.predicates, [predicateId, objectId, subjectId]);
|
|
1153
|
+
objects = indexMatch(content.objects, [objectId, subjectId, predicateId]);
|
|
1149
1154
|
}
|
|
1150
|
-
}
|
|
1151
|
-
else if (subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId])) {
|
|
1152
|
-
predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]);
|
|
1153
|
-
objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]);
|
|
1154
|
-
}
|
|
1155
1155
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1156
|
+
if (subjects)
|
|
1157
|
+
newStore._graphs[graphKey] = { subjects, predicates, objects };
|
|
1158
|
+
}
|
|
1158
1159
|
}
|
|
1159
1160
|
newStore._size = null;
|
|
1160
1161
|
}
|