Skip to main content

Module programs

Module programs 

Source
Expand description

Role-specific execution traits and command-line configuration values.

Each trait is a marker extending Execute. It identifies the intended operation but adds no constructor, input parameter, or runtime validation. T is the result type; the implementation chooses the associated Error type. Bounds can constrain it with, for example, Fetcher<T, Error = E>. Indexer has no type parameters and uses () for its result; its error can likewise be constrained with Indexer<Error = E>.

§Pattern catalog

TraitLogical inputLogical outputOptions
AdapterSPARQL queryRDF query resultAdapterOptions
CompilerNatural-language textSPARQL queryCompilerOptions
EmitterNoneGenerated RDFEmitterOptions
FetcherOne URLRDF describing the resourceFetcherOptions
IndexerRDFNone; updates a persistent indexIndexerOptions
ListerOne collection URLRDF describing zero or more entriesListerOptions
MatcherRDFRDF describing matchesMatcherOptions
PrompterPrompt textResponse textPrompterOptions
ReaderDocument or byte streamImported RDFReaderOptions
ReasonerRDFEntailed RDFReasonerOptions
ResolverOne URIZero or more URLsResolverOptions
RunnerProgram textExecution result as textRunnerOptions
WriterRDFExported document or byte streamWriterOptions

All thirteen patterns in the specification have corresponding traits here and process wrappers in asimov-runner. RDF in this table denotes graphs or datasets, not individual statements, records, or buffers.

§Results and streaming

These traits prescribe semantic roles, not buffering, stream types, or process management. A streaming implementation must distinguish successful startup from eventual completion and expose later errors through its result. Receiving output alone does not establish success; see Execute.

Concrete behavior is documented in asimov-runner: consult its execution and results section for result types, input ownership, output routing, and cancellation; completion outcomes for error precedence; and JSONL transport for graph framing, batching, and composition. The runner’s linear pipelines connect compatible process-backed programs and coordinate their completion independently of these marker traits.

§Native capabilities

ListerCapabilities describes optional native sorting, numeric offset, URI cursor (before/after), and limit support separately from the requests in ListerOptions. Each capability uses OptionSupport: unknown, supported, or unsupported. Callers can translate manifest metadata into these values without this crate depending on a manifest schema. Capabilities do not imply host emulation; forwarding and fallback policies are documented by the concrete executor.

§Options and defaults

Every options type supports Default, direct field access, and a builder(). Defaults leave optional fields unset and collections empty; builders accept values convertible to String for string fields. Values are stored without checking whether the selected program supports them.

The companion asimov-runner wrappers emit configured fields as individual --name=value arguments according to supplied capabilities. Hosts may enforce a limit instead of forwarding an unsupported flag, and may also enforce it independently to protect against program bugs. None omits an option rather than supplying an empty value. Programs apply these defaults:

PatternsInput formatOutput formatOther defaults
Adapter, emitter, fetcherNo input-format optionjsonl
CompilerNo input-format optionNo output-format optionNo pattern-specific options
IndexerjsonlNo output-format optionIndex destination required
ListerNo input-format optionjsonlNo limit or cursor bounds; offset 0; program-defined order
Matcher, reasonerjsonljsonl
PromptertexttextModel auto
Readerautojsonl
ResolverNo input-format optionNo output-format optionNo limit
RunnerNo input-format optionNo output-format optionNo definitions
Writerjsonlauto

text means UTF-8 without a standardized chat envelope. auto delegates format detection or selection to the program. jsonl needs a documented RDF mapping profile shared by producer and consumer. Setting a format option does not encode, decode, or convert any bytes in this crate.

§Additional arguments and files

Each other vector is an ordered argument list, not a shell command. The runner appends its entries after generated options and before a dedicated URL or URI operand. Each entry is passed verbatim as one argument: use two entries for --name value, or one for --name=value. Do not add shell quotes or redirection syntax. Repeated builder other(...) calls append; the maybe_other(...) helpers append only Some values.

