Database Reference
In-Depth Information
As a final example, how can we find pairs of trains that met, that is, have been
at the same place at the same time? When and where did they meet?
select t1.Id, t1.Line, t2.Id, t2.Line,
inst(initial(intersection(t1.Trip, t2.Trip))) as MeetingTime,
val(initial(intersection(t1.Trip, t2.Trip))) as MeetingPlace
from Trains as t1, Trains as t2
where t1.Id < t2.Id and sometimes(t1.Trip = t2.Trip)
This query uses new operations
= :
mpoint × mpoint
mbool
sometimes:
mbool
bool
intersection: mpoint × mpoint
mpoint
3.2.2 Design Principles
The examples have demonstrated that it is useful to have a collection of related
data types and operations to obtain a query language for moving objects. The
quality of such a language, that is, its ease of use and expressive power, depends
on the principles applied in the design of types and operations. The following
principles are observed.
D1 For all base types of interest, there are corresponding time-dependent types.
D2 Definitions of static and time-dependent types should be consistent.
D3 For each time-dependent type, there are types to represent the projection to
the domain and range of the respective function.
D4 The type system has many types - to avoid a proliferation of operations, one
should use generic operations as much as possible.
D5 The space of possible operations should be explored systematically.
D6 Operations on static and time-dependent types should be consistent.
The type system used is shown in Figure 3.2 . It starts from the set of standard
types int , real , bool ,and string , and spatial types point , points , line ,and region .
All these types are made uniformly time dependent by introducing a type con-
structor, moving . It returns for a given static type α the type whose values are
partial functions from the time domain into α .
More formally, let A α denote the domain of type α , that is, the set of possible
values of type α . Then the domain for type moving ( α )is
A moving ( α ) : ={ f | f : A instant A α is a partial function }
One can observe that design rules D1 and D2 are fulfilled.
The range type constructor provides for a given type α , which must have
a total order, the type whose values are finite sets of disjoint intervals over
Search WWH ::




Custom Search