Skip to content
Ruben Verborgh edited this page Mar 11, 2016 · 1 revision

A proposal by @RubenVerborgh.

Interface Stream

extends EventEmitter

  • void stream.on('readable', function () {})

  • void stream.on('end', function () {})

  • Quad stream.read()

And additionally

  • void stream.on('data', function (Quad quad) {})

which simply reads the stream on readable and emits quads.

Stream can have convenience methods like

  • Stream stream.filter(function (Quad quad) {})

(I have a library for this that is 99% ready.)

Source

  • Stream source.find(Node subject, Node predicate, Node object, Node graph)

Sink

  • void sink.read(Stream stream)