Additional arguments can supply documented extensions or positional files. Keep options before operands; use -- to end option parsing when a filename begins with -. Avoid repeating singleton options already set in fields: precedence is program-defined, so other is not an override mechanism.

Format selection and file selection are separate. For patterns with optional input/output files, no operands select stdin/stdout, one operand selects the input file, and two select input then output. To read stdin and write a file, supply - followed by the output path. An indexer instead requires its final operand to name the persistent index. See each trait’s synopsis for the applicable operand rules.

A named input file replaces stdin as the payload source, and a named output file replaces stdout as the destination. Consult the concrete invocation API for file selection and stream-routing behavior; see the runner’s file operands.

Structs§

AdapterOptions
Output-format selection and additional arguments for an Adapter.
AdapterOptionsBuilder
Use builder syntax to set the inputs and finish with build().
CompilerOptions
Additional arguments and an optional input file for a Compiler.
CompilerOptionsBuilder
Use builder syntax to set the inputs and finish with build().
EmitterOptions
Output-format selection and additional arguments for an Emitter.
EmitterOptionsBuilder
Use builder syntax to set the inputs and finish with build().
FetcherOptions
Output-format selection and additional arguments for a Fetcher.
FetcherOptionsBuilder
Use builder syntax to set the inputs and finish with build().
IndexerOptions
Input-format selection and additional arguments for an Indexer.
IndexerOptionsBuilder
Use builder syntax to set the inputs and finish with build().
ListerCapabilities
Declared native support for a lister program’s optional operations.
ListerCapabilitiesBuilder
Use builder syntax to set the inputs and finish with build().
ListerOptions
Output-format and pagination requests for a Lister.
ListerOptionsBuilder
Use builder syntax to set the inputs and finish with build().
MatcherOptions
Input/output formats and additional arguments for a Matcher.
MatcherOptionsBuilder
Use builder syntax to set the inputs and finish with build().
PrompterOptions
Prompt/response formats and inference-model selection for a Prompter.
PrompterOptionsBuilder
Use builder syntax to set the inputs and finish with build().
ReaderOptions
Source and RDF output formats for a Reader, plus additional arguments.
ReaderOptionsBuilder
Use builder syntax to set the inputs and finish with build().
ReasonerOptions
RDF input/output formats and additional arguments for a Reasoner.
ReasonerOptionsBuilder
Use builder syntax to set the inputs and finish with build().
ResolverOptions
Result-count selection and additional arguments for a Resolver.
ResolverOptionsBuilder
Use builder syntax to set the inputs and finish with build().
RunnerOptions
Runtime variable definitions and additional arguments for a Runner.
RunnerOptionsBuilder
Use builder syntax to set the inputs and finish with build().
WriterOptions
RDF input and export formats for a Writer, plus additional arguments.
WriterOptionsBuilder
Use builder syntax to set the inputs and finish with build().

Traits§

Adapter
An RDF dataset proxy that evaluates a SPARQL query and produces RDF.
Compiler
A prompt compiler that translates natural-language text into one SPARQL query.
Emitter
A value generator that produces RDF without consuming a payload input.
Fetcher
A URL protocol client that retrieves one resource and represents it as RDF.
Indexer
An RDF consumer that creates or updates a persistent index without payload output.
Lister
A directory or collection iterator that describes its entries as RDF.
Matcher
An exact or approximate matcher that consumes RDF and describes matches as RDF.
Prompter
A language-model inference provider that turns a prompt into a response.
Reader
An importer that maps a document or byte stream into an RDF graph or dataset.
Reasoner
An RDF entailer that derives consequences under a documented regime or rule system.
Resolver
A URI resolver that identifies zero or more resource locations as URLs.
Runner
A language runtime that executes program text and emits its result as text.
Writer
An exporter that converts an RDF graph or dataset into a supported representation.