U de C - logo

SPATIAL DATABASES

diicc - logo

Logical Data Models and Languages > Relational v/s OO Model

1. Merge query. Build a map from Y as the merge of geometries that share attribure X:


Relational model:

select X, sum(Geometry) from Y group by X


OO model:

group X in (select tuple(y.Geometry) from y in Y by (X:y.X) with
(Geometry: union (select p.Geometry from p in partition))

 

2. Aggregation query. Create a map from the aggregation of its parts with the sum of attribute Z.


Relational model:

select sum(y.Z), sum(y.Geometry) from Wholes x, Parts y where x.whole = y.whole group by x.whole


OO model:


select tuple (Z: sum(select y.Z from y in x.parts), region: union(select y.whole from y in x.parts)) from x in Wholes

3. Decomposition query: Descompose a whole into non connected parts.

Relational model:

It cannot be expressed in SQL because the decompose operator and unnest operators are not defined.


OO model:


select tuple(Region e) from x in Wholes, y in x.Parts, e in y.Whole-> decompose

 


Valid HTML 4.0! Valid CSS!