Database Reference
In-Depth Information
Figure 4. Multidimensional analysis
The main application of the CUBE operator is multidimensional analysis where data is represented
in aggregated form over a multidimensional space with user-defined structure. The analyzed parameter,
measure, is normally computed by aggregating data for each cell of the cube. Measure can be computed
within query body denoted by the BODY keyword. For example, if we need to show sales over countries
and categories then it can be done as follows:
ResultCube =
CUBE (Countries co, Categories ca)
BODY {
cell = co <-* Sales AND
ca <-* Sales
measure = SUM(cell.price)
}
RETURN co.name, ca.name, measure
In this query it is assumed that the Sales collection is a common lesser collection for Countries and
Categories. The result is a combination of country and category names along with the total sales for
them. To compute the total sales figure we first find all facts belonging to one cell (to a combination of
the current country and category). It is done by de-projecting the country and category down to the Sales
fact collection and then finding their intersection (denoted by AND). Then we sum up all sales within one
cell of the cube using only one numeric dimension for aggregation and store this result in the measure
variable. Finally, the value computed for this country and this category is then returned in the result.
RELATED WORK
Although the concept-oriented model is based on only three principles, it is able to simulate many wide-
spread mechanisms and data modeling patterns provided in other model. For example, the existence of
hierarchies in COM makes it very similar to the classical hierarchical data model (HDM) (Tsichritzis et
al, 1976). In both models data exist within a hierarchy where any element has a unique position. There-
fore, this can be viewed as a reincarnation of the hierarchical model on a new cycle of the development
spiral. The main distinguishing feature of COM is that it proposes to use domain-specific identities by
providing means for modeling hierarchical address space for each problem domain. Another novelty is
Search WWH ::




Custom Search