Comparing version 1.22.2 to 1.22.3
@@ -1080,3 +1080,2 @@ "use strict"; | ||
}); | ||
const graphs = n3Store._getGraphs(graph); | ||
let subjectId, predicateId, objectId; | ||
@@ -1086,11 +1085,24 @@ | ||
if (subject && !(subjectId = newStore._termToNumericId(subject)) || predicate && !(predicateId = newStore._termToNumericId(predicate)) || object && !(objectId = newStore._termToNumericId(object))) return newStore; | ||
for (const graph in graphs) { | ||
const subjects = indexMatch(graphs[graph].subjects, [subjectId, predicateId, objectId]); | ||
if (subjects) { | ||
newStore._graphs[graph] = { | ||
subjects, | ||
predicates: indexMatch(graphs[graph].predicates, [predicateId, objectId, subjectId]), | ||
objects: indexMatch(graphs[graph].objects, [objectId, subjectId, predicateId]) | ||
}; | ||
const graphs = n3Store._getGraphs(graph); | ||
for (const graphKey in graphs) { | ||
let subjects, predicates, objects; | ||
if (!subjectId && predicateId) { | ||
if (predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId])) { | ||
subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]); | ||
objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]); | ||
} | ||
} else if (objectId) { | ||
if (objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId])) { | ||
subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]); | ||
predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]); | ||
} | ||
} else if (subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId])) { | ||
predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]); | ||
objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]); | ||
} | ||
if (subjects) newStore._graphs[graphKey] = { | ||
subjects, | ||
predicates, | ||
objects | ||
}; | ||
} | ||
@@ -1097,0 +1109,0 @@ newStore._size = null; |
{ | ||
"name": "n3", | ||
"version": "1.22.2", | ||
"version": "1.22.3", | ||
"description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.", | ||
@@ -5,0 +5,0 @@ "author": "Ruben Verborgh <ruben.verborgh@gmail.com>", |
@@ -1126,3 +1126,2 @@ // **N3Store** objects store N3 quads by graph in memory. | ||
const newStore = this._filtered = new N3Store({ factory: n3Store._factory, entityIndex: this.options.entityIndex }); | ||
const graphs = n3Store._getGraphs(graph); | ||
@@ -1137,11 +1136,25 @@ let subjectId, predicateId, objectId; | ||
for (const graph in graphs) { | ||
const subjects = indexMatch(graphs[graph].subjects, [subjectId, predicateId, objectId]); | ||
if (subjects) { | ||
newStore._graphs[graph] = { | ||
subjects, | ||
predicates: indexMatch(graphs[graph].predicates, [predicateId, objectId, subjectId]), | ||
objects: indexMatch(graphs[graph].objects, [objectId, subjectId, predicateId]), | ||
}; | ||
const graphs = n3Store._getGraphs(graph); | ||
for (const graphKey in graphs) { | ||
let subjects, predicates, objects; | ||
if (!subjectId && predicateId) { | ||
if (predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId])) { | ||
subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]); | ||
objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]); | ||
} | ||
} | ||
else if (objectId) { | ||
if (objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId])) { | ||
subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]); | ||
predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]); | ||
} | ||
} | ||
else if (subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId])) { | ||
predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]); | ||
objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]); | ||
} | ||
if (subjects) | ||
newStore._graphs[graphKey] = { subjects, predicates, objects }; | ||
} | ||
@@ -1148,0 +1161,0 @@ newStore._size = null; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
598724
8693