author | František Kučera <franta-hg@frantovo.cz> |
Tue, 05 Feb 2019 19:18:28 +0100 | |
branch | v_0 |
changeset 244 | d4f401b5f90c |
parent 241 | relpipe-data/examples.xml@f71d300205b7 |
child 317 | fce3d6290c40 |
permissions | -rw-r--r-- |
23
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
1 |
<stránka |
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
2 |
xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana" |
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
3 |
xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"> |
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
4 |
|
244
d4f401b5f90c
examples: move each example to a separate page + add generated list of examples
František Kučera <franta-hg@frantovo.cz>
parents:
241
diff
changeset
|
5 |
<nadpis>Hello Wordl!</nadpis> |
d4f401b5f90c
examples: move each example to a separate page + add generated list of examples
František Kučera <franta-hg@frantovo.cz>
parents:
241
diff
changeset
|
6 |
<perex>generating relational data from CLI arguments</perex> |
d4f401b5f90c
examples: move each example to a separate page + add generated list of examples
František Kučera <franta-hg@frantovo.cz>
parents:
241
diff
changeset
|
7 |
<m:pořadí-příkladu>00100</m:pořadí-příkladu> |
4
1bb39595a51c
genrování hlavní nabídky #1
František Kučera <franta-hg@frantovo.cz>
parents:
2
diff
changeset
|
8 |
|
2
ab9099ff88fa
vkládání zápatí, jmenné prostory, saxon
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
9 |
<text xmlns="http://www.w3.org/1999/xhtml"> |
176
46042297e0d6
relpipe-tr-validator: specification and examples
František Kučera <franta-hg@frantovo.cz>
parents:
140
diff
changeset
|
10 |
|
185
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
11 |
<p> |
195
65138c5d5a7c
examples: fstab - another check
František Kučera <franta-hg@frantovo.cz>
parents:
187
diff
changeset
|
12 |
Let's start with an obligatory Hello World example. |
185
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
13 |
</p> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
14 |
|
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
15 |
<m:pre jazyk="bash"><![CDATA[relpipe-in-cli generate "relation_from_cli" 3 \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
16 |
"a" "integer" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
17 |
"b" "string" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
18 |
"c" "boolean" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
19 |
"1" "Hello" "true" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
20 |
"2" "World!" "false"]]></m:pre> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
21 |
|
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
22 |
<p> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
23 |
This command generates relational data. |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
24 |
In order to see them, we need to convert them to some other format. |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
25 |
For now, we will use the "tabular" format and pipe relational data to the <code>relpipe-out-tabular</code>. |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
26 |
</p> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
27 |
|
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
28 |
<m:pre jazyk="bash"><![CDATA[relpipe-in-cli generate "relation_from_cli" 3 \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
29 |
"a" "integer" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
30 |
"b" "string" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
31 |
"c" "boolean" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
32 |
"1" "Hello" "true" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
33 |
"2" "World!" "false" \ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
34 |
| relpipe-out-tabular]]></m:pre> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
35 |
|
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
36 |
<p>Output:</p> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
37 |
|
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
38 |
<pre><![CDATA[relation_from_cli: |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
39 |
╭─────────────┬────────────┬─────────────╮ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
40 |
│ a (integer) │ b (string) │ c (boolean) │ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
41 |
├─────────────┼────────────┼─────────────┤ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
42 |
│ 1 │ Hello │ true │ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
43 |
│ 2 │ World! │ false │ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
44 |
╰─────────────┴────────────┴─────────────╯ |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
45 |
Record count: 2 |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
46 |
]]></pre> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
47 |
|
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
48 |
<p> |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
49 |
The syntax is simple as we see above. We specify the name of the relation, number of attributes, |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
50 |
and then their definitions (names and types), |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
51 |
followed by the data. |
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
52 |
</p> |
196
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
53 |
|
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
54 |
<p> |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
55 |
A single stream may contain multiple relations: |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
56 |
</p> |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
57 |
|
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
58 |
<m:pre jazyk="bash"><![CDATA[(relpipe-in-cli generate a 1 x string hello; \ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
59 |
relpipe-in-cli generate b 1 y string world) \ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
60 |
| relpipe-out-tabular]]></m:pre> |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
61 |
|
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
62 |
<p> |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
63 |
Thus we can combine various commands or files and pass the result to a single relational output filter (<code>relpipe-out-tabular</code> in this case) and get: |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
64 |
</p> |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
65 |
|
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
66 |
<pre><![CDATA[a: |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
67 |
╭────────────╮ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
68 |
│ x (string) │ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
69 |
├────────────┤ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
70 |
│ hello │ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
71 |
╰────────────╯ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
72 |
Record count: 1 |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
73 |
b: |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
74 |
╭────────────╮ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
75 |
│ y (string) │ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
76 |
├────────────┤ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
77 |
│ world │ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
78 |
╰────────────╯ |
8dd5b7ecb736
examples: multiple relations in a single stream
František Kučera <franta-hg@frantovo.cz>
parents:
195
diff
changeset
|
79 |
Record count: 1]]></pre> |
185
6cd2e54d90ea
examples: relpipe-in-cli
František Kučera <franta-hg@frantovo.cz>
parents:
184
diff
changeset
|
80 |
|
87
25dec6931f18
Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents:
23
diff
changeset
|
81 |
</text> |
4
1bb39595a51c
genrování hlavní nabídky #1
František Kučera <franta-hg@frantovo.cz>
parents:
2
diff
changeset
|
82 |
|
1 | 83 |
</stránka> |