(Warmer and Kleppe, 2003). Also according to the
authors a lot of failures from diagrams are caused by
limitations of the models which cannot express all
data requirements of the complete application
specification. Due to the fact that natural language
lead to ambiguities during its interpretation process
by different persons, the OCL proposes to
complement the UML diagrams in an accurate and
not ambiguous way, creating a more complete and
satisfactory specification of the problem.
Duboisset et al., (2005) propose OCL
expressions involving the relationship between
areas, based in 8 topological relationships that are
described in Egenhofer and Franzosa (1991). The
extension proposed in this article is based in
Duboisset et al., (2005), but extended to the
topological relationships between point, line and
polygon of section 2.
3.1 Validating the Topological
Relationships on UML-GeoFrame
In the UML-GeoFrame data model, the geographic
phenomena are modeled by classes with stereotypes
of spatial representation corresponding to the
symbols that can characterize its geometrical
representation. A class of phenomenon in the object
view can have a geometrical representation of type
point (), line () or polygon (). A class can have
multiple representations. This property can be used,
for example, when an object can be stored as point
and area, according to the scale of the application.
In addition to the phenomenon from the object
view, there is a lot of phenomenon in the field view
that can have a geometrical representation of grid
cells (), grid of points (), adjacent polygons
(),isolines () and irregular points () types.
Based in the characteristics of the field view
presented by Lisboa Filho et al. (1996), the
topological constraints presented in section 2 do not
apply, thereby this article will treat only the existent
relationships in the object view.
Textual stereotypes (<<stereotypes>>) are used
in the UML-GeoFrame diagrams to specify existing
topological relationships between the geographical
phenomenon classes, allowing the designer to have a
better understanding of the diagram. However, the
use of textual stereotypes itself may not make clear
the topological relationship between the involved
classes, since it contains no mechanism to indicate
the order in which its reading can be realized.
A possible solution to the problem referring to
the interpretation of topological relationships is to
use existing arrows of the UML. According to
Dietrich and Urban (2005), an arrow can be used to
indicate how the reading of the associations between
the classes can be made.
However, even with the use of arrows to indicate
a direction to read and the use of textual stereotypes
to indicate spatial constraints between two classes, a
less experienced designer could model the
topological relationships in the incorrect form. For
example, when modeling two distinct classes
represented by the geometric type Point, the
designer could specify the relationship “touch”
although this type of relationship does not exist
between the types Point and Point. The model alone
cannot avoid that errors like this can be added in the
conceptual modeling phase. Therefore, this paper
proposes constraints using OCL defined about the
own UML-GeoFrame to verify if relationships
specified in diagrams are valid. Constraints are
specified using the syntax in Code 1:
Code 1: OCL syntax for the UML-GeoFrame validation.
context Class1
inv: self.geometry.OclIsKindOf(geometricType)
inv: Class2.geometry.OclIsKindOf(geometricType)
inv: self.stereotype = PossibleRelationTypes
The proposed OCL expression, with the intention
of validating the UML-GeoFrame diagram, uses
syntax constructors from the standard OCL. These
constructors are reserved words, like Context, that
informs the class to which the OCL expression is
related, specifying an entity defined in the UML
diagram. It also possesses invariants (inv) that are
boolean expressions, which define rules that must
always be satisfied by all instances of defined type.
The reserved word self is optional and used to
explicitly refer to an instance that was specified in
context. For example, in the expression in Code 1,
self refers to an instance of Class1.
Besides the reserved words used in the OCL
standard, the OCL expression presented in Code 1
extends the OCL by adding geographical
constructors to help the validation of the diagram
build using the UML-GeoFrame conceptual data
model. Therefore, the reserved word geometry is
added to the OCL and together with the existing
reserved word OCLIsKindOf, verifies whether the
modeled classes are of point, line or polygon type.
OCLIsKindOf is used to verify if the declared type is
equal to the one restrained in the context class.
This notation of the OCL expression proposed in
Code 1 is used with the purpose of verifying if the
relationship involving the classes are valid, thus
avoiding errors during the modeling and the
ICEIS2013-15thInternationalConferenceonEnterpriseInformationSystems
288