# Everything barnard59-rdf declares in RDF: operations and CLI commands
# https://barnard59.zazuko.com/packages/rdf

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

<https://barnard59.zazuko.com/operations/rdf/fs.js#parse> a p:Operation, p:ReadableObjectMode;
  rdfs:comment "Opens and parses an RDF file, choosing the correct parser based on the extension";
  rdfs:label "Parse RDF file";
  code:implementedBy [ a code:EcmaScriptModule;
      code:link <node:barnard59-rdf/fs.js#parse>
    ].

<https://barnard59.zazuko.com/operations/rdf/getDataset> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "The entire RDF stream is combined into a single dataset";
  rdfs:label "Combine RDF stream to dataset";
  code:implementedBy [ a code:EcmaScript;
      code:link <node:rdf-stream-to-dataset-stream/toDatasetStream.js>
    ].

<https://barnard59.zazuko.com/operations/rdf/mapMatch> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Calls a map function only for quads matching the given triple pattern.";
  rdfs:label "Map (RDF/JS Quad)";
  code:implementedBy [ a code:EcmaScriptModule;
      code:link <node:barnard59-rdf/mapMatch.js#default>
    ].

<https://barnard59.zazuko.com/operations/rdf/metadata.js#append> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Fetches, updates and appends a metadata resource";
  rdfs:label "Append metadata";
  code:implementedBy [ a code:EcmaScriptModule;
      code:link <node:barnard59-rdf/metadata.js#append>
    ].

<https://barnard59.zazuko.com/operations/rdf/metadata.js#voidStats> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Appends void statistics, such as counts for entities and properties";
  rdfs:label "Void statistics";
  code:implementedBy [ a code:EcmaScriptModule;
      code:link <node:barnard59-rdf/metadata.js#voidStats>
    ].

<https://barnard59.zazuko.com/operations/rdf/open> a p:Operation, p:ReadableObjectMode;
  rdfs:comment "Web resource requires content-type header. Will try n-triples as fallback. Local paths will be relative to the current working directory";
  rdfs:label "Opens an RDF from web or local file";
  code:implementedBy [ a code:EcmaScriptModule;
      code:link <node:barnard59-rdf/open.js#default>
    ].

<https://barnard59.zazuko.com/operations/rdf/setGraph> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Sets the graph of all quads to the given fixed value.";
  rdfs:label "Set Graph";
  code:implementedBy [ a code:EcmaScriptModule;
      code:link <node:barnard59-rdf/setGraph.js#default>
    ].

<https://barnard59.zazuko.com/operations/rdf/splitDataset/byGraph> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Combines streamed quads into datasets. A new dataset is pushed when graph changes";
  rdfs:label "Splits RDF stream on graph";
  code:implementedBy [ a code:EcmaScript;
      code:link <node:rdf-stream-to-dataset-stream/byGraph.js>
    ].

<https://barnard59.zazuko.com/operations/rdf/splitDataset/byPredicate> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Combines streamed quads into datasets. A new dataset is pushed when predicate changes";
  rdfs:label "Splits RDF stream on predicate";
  code:implementedBy [ a code:EcmaScript;
      code:link <node:rdf-stream-to-dataset-stream/byPredicate.js>
    ].

<https://barnard59.zazuko.com/operations/rdf/splitDataset/bySubject> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Combines streamed quads into datasets. A new dataset is pushed when subject changes";
  rdfs:label "Splits RDF stream on subject";
  code:implementedBy [ a code:EcmaScript;
      code:link <node:rdf-stream-to-dataset-stream/bySubject.js>
    ].

<https://barnard59.zazuko.com/operations/rdf/splitDataset/byType> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:comment "Combines streamed quads into datasets. A new dataset is pushed when an rdf:type triple is encountered";
  rdfs:label "Splits RDF stream by RDF type";
  code:implementedBy [ a code:EcmaScript;
      code:link <node:rdf-stream-to-dataset-stream/byType.js>
    ].

<https://barnard59.zazuko.com/operations/rdf/transformCodeImports> a p:Operation, p:ReadableObjectMode, p:WritableObjectMode;
  rdfs:label "Transforms code:imports triples by fetching remote graphs and mergin them with the passing stream";
  code:implementedBy [ a code:EcmaScriptModule;
      code:link <node:barnard59-rdf/imports.js#default>
    ].
