Topological relationships play an important role in query optimization in spatial databases. If topological relationships are known a priori, then expensive query processing can be avoided. In this paper we address the problems of: ⅰ) identifying topological relationships among spatial objects, ⅱ) checking consistency of specified topological relationships, and ⅲ) exhaustively deriving new topological relationships from the ones specified. These activities lead to an efficient query processing when queries associated with topological relationships are invoked. Specifically, eight types of topological relationships ({equal, disjoint, overlap, meets, contains, contained-in, properly-contains, and properly-contained-in}) are considered. We present an algorithm to check the consistency of specified topological relationships and to derive all possible relationships from the given set of known relationships.