Conditions, C. Conditions refer both to selection
conditions, of queries and views and constraints, of
the database schema. We consider three classes of
atomic conditions that are composed through the
appropriate usage of an operator op belonging to the
set Op, containing the usual binary operators, (e.g.,
<, >, =, ≤, ≥, !=, IN, EXISTS, ANY): (a) Ω op
constant; (b) Ω op Ω’; and (c) Ω op Q. (Ω, Ω’
are attributes of the underlying relations and Q is a
query). A condition node is used for the
representation of the condition. The node is tagged
with the respective operator and it is connected to
the operand nodes of the conjunct clause through the
respective operand relationships, O. Composite
conditions are easily constructed by tagging the
condition node with a Boolean operator (e.g., AND
or OR) and the respective edges, to the conditions
composing the composite condition.
Queries, Q. The graph representation of a Select
- Project - Join - Group By (SPJG) query involves a
new node representing the query, namely query
node, and attribute nodes corresponding to the
schema of the query. Thus, the query graph is a
directed graph connecting the query node with all its
schema attributes, through schema relationships
. In
order to represent the relationship between the query
graph and the underlying relations, the query is
resolved into its essential parts: SELECT, FROM,
WHERE, GROUP BY, HAVING, and ORDER BY, each
of which is eventually mapped to a subgraph.
Select part. Each query is assumed to own a
schema that comprises the attributes, either with
their original or alias names, appearing in the
SELECT clause. In this context, the SELECT part of
the query maps the respective attributes of the in-
volved relations to the attributes of the query schema
through map-select relationships, E
M
, directing from
the query attributes towards the relation attributes.
From part. The FROM clause of a query is con-
sidered as the relationship between the query and the
relations involved in this query. Thus, the relations
included in the FROM part are combined with the
query node through from relationships, E
F
, directing
from the query node towards the relation nodes.
Where and Having parts. We assume the WHERE
and/or HAVING clauses of a query in conjunctive
normal form. Thus, we introduce two directed edges,
namely where relationships, E
w
, and having
relationships, E
H
, both starting from a query node
towards an operator node corresponding to the
conjunction of the highest level.
Group and Order By part. For the representation
of aggregate queries, two special purpose nodes are
employed: (a) a new node denoted as GB∈GB, to
capture the set of attributes acting as the aggrega-
tors; and (b) one node per aggregate function labeled
with the name of the employed aggregate function;
e.g., COUNT, SUM, MIN. For the aggregators, we use
edges directing from the query node towards the GB
node that are labeled <group-by>, indicating
group-by relationships, E
G
. The GB node is con-
nected with each of the aggregators through an edge
tagged also as <group-by>, directing from the GB
node towards the respective attributes. These edges
are additionally tagged according to the order of the
aggregators; we use an identifier i to represent the i-
th aggregator. Moreover, for every aggregated at-
tribute in the query schema, there exists an edge
directing from this attribute towards the aggregate
function node as well as an edge from the function
node towards the respective relation attribute. Both
edges are labeled <map-select> and belong to
E
M
, as these relationships indicate the mapping of the
query attribute to the corresponding relation attribute
through the aggregate function node. The represen-
tation of the ORDER BY clause is performed
similarly, whereas nested queries and functions used
in queries are also incorporated in our model.
Views, V. Views are considered either as queries
or relations (materialized views), thus, V ⊆ R∪Q.
3 CONSTRUCTS ANNOTATION
WITH EVOLUTION POLICIES
Evolution changes may affect the software around
the database (mainly views and queries) in two
ways: (a) syntactically, a change may evoke a com-
pilation or execution failure during the execution of
a piece of code; and (b) semantically, a change may
have an effect on the semantics of the software used.
In the context of the proposed graph, changes in the
database schema are events, which transform spe-
cific parts of the graph (e.g., a relation graph sus-
taining a change) and eventually affect other de-
pendent graph constructs (e.g., a view graph de-
pending on the specific relation). The latter may
raise, in turn, new evolution changes, which have
impact on other graph constructs (such as a query
graph depending on the specific view.)
To handle schema evolution, the constructs of
the graph are annotated with elements that facilitate
what-if analysis and predetermine the reaction to
evolution events that may occur. Each construct is
ICEIS 2008 - International Conference on Enterprise Information Systems
76