What exactly are ontologies in AI? How should I write them and why are they important?
Before considering the question directly, it is useful to gain some context about the origin of ontology. This will help understand why the term was chosen and retain clarity about what ontology is and what is not.
ontology noun on·tol·o·gy | \än-ˈtä-lə-jē
1 : a branch of metaphysics concerned with the nature and relations of being — Ontology deals with abstract entities.
2 : a particular theory about the nature of being or the kinds of things that have existence
The concept of ontology did not originate in the world of software, although a software abstraction is, to some degree, ontological. Some literature has confused ontology with a map of relationships between concrete types in an object oriented design, which may not be sufficiently abstract to warrant the use of the term.
Ontology in AI
There are a few stakeholder classes of professionals or teams of professionals seeking to discover things which may not have been invented or placed but nonetheless exist. This trend originated in academia, as many do.
We have a few obvious applications of discovering the emergence of things not planned or even noticed initially.
- Businesses intending to act proactively, which is the business intelligence application
- Natural language systems researchers intending to map sequences of linguistic elements such as words, prefixes, suffixes, verb conjugations, multiword jargon, or colloquialisms to and from semantic nets and association structures
- Data researchers interested in tracking emergence in worldwide web interlinking and content redundancy
The article referenced in the first comment to the question has an interesting paragraph, "The Artificial-Intelligence literature contains many definitions of an ontology; many of these contradict one another. For the purposes of this guide an ontology is a formal explicit description of concepts in a domain of discourse (classes (sometimes called concepts)), properties of each concept describing various features and attributes of the concept (slots (sometimes called roles or properties)), and restrictions on slots (facets (sometimes called role restrictions)). An ontology together with a set of individual instances of classes constitutes a knowledge base. In reality, there is a fine line where the ontology ends and the knowledge base begins."
Notice the LISP syntax above. Also notice the conflicting definitions of Ontology as it applies to AI. These definitions sometimes relate to concept classes as in the PAC (probably approximately correct) learning framework. They may relate to NLP work on semantics.
It may be wise to stabilize the term, which is why the dictionary definition was reproduced above. AI would not benefit from the emergence of misleading jargon, where the words are no longer meaning what they once meant, solely because no one took the time to see what was legitimate about their meaning before they started writing papers.
These are a few academic publications that provide an overview of the use of ontological concepts in discovery.
From the perspective of C++ programming, an ontology is a class which contains variables and methods. Or to be more specific, it is a group of classes connected together. Prototyping an ontology can be made with an UML drawing software. Explaining ontologies from AI perspective is a bit harder. Because creating some classes and using object-oriented programming alone will not make a robot more intelligent. The reason why ontologies are used for Artificial Intelligence has to do with machine readable knowledge storing. The idea is to formalize a task with natural language and the ontology is the place for storing the language.
Let us make an example: A robot is in room and detects a ball on the table. This is the situation which has to be stored in a computer program. With an ontology the first step is to create a class “robot” which has a position, and a second class for the room. Now it is possible to fill the slots with values. The robot is set to a position, and the room class gets the table and the ball as a value.
If such a case should be programmed in real software there are two possibilities. The first one is to hard-code the classes in sourcecode, that means we are writing in the C++ program that a class is there for the robot and a second for the room. The better alternative is to use self-modifying code. This sounds more complicated than it is in reality. It means only, that the classes are created at runtime and that the class-diagram can be altered during the program is running. This idea is influenced from PDDL like programming languages which are extended by object-oriented features. The result is a language like OWL-S.