From 9-IM Topological Operators to Qualitative Spatial Relations
using 3D Selective Nef Complexes and Logic Rules for Bodies
Helmi Ben Hmida
1,2
, Christophe Cruz
2
, Frank Boochs
1
and Christophe Nicolle
2
1
Laboratoire Le2i, UMR-5158 CNRS, Dep. Informatique IUT Dijon, 7 Boulevard Docteur Petitjean,
BP 17867, 21078 Dijon CEDEX, France
2
Institut i3mainz, am Fachbereich 1 - Geoinformatik und Vermessung, Fachhochschule Mainz,
Lucy-Hillebrand-Str. 2, 55128 Mainz, Germany
Keywords: Topological Relations, 9-IM, Selective Nef Complex, Ontology, Logic Rules, OWL, SWRL.
Abstract: This paper presents a method to compute automatically topological relations using SWRL rules. The
calculation of these rules is based on the definition of a Selective Nef Complexes Nef Polyhedra structure
generated from standard Polyhedron. The Selective Nef Complexes is a data model providing a set of binary
Boolean operators such as Union, Difference, Intersection and Symmetric difference, and unary operators
such as Interior, Closure and Boundary. In this work, these operators are used to compute topological
relations between objects defined by the constraints of the 9 Intersection Model (9-IM) from Egenhofer.
With the help of these constraints, we defined a procedure to compute the topological relations on Nef
polyhedra. These topological relationships are Disjoint, Meets, Contains, Inside, Covers, CoveredBy,
Equals and Overlaps, and defined in a top-level ontology with a specific semantic definition on relation such
as Transitive, Symmetric, Asymmetric, Functional, Reflexive, and Irreflexive. The results of the
computation of topological relationships are stored in an OWL-DL ontology allowing after what to infer on
these new relationships between objects. In addition, logic rules based on the Semantic Web Rule Language
allows the definition of logic programs that define which topological relationships have to be computed on
which kind of objects with specific attributes. For instance, a “Building” that overlaps a “Railway” is a
“RailStation”.
1 INTRODUCTION
Nowadays, qualitative spatial relationships are used
in many areas of Computer Science where reasoning
about such relationships is fundamental to infer
about graphical depiction through logic mechanisms.
Such relationships facilitate the access to data by a
query processing mechanism that refers to objects
and their relationships. Methods for modelling
spatial relationships have been compiled in several
surveys such as (Galton, 2009) where current
models belong to two main categories – connection
based model (Randell et al., 1992), and intersection
based one (Egenhofer and Herring, 1990). From a
logical point of view, the qualitative models are
defined to infer on topological relations without
taking into account real geometries. The Open
Geospatial Consortium (OGC) has defined a
standard nomination to the basic topological
relations (Consortium, 2012). From the
space
implementation of theses topological relation point
of view, (Borrmann et al., 2009), the octree-based
implementation, (Meagher, 1982), and the B-Rep
approaches (Lienhardt, 1991) are used to define the
spatial operators of a query language. In the octree-
approach, Octrees allows the application of recursive
algorithms that successively increase the discrete
resolution of the spatial objects employed. The B-
Rep, approach is used for metric operators such as
mindist, maxdist, isCloserto and isFartherfrom.
From the semantics point of view, the qualitative
spatial relations are used to perform inference and to
identify inconsistencies on these relations. An
ontology based approach is described in
(Karmacharya et al., 2011) and focuses on regions
in
. The presented approach aims at defining
topological relations based on the 9 Intersection
Model in
, (Ellul and Haklay, 2009), and compute
them with the Boolean operators defined by the Nef
polyhedra (Granados et al., 2003). In the actual
208
Ben Hmida H., Cruz C., Boochs F. and Nicolle C..
From 9-IM Topological Operators to Qualitative Spatial Relations using 3D Selective Nef Complexes and Logic Rules for Bodies.
DOI: 10.5220/0004135702080213
In Proceedings of the International Conference on Knowledge Engineering and Ontology Development (KEOD-2012), pages 208-213
ISBN: 978-989-8565-30-3
Copyright
c
2012 SCITEPRESS (Science and Technology Publications, Lda.)
contribution, the quantitative spatial operators are
implemented using built-ins based the Semantic
Web Rules Languages (SWRL) which allows the
definition of logic program base on Horn-like
clauses (Horrocks et al., 2004). This language is
designed to perform logical program on Ontology
Web Language (OWL) (Antoniou and Harmelen,
2009). Consequently, the results of these 3D spatial
operators may enrich the ontology with spatial
relations between the different objects represented
via polyhedron. Figure 1 depicts the process
sequence for the enrichment of an ontology
containing 3D objects.
Figure 1: General overview of the process sequence.
This paper is divided into 5 sections. Section 2
introduces the technical background on 9-IM,
Selective Nef Complex, and logic rules. Section 3
deals with the important elements of the
implementation concerning the process sequence.
Section 4 highlight the SWRL rules impact on
semantic qualification of geometries and finally
section 5 concludes the paper.
2 BACKGROUND
This section is divided into three sections. The next
sub-section focuses on the 9-IM models used to
qualify topologic relation. The second sub-section
deals with a new data model called Selective Nef
Complexes that allows the computation of operators
on Nef Polyhedra. These operators are used to verify
the topological relation constraints. Finally, the last
section deals with the logic aspect and the
representation of quantitative topological relations.
2.1 Topological Relationships
Spatial reasoning is the process that uses spatial
theory and artificial intelligence to model and to
analyse spatial relations between objects. The
standard models are composed by the Simple
Feature Relations, The Egenhofer Relations and the
RCC8 Relations (Stocker and Sirin, 2009). The
Egenhofer Relations are composed of the following
relationships: Equals, Disjoint, Meet, Overlap,
Covers, Covered by, Inside, Contains (Egenhofer,
2010).
Binary topological relations between two
objects, A and B is based upon the intersection of
A’s interior (A°), boundary (δA), and exterior (A
-
)
with B’s interior (B°), boundary (δB), and exterior
(B
-
). The 9 intersections between the six objects
parts describe a topological relation and can be
concisely represented by a 3x3 matrix, called the 9-
Intersection Model. The binary relationship R(A,B)
between the two objects is then identified by
composing all the possible set intersections of the
six topological primitives, i.e. AB, δAB,
A
B, AδB, δAδB, A

