This file is indexed.

/usr/share/doc/libdata-stag-perl/homepage/script-list.html is in libdata-stag-perl 0.11-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
<?xml version="1.0" encoding="UTF-8"?>
<html>
  <head>
    <title>Stag Script Index</title>
    <link rel="stylesheet" type="text/css" href="./stylesheet.css">
    </link>
  </head>
  <body>
    <h1>Stag Scripts</h1>
    <div class="intro">
        <p>These scripts come with the stag and dbstag distributions</p>
    </div>
    <h2>Data::Stag Script List</h2>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-autoschema.html">stag-autoschema.pl</a>
    </h3>
    <div class="summary">writes the implicit stag-schema for a stag file</div>
    <div class="codeblock">
        <pre>
stag-autoschema.pl -w sxpr sample-data.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>Takes a stag compatible file (xml, sxpr, itext), or a file in any
format plus a parser, and writes out the implicit underlying stag-schema

stag-schema should look relatively self-explanatory.

Here is an example stag-schema, shown in sxpr syntax:
(db
   (person*
    (name "s"
    (address+
     (address_type "s")
     (street "s")
     (street2? "s")
     (city "s")
     (zip? "s")))))

The database db contains zero or more persons, each person has a
mandatory name and at least one address.

The cardinality mnemonics are as follows:</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-db.html">stag-db.pl</a>
    </h3>
    <div class="summary">persistent storage and retrieval for stag data (xml, sxpr, itext)</div>
    <div class="codeblock">
        <pre>
stag-db.pl -r person -k social_security_no -i ./person-idx myrecords.xml
  stag-db.pl -i ./person-idx -q 999-9999-9999 -q 888-8888-8888</pre>
    </div>
    <div class="scriptdesc">
        <pre>Builds a simple file-based database for persistent storage and
retrieval of nodes from a stag compatible document.

Imagine you have a very large file of data, in a stag compatible
format such as XML. You want to index all the elements of type
B&lt;person&gt;; each person can be uniquely identified by
B&lt;social_security_no&gt;, which is a direct subnode of B&lt;person&gt;

The first thing to do is to build an index file, which will be stored
in your current directory:
stag-db.pl -r person -k social_security_no -i ./person-idx myrecords.xml

You can then use the index "person-idx" to retrieve B&lt;person&gt; nodes by
their social security number

  stag-db.pl -i ./person-idx -q 999-9999-9999 &gt; some-person.xml

You can export using different stag formats

  stag-db.pl -i ./person-idx -q 999-9999-9999 -w sxpr &gt; some-person.xml

You can retrieve multiple nodes (although these need to be rooted to
make a valid file)

  stag-db.pl -i ./person-idx -q 999-9999-9999 -q 888-8888-8888 -top personset

Or you can use a list of IDs from a file (newline delimited)

  stag-db.pl -i ./person-idx -qf my_ss_nmbrs.txt -top personset</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-diff.html">stag-diff.pl</a>
    </h3>
    <div class="summary">finds the difference between two stag files</div>
    <div class="codeblock">
        <pre>
stag-diff.pl -ignore foo-id -ignore bar-id file1.xml file2.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>Compares two data trees and reports whether they match. If they do not
match, the mismatch is reported.</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-drawtree.html">stag-drawtree.pl</a>
    </h3>
    <div class="summary">draws a stag file (xml, itext, sxpr) as a PNG diagram</div>
    <div class="codeblock">
        <pre>
stag-drawtree.pl -o my.png myfile.xml

  stag-drawtree.pl -p My::MyFormatParser -o my.png myfile.myfmt</pre>
    </div>
    <div class="scriptdesc">
        <pre>requires GD library and GD perl module</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-eval.html">stag-eval.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre>
stag-eval.pl '' file2.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre></pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-filter.html">stag-filter.pl</a>
    </h3>
    <div class="summary">filters a stag file (xml, itext, sxpr) for nodes of interest</div>
    <div class="codeblock">
        <pre>
stag-filter.pl person -q name=fred file1.xml

  stag-filter.pl person 'sub {shift-&gt;get_name =~ /^A*/}' file1.xml

  stag-filter.pl -p My::Foo -w sxpr record 'sub{..}' file2</pre>
    </div>
    <div class="scriptdesc">
        <pre>parsers an input file using the specified parser (which may be a built
in stag parser, such as xml) and filters the resulting stag tree
according to a user-supplied subroutine, writing out only the
nodes/elements that pass the test.

the parser is event based, so it should be able to handle large files
(although if the node you parse is large, it will take up more memory)</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-findsubtree.html">stag-findsubtree.pl</a>
    </h3>
    <div class="summary">finds nodes in a stag file</div>
    <div class="codeblock">
        <pre>
stag-findsubtree.pl 'person/name' file.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>parses in an input file and writes out subnodes</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-flatten.html">stag-flatten.pl</a>
    </h3>
    <div class="summary">turns stag data into a flat table</div>
    <div class="codeblock">
        <pre>
stag-flatten.pl MyFile.xml dept/name dept/person/name</pre>
    </div>
    <div class="scriptdesc">
        <pre>reads in a file in a stag format, and 'flattens' it to a tab-delimited
table format. given this data:
(company
   (dept
    (name "special-operations")
    (person
     (name "james-bond"))
    (person
     (name "fred"))))

the above command will return a two column table

  special-operations      james-bond
  special-operations      fred</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-grep.html">stag-grep.pl</a>
    </h3>
    <div class="summary">filters a stag file (xml, itext, sxpr) for nodes of interest</div>
    <div class="codeblock">
        <pre>
stag-grep.pl person -q name=fred file1.xml

  stag-grep.pl person 'sub {shift-&gt;get_name =~ /^A*/}' file1.xml

  stag-grep.pl -p My::Foo -w sxpr record 'sub{..}' file2</pre>
    </div>
    <div class="scriptdesc">
        <pre>parsers an input file using the specified parser (which may be a built
in stag parser, such as xml) and filters the resulting stag tree
according to a user-supplied subroutine, writing out only the
nodes/elements that pass the test.

the parser is event based, so it should be able to handle large files
(although if the node you parse is large, it will take up more memory)</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-handle.html">stag-handle.pl</a>
    </h3>
    <div class="summary">streams a stag file through a handler into a writer</div>
    <div class="codeblock">
        <pre>
stag-handle.pl -w itext -c my-handler.pl myfile.xml &gt; processed.itext
  stag-handle.pl -w itext -p My::Parser -m My::Handler myfile.xml &gt; processed.itext</pre>
    </div>
    <div class="scriptdesc">
        <pre>will take a Stag compatible format (xml, sxpr or itext), turn the data
into an event stream passing it through my-handler.pl</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-join.html">stag-join.pl</a>
    </h3>
    <div class="summary">joins two stag files together based around common key</div>
    <div class="codeblock">
        <pre>
stag-join.pl  -w xml country/city_id=capital/capital_id countries.xml capitals.xml

  stag-join.pl  -w itext gene/tax_id=species/tax_id genedb.itext speciesdb.itext</pre>
    </div>
    <div class="scriptdesc">
        <pre>Performs a relational-style INNER JOIN between two stag trees; this
effectively merges two files together, based on some kind of ID in the
file</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-merge.html">stag-merge.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre>
stag-merge.pl  -xml file1.xml file2.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>script wrapper for the Data::Stag modules</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-mogrify.html">stag-mogrify.pl </a>
    </h3>
    <div class="summary">mangle stag files</div>
    <div class="codeblock">
        <pre>
stag-mogrify.pl  -w itext file1.xml file2.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>script wrapper for the Data::Stag modules

feeds in files into a parser object that generates nestarray events,
and feeds the events into a handler/writer class</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-parse.html">stag-parse.pl</a>
    </h3>
    <div class="summary">parses a file and fires events (e.g. sxpr to xml)</div>
    <div class="codeblock">
        <pre>
# convert XML to IText
  stag-parse.pl -p xml -w itext file1.xml file2.xml

  # use a custom parser/generator and a custom writer/generator
  stag-parse.pl -p MyMod::MyParser -w MyMod::MyWriter file.txt</pre>
    </div>
    <div class="scriptdesc">
        <pre>script wrapper for the Data::Stag modules

feeds in files into a parser object that generates nestarray events,
and feeds the events into a handler/writer class</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-query.html">stag-query.pl</a>
    </h3>
    <div class="summary">aggregare queries</div>
    <div class="codeblock">
        <pre>
stag-query.pl avg person/age file.xml

  stag-query.pl sum person/salary file.xml

  stag-query.pl 'sub { $agg .= ", ".shift }' person/name file.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>Performs aggregate queries</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-splitter.html">stag-splitter.pl</a>
    </h3>
    <div class="summary">splits a stag file into multiple files</div>
    <div class="codeblock">
        <pre>
stag-splitter.pl -split person -name social_security_no file.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>Splits a file using a user specified parser (default xml) around a
specified split node, naming each file according to the name argument

the files will be named anonymously, unless the '-name' switch is specified; this will use the value of the specified element as the filename

eg; if we have
&lt;top&gt;
    &lt;a&gt;
      &lt;b&gt;foo&lt;/b&gt;
      &lt;c&gt;yah&lt;/c&gt;
      &lt;d&gt;
        &lt;e&gt;xxx&lt;/e&gt;
      &lt;/d&gt;
    &lt;/a&gt;
    &lt;a&gt;
      &lt;b&gt;bar&lt;/b&gt;
      &lt;d&gt;
        &lt;e&gt;wibble&lt;/e&gt;
      &lt;/d&gt;
    &lt;/a&gt;
  &lt;/top&gt;

if we run

  stag-splitter.pl -split a -name b

it will generate two files, "foo.xml" and "bar.xml"

input format can be 'xml', 'sxpr' or 'itext' - if this is left blank
the format will be guessed from the file suffix

the output format defaults to the same as the input format, but
another can be chosen.

files go in the current directory, but this can be overridden with the
'-dir' switch</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-view.html">stag-view.pl</a>
    </h3>
    <div class="summary">draws an expandable Tk tree diagram showing stag data</div>
    <div class="codeblock">
        <pre>
stag-view.pl  file1.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>Draws a Tk tree, with expandable/convertable nodes</pre>
    </div>
    <h2>DBIx::DBStag Script List</h2>
    <hr></hr>
    <h3>
      <a href="script-docs/selectall_html.html">selectall_html.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre>
selectall_html.pl -d "dbi:Pg:dbname=mydb;host=localhost" "SELECT * FROM a NATURAL JOIN b"</pre>
    </div>
    <div class="scriptdesc">
        <pre></pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/selectall_xml.html">selectall_xml.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre>
selectall_xml.pl [-d &lt;dbi&gt;] [-f file of sql] [-nesting|n &lt;nesting&gt;] SQL</pre>
    </div>
    <div class="scriptdesc">
        <pre>This script will query a database using either SQL provided by the
script user, or using an SQL templates; the query results will be
turned into XML using the L&lt;DBIx::DBStag&gt; module. The nesting of the
XML can be controlled by the DBStag SQL extension "USE NESTING..."</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-autoddl.html">stag-autoddl.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre>
stag-autoddl.pl -parser XMLAutoddl -handler ITextWriter file1.txt file2.txt

  stag-autoddl.pl -parser MyMod::MyParser -handler MyMod::MyWriter file.txt</pre>
    </div>
    <div class="scriptdesc">
        <pre>script wrapper for the Data::Stag modules</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-bulkload.html">stag-bulkload.pl</a>
    </h3>
    <div class="summary">creates bulkload SQL for input data</div>
    <div class="codeblock">
        <pre>
# convert XML to IText
  stag-bulkload.pl -l person file1.xml file2.xml

  # use a custom parser/generator and a custom writer/generator
  stag-bulkload.pl -p MyMod::MyParser file.txt</pre>
    </div>
    <div class="scriptdesc">
        <pre>Creates bulkload SQL statements for an input file

Works only with certain kinds of schemas, where the FK relations make
a tree (not a graph); i.e. the only FKs are to the parent

You do not need a connection to the DB

It is of no use for incremental loading - it assumes integer surrogate
promary keys and starts these from 1</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-ir.html">stag-ir.pl</a>
    </h3>
    <div class="summary">information retrieval using a simple relational index</div>
    <div class="codeblock">
        <pre>
stag-ir.pl -r person -k social_security_no -d Pg:mydb myrecords.xml
  stag-ir.pl -d Pg:mydb -q 999-9999-9999 -q 888-8888-8888</pre>
    </div>
    <div class="scriptdesc">
        <pre>Indexes stag nodes (XML Elements) in a simple relational db structure
- keyed by ID with an XML Blob as a value

Imagine you have a very large file of data, in a stag compatible
format such as XML. You want to index all the elements of type
B&lt;person&gt;; each person can be uniquely identified by
B&lt;social_security_no&gt;, which is a direct subnode of B&lt;person&gt;

The first thing to do is to build the index file, which will be stored
in the database mydb
stag-ir.pl -r person -k social_security_no -d Pg:mydb myrecords.xml

You can then use the index "person-idx" to retrieve B&lt;person&gt; nodes by
their social security number

  stag-ir.pl -d Pg:mydb -q 999-9999-9999 &gt; some-person.xml

You can export using different stag formats

  stag-ir.pl -d Pg:mydb -q 999-9999-9999 -w sxpr &gt; some-person.xml

You can retrieve multiple nodes (although these need to be rooted to
make a valid file)

  stag-ir.pl -d Pg:mydb -q 999-9999-9999 -q 888-8888-8888 -top personset

Or you can use a list of IDs from a file (newline delimited)

  stag-ir.pl -d Pg:mydb -qf my_ss_nmbrs.txt -top personset</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-pgslurp.html">stag-pgslurp.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre>
stag-pgslurp.pl -d "dbi:Pg:dbname=mydb;host=localhost" myfile.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>This script is for storing data (specified in a nested file format
such as XML or S-Expressions) in a database. It assumes a database
schema corresponding to the tags in the input data already exists.</pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-sl2sql.html">stag-sl2sql.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre></pre>
    </div>
    <div class="scriptdesc">
        <pre></pre>
    </div>
    <hr></hr>
    <h3>
      <a href="script-docs/stag-storenode.html">stag-storenode.pl</a>
    </h3>
    <div class="summary"></div>
    <div class="codeblock">
        <pre>
stag-storenode.pl -d "dbi:Pg:dbname=mydb;host=localhost" myfile.xml</pre>
    </div>
    <div class="scriptdesc">
        <pre>This script is for storing data (specified in a nested file format
such as XML or S-Expressions) in a database. It assumes a database
schema corresponding to the tags in the input data already exists.</pre>
    </div>
  </body>
</html>