4. Making ontologies: theoretical basics and instructions
Сайт: | Открытые курсы ИРНИТУ |
Курс: | Digital Humanities |
Книга: | 4. Making ontologies: theoretical basics and instructions |
Напечатано:: | Гость |
Дата: | Суббота, 11 Октябрь 2025, 03:01 |
1. Definition
An ontology in the context of computer science is a structured framework for organizing information and represents formal knowledge as a set of concepts within a domain, and the relationships between those concepts. An ontology is an explicit specification of a conceptualization. It provides a shared vocabulary for a domain and defines the meaning of terms and the relationships between them.
1.1. Domains
The domain of an ontology refers to the specific area of knowledge, interest, or activity that the ontology aims to model, represent, and capture. It defines the scope and the context within which the concepts, relationships, and properties described by the ontology are relevant and applicable. The domain sets the boundaries for what is included in the ontology, guiding the selection of concepts to be defined, the relationships that hold between those concepts, and the properties that characterize them.
Characteristics of a Domain in Ontology:
Specificity: The domain is usually well-defined and specific, allowing for a focused and detailed representation of knowledge. For example, an ontology might have the domain of "healthcare," "environmental science," or "digital marketing."
Relevance: The concepts and relationships captured in the ontology are relevant to the domain, ensuring that the ontology is useful for domain experts, applications, and tasks.
Expertise: Developing an ontology for a particular domain often requires domain expertise to accurately represent the knowledge and ensure it is meaningful and correct.
Application: The domain determines the potential applications and uses of the ontology, from powering semantic web applications to facilitating data integration, enhancing search and retrieval, and supporting decision-making processes in specific fields.
Examples of Domains:
Biomedical Ontology: Focuses on concepts relevant to biology and medicine, including diseases, treatments, biological processes, and anatomy.
Geographical Ontology: Models geographical information, including physical locations, geopolitical entities, natural features, and spatial relationships.
E-Commerce Ontology: Represents knowledge related to online retail, including products, transactions, customer profiles, and vendor information.
Importance of Domain in Ontology Development:
Clarity and Scope: Defining the domain at the start of ontology development helps clarify the scope and boundaries of what the ontology will cover, guiding the development process.
Interoperability: A clear domain definition supports interoperability with other ontologies and systems within the same or related domains.
Usability: An ontology that accurately reflects its domain can be more easily used and adopted by domain experts, enhancing its utility and effectiveness in real-world applications.
In the context of ontologies and knowledge representation, concepts and classes are fundamental elements used to model and organize information about the world. While often used interchangeably in casual discussion, they have distinct meanings in formal ontology development and computer science.
2. Key terms and elements of ontologies
To describe an ontology, we need to study its elements and terms that represent them; the key elements are domain, classes, and the relationships. Let us have a close look at them.
2.1. Concepts and classes
A concept is a mental representation or idea of a group of objects, events, or phenomena that share common characteristics. Concepts serve as the building blocks of human thought, enabling us to categorize and make sense of the world around us. They are abstract ideas or mental symbols that people use to understand and classify entities based on their properties or features.
In cognitive science and philosophy, concepts are studied to understand how knowledge is structured, acquired, and applied. Concepts help us to recognize instances of a particular category (e.g., recognizing a particular animal as a "dog") and to communicate about categories of things with others.
In ontology development and computer science, a class is a formal representation of a concept within a structured model or system. Classes are used in ontologies, databases, and programming to define the properties and behaviours of a set of objects or instances that belong to that class.
Ontologies: In ontologies, a class represents a concept or category of things, and instances of that class (individuals) are entities that belong to the category. For example, in an ontology about animals, "Bird" might be a class representing the concept of birds, and individual birds like "Eagle" and "Sparrow" would be instances of the "Bird" class.
Object-Oriented Programming: In object-oriented programming (OOP), a class is a blueprint for creating objects (instances), specifying the data fields (attributes) and methods (functions or behaviours) that those objects will have. Each object instantiated from a class shares the class's structure and behaviour but can have different values for its attributes.
Relationship Between Concepts and Classes
Concepts are the abstract ideas or cognitive units that we use to think about and categorize the world.
Classes are the formal representations of concepts within a computational system, used to model the structure and behaviour of sets of entities that share common characteristics.
In ontology engineering, classes are defined to represent concepts in a way that can be processed by computers, allowing for sophisticated reasoning, querying, and analysis based on the relationships and properties defined in the ontology. Classes in an ontology are organized into hierarchies or networks, reflecting the natural categorization of concepts, including subclass (is-a) relationships, part-whole (meronymy) relationships, and associative relationships.
3. Relationships in semantic representations of ontologies
Linguistics studies relationships within human languages that also structure knowledge. It distinguishes the two types of relationships: syntagmatic and paradigmatic.
These relationships are two fundamental ways in which elements (such as words) can be related to each other in language. These concepts are key to understanding how meaning is constructed and interpreted in linguistic structures.
Syntagmatic Relationships
Syntagmatic relationships refer to how words can be combined in sequences within a syntactic structure to form phrases, clauses, or sentences. This relationship is about the linear or horizontal connections between words in spoken or written discourse. It's concerned with the rules governing the order of words and how they function together to produce meaning.
Example: In the sentence "The quick brown fox jumps over the lazy dog," the relationships between the words as they appear in sequence are syntagmatic. Each word contributes to the meaning of the sentence in the context of its neighbours.
Paradigmatic Relationships
Paradigmatic relationships, on the other hand, refer to the sets of words that can be substituted for each other in a particular context, often because they share a similar meaning, belong to the same grammatical category, or fulfil a similar role within a sentence. This relationship is conceptualized as vertical, representing the choices available in the mental lexicon that can fit into a particular slot in a sentence.
Example: In the sentence "The quick brown fox jumps over the lazy dog," the word "quick" can be replaced with "slow," "sly," or "happy" without altering the grammatical structure of the sentence. These substitutions form a paradigmatic relation because they are all adjectives that describe the noun "fox."
Importance in Linguistic Analysis
Syntagmatic Analysis: Focuses on the structure of texts and how words combine to create meaning contextually. It is crucial for understanding syntax, grammar, and the pragmatic aspects of language use.
Paradigmatic Analysis: Helps in studying semantics, lexical relations, and the associative meanings of words. It is essential for understanding synonyms, antonyms, hyponyms, and other lexical relationships.
Based on these methods of analysis, linguists identified paradigmatic and syntagmatic semantic relationships.
3.1. Paradigmatic relationships
Synonymy: This relation exists between words that have similar or identical meanings in some or all contexts. For example, "big" and "large" are synonyms because they can often be used interchangeably.
Antonymy: This involves words that have opposite meanings. Antonyms can be further categorized into gradable (e.g., "hot" and "cold"), complementary (e.g., "alive" and "dead"), and relational opposites (e.g., "teacher" and "student").
Hyponymy and Hypernymy: Hyponymy is the relation between a more specific word (the hyponym) and a more general word (the hypernym). For instance, "rose" is a hyponym of "flower." Conversely, hypernymy is the relationship from the general to the specific.
Meronymy: This describes a part-whole relationship between words. For example, "wheel" is a meronym of "car," as a wheel is part of a car.
Holonymy: The opposite of meronymy, holonymy relates the whole to a part. Using the previous example, "car" is a holonym of "wheel."
Troponymy: This is specific to verbs and describes a more specific way of performing the action described by another verb. For example, "to jog" is a troponym of "to run."
Metonymy: A type of figurative language where a word is used to stand in for something else that it is closely related to or associated with. For example, "the White House" can be used to refer to the President or his administration.
Polysemy: The relation between a single word that has multiple related meanings. For example, "bank" can mean the side of a river and a financial institution.
Homonymy: This includes homophones (words that sound the same but have different meanings, e.g., "sea" and "see") and homographs (words that are spelled the same but have different meanings or pronunciations, e.g., "lead" the metal and "lead" a group).
These semantic relations can make a hierarchy to constitute ontologies.
For example, the list of words below can be organized as ontological entity, as there are semantic paradigmatic relations among these concepts or words.
- linguistics
- computational linguistics
- machine translation
- mathematics
- discipline
- cognitive science
Top-Level Class:
Discipline: A branch of knowledge, typically one studied in higher education.
Subclasses of Discipline:
Mathematics: Now positioned as a component of Cognitive Science alongside Linguistics, reflecting its role in the study of cognition and intelligence.
Linguistics: Considered a component of Cognitive Science, focusing on the scientific study of language and its structure.
Mathematics and linguistics are sister terms, as they are at the same level of hierarchy, and both are disciplines.
As for the term ‘cognitive science’, it is a part holonym to the term ‘linguistics’ – the interdisciplinary study of mind and intelligence, embracing philosophy, psychology, artificial intelligence, neuroscience, linguistics, anthropology, and mathematics. This class can become a part of a separate hierarchy.
Subclass of linguistics (hyponym):
Computational Linguistics: An interdisciplinary field concerned with the statistical or rule-based modelling of natural language from a computational perspective.
Subclass of computational linguistics (hyponym):
Machine Translation: A specific direction within Computational Linguistics focused on translating text or speech across languages.
3.2. Syntagmatic relationships
Syntagmatic semantic relations represent links between the elements of word combinations, sentences and texts. For example, if my sentence has the verb read, it is likely to have a reader (somebody who performs the action of reading) and a book or another object that can be used for reading. This type of semantic relationships is usually referred to as associative.
An associative relationship refers to a type of connection between two or more concepts or entities that indicates a non-hierarchical link. Unlike "is-a" relationships (which establish a hierarchy from more general to more specific classes) or part-whole relationships (which denote how entities form part of a larger whole), associative relationships capture a broad range of other connections that entities might have to each other.
Characteristics of Associative Relationships:
Non-hierarchical: Associative relationships do not imply a hierarchical order or structure between the entities involved. They represent peer-to-peer connections.
Bidirectional or Unidirectional: Depending on the nature of the relationship, it can be bidirectional (implying mutual association) or unidirectional (where the association is from one entity to another, but not necessarily back).
Semantic Connection: These relationships are defined by some meaningful connection relevant to the domain of knowledge being modelled, such as "works with," "located near," "owns," or "married to."
Domain-Specific: The meaning and interpretation of an associative relationship often depend on the specific domain or context in which it is used.
Examples:
Friendship: In a social network ontology, "isFriendOf" might represent an associative relationship between two individuals, indicating a social connection.
Collaboration: In a research domain ontology, "collaboratesWith" could link researchers who have worked together on a project.
Ownership: In an e-commerce ontology, "owns" might relate customers to the products they have purchased.
Proximity: In a geographic information system (GIS), "isNear" could associate places that are close to each other.
Importance in Ontologies:
Associative relationships play a crucial role in ontologies by enabling the representation of complex interconnections between entities that reflect real-world interactions and associations. They enrich the semantic structure of an ontology, allowing for more detailed queries and reasoning. For example, understanding associative relationships can help infer potential influences between entities, model networks of relationships, and support complex decision-making processes.
Associative relationships encompass a wide array of connections between entities or concepts within various domains, extending the richness and utility of ontologies, databases, and semantic networks. Here are more examples of associative relationships, illustrating their diversity and applicability:
Uses/UsedBy: Indicates that one entity utilizes another for a specific purpose, common in technical and engineering domains. For example, "Car uses Fuel."
Produces/ProducedBy: Links a producer entity to the products or outcomes they create. In a business ontology, "Factory produces Goods."
AdjacentTo: Used in geographical and spatial ontologies to denote proximity without direct contact, e.g., "Property A is adjacent to Property B."
ParticipatesIn/Involves: Describes involvement in events or activities, such as "Player participates in Game" or "Meeting involves Employees."
Precedes/FollowedBy: Indicates temporal succession between events or states, e.g., "Phase 1 precedes Phase 2."
HasSymptom/IsSymptomOf: Used in medical ontologies to relate conditions to their manifestations, such as "Flu hasSymptom Fever."
BelongsTo/HasMember: Denotes membership or inclusion, commonly used in organizational or group contexts, e.g., "Employee belongs to Department."
Influences/IsInfluencedBy: Captures the effect one entity has on another, significant in psychological, environmental, and social studies, e.g., "Pollution influences Climate."
CompetesWith: Indicates rivalry or competition, applicable in sports, business, and other fields, e.g., "Company A competes with Company B."
DependsOn/IsRequiredBy: Shows dependency relationships, critical in systems engineering and project management, e.g., "Process A depends on Resource B."
TranslatesTo/IsTranslationOf: Highlights linguistic or informational transformations, such as "Document A translates to Language B."
Violates/IsViolatedBy: Used in legal and regulatory ontologies to denote the breach of rules, e.g., "Action violates Regulation."
AuthorOf/HasAuthor: Connects authors to their works, used in bibliographic and academic ontologies, e.g., "Author is author of Book."
LivesIn/IsHabitatFor: Relates organisms to their living environments, important in ecological and biological ontologies, e.g., "Fish lives in River."
MarriedTo: Denotes a marital relationship between individuals, used in genealogical and social ontologies, e.g., "Person A is married to Person B."
These examples demonstrate the breadth of associative relationships, each serving to enrich the semantic modelling of knowledge by capturing various types of interactions and connections between entities across different domains.
4. An example of an ontology
To represent an ontology, you can follow a structured approach that outlines the core concepts, their properties, and the relationships between these concepts within a specific domain. Below is a simplified example of an ontology for a basic domain: "Pets."
Domain: Pets
Concepts and Classes:
Pet: The primary class representing animals kept for companionship or leisure.
Dog, Cat, Bird: Subclasses of Pet, representing specific types of pets.
Owner: Represents individuals who own pets.
Properties (Attributes):
Pet
Name (string)
Age (integer)
Breed (string, applicable for Dogs and Cats)
Species (string, applicable for Birds)
Owner
Name (string)
Address (string)
Phone Number (string)
Relationships:
owns: A relationship between Owner and Pet (e.g., John owns Bella).
isA: A hierarchical relationship indicating that Dog, Cat, and Bird are all types of Pet.
friendOf: An optional relationship indicating friendship between Pets (e.g., Bella is a friend of Max).
Instances:
Pets
Bella (Dog): Name="Bella", Age=5, Breed="Labrador"
Whiskers (Cat): Name="Whiskers", Age=3, Breed="Siamese"
Tweety (Bird): Name="Tweety", Age=2, Species="Canary"
Owners
John: Name="John", Address="123 Elm St", Phone Number="555-1234"
Jane: Name="Jane", Address="456 Pine St", Phone Number="555-5678"
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.
5. Ontologies’ functionality and software
Let us consider how we can apply our “Pets” ontology. There many options and possibilities:
Querying: This ontology enables querying for information based on the structured model it defines. For example, one could query for all instances of Dog, pets owned by John, or pets that are older than a certain age.
Reasoning: Using a reasoner, the ontology can infer new information that isn't explicitly stated but is implied by the ontology's structure and instances. For example, if Bella is stated to be a Dog and Dog is a subclass of Pet, the reasoner can infer that Bella is also a Pet.
Integration and Interoperability: This ontology can serve as a common model for representing pets and ownership information in various systems, facilitating data sharing and integration across different platforms that understand OWL.
In summary, the ontology functions as a formal, explicit specification of a shared conceptualization of the ‘Pets’ domain. It enables automated reasoning about pets, their characteristics, and their relationships with owners, supporting tasks like information retrieval, data integration, and semantic web services.
In software or formal representation (like OWL or RDF), this ontology would involve defining classes for each concept, properties for the attributes of these classes, and relationships as predicates connecting instances of the classes. Here's a simplified example in a generic syntax:
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.
Ontologies can be visualised, as we see in the example below:
Codes can be used to create a diagram based on ontology. For example, to create a class diagram in Draw.io format based on our ‘Pets’ specification, we can translate the given class diagram syntax into XML code that Draw.io can interpret. This code will include the classes Pet, Dog, Cat, Bird, Owner, and instances such as Bella, Whiskers, Tweety, John, and Jane, along with their relationships:
This XML represents a basic structure for our class diagram including classes and their relationships. To visualize the provided Draw.io XML code, follow these steps:
1) Open Draw.io: Go to the Draw.io website or open the Draw.io application if you have it installed.
2) Start a New Diagram: If prompted, choose to create a new diagram or open an existing one. For this purpose, starting with a blank diagram is recommended.
3) Access Edit Diagram: Navigate to the Extras menu on the top menu bar and select Edit Diagram from the dropdown menu.
4) Paste the XML Code: In the text field that appears, delete any existing code and paste the XML code provided earlier.
5) Apply Changes: Click "OK" or the corresponding button to apply the changes. The diagram should now render on the screen according to the XML code's specifications.
6) Adjust as Needed: You can manually adjust the diagram's elements (e.g., moving shapes, changing text) directly in Draw.io for finer control over the appearance and layout.
This process converts the XML code into a visual diagram, allowing you to see the class structure, relationships, and other details as specified in the XML.
To create an ontology for a "Wedding" in Draw.io XML format, we'll define several key concepts and their relationships within the context of a wedding. This ontology will include elements like Couple, Guest, Venue, Event, and Vendor, among others, to represent a simplified structure of the relationships and entities involved in a wedding.
Here's an example of how this might be represented in Draw.io XML code:
Here is a diagram based on the code