Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

n3

Package Overview
Dependencies
Maintainers
2
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n3 - npm Package Compare versions

Comparing version 1.22.2 to 1.22.3

30

lib/N3Store.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc