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
// This is free and unencumbered software released into the public domain.
//! URL-to-RDF retrieval: the fetcher marker trait and options.
use crateExecute;
use ;
use Builder;
/// A URL protocol client that retrieves one resource and represents it as RDF.
///
/// The program defines supported URL schemes and the mapping from retrieved
/// content to RDF. A single resource may produce many RDF statements. Returning
/// arbitrary response bytes alone does not fulfill the RDF output contract.
///
/// # Command-line contract
///
/// `PROGRAM [OPTIONS] INPUT-URL`
///
/// One absolute URL is required as a single argument; it is not a stdin
/// payload or an implicitly converted local pathname. RDF is written to stdout
/// using [`FetcherOptions::output`] (`jsonl` by default). The program validates
/// the URL and rejects unsupported schemes.
///
/// `T` is the implementation's result representation. Retrieval, redirects,
/// authentication, caching, and resource-to-RDF mapping belong to the program.
/// See [`crate::programs`] for links to concrete execution behavior and the
/// [fetcher specification][spec].
///
/// [spec]: https://asimov-specs.github.io/program-patterns/#fetcher
/// Output-format selection and additional arguments for a [`Fetcher`].
///
/// The URL is supplied separately by the implementation's invocation API.
/// `Default` leaves `output` unset and `other` empty; format support and URL
/// validity are not checked by this configuration type.
///
/// # Examples
///
/// ```rust
/// use asimov_patterns::FetcherOptions;
///
/// let options = FetcherOptions::builder()
/// .output("jsonl")
/// .build();
/// ```