Problem
PipelineOptions.stages is a fixed Stage[]: every selected dataset runs the same stages. The LODA pipeline (netwerk-digitaal-erfgoed/loda-pipeline#17) transforms six schema.org datasets to EDM in one run. All six share a generic stage set. denbosch also needs a compensator stage that lifts its source to schema.org first.
Today LODA runs one Pipeline per dataset: one process each, with no writer run or reporter shared between them.
Proposal
Accept a function of the dataset, as Stage.sourceFor already does for the distribution:
stages: Stage<Out>[] | ((dataset: Dataset) => Stage<Out>[] | Promise<Stage<Out>[]>);
A plain array keeps its current meaning, so this is not a breaking change.
Open questions
Problem
PipelineOptions.stagesis a fixedStage[]: every selected dataset runs the same stages. The LODA pipeline (netwerk-digitaal-erfgoed/loda-pipeline#17) transforms six schema.org datasets to EDM in one run. All six share a generic stage set. denbosch also needs a compensator stage that lifts its source to schema.org first.Today LODA runs one
Pipelineper dataset: one process each, with no writer run or reporter shared between them.Proposal
Accept a function of the dataset, as
Stage.sourceForalready does for the distribution:A plain array keeps its current meaning, so this is not a breaking change.
Open questions
chainingis set when a stage has sub-stages. With a function that check moves to the point where the stages are resolved.