@base <https://barnard59.zazuko.com/operations/base/> .
@prefix code: <https://code.described.at/> .
@prefix p: <https://pipeline.described.at/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<combine> a p:Operation, p:Writable, p:Readable;
  rdfs:label "Combine";
  rdfs:comment "Combines multiple streams to a single stream connecting them in the given order.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/combine.js#default>
  ].

<concat> a p:Operation, p:Readable;
  rdfs:label "Concat";
  rdfs:comment "Concatenates the content of the given streams to a single stream.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/concat.js#default>
  ].

<concat/object> a p:Operation, p:ReadableObjectMode;
  rdfs:label "Concat (Object)";
  rdfs:comment "Concatenates the content of the given streams to a single stream.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/concat.js#object>
  ].

<filter> a p:Operation, p:WritableObjectMode, p:ReadableObjectMode;
  rdfs:label "Filter";
  rdfs:comment "Forwards incoming chunks if they pass the filter function.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/filter.js#default>
  ].

<batch> a p:Operation, p:WritableObjectMode, p:ReadableObjectMode;
  rdfs:label "Batch";
  rdfs:comment "Groups incoming items into arrays of the given size.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/batch.js#default>
  ].

<flatten> a p:Operation, p:WritableObjectMode, p:ReadableObjectMode;
  rdfs:label "Flatten";
  rdfs:comment "Separates incoming arrays into their elements and emits each element as a single chunk.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/flatten.js#default>
  ].

<forEach> a p:Operation, p:WritableObjectMode, p:ReadableObjectMode;
  rdfs:label "For Each";
  rdfs:comment "Calls a sub pipeline for each incoming chunk.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/forEach.js#default>
  ].

<glob> a p:Operation, p:ReadableObjectMode;
  rdfs:label "Glob";
  rdfs:comment "Match files using the given pattern and emits each filename as a single chunk.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/glob.js#default>
  ].

<json/parse> a p:Operation, p:Writable, p:ReadableObjectMode;
  rdfs:label "Parse JSON";
  rdfs:comment "Converts each chunk to an object by calling JSON.parse().";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/json.js#parse>
  ].

<json/stringify> a p:Operation, p:WritableObjectMode, p:Readable;
  rdfs:label "Serialize JSON";
  rdfs:comment "Converts each chunk to a JSON string by calling JSON.stringify().";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/json.js#stringify>
  ].

<limit> a p:Operation, p:WritableObjectMode, p:ReadableObjectMode;
  rdfs:label "Limit";
  rdfs:comment "Limits the amount of forwarded chunks and discards any chunks after reaching the limit.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/limit.js#default>
  ].

<map> a p:Operation, p:WritableObjectMode, p:ReadableObjectMode;
  rdfs:label "Map";
  rdfs:comment "Converts each chunk using the given function.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/map.js#default>
  ].

<nul> a p:Operation, p:WritableObjectMode;
  rdfs:label "/dev/null";
  rdfs:comment "Dummy output stream, just like /dev/null.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/dev-nul.js#default>
  ].

<offset> a p:Operation, p:WritableObjectMode, p:ReadableObjectMode;
  rdfs:label "Offset";
  rdfs:comment "Discards all chunks before the given offset.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/offset.js#default>
  ].

<stdout> a p:Operation, p:Writable, p:Readable;
  rdfs:label "stdout";
  rdfs:comment "Writes the incoming data to stdout and also forwards the data to the stream output.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/process.js#stdout>
  ].

<stdin> a p:Operation, p:Writable, p:Readable;
  rdfs:label "stdin";
  rdfs:comment "Reads from standard input";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/process.js#stdin>
  ].

<toString> a p:Operation, p:WritableObjectMode, p:Readable;
  rdfs:label "To String";
  rdfs:comment "Converts each chunk to a string by calling .toString().";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/toString.js#default>
  ].

<streamValues> a p:Operation, p:ReadableObjectMode;
  rdfs:label "Stream values";
  rdfs:comment "Creates a readable stream from the given array.";
  code:implementedBy [ a code:EcmaScriptModule;
    code:link <node:barnard59-base/Readable.js#from>
  ].
