Including SpatialTemporal Objects in ORM A proposal Including
Including Spatial/Temporal Objects in ORM A proposal
Including Spatial/Temporal Objects in ORM Gerhard Skagestein 1 Håvard Tveite 2 1 University gerhard@ifi. uio. no havard. tveite@umb. no of Oslo, Department of informatics 2 Norwegian University of Life Sciences, Dept. of Mathematical Sciences and Technology International Workshop on Fact-Oriented Modeling (ORM 2013) Graz, Austria, September 11 -13, 2013 12. September 2013 Including spatial/temporal objects in ORM – a proposal 3
The idea • To include spatial entities as first order citizens in ORM 12. September 2013 Including spatial/temporal objects in ORM – a proposal 4
Why? • Starting with the model is a good idea • The model opens for user participation • A common model can serve as a bridge between different implementations • Automated tools for generating a running system may be developed 12. September 2013 Something Including spatial/temporal objects in ORM – a proposal Location ({x, y, z}) (. id) spaghetti network vector raster approximations 5
Why not? • Makes the ORM-language bigger – If you don’t need it, don’t use it • Making the continuous model discrete is a challenge – But is that a good reason for not using it? • No automated tools for deriving a running system from the model available (yet) – One model, many possible implementations – Without a tool, will the model be maintained? 12. September 2013 Including spatial/temporal objects in ORM – a proposal 6
Some basic concepts • • • The space Direct positions Locations Spatial values Spatial constraints (topological constraints) Implementation issues 12. September 2013 Including spatial/temporal objects in ORM – a proposal 7
The space y (m) t (dhm) x (m) • m: x, m: y, dhm: t 12. September 2013 Including spatial/temporal objects in ORM – a proposal 8
The direct position y (m) t 4 (dhm) 300: 07: 30 3 x (m) • (3, 4, 300: 07: 30) 12. September 2013 Including spatial/temporal objects in ORM – a proposal 9
The location y (m) t (dhm) x (m) • {m: x, m: y, dhm: t} • Note that the Location is a set of direct positions! 12. September 2013 Including spatial/temporal objects in ORM – a proposal 10
The spatial value y (m) t (dhm) x (m) • {x, y, t | expression on x, y, t} 12. September 2013 Including spatial/temporal objects in ORM – a proposal 11
How to model a Time. Period • Conventially [startday] Time. Period (. id) Day (ydm: t) • With spatial entity [endday] has Time. Period 12. September 2013 ({ymd: t}) Including spatial/temporal objects in ORM – a proposal 12
Something in a Location Something (. id) y occupies/is occupied by Location ({m: x, m: y, dhm: t}) (m) t Something (dhm) x 12. September 2013 Including spatial/temporal objects in ORM – a proposal (m) 13
The three object part system exterior A¯ boundary ∂A interior A 12. September 2013 Including spatial/temporal objects in ORM – a proposal 14
Spatial (topological) predicates Schneider and Behr: Topological Relationships Between Complex Spatial Objects (2006) • • disjoint meet inside contains covered. By covers equal overlap 12. September 2013 Very thorough discussion of the subject Covers also no-continuous (complex) spatial objects However, covers only 0, 1 and 2 -dimensional objects Including spatial/temporal objects in ORM – a proposal 15
Three important predicates def • disjoint(A, B) = A B = A ∂B = ∂A ∂B = def • meet(A, B) = A B = (A ∂B ∂A ∂B ) def • equal(A, B) = A B¯= A¯ B = A ∂B = ∂A B ¯ = A¯ ∂B = 12. September 2013 Including spatial/temporal objects in ORM – a proposal 16
no. Overlap, a useful additional predicate no. Overlap: Either disjoint or meet: def • no. Overlap(A, B) = A B = A¯ B A B ¯ 1. The interior of one of the spatial values has no direct positions in common with the interior of the other 2. The interior of one of the spatial values has at least one direct position in common with the exterior of the other and vice versa – this rules out situations where one of the spatial values is equal to or inside the boundary of the other 12. September 2013 Including spatial/temporal objects in ORM – a proposal 17
Some topological constraints Uniqueness constraint i, j (i j (xi equal xj)) No overlap constraint i, j (i j xi no. Overlap xj) No overlap exclusion constraint … see later 12. September 2013 Including spatial/temporal objects in ORM – a proposal 18
No overlap constraint, example 1 [country. Region] Country (. name) Region ({latitude, longitude}) Denmark Norway Sweden 12. September 2013 Including spatial/temporal objects in ORM – a proposal 19
No overlap constraint, example 2 Task Person (. name) is. Busy Smith Jones Brown Smith 12. September 2013 Including spatial/temporal objects in ORM – a proposal Time. Period ({hhmm: t}) Note! 20
No overlap exclusion constraint r 1 r 2 [project. Time] Time. Period ({yd: t}) Person (. id) r 3 r 4 [vacation. Time] No overlap exclusion constraint (r 1, r 2) no. Overlap (r 3, r 4) 12. September 2013 Including spatial/temporal objects in ORM – a proposal 21
Patterns • A pattern is a reusable model piece • We will have a look at an important example … 12. September 2013 Including spatial/temporal objects in ORM – a proposal 22
A pattern - example Countries are partitioned into Provinces Country (. name) [country. Region] Region ({latitude, longitude}) in Province (. name) [province. Region] For each Country country. Region = UProvince in Country province. Region 12. September 2013 Including spatial/temporal objects in ORM – a proposal 23
Implementation We have one conceptual model, but many possible implementation platforms, like for example: 1. A tessellation based implementation 2. An extended relational database 3. A special purpose system, like a Geographical Information System (GIS) 4. A system build around a constraint database 5. An object-oriented system The problem is the discretization! 12. September 2013 Including spatial/temporal objects in ORM – a proposal 24
A tessellation based implementation The infinite sets of direct positions are replaced by a finite sets of tiles. The tiles can be of equal size, as in a raster model (pixles in 2 D and voxels in 3 D), or irregular, as in a Triangulated Irregular Network (TIN). Main advantage: Can represent any spatial entity, although with a precision determined by the size of the tiles. Primary disadvantage: Relatively costly in terms of storage space and processing time. Boundaries are not represented explicitly; they will always run along the edges of the tessellation elements. Then it is rather convenient that our definition of the no overlap constraint does not involve the boundary. 12. September 2013 Including spatial/temporal objects in ORM – a proposal 25
Using a relational database with extensions One obvious candidate is the relational database language SQL/MM Spatial , which has been extended with spatial abstract datatypes (ADTs) for geometry (abstract), 0 D(point), 1 D (curve with specializations), 2 D (surface with specializations), 2 D tesselations (polyhedral surface with TIN as a specialization), collections (of geometries, points, curves and surfaces) and topology. 12. September 2013 Including spatial/temporal objects in ORM – a proposal 26
Using a special purpose DBMS A special purpose DBMS, like a Geographic Information System (GIS), may be an attractive option for the many systems that handle geographic information. Most such systems have at least a built in datatype called polygon, which can be used for representing the boundary, and then inherently also the interior, of a two-dimensional spatial entity in two-dimensional space. However, those systems are not really set up to handle spatial values of the kind encountered outside the GIS-world. If the model follows the pattern "The whole and its parts" , as is often the case for maps, we may use the so called network model. 12. September 2013 Including spatial/temporal objects in ORM – a proposal 27
Using a Constraint database system The general idea in such systems is to represent an infinite set of direct positions by a set of constraints that cuts the spatial value out of the space, and then to store only the constraints. Constraint databases seem to be a promising technology for databases containing spatial values. 12. September 2013 Including spatial/temporal objects in ORM – a proposal 28
Using an object-oriented system In an object-oriented system, all the difficulties of representing the spatial values are hidden inside classes and objects. From the outside we can only see the interface as a collection of methods to set and get the spatial values, to do spatial operations and to check constraints. This means that the implementor has full freedom in choosing the internal representation of a spatial value, as long as the methods are working as expected. Further, all objects have their own internal object identifier (OID) that may be used to refer to the object from elsewhere. 12. September 2013 Including spatial/temporal objects in ORM – a proposal 29
Using an object-oriented system - a comment In the object-oriented world there may be no police force that Is enforcing the rules defined by the constraints. The philosophy is rather that every object is responsible for behaving according to the rules. So, for example, to enforce the no overlap constraint, a new (or changed) spatial entity has to call some method like check. No. Overlap(another. Object) for all the other objects. It may be a better option to maintain a spatial object for the unused space (which is the exterior of the union of the already existing spatial entities) and let a new (or changed) object check for being inside that space. 12. September 2013 Including spatial/temporal objects in ORM – a proposal 30
So, what is the proposal? • Spatial entities should be first order citizens, i. e. no collections • Spatial values are seen as a (possibly infinite) mathematical set of direct positions • A direct position is given as a coordinate in some coordinate system • For calculations, use the spatial predicates defined by Schneider and Behr (2009) … • … plus the very useful no. Overlap predicate • Useful constraints and patterns may be defined 12. September 2013 Including spatial/temporal objects in ORM – a proposal 31
Implementation issues • The continous conceptual model must be discretizised • This can be done in several ways, considering the available technical platform(s) 12. September 2013 Including spatial/temporal objects in ORM – a proposal 32
Conclusion • A spatial system may have several possible implementations – an Object-Role Model on a high level of abstraction may serve as a common picture of the world! 12. September 2013 Including spatial/temporal objects in ORM – a proposal 33
- Slides: 32