4. Making ontologies: theoretical basics and instructions
4. An example of an ontology
4.1. Additional terms and definitions
In addition to domain, classes, and the relationships, ontologies have other relevant elements:
Individuals (Instances)
Individuals represent specific instances or objects within the domain of the ontology. They are concrete examples of the classes defined in the ontology and are used to populate the ontology with actual data. Individuals can have properties assigned to them that specify their attributes (using datatype properties) or their relationships to other individuals (using object properties).
For instance, in an ontology about people, "John Doe" could be an individual of the class Person, with properties like hasName "John Doe" (a datatype property) and worksFor SomeCompany (an object property linking John to another individual, SomeCompany).
Example
Consider an ontology for a university domain:
Classes: Person, Course, Department
Datatype Properties: hasName (applies to Person, Department), hasCourseCode (applies to Course), hasEnrollmentNumber (applies to Person)
Object Properties: teaches (linking Person to Course), enrolledIn (linking Person to Course), memberOf (linking Person to Department)
Individuals: Alice (an instance of Person), CS101 (an instance of Course), ComputerScience (an instance of Department)
Attributes (Properties) and Individuals in Use:
Alice hasName "Alice"^^xsd:string.
Alice enrolledIn CS101.
CS101 hasCourseCode "CS101"^^xsd:string.
ComputerScience hasName "Computer Science"^^xsd:string.
Alice memberOf ComputerScience.
This example demonstrates how attributes (both datatype and object properties) are used to describe the characteristics and relationships of individuals within an ontology, providing a structured and semantically rich representation of the domain knowledge.
In “Pets” ontology instances of classes represent specific entities, such as Bella (a dog), Whiskers (a cat), Tweety (a bird), and John (an owner). These instances are linked through properties to define their attributes and relationships accurately.
Properties
In ontologies, particularly those developed using the Web Ontology Language (OWL), attributes are often referred to as properties. Properties in OWL are used to describe characteristics of classes (concepts) and relationships between classes. They can be broadly categorized into two main types: Datatype Properties and Object Properties.
Datatype Properties
Datatype properties (sometimes just called "data properties") are used to describe attributes of classes that have literal values, such as strings, numbers, dates, or other simple data types. These properties connect an instance of a class to data values. For example, in a Person ontology, you might have datatype properties like hasName (with string values), hasAge (with integer values), or hasBirthDate (with date values).
Example of Datatype Property Definition:
This defines hasAge as a property of the Person class, where the age value is an integer.
Object Properties
Object properties describe relationships between instances of two classes. These properties do not link to literal data values but instead connect one instance to another instance. For instance, in an ontology that includes classes for Person and Car, an object property might describe the ownership relationship between a person and a car.
Example of Object Property Definition:
This defines ownsCar as a property that links a Person to a Car, indicating ownership.
Functionalities and Usage
Attributes (Datatype Properties): They are essential for describing the characteristics or features of individuals in an ontology. By defining these properties, you can annotate instances with specific information, making the data richer and more useful for querying and reasoning.
Relationships (Object Properties): They are crucial for defining how instances of different classes are related, allowing the ontology to model complex real-world interactions and connections between entities.
Declaring Attributes in OWL Ontologies
Attributes are declared in OWL ontologies to enrich the description of concepts, enabling a detailed representation of knowledge in a structured and machine-interpretable format. This facilitates advanced data integration, querying, and reasoning capabilities, making ontologies powerful tools for knowledge management, semantic web applications, and artificial intelligence systems.
In “Pets” ontology we have both types of attributes:
Datatype properties (owl:DatatypeProperty) like hasName, hasAge, hasBreed, and hasSpecies define the attributes of pets. These properties allow assigning values to instances of the classes, such as a pet's name, age, breed, and species.
Object properties (owl:ObjectProperty), such as owns, describe relationships between instances of two classes. In this case, it models the ownership relationship between an Owner and a Pet.
Strings
A string in ontology is used to represent textual data. It is a sequence of characters, often used to store names, descriptions, or any other type of textual information. For example, in a Pets ontology, the name of a pet can be represented as a string.
In OWL, a string datatype property might be defined as follows to assign names to pet instances:
Here, xsd:string specifies that the hasName property will contain string values, such as "Bella" or "Whiskers."
This ontology, when implemented in an OWL-compatible software tool like Protégé, functions as a structured representation of knowledge about pets, their owners, and the relationships between them. It defines a model for understanding how pets are categorized, their properties, and their associations with human owners within a given domain. Here's how the ontology functions across different components:
Classes and Hierarchies
Classes such as Pet, Dog, Cat, Bird, and Owner serve as templates for creating instances (individuals) that represent real-world entities in those categories.
The subclass relationships (rdfs:subClassOf) create a hierarchical structure. For example, Dog, Cat, and Bird are subclasses of Pet, indicating that they are more specific categories of pets.
Booleans
A boolean in ontology is a datatype property that represents two possible values: true or false. This type is used for properties that express binary attributes or conditions. For instance, in a Pets ontology, you might have a boolean property to indicate whether a pet has been vaccinated.
An OWL representation of a boolean property might look like this:
xsd:boolean indicates that the isVaccinated property will have a boolean value, expressing a truth value regarding the vaccination status of a pet.