A schema file contains the basic information necessary to create a table or tables of a particular type. Associated information would be included in this file as comments. Information which Timport will act upon directly is listed as keywords with assigned values.
The simplest kind of table you could create would be one where the full text of each file was loaded into a table as a text field, and statistics about each file would be captured into respective fields. This requires virtually no study of text content, so we'll use it as the first example.
The Thunderstone's old indexing program 3DB indexed text files into a
database. Timport can create this general kind of table with the
sample schema file provided, called 3db.sch
. The content of
this schema file follows:
#
# create a 3DB style Texis table with no extra info
#
database /tmp/testdb
table threedb
stats
# create table threedb(id counter,File varind,Fsize long,Ftime date);
To make sense of this file, read it with the following rules in mind, which apply to all schema files:
Preliminary Schema File Format Rules
#
character.
The first 3 lines of the example file begin with a #
, as does the last.
These are comment lines but include important information to the
creation of the table. The first comment describes what this schema
file is for. The last comment gives the exact CREATE TABLE
command to create with Texis first, before running Timport on this
schema file.
The remaining 3 lines which are not comments, are the keywords and their values which Timport will act on to create the table. This is the lowest minimum requirement to a schema file:
/tmp/testdb
. The keyword is database, separated with one
or more spaces or tabs from its value /tmp/testdb
.threedb
. The keyword is table, separated with
one or more spaces or tabs from its value threedb
.Stats automatically gets the file size and date. Field information can alternatively be obtained by listing the fields individually, as will be shown in later examples. Where no fields have been defined and stats is used, it will also automatically load the full text of the file as an indirect field.
You can use the keyword stats along with specified fields, to capture file size and date. To also load the full text of the file where additional fields have been specified, you would specify it as a field within the schema file.
In data type terms, stats adds the fields "Fsize long
"
and "Ftime date
" and fills them in with the file's info for
each file. It will also add "File varind
" if no fields have
been defined. Refer the Texis manual for a more complete
understanding of data types.