n3 1.23.0 → 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/N3Parser.js +40 -46
- package/lib/N3Store.js +20 -18
- package/package.json +3 -3
- package/src/N3Parser.js +42 -47
- package/src/N3Store.js +19 -18
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
|
}
|