Unit II Spatial and Temporal Databases
Unit II Spatial and Temporal Databases
Active Database:
Active Database is a database consisting of set of triggers.
A trigger is a procedure which is automatically invoked by the DBMS in response to changes
to the database, and is specified by the database administrator (DBA). A database with a set of
associated triggers is generally called an active database.
Example :
Triggers included in Oracle, Sybase,DB2
Inventory control – reordering items when quantity in stock falls below threshold.
Travel Waiting list –Book ticket as soon as right kind is available
Stock Market –Buy/Sell stocks when price below /above threshold .
Event-condition-action (ECA) model or(Parts of trigger)
A triggers description contains three parts, which are as follows −
Event − Event triggers a rule
Usually database update operations
An event is a change to the database which activates the trigger.
Condition −Action will complete only if condition evaluates to true
Action −A procedure which is executed when the trigger is activated and its condition
is true. Sequence of SQL statements, transaction, or external program
Types of triggers
The different types of triggers are explained below −
Statement level trigger − It is fired only once for DML statement irrespective of
number of rows affected by statement. Statement-level triggers are the default type of
trigger.
Before-triggers − At the time of defining a trigger we can specify whether the trigger is
to be fired before a command like INSERT, DELETE, or UPDATE is executed or after
the command is executed. Before triggers are automatically used to check the validity
of data before the action is performed. For instance, we can use before trigger to
prevent deletion of rows if deletion should not be allowed in a given case.
After-triggers − It is used after the triggering action is completed. For example, if the
trigger is associated with the INSERT command then it is fired after the row is
inserted into the table.
Row-level triggers − It is fired for each row that is affected by DML command. For
example, if an UPDATE command updates 150 rows then a row-level trigger is fired
150 times whereas a statement-level trigger is fired only for once.
Create database trigger
The syntax to create database trigger is as follows –
Active Rules: Rules that are automatically triggered by events in the database
Example:
Events that may cause a change in value of Total_sal attribute
Inserting new employee -R1
Changing salary -R2
Reassigning or deleting employees -R3
Figure 26.1 A simplified COMPANY database used for active rule examples
Figure 26.2 Specifying active rules as triggers in Oracle notation (a) Triggers for
automatically maintaining the consistency of Total_sal of DEPARTMENT
Triggers in SQL-99
s
Figure 26.6 Trigger T1 illustrating the syntax for defining triggers in SQL-99
Spatial Data Mining Temporal Data Mining
Spatial data mining refers to the temporal data mining refers to the process of
extraction of knowledge, spatial extraction of knowledge about the occurrence
relationships and interesting patterns of an event whether they follow, random,
that are not specifically stored in a cyclic, seasonal variation, etc
spatial database.
Primarily, it deals with spatial data Primarily, it deals with implicit and explicit
such as location, geo-referenced. temporal content, form a huge set of data.
❖ Spatial data are of two types according to the storing technique, namely,
1) Raster data - it is composed of grid cells identified by row and column. The
whole geographic area is divided into groups of individual cells, which
represent an image. Satellite images, photographs, scanned images, etc., are
examples of raster data.
2) Vector data - it is composed of points, polylines, and polygons. Wells, houses,
etc., are represented by points. Roads, rivers, streams, etc., are represented by
polylines. Villages and towns are represented by polygons. Vector data
composed of points, lines, polygons
1.Map Data
2. Attribute Data:-
It is a descriptive data that GIS system associate with map Features
.example:Population,largest city,area in square miles
3. Image data :-
It includes data such as satellite images and aerial photographs, which are created
by camera.
Image can also be attribute of Map features .
Spatial Operators:
❖ Topological operators: through topology we can express predicates about the
connection, the number of components, the presence/absence of holes as well as
topological relations (which describe whether two objects intersect or not, and, in the
former case, how they intersect)
❖ Projective operators: through projective operators, we can express predicates about
the concavity/convexity of objects as well as other spatial relations (e.g., being inside
the concavity of a given object)
❖ Metric operators: through metrics, we can express predicates about the compactness
or symmetry properties of objects as well as distance and directional relations.
❖ Dynamic Spatial Operators : Dynamic operations change the objects upon which the
operators are applied. Create, destroy, and update are the fundamental dynamic
operations.
Spatial queries:
❖ Spatial queries are queries in a spatial database that can be answered on the basis of
geometric information only, i.e., the spatial position and extent of the objects
involved.
❖ There are mainly three types of spatial queries as given below.
1. Nearest neighbour queries:
It requests objects that present near a specified location. The nearest-neighbour
query requests the object that is nearest to a specified point.
For example, we may want to find the nearest Railway station.
2. Range queries:
It deals with spatial regions. For example, a query can ask for objects that are
present partially or completely within a fixed region. A query to find all medicine
shops within the geographic boundaries of a given town or we can find all the
available schools in a particular city.
3. Union/Intersection:
In this type of queries, we may also request intersections and unions of regions.
For example, given region information, such as annual rainfall and population
density, a query may request all regions with a low annual rainfall as well as a
high population density.
Spatial Data Indexing Techniques:
1. Grid Files:
Fixed grid index is an n×n array of equal-size cells. Each one is associated with a list of
spatial objects which intersect or overlap with the cell. Figure 3 depicts a fixed 4×4 gird
indexing a collection of three spatial objects.
2. R-Tree:
The minimum bounding rectangle, or MBR, which is also called minimum bounding
box, or MBB. An MBR is a single rectangle that minimally encloses the geometry in
2D plane.
The coverage of covering rectangles and overlaps between them in the R-tree are
affected by the objects are being partitioned into groups by its splitting algorithm. This
hierarchical structure is based on the heuristic optimization of the area of MBRs in
each node in order to improve the access efficiency.
M4 through M9 are MBRs of spatial objects in a layer. They are the leaf nodes of the
R-tree index, and contain minimum bounding rectangles of spatial objects, along with
pointers to the spatial objects. M2 and M3 are parents of the leaf nodes. M1 is the
root, containing all the MBRs. This R-tree has a depth of three.
A spatial join index precomputes a spatial join operation and stores the pointers to a
related object in an index structure .
Join indexes improve the performance of recurring join queries .
Spatial join conditions are used to answer the queries such as “Create a list of highway
–river combinations that cross .
1. Spatial Classification :
The task of classification is to assign an object to a class from a given set of classes
based on the attribute values of this object. In spatial classification the attribute values
of neighbouring objects are also considered.
2. Spatial Clustering:
Spatial clustering is a process of grouping a set of spatial objects into clusters so that
objects within a cluster have high similarity in comparison to one another, but are
dissimilar to objects in other clusters. For example, clustering is used to determine the
“hot spots” in crime analysis and disease tracking. Hot spot analysis is the process of
finding unusually dense event clusters across time and space. Many criminal justice
agencies are exploring the benefits provided by computer technologies to identify
crime hot spots in order to take preventive strategies such as deploying saturation
patrols in hot spot areas.
3. Spatial association:
This rule is a rule indicating a certain association relationship among a set of spatial
and possibly some non-spatial predicates. A strong rule indicates that the patterns in
the rule have relatively frequent occurrences in the database and strong implication
relationships.
Multimedia databases
Multimedia Database
Content of Multimedia database – Text, Graphic, Video, Audio, Animation
Types of Multimedia Data –Static, dynamic, dimensional
Content-based retrieval
Automatic analysis of images
Object Recognition in Images
Semantic Tagging of Images –Semantic tag , OWL
Analysis of Audio Data Source - Text-based indexing, Content-based indexing
Challenges of Multimedia Database
Categories of Multimedia Data Mining
Multimedia Database Applications
Multimedia Database
The multimedia databases are used to store multimedia data such as images, animation,
audio, video along with text. This data is stored in the form of multiple file types like
.txt(text), .jpg(images), .swf(videos), .mp3(audio) etc.
Contents of the Multimedia Database
The multimedia database stored the multimedia data and information related to it. This is
given in detail as follows −
Media data
This is the multimedia data that is stored in the database such as images, videos, audios,
animation etc.
The multimedia database can be classified into three types. These types are:
1. Static media
2. Dynamic media
3. Dimensional media
Static media contains text (digital library, creating SMS and MMS) and
images (photos and medical images) .time independent
Dynamic media contains Audio (music and MP3 sounds) and Video
(movies). time dependent
Dimensional data are 3D game and computer aided drafting programs
Content-based retrieval,
The multimedia source is being retrieved based on its containing certain objects or activities.
For example, one may want to locate all video clips in a video database of a person, say
Michael Jackson
1. One approach is to divide the image into homogeneous segments using a homogeneous
predicate. For example, in a colored image, adjacent cells that have similar pixel values are
grouped into a segment. The homogeneity predicate defines conditions for automatically
grouping those cells .
2. Another approach
finds measurements of the object that are invariant to transformations. It is impossible to
keep a database of examples of all the different transformations of an image . To deal with
this, object recognition approaches find interesting points (or features) in an image that are
invariant to transformations used scale invariant features from images to perform reliable
object recognition. This approach is called scale-invariant feature transform (SIFT)
s
Categories of Multimedia Data Mining