Download RELAXML
Transcript
3.2. A Formal Definition of Concepts Further, we require that if !i 11 2 O then !j 2 I for j < i. For an ! 2 and a predicate p we let A ! p B denote the join (with type defined by ! ) where the predicate p must be fulfilled. For a given join tuple r it is then possible to compute a relation by means of the eval function which is given as eval(r) = 8 > > < > > : eval(r1 ) !1p1 eval(r2 ) !2p2 !mp m 1 1 eval(rm ) r = ((r1 , : : : , rm ), (!1, : : : , !m 1), (p1, : : : , pm 1)) if r if r is a relation. That is, the value of eval applied to a relation is the relation itself. The value of eval applied to a join tuple is the relation that arises when the values of eval applied to the elements in the first component of the join tuple are joined. Note that even though the operators in O are not associative nor commutative the value of eval is unambiguously defined. The reason for this is that that we in Definition 3.4 require that an operator from O cannot be followed by another operator from O. If more than one operator from O must be used to compute a relation, then this is modeled by inserting a join tuple with the first operator from O into another join tuple with the second operator from O. Note that a Cartesian product is modeled as a theta join with the join predicate true. Definition 3.5 (Concept) A concept k is a 6-tuple (n, A, J , C , f , T ) where n is the caption of the concept, A is a possibly empty sequence (without duplicates) of parent concepts which the concept inherits from, J is a join tuple, C is a set of included columns from the base relations of J , f is a predicate acting as a row filter and T is a possibly empty sequence of transformations to be applied to the data during export. The predicate of a row filter can be composed by other predicates using the connectives and, or and not. A predicate can for example for a given row compare two columns or a column and a constant using =, 6=, <, , > or . The relation valued function D computes the base data2 for a concept. For a concept k = (nk , (a1 , : : : , am ), Jk , Ck , fk , Tk ), the function D is given as follows, where for a column we let () denote the name of the table from which the column originates and where ols(x) gives all the columns in the relation x. D(k) = 2,C [hki# ()$/℄ (C [f~ j ~2ols(D(a )), i=1,:::,ng (f (eval(Jk )))) k k i k (3.1) Thus, first eval is used to compute the relation that holds the data from the used base relations. Then a selection is performed on this relation before a projection of all columns included by k or any of its ancestors. Finally, a renaming schema of the columns included by k is used by means of the rename operator where # and $ represent separator characters. This 3-part naming schema (concept name, table name, column name) is necessary in order have a one-toone mapping from the columns of D(k ) to the columns of the database and to 2 By base data we mean data that has not been transformed yet.