δB,
AB
,δAB
,A
B
, and qualifying empty ()
or non-empty () intersections. Table 1 shows the
9-IM matrices of the eight topological predicates
defined by Egenhofer.
Table 1: The 9-IM matrix.
,

° ° °

°  


∩°

∩

∩

Table 2: The 6 topological relations between the basic
body object, A is the blue box, and B is the red box.
AmeetsB
BmeetsA
∅∅∗
∗∗
∗∗

∅∗
∅ ∗ ∗
∗∗

∅∗∗
∗
∗∗
Acontains
B
BinsideA
∅
∗∗
∅∅

AequalsB
BequalsA
∗∅
∅∗∅
∅∅

Table 2 represents the topology in
and
with
the 9-IM matrixes for bodies. A basic body object in
3D space is a convex polyhedron that constructed by
n (n>2) connected regions (r1, r2, …,rn). The
interior connects and does not contain holes.
From9-IMTopologicalOperatorstoQualitativeSpatialRelationsusing3DSelectiveNefComplexesandLogicRulesfor
Bodies
209
2.2 Selective Nef Complex
The Selective Nef Complex (SNC) presents a model
to define a partition with the labelling of its cells.
When the labels are Booleans in order to define the
in and out parts, the complex describes a set, a so-
called Nef polyhedra (Nef, 1978). In the
implementation of Nef polyhedra in 3D (Granados et
al., 2003), they offer a B-rep data structure that is
closed under Boolean operations and with all their
generality. Starting from halfspaces, it is possible to
work with union, intersection, difference,
complement, interior, exterior, boundary, closure,
and regularization operators. The theory of Nef
polyhedra has been developed for arbitrary
dimensions. A Nef-polyhedra in dimension d is a
point set P ⊆
generated from a finite number of
open half spaces by set complement and set
intersection operations and is closed under all
Boolean set operations. The implementation in
(Granados et al., 2003) provides functions and
operators for the most common ones: complement,
union, difference, intersection and symmetric
difference. It provides the topological operations
interior, closure and boundary. The interior operator
deselects all boundary items. The boundary operator
deselects all volumes, and the closure operator
selects all boundary items.
Table 3: Set of binary and unary operators
Operators Syntax
Complement A
Union A∪B
Difference A\B
Intersection A∩B
Symmetric difference A∆B
Interior I(A)
Closure C(A)
boundary B(A)
2.3 Ontology and Rules
Ontology is a formal representation of the
knowledge through the hierarchy of concepts and the
relationships between those concepts. In theory,
ontology is a formal, explicit specification of shared
conceptualization (Gruber, 1993). Description logics
(DLs) (Calvanese et al., 2001) are a family of
knowledge representation languages that can be used
to represent knowledge of an application domain in
a structured and formally well-understood way. The
following example defines a Mother as a Woman
which has at least a child type of Person. By
inference, it means that every individual type of
Women which as at least a relation with a Person
and the type of the relation is “hasChild”, then this
Woman is of kind of Mother.
MotherWoman∃hasChild.Person
(1)
As the Semantic Web technologies matured, the
need of incorporating the concepts behind
description logic within the ontology languages was
realized. It took few generations for the ontology
languages defined within Web environment to
implement the description language completely. The
Web Ontology Language (OWL) (Antoniou and
Harmelen, 2009) is intended to be used when the
information contained in documents needs to be
processed by applications and not by human. The
horn logic more commonly known the Horn clauses
is a clause with at least one positive literal. It has
been used as the base of logic programming and
Prolog languages (Sterling et al., 1986) for years.
These languages allow the description of knowledge
with predicates. Summarizing, it could be said that
ontology defines the data structure of a knowledge
base and this knowledge base could be inferred
through various inference engines. These inference
engines can be perform under Horn logic through
Horn-like rules languages. The system of built-ins
should also help in the interoperation of SWRL with
other Web formalisms by providing an extensible,
modular built-ins infrastructure for Semantic Web
Languages, Web Services, and Web applications.
These built-ins are keys for any external integration,
like the integration of the topological operators.
2.4 Enrichment of an Ontology from
Boolean Operators
The use of SNC model and its associated Boolean
operator allows us to model the topological
relationships. In order to combine SWRL rules with
topological operators, news built-ins are defined in
order to compute the operator. Consequently, the
results of the operators can be used to define queries
or to enrich the ontology with new topological
relationships between two objects. In order to make
it possible, two issues appear and have to be solved.
First, the semantic definition of the relationships has
to be done in the ontology regarding their own
properties. Second, the calculation of topological
relationships using Boolean operators has to be
defined regarding the constraints of the 9-IM model.
The following rule specifies that a “Building”
KEOD2012-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
210
defined in the ontology that overlaps a “Railway”
defined as well in the ontology, is a “RailStation”.
Buiding(?b) ^ Railway(?r) ^
topo:overlaps(?b, ?r) RailStation(?b)
(2)
3 IMPLEMENTATION
This section is divided into three sections. The first
describes how the Boolean operators are used to
compute the 9-IM matrix for a topological relation
qualification. The second introduces news
relationships in the top-level ontology and its built-
in counterparts. These news relationships are
specified with a semantic definition. The last section
deals with the translation engine which allows the
computation of the topological built-ins to enrich the
ontology.
3.1 Calculation of 9-IM using the SNC
Boolean Operators
Table 4 presents an overview of the available SNC
Boolean operators. Regarding the Table 1 about the
9-IM matrix, only the operators about intersection
(A∩B), interior (A°equivalent I(A)), boundary (δA
is equivalent to B(A)) and complement (A

is
equivalent to
I
A
∪
that we will be denoted
as E(A)) are necessary. Consequently, the following
9-IM matrix with SNC operators is deduced.
Table 4: The updated 9-IM matrix with SNC operators.
,

