NAME

tdbjoin - temporal database operator

SYNOPSIS

tdbjoin [ -123jmoprstv ] file

DESCRIPTION

Tdbjoin reads from standard input lines specifying a set of temporal triads, and joins each triad with the temporal relation stored in file created by tdbadd(1).

The fields of the input triad are time, element, and attribute separated by tabs. Any other fields on the input line are passed through.

The temporal relation also is a set of triads. The time of the input triad is the effective time. The time of the temporal relation is the valid time, that is, the start time when the element attribute pair become valid. The standard join condition is true when both element fields match and the valid time is less than the effective time and effective time is less than the next greater valid time for the element or if no greater valid time for the element exists. The join condition can be altered by one of the command line flags.

The default output is a triad with time being the effective time taken from the input and element and attribute values taken from the file.

The following options are recognized.
-n    where n is the inversion 1, 2, or 3 on which to join. 1st inversion implies the element is a time in seconds and the file is searched on the time field. 2nd inversion, the default, searches the file on the element field. 3rd inversion searches file on the attribute field.
-j    Join the triad and entry. Instead of the default behaviour of substituting the target attribute for field 3 in the pipeline, tdbjoin pushes fields 3 and greater to the right, and places the target attribute in field 3.
-m    The relation is one-to-many so the valid time is ignored in the relation and all matching records are printed.
-o    Outer join. The source (standard input) line is printed even if no matching target line is found.
-p    Treat the element as a prefix to be searched on, instead of the default which is an exact match of the key.
-r    Interpret the input element and attribute as a range and print all triads from file that fall within that range.
-s    Substitute the target attribute for field 2 (element) in the output.
-v    Print the valid time instead of the effective time.
-t    Toggle the validity of the element/attribute pair on every successive entry along the valid time line. This is also a one-to-many join where effective time specifies the cut-off date for the join; no tuples specified in the future are considered.

EXAMPLES

List the currently effective description for all files in the current directory.
9ls |tdbjoin description

SEE ALSO

tdbadd(1) 9ls(1)