rdf-streaming-store
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -65,5 +65,5 @@ "use strict"; | ||
} | ||
exports.PendingStreamsIndex = PendingStreamsIndex; | ||
PendingStreamsIndex.ID_VARIABLE = '?'; | ||
PendingStreamsIndex.ID_SEPARATOR = ':'; | ||
exports.PendingStreamsIndex = PendingStreamsIndex; | ||
//# sourceMappingURL=PendingStreamsIndex.js.map |
@@ -6,2 +6,5 @@ /// <reference types="node" /> | ||
import { PendingStreamsIndex } from './PendingStreamsIndex'; | ||
interface ILocalStore<Q extends RDF.BaseQuad> extends RDF.Store<Q> { | ||
countQuads: (subject: RDF.Term | null, predicate: RDF.Term | null, object: RDF.Term | null, graph: RDF.Term | null) => number; | ||
} | ||
/** | ||
@@ -16,3 +19,3 @@ * A StreamingStore allows data lookup and insertion to happen in parallel. | ||
*/ | ||
export declare class StreamingStore<Q extends RDF.BaseQuad = RDF.Quad, S extends RDF.Store<Q> = Store<Q>> implements RDF.Source<Q>, RDF.Sink<RDF.Stream<Q>, EventEmitter> { | ||
export declare class StreamingStore<Q extends RDF.BaseQuad = RDF.Quad, S extends ILocalStore<Q> = Store<Q>> implements RDF.Source<Q>, RDF.Sink<RDF.Stream<Q>, EventEmitter> { | ||
protected readonly store: S; | ||
@@ -37,1 +40,2 @@ protected readonly pendingStreams: PendingStreamsIndex<Q>; | ||
} | ||
export {}; |
@@ -38,4 +38,4 @@ "use strict"; | ||
stream.on('data', (quad) => { | ||
for (const pendingStream of this.pendingStreams.getPendingStreamsForQuad(quad)) { | ||
if (!this.ended) { | ||
if (!this.ended && !this.store.countQuads(quad.subject, quad.predicate, quad.object, quad.graph)) { | ||
for (const pendingStream of this.pendingStreams.getPendingStreamsForQuad(quad)) { | ||
pendingStream.push(quad); | ||
@@ -42,0 +42,0 @@ pendingStream.emit('quad', quad); |
{ | ||
"name": "rdf-streaming-store", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "A read-only RDF/JS store that allows parallel data lookup and insertion.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
28182
224