Learning Ontology from Object-Relational Database

Abstract This article describes a method of transformation of object-relational model into ontology. The offered method uses learning rules for such complex data types as object tables and collections – arrays of a variable size, as well as nested tables. Object types and their transformation into ontologies are insufficiently considered in scientific literature. This fact served as motivation for the authors to investigate this issue and to write the article on this matter. In the beginning, we acquaint the reader with complex data types and object-oriented databases. Then we describe an algorithm of transformation of complex data types into ontologies. At the end of the article, some examples of ontologies described in the OWL language are given.


I. INTRODUCTION
Many systems use object-oriented databases in the architecture [1]- [4].The process of ontology creation from such databases is insufficiently well described in scientific articles and literature.Object-oriented database (OOD) is a database in which data are modelled in the form of objects, their attributes, methods and classes.
This article describes a transformation algorithm of objectrelational model into ontology [8]- [12].The algorithm is constructed on application of compliance rules for complex data types, which are implemented in a relational database from Oracle Corporation.In the beginning, we consider complex data types, then the algorithm of transformation, and in conclusion we describe some examples of transformation of complex data types into ontologies.

II. COMPLEX DATA TYPES
For modelling real objects, for example, such as clients, orders and payments, complex data types are used in databases.Oracle company in its own database product allows one to implement the following types of data: object tables, collectionsvariable length arrays and nested tables.
The created object types may contain the built-in data types, earlier defined object types, references to objects and collections.Object data types can be used for processing video, audio and graphic information.
The model of object types is similar to the mechanism of classes in object-focused programming implemented in such languages as C++, Java.Likewise classes, object types can also be reused, which makes the process of application programming of databases more effective and fast.
Let us consider the main characteristics of object-oriented databases.

III. CHARACTERISTICS OF OBJECT-ORIENTED DATABASES
Object-oriented databases are usually recommended for those cases when high-performance data processing is required, having complex data structure.
Characteristics of OOD are considered in the OOD manifesto [5].Their choice is based on two criteria: the system has to be object-oriented and represent a database.
In what follows, we will list obligatory characteristics of object-oriented databases.
Support of complex objects.A possibility of creation of compound objects due to application of constructors of compound objects has to be provided in the system.It is required that constructors of objects are orthogonal, that is, any constructor would be possible to apply to any object.
Support of identity of objects.All objects have to have the unique identifier, which does not depend on the values of object attributes.
Encapsulation support.Correct encapsulation is reached because programmers have the right of access only to the specification of the interface of methods, and data and implementation of methods are hidden in objects.
Support of types and classes.It is required that in the OOD at least one concept of distinction between types and classes was supported.(The term "type" rather corresponds to the concept of abstract type of data.The variable appears in programming languages with the indication of its type.The compiler can use this information to check the operations, which are carried out from a variable on compatibility with its type that allows one to guarantee software correctness.On the other hand, the class is a certain template for the creation of objects and provides methods, which can be applied to these objects.Thus, the concept "class" belongs to the time of execution rather than to the time of compilation.)Support of inheritance of types and classes from their ancestors.The subtype, or a subclass, has to inherit attributes and methods from its super type, or a super class, respectively.
Overload in combination with full binding.Methods have to be applied to objects of different types.Implementation of a method has to depend on type of objects, to which this method is applied.For ensuring this functionality, binding of names of methods in the system should not be carried out until execution of the program.
Computing completeness.Data manipulation language has to be a programming language of general purpose.
The data types have to be expandable.The user has to have tools for new types of the predetermined system types given on the basis of the existing set.Moreover, there should be no distinctions between ways of use of the system and user types of data.

IV. OBJECT DATA TYPES
Object data types in application are similar to simple types, such as NUMBER or VARCHAR2.They consist of attributes and methods [6].If we have preset values of attributes, the object type is called an exemplar (object instance).In Fig. 1, an example of object type and several exemplars is shown.The variable of object type is an exemplar.Object types consist of attributes and methods (Fig. 2).After definition of object type, it is possible to create the tables having one or several columns of object type.An example of this kind of table is given below: The table contacts contains a column of earlier defined object type -person_type.The objects contained in the columns of the table are called column objects.
Such a table can be filled in with data by means of a standard data modification language (DML), for example, with operator INSERT: Methods of object are performed functions or procedures determined by the user.The methods can be of several types: Member methods.These methods implement access to attributes of object, and also the procedure and operation over attributes.
Static methods.Implement operations over exemplars of objects.For example, it is possible to define operation of object comparison.Such operations are defined by static methods.
Constructor methods.By means of exemplar constructor, exemplars of the set type are created.The constructor is set implicitly for any object; however, the user can make necessary changes that influence the process of creation of exemplars.
External implemented methods.External methods can be implemented in C/C++ and are stored in a type of libraries outside a database.
An example of using a method for the previously considered person_typ types and the table contacts is given below: select c.contact.get_idno()from contacts c; This query will print on display attribute of idno for all objects from the table contacts.

A. Object Tables
A table containing only objects is called object table.Every record in such a table represents the whole object.In such tables, it is possible to refer to objects from other objects or a program code.For such references in the database, special identifiers of objects are used.
Such object identifiers can be of two types: 1. Systemically generated (are applied by default).2. Based on the primary keys.
For use of identifiers, the construction REF is used, which allows addressing an object.

B. Oracle Collections
Collections in the databases are used for modelling multiple attributes (multi-valued attributes) and relations "many to many".
Collections can be of two typesvariable length arrays (VARRAY) and nested tables.Collections can serve as type of data in objects or simple tables (as certain columns).We will give an example of collection: The attribute of dept_emps is the table supporting the employees working at a certain department.

B. Learning Rules for Collections
Let us define object like a Course: The built ontology can be represented graphically (Fig. 4).This article has introduced the complex data type transformation algorithm from a database into ontology.In the beginning, definitions of object-oriented databases have been given.The main characteristics of such database types have been considered.
To be specific, examples of complex data types implemented in the Oracle database have been provided.Then steps of transformation of object data types into ontology are shown.
For each complex data type, a set of learning rules has been provided, which is used for the transformation of database objects into ontology.
In conclusion, examples of transformation from a database into ontologies described in the OWL language have been considered, which confirms the applicability of the algorithm.

Fig.
Fig. Ontology built using learning rules.
TABLE person_obj_table OF person_typ; Further, the object table can be filled in with data: Every certain type defined by a user will be transformed into an ontology class.Attributes of object type will be transformed into attributes of a class of ontology.
Attributes of the nested table will be transformed into attributes of this class of ontology.