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
89
// This is free and unencumbered software released into the public domain.
//! RDF export: the writer marker trait and input/destination format options.
use crateExecute;
use ;
use Builder;
/// An exporter that converts an RDF graph or dataset into a supported representation.
///
/// Output may be another RDF serialization or a non-RDF document or byte stream.
/// The program defines supported formats, mappings, and any information loss,
/// such as omission of named graphs or datatype information. This role describes
/// a data-export operation, not an implementation of Rust's byte-writing 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.
/// [`WriterOptions`] defaults to `jsonl` input and automatic output-format
/// selection. The program must define automatic selection even when stdout
/// has no filename from which to infer a format.
///
/// `T` is the implementation's exported-result representation. See
/// [`crate::programs`] for links to concrete execution behavior and the
/// [writer specification][spec].
///
/// [spec]: https://asimov-specs.github.io/program-patterns/#writer
/// RDF input and export formats for a [`Writer`], plus additional arguments.
///
/// `Default` leaves formats unset and `other` empty, delegating defaults to
/// the program. Select an explicit output format when the consumer requires
/// a particular representation. Format selection itself does not convert data
/// or establish that the selected program supports that format.
///
/// # Examples
///
/// ```rust
/// use asimov_patterns::WriterOptions;
///
/// let options = WriterOptions::builder()
/// .input("jsonl")
/// .output("auto")
/// .build();
/// ```