Object Oriented Ontology

This semester I am taking a computer science course that revolves around coding in Java. This is an object oriented language, and in just two weeks of using this language I can already see the importance of an ontology when coding in Java. In this language there is a type of data called an interface. This is a more broad data type in which more specific types of data called a class make up the interface. An example of something that we represented using an interface is the MBTA lines. The interface was the MBTA, and the classes that made up the interface were the red line, green line, orange line, blue line, and commuter rail.

When representing this data within Java, our instructors often suggest that we write a “class diagram.” This is a chart that shows which classes implement which interfaces, and how the different types of data relate to each other. The class diagram is an example of an ontology, and it closely resembles the UML diagram that we are learning about in my information science class. The data types are represented in boxes, and lines are drawn between the different boxes to represent the relationship that they have to each other. Inside each box in the class diagram are the fields that each type of data contain. These fields are equivalent to attributes in the UML diagram, and the data types are equivalent to entities.

In Java, when a method is applied to an interface, it then must be applied to all of the classes that make up that interface. This is an instance of inheritance, which is a characteristic of ontologies. Since the interface has a certain method, and the class is a kind of the interface, then the class must also have that method implemented. Transitivity is also found in the class diagrams that we create in Java. If x is a kind of y, and y is a kind of z, then x is a kind of z. This is a fundamental concept of logical reasoning in ontologies.

Creating class diagrams to represent data in Java is an example of where I use an ontology to simplify a task. Having the ontology available to reference makes it easier to understand which classes must implement a method when I add it to an interface. It allows me to quickly see what attributes each class has, and the relationships that they share with each other. Without understanding the taxonomy and partonomy that the data has, it is easy to make a mistake when coding that causes an error to occur in the program. Ontologies are crucial to use when coding in an object oriented language, especially when the relationships between the data represented become increasingly complex.

-Nick Bagley

Design a site like this with WordPress.com
Get started