Chapter 6: The Domain Catalog
6.1 -- Introduction: The Hermes domain catalog
file (Hermes.dom) provides an abstract specification of integrated
software and data accessible to Hermes mediators. Domain function declarations
provide high-level specification of input, output, and processing, for
each integrated software function. Internal software data types are also
definable in the domain catalog.
NOTE: Types can also be declared at the beginning of the domain
6.2 -- Declarations: Every integrated software
or data domain is represented by declaration groupings, within the catalog,
which include domain name, function, and types, supported by that domain.
-- The domain declaration: Domains generally correspond to programs
(such as a relational database management system) or a sets of related
functions (such as math functions). The declaration consists of the reserved
word domain followed by arguments for name and a domain description as
seen in Fig. 6-3.
-- The type declaration: Hermes provides global type declarations
to simplify and clarify the use of data types in the domain catalog and
mediators. The domain catalog can contain type declarations used by domain
functions. A type can be declared anywhere in the domain catalog, but it
must be declared before it is used either in a domain function declaration
or in another type declaration. All types declared in the domain catalog
are available to a mediator.
18.104.22.168 -- Fig. 6-5 shows the Date type declaration used in the
date domain. Moreover, it demonstrates nested types via the Route type
declaration. NOTE: Type number (see section 6.2.5)
and type any (see section 6.2.6) cannot be used in
a type declaration.
-- The domain function declaration: Hermes domains can include
any number of domain functions. The function-name and descriptor-string
tokens are self-explanatory. The term-types token, if any, represents
the domain function input parameter names and types (See section
5.3 for syntax). Finally, the function-type token declares the
defined function return type.
Executing the math domain count function, as defined in Fig. 6-7, with
parameters (0, 10, 2) will cause Hermes to return the array
[0 2 4 6 8 10].
6.2.4 -- Ellipse (. . .) usage: Hermes
syntax supports the use of ellipses (. . .) after the final function input
term to indicate a repeating input term. For example, to search for USA
Today news summaries relating to Bill Clinton, published on April 18 or
19, 1994, use the file:search domain function (defined in Fig.
6-7 above). The ellipses following the final function definition input
term allows the user
to input multiple search paths (with standard wild-card characters). Thus,
the query (see Fig. 6-8) searches two source directories and returns an
array of file names which match the search string, but are found in either
source directory (Fig. 6-9).
-- Domain function number type: The number type can only be used to
declare domain function input and output types.
22.214.171.124 -- Input: Number type inputs provide domain call flexibility
by allowing either integer or real values for numeric input.
126.96.36.199 -- Output: For functions with number output types, all inputs
must be of the number type. If all inputs are integers, then the output
is also an integer. For mixed integer and real, or straight real number
inputs, the function returns a real value.
Using number input and output types, the math:add function, noted
in Fig. 6-10, above can be used with any combination of constants, variables
and functions evaluating to integers or reals. The first function call
(see Fig. 6-11) returns an integer; the remaining four return real values.
6.2.6 -- Domain function any type: The any
type provides domain function call flexibility by allowing any type of
input data -- It can only be used for function input types. The file:print
function defined in Fig. 6-12 accepts input values of any data type; Any
combination of constants, variables and input functions are valid. The
execution noted in Fig. 6-13, with inputs of two strings and an array of
render the string "Printing messages is as easy as 1 2 3!" to
system standard output. Note, Hermes also defines a file:format
function which prints Hermes format characters along with the values.
Some domain functions, such as file:print defined in the example
code, accept all Hermes data types for the any input type. Other
domain functions, such as ingres:select, require that the any
input type correspond to another input type. Hermes is not able
to check these relationships between domain function input types, so the
domain interface is responsible for checking the types at run time and
returning an error message if a mismatch occurs. In the ingres:select
function, listed in Fig. 6-14, the constant type specified by Value input
must match the field type specified by Field input. Hermes will
accept function calls such as those in Fig. 6-15 as it can not know that
the entries "widget3", or
3, must correspond to the table field type referenced by the name string
"part". The ingres interface will return an error message,
however, if the Value type does not match the Field type.
-- The domain data function: For databases structured as varying types
of records or objects, the domain data function declares the output type
of the domain function based on the input types. The variable token
represents a domain function file input name. Domain catalog data functions
work directly with mediator file data declarations (see section
7.2.3) to determine function output types based on input file types.
This allows software such as Oracle, or O2, which processes
dynamic queries to be integrated once -- New data files can then be used
in a mediator simply by declaring the file structure and writing usage
The Hermes domain, listed in Fig. 6-17, can process nested arrays,
records and sets. In each case, the domain function returns a data set
of the same types as the input database.