1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// This is free and unencumbered software released into the public domain.
//! RDF import: the reader marker trait and source/output format options.
use crateExecute;
use ;
use Builder;
/// An importer that maps a document or byte stream into an RDF graph or dataset.
///
/// Source data may use an RDF or non-RDF format. The program defines supported
/// inputs and their mappings, including vocabulary, base-IRI handling, and
/// identifier generation. This role describes a data-import operation, not an
/// implementation of Rust's byte-reading traits.
///
/// # Command-line contract
///
/// `PROGRAM [OPTIONS] [INPUT-FILE [OUTPUT-FILE]]`
///
/// Input and output default to stdin and stdout. A single operand selects
/// input; two select input then output, with `-` denoting a standard stream.
/// [`ReaderOptions`] defaults to automatic input-format detection and `jsonl`
/// output. The program must document its detection procedure and fail if it
/// cannot select a supported input format.
///
/// `T` is the implementation's imported-result representation. See
/// [`crate::programs`] for links to concrete execution behavior and the
/// [reader specification][spec].
///
/// [spec]: https://asimov-specs.github.io/program-patterns/#reader
/// Source and RDF output formats for a [`Reader`], plus additional arguments.
///
/// `Default` leaves formats unset and `other` empty, delegating detection and
/// output defaults to the program. Configuration does not perform detection,
/// validate format support, or transform the input.
///
/// # Examples
///
/// ```rust
/// use asimov_patterns::ReaderOptions;
///
/// let options = ReaderOptions::builder()
/// .input("auto")
/// .output("jsonl")
/// .build();
/// ```