IAI B 
I B 
I  
If the results of the nine updated equation is
conformed to the expected results then the relation is
true. Otherwise the relation is false. Table 5 is an
example of the disjoint relation. If one of these
equations is false, then the relation between the two
objects does not exist.
Table 5: Example for the disjoint relation.
,

I
A
∩I
B ∅
I B 
I∅ ∅ ∅
3.2 Definition of Topologic
Relationships in the Ontology
Regarding our knowledge base, the top level
ontology is created to model the topological
relationships. This ontology is used to enrich an
existing knowledge base to make it possible to
define topological relationships between objects.
The next table summarizes for each topological
relation, its name in the ontology using the prefix
“topo”, its semantic characteristics and the new
built-in to automatize the computation of relations
with the help of SWRL rules. In addition, two
inverse relations are defined in the top level
ontology. The topo:inside relation is the inverse
relation of topo:contains, and the relation
topo:covers is the inverse relation of
topo:coveredBy.
Table 6: Definition of the topological relationships and its
semantics.
Topologic
relations
Property Characteristics
SWRL built-
ins
Meets
topo:
meets
Symmetric
Irreflexive
swrl_topo:mee
ts (?x, ?y)
Inside
topo:
inside
Transitive
Asymmetric
Irreflexive
swrl_topo:insi
de (?x, ?y)
Equals
topo:
equals
Transitive
Symmetric
Reflexive
swrl_topo:equa
ls (?x, ?y)
3.3 Translation Engine
The translation engine allows the computation of
spatial SWRL rules which can also be in form of
queries. It interprets the statements in order to parse
the spatial components. Once the spatial components
are parsed, they are computed through relevant
spatial functions and operations by the translation
engine through the operations provided at the SNC
level. The results are populated in the knowledge
Figure 2: The translation engine that process rules with
topological built-ins.
From9-IMTopologicalOperatorstoQualitativeSpatialRelationsusing3DSelectiveNefComplexesandLogicRulesfor
Bodies
211
base, thus making it spatially rich. After that, the
spatial statements are translated to standard ones for
the executions through their respective engines.
With the inference engine, the enrichment and the
population of the ontology through the results of the
inference process is eventually stored in the
knowledge base, Figure.
4 SWRL RULES IMPACT ON
SEMANTIC QUALIFICATION
To highlight the utilisability of the presented
approach, we decide to extend the research by
making a step forward from the qualification of the
spatial relation semantically to the extension of the
semantic rules and query language creating a 3D
Semantic Spatial Qualification platform (3DSQ).
Such an improvement will support the inference on
3D spatial knowledge and will allow finally
querying spatial knowledge base. To do, a Java
prototype demonstrating the applicability of the
presented concept was developed. It ensure the
interaction between the users, the OWL ontology
and the Qualification engine from one side and
maintain an interactive visualisation of the qualified
Spatial Relation from another side.
Add to its ability to process Spatial Data in our
case, 3DSQ platform guarantee a common
understanding of Spatial domain between Human
and machines via ensuring the Semantic inference
and queries using Spatial knowledge. The
declaration of the spatial built-Ins in our cases
respects the standard nomination suggested by
Egenhofer (Egenhofer, 2010). As convention, each
Topological Built-Ins began with the prefix
“Swrlb_Topo” where the first syllable state that it
presents a complex Built-Ins while the second one
highlight the type of the Built-Ins, “Topo” in our
case. Finally, the type of spatial topological
predicate, “Inside” for example, will validate such a
relation. In such case, the scene in question and the
spatial qualification results are presented in different
colours depending on the nature of objects.
To prove it, an IFC architectural scene containing
just geometric elements was populated in the
ontology. Furthermore, spatial relations between
populated geometries are qualified via the 3DSQ. In
the next, two examples reflecting the main
languages acting with the semantic web one which
are the SWRL and SQWRL (Semantic Query-
Enhanced Web Rule Language) one will be
highlighted.
Figure 3: Example of an Inside Relationship (Blue Sky
elements).
First, the rule 3 shows an example able to extract
from the knowledge base all the elements “Inside”
walls individuals which can be qualified later on if
respecting certain characteristics as windows for
example, Figure 3.
Wall(?x) ^ Geometry(?y) ^ swrlb_Topo:Inside
(?x,?y) ^ haslength(?y,?l) ^ swrlb:LessThan
(?l,2) Windows (?y)
(3)
Second, as we have already selected a qualitative
manner based on semantic knowledge to define
spatial operators, SQWRL (Semantic Query-
Enhanced Web Rule Language) language can be
used as a query language to query the knowledge
base. The next equation (rule 4) is an example of a
query that select all “Meets” spatial elements with
the element “BldgElem__113_BBox” in the current
knowledge base, Figure 4.
Geometry(BldgElem__113) Geometry (?y)
Swrlb_Topo: Meets (BldgElem__113, ?y)
sqwrl:select(?y)
(4)
Figure 4: Example of SQWRL rule result.
5 CONCLUSIONS
This paper presents a semantic method to compute
automatically topological relations using OWL
ontology and SWRL rules. The calculation of these
rules is based on the definition of Nef Polyhedra
which can be generated automatically from standard
KEOD2012-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
212
Polyhedron. A prototype is being developed using
the library CGAL (http://www.cgal.org). Some
simplification will be undertaken regarding the 9-IM
computation of each topological relationship in
order to reduce the calculation volume. Future work
on topological relation qualification will be mainly
focus on semantic qualification and inferences
(Boley et al., 2001) and depicted in the next
generation of SWRL topologic rule. This can also be
done by a composition of relations, meet
containsDisjoint
.
meet (?a, ?b) ^ contains(?a, ?c) disjoint (?a, ?c)
(4)
REFERENCES
Abdul-Rahman, A., Pilouk, M., 2007. Spatial data
modelling for 3D GIS. Springer Publishing Company.
Antoniou, G., Harmelen, F., 2009. Web ontology
language: OWL. Handbook on ontologies, pp. 91--
110.
Boley, H., Tabet, S., Wagner, G., 2001. Design rationale
of RuleML: A markup language for semantic web
rules, pp. 381--402.
Borrmann, A., Schraufstetter, S., Rank, E., 2009.
Implementing metric operators of a spatial query
language for 3D building models: octree and B-Rep
approaches. Journal of Computing in Civil
Engineering, Volume 23, p. 34.
Calvanese, D., De Giacomo, G., Lenzerini, M., Nardi, D.,
2001. Reasoning in expressive description logics.
Handbook of Automated Reasoning, Volume 2, pp.
1581--1634.
Consortium, O. G., 2012. OGC Reference Model (ORM).
[Online], Available at: http://www.opengeospatial.org/
standards/orm [Accessed 14 04 2012].
Egenhofer, M. J., 2010. Qualitative Spatial-Relation
Reasoning for Design, NSF International Workshop
on Studying Visual and Spatial Reasoning for Design
Creativity, Aixen-Provence.
Egenhofer, M. J., Herring, J., 1990. A mathematical
framework for the definition of topological
relationships. In: Fourth International Symposium on
Spatial Data Handling. pp. 803--813.
Ellul, C., Haklay, M. M., 2009. Using a B-rep structure to
query 9-intersection topological relationships in 3D
GIS--reviewing the approach and improving
performance. 3D Geo-information Sciences, pp. 127--
151.
Galton, A., 2009. Spatial and temporal knowledge
representation. Earth Science Informatics, Volume 2,
pp. 169--187.
Granados, M., Hachenberger, P., Hert, S., Kettner, L.,
Mehlhorn, K., Seel, M., 2003. Boolean operations on
3D selective Nef complexes: Data structure,
algorithms, and implementation. Algorithms-ESA
2003, pp. 654--666.
Gruber, T. R., 1993. A translation approach to portable
ontology specifications. Knowledge acquisition,
Volume 5, pp. 199--220.
Horrocks, I. et al., 2004. SWRL: A semantic web rule
language combining OWL and RuleML. W3C
Member submission, Volume 21, p. 79.
Karmacharya, A., Cruz, C., Boochs, F. & Marzani, F.,
2011. Integration of Spatial processing and knowledge
Processing through the Semantic Web Stack.
GeoSpatial Semantics, pp. 200--216.
Lienhardt, P., 1991. Topological models for boundary
representation: a comparison with n-dimensional
generalized maps. Computer-Aided Design, Volume
23, pp. 59--82.
Meagher, D., 1982. Geometric modeling using octree
encoding. Computer Graphics and Image Processing,
Volume 19, pp. 129--147.
Nef, W., 1978. Beitrage zur Theorie der Polyeder: mit
Anwendungen in der Computergraphik. Lang.
Perry, M. & Herring, J., 2010. GeoSPARQL--A
geographic query language for RDF data. A proposal
for an OGC Draft Candidate Standard. Open
Geospatial Consortium, Volume 27.
Randell, D. A., Cui, Z., Cohn, A. G., 1992. A spatial logic
based on regions and connection. KR, Volume 92, pp.
165--176.
Sterling, L., Shapiro, E., Eytan, M., 1986. The art of
Prolog. Wiley Online Library.
Stocker, M., Sirin, E., 2009. Pelletspatial: A hybrid rcc-8
and rdf/owl reasoning and query engine. Proc. 6
th
International Workshop OWL: Experiences and
Directions (OWLED), Volume 529.
From9-IMTopologicalOperatorstoQualitativeSpatialRelationsusing3DSelectiveNefComplexesandLogicRulesfor
Bodies
213