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.
//! Natural-language query compilation: the compiler marker trait and arguments.
use crateExecute;
use ;
use Builder;
/// A prompt compiler that translates natural-language text into one SPARQL query.
///
/// The query is intended for an [`Adapter`](crate::Adapter); compiling it does
/// not execute it. The program documents its assumptions about the target
/// dataset, vocabulary, and adapter capabilities. Syntactic validity alone does
/// not guarantee that a query captures the author's intent.
///
/// # Command-line contract
///
/// `PROGRAM [OPTIONS] [INPUT-FILE]`
///
/// The natural-language input file defaults to `-` (stdin). On success, stdout
/// contains a syntactically valid SPARQL query as UTF-8, without Markdown fences
/// or explanatory prose outside the query. The query must produce a graph or
/// use a form for which the intended adapter's profile defines an RDF mapping.
/// There are no standard pattern-specific options or output-file operand.
///
/// `T` is the implementation's query representation. See [`crate::programs`]
/// for links to concrete execution behavior and the [compiler specification][spec].
///
/// [spec]: https://asimov-specs.github.io/program-patterns/#compiler
/// Additional arguments and an optional input file for a [`Compiler`].
///
/// `Default` creates an empty argument list, selecting the program's stdin-input
/// form. The pattern defines no standard model or format options. Any such
/// options supplied through [`other`](Self::other) are extensions requiring
/// support from the selected program; this type does not validate that support.
///
/// # Examples
///
/// Select a named input file as one literal argument, retaining stdout output:
///
/// ```
/// use asimov_patterns::CompilerOptions;
///
/// let options = CompilerOptions::builder()
/// .other("--")
/// .other("request with spaces.txt")
/// .build();
/// ```