pub struct Adapter { /* private fields */ }std only.Expand description
An external adapter that proxies an RDF dataset using SPARQL queries.
The SPARQL query is passed to stdin as bytes, relying on the pattern’s default
query-file argument of -. The external program evaluates the query and
emits RDF as JSONL lines. Execution uses the concurrent streaming and
stream-handling behavior described in crate::programs.
Implementations§
Source§impl Adapter
impl Adapter
Sourcepub fn new(
program: impl AsRef<OsStr>,
input: QueryInput,
output: GraphOutput,
options: AdapterOptions,
) -> Self
pub fn new( program: impl AsRef<OsStr>, input: QueryInput, output: GraphOutput, options: AdapterOptions, ) -> Self
Configures an adapter without starting it.
Adds --output=<format> when options.output is set, followed by
options.other. The input and output values select stdin and stdout;
stderr is captured for failure diagnostics.
Sourcepub async fn execute(&mut self) -> AdapterResult
pub async fn execute(&mut self) -> AdapterResult
Starts a child and returns its live JSONL graph stream.
After successful spawning, input ownership moves into the stream, which feeds it concurrently when polled. Subsequent executions have no query input.
§Errors
Spawn failures are returned directly; input, output, wait, and exit failures are stream items. Consume the stream to completion to check process success.
Source§impl Adapter
impl Adapter
Sourcepub fn with_batching(self, options: BatchOptions) -> Self
pub fn with_batching(self, options: BatchOptions) -> Self
Sets batching thresholds for captured JSONL output. This does not change
subprocess arguments, native pipeline edges, or listing limits.
The default policy is crate::BatchOptions::default.