Introduction to Semantic Systems - Handbook PDF
Document Details
Uploaded by Deleted User
Vienna University of Technology
2025
Max Tiessler
Tags
Summary
This is a handbook on introduction to semantic systems. It covers topics such as ontology, description logics, and the Semantic Web. The handbook is well-structured with clear explanations and examples to aid in understanding.
Full Transcript
188.399 Einführung in Semantic Systems Author: Max Tiessler 2025-01-10 Introduction to Semantic Systems - Handbook Max Tiessler Contents 1 Introduction...
188.399 Einführung in Semantic Systems Author: Max Tiessler 2025-01-10 Introduction to Semantic Systems - Handbook Max Tiessler Contents 1 Introduction 4 2 What is an Ontology 5 2.1 Definition.......................................... 5 2.2 Types and Categories.................................... 6 2.2.1 Lightweight..................................... 6 2.2.2 Taxonomies..................................... 7 2.2.3 Heavyweight..................................... 8 2.3 Ontology........................................... 9 2.3.1 Mechanics...................................... 9 2.3.2 Instances/Entities.................................. 9 2.4 Description Logics..................................... 10 2.4.1 Introduction..................................... 10 2.4.2 General DL Architecture.............................. 11 2.4.3 Notation / Syntax................................. 12 2.4.4 Semantics...................................... 12 2.5 How to Build an Ontology................................. 13 2.5.1 1 - Determine Scope (Competency Questions).................. 13 2.5.2 2 - Consider Reuse................................. 14 2.5.3 3 - Enumerate Terms................................ 14 2.5.4 4 - Define Classes and a Taxonomy........................ 14 2.5.5 5 - Define Properties................................ 15 2.5.6 6 - Define Constraints............................... 15 2.5.7 7 - Create Instances................................. 15 2.5.8 8 - Check Anomalies................................ 16 2.6 Reasoning.......................................... 16 2.6.1 Capabilities of Reasoning with Ontologies.................... 16 2.6.2 Consistency Checking................................ 16 2.6.3 Satisfiability Checking............................... 17 2.6.4 Class Inference................................... 17 2.6.5 Instance Inference.................................. 17 2.6.6 Class + Instance Inference............................. 17 3 Semantic Web, RDF, RDFS, and OWL 19 3.1 The Semantic Web..................................... 19 3.1.1 Key Concepts and Foundations.......................... 19 3.1.2 Semantic Web Language Design Principles.................... 19 3.1.3 Benefits of Semantic Web Principles........................ 20 3.1.4 Technological Foundations............................. 20 3.1.5 Applications and Use Cases............................ 21 3.1.6 Challenges and Evolution............................. 21 3.2 RDF............................................. 21 3.2.1 Overview of RDF.................................. 22 3.2.2 RDF Graph Model................................. 22 3.2.3 RDF Serialization Formats............................. 22 1 Introduction to Semantic Systems - Handbook Max Tiessler 3.2.4 RDF Literals and Datatypes............................ 25 3.2.5 RDF in Practice.................................. 25 3.3 Advanced RDF....................................... 25 3.3.1 Structured Values.................................. 25 3.3.2 Blank Nodes..................................... 26 3.3.3 Reification...................................... 26 3.3.4 RDF Data Structures: Containers and Collections................ 27 3.3.5 RDF Vocabulary.................................. 27 3.3.6 RDF-star and RDF*................................ 27 3.3.7 Conclusion...................................... 27 3.4 RDFS (RDF Schema)................................... 27 3.4.1 Purpose of RDFS.................................. 27 3.4.2 Main Constructs of RDFS............................. 28 3.4.3 Example of Class Hierarchies........................... 28 3.4.4 Domain and Range Restrictions.......................... 29 3.4.5 RDFS Vocabulary................................. 29 3.4.6 Limitations of RDFS................................ 29 3.5 OWL (Web Ontology Language).............................. 30 3.5.1 Overview and Purpose............................... 30 3.5.2 Extending RDFS.................................. 30 3.5.3 Classes and Individuals............................... 30 3.5.4 Properties...................................... 31 3.5.5 Class Hierarchies and Inference.......................... 31 3.5.6 Advanced Constructs................................ 32 3.5.7 Combining TBox and ABox............................ 32 3.5.8 Inference and Reasoning.............................. 32 3.6 Advanced OWL....................................... 33 3.6.1 Disjunctive Properties............................... 33 3.6.2 Transitive Properties................................ 33 3.6.3 Closed Classes (Nominals)............................. 34 3.6.4 Property Restrictions................................ 34 3.6.5 Property Characteristics and Relationships.................... 35 3.6.6 Combining Restrictions............................... 35 3.7 RDF, RDFS, OWL Summary............................... 37 4 SPARQL 38 4.0.1 Overview and RDF Graphs............................ 38 4.0.2 SPARQL Query Forms............................... 38 4.0.3 Basic Graph Patterns................................ 38 4.0.4 Solution Modifiers: Filtering, Ordering, and Aggregation............ 39 4.0.5 Advanced Query Patterns: UNION, OPTIONAL, and Subqueries....... 39 4.0.6 Federated Queries.................................. 39 4.0.7 Entailment Regimes................................ 39 4.0.8 SPARQL 1.1 Updates............................... 40 5 SHACL 41 5.0.1 Overview of SHACL................................ 41 2 Introduction to Semantic Systems - Handbook Max Tiessler 5.0.2 Targets and Focus Nodes.............................. 41 5.0.3 Node Shapes and Property Shapes........................ 41 5.0.4 Core Constraints in SHACL............................ 42 5.0.5 Practical Observations and Example....................... 42 5.0.6 Improving RDF Quality with SHACL....................... 43 5.0.7 Conclusion...................................... 43 6 Knowledge Graph Creation 44 6.1 Introduction......................................... 44 6.2 Tabular Data to RDF................................... 45 6.2.1 OpenRefine for Data Preparation......................... 45 6.2.2 Entity Reconciliation................................ 45 6.2.3 Exporting to RDF................................. 45 6.2.4 Summary and Further Pointers.......................... 46 6.3 Relational Data to RDF.................................. 46 6.3.1 Direct Mapping Overview............................. 46 6.3.2 R2RML: The RDB to RDF Mapping Language................. 47 6.3.3 Advanced Configuration.............................. 47 6.4 Structured Data to RDF.................................. 48 6.4.1 RML Fundamentals and Motivation........................ 48 6.4.2 RML in Practice.................................. 49 6.4.3 YARRRML: A More Accessible Syntax...................... 49 6.4.4 Points to Consider and Further Resources.................... 49 6.5 Text to RDF........................................ 50 6.5.1 Semantic Annotation: Formal Modeling and Motivation............. 50 6.5.2 Annotation Ontologies and Standards....................... 50 6.5.3 Annotation Tools and Services........................... 51 6.5.4 From Document to Knowledge Graph....................... 51 6.6 RDF Storage........................................ 52 6.6.1 Centralized vs. Distributed Systems........................ 52 6.6.2 Common RDF Storage Approaches........................ 52 6.6.3 Selecting the Right Approach........................... 53 7 Extras 54 7.0.1 Historical Context and Transition to Knowledge Graphs............ 54 7.0.2 Industry Impact and Linked Data Growth.................... 54 7.0.3 Neurosymbolic AI.................................. 54 7.0.4 Data Fabrics and Semantic Data Lakes...................... 55 7.0.5 Provenance and Explainability........................... 55 7.0.6 Use Cases and Future Directions......................... 55 3 Introduction to Semantic Systems - Handbook Max Tiessler 1 Introduction This summary is for the course ”Introduction to Semantic Systems” (course code: 188.399) at the Vienna University of Technology (TU Wien) and was created for the Winter Semester 2024 in prepa- ration for the exam. The document covers most of the essential topics discussed in the course, focusing on key concepts and practical applications in semantic systems. While it aims to provide a comprehensive review of the material, some advanced topics might not be explored in full depth. This summary is available on GitHub. If you find typos, errors, want to add content (such as addi- tional explanations, links, figures, or examples), or wish to contribute, you can do so at the following repository: https://github.com/mtiessler/188.399-Introduction-To-Semantic-Systems-Summary-TUW/blob/ main/ISS_Summary.pdf. If the URL does not work, you can locate it on GitHub using the following details: User: mtiessler Repo-Name: 188.399-Introduction-To-Semantic-Systems-Summary-TUW 4 Introduction to Semantic Systems - Handbook Max Tiessler 2 What is an Ontology Ontology is derived from the Greek words ontos (being) and logos (word), meaning the study or systematic explanation of existence. In philosophy, ontology is a branch concerned with categorizing and explaining existence. Aristotle (400 BC) made early attempts to establish universal categories for classifying everything that exists. 2.1 Definition According to the Merriam-Webster dictionary: A branch of metaphysics concerned with the nature and relations of being. A particular theory about the nature of being and kinds of existents. In the context of knowledge representation, Studer (1998) defines ontology as seen in figure 1. This definition highlights several key aspects: Formal: Ontologies are machine-readable and interpretable. Explicit: Concepts, properties, functions, and axioms are clearly defined. Shared: Ontologies are agreed upon and shared by a community. Conceptualization: They provide an abstract model of some phenomena in the world. Figure 1: Ontology definition 5 Introduction to Semantic Systems - Handbook Max Tiessler 2.2 Types and Categories Figure 2: Ontology Types 2.2.1 Lightweight Lightweight ontologies are simplified frameworks for organizing and defining knowledge. Key types include: Controlled Vocabulary: A finite list of terms, often used in catalogs. – Example: A library catalog listing book titles, authors, and genres (e.g., ”Fiction,” ”Science,” ”Biography”). Glossary: A controlled vocabulary with informal definitions provided in natural language. – Example: A glossary of medical terms, such as: ∗ ”Hypertension: High blood pressure.” ∗ ”Cardiology: The branch of medicine dealing with the heart.” Thesauri: A controlled vocabulary where concepts are connected through various relations: – Equivalency: Synonym relations between concepts. ∗ Example: ”Automobile” and ”Car.” – Hierarchies: Subclass and superclass relationships. ∗ Example: ”Dog” is a subclass of ”Animal.” – Homographs: Handling of homonyms (terms with identical spellings but different mean- ings). ∗ Example: ”Bank” (a financial institution) vs. ”Bank” (the side of a river). – Associations: Relations between similar or related concepts. ∗ Example: ”Wine” is related to ”Grape.” A popular example of a lightweight ontology is the ”Friend of a Friend” (FOAF) ontology, which defines relationships between people in social networks. 6 Introduction to Semantic Systems - Handbook Max Tiessler 2.2.2 Taxonomies Taxonomies provide a hierarchical system of grouping concepts or entities. The term originates from the Greek words taxis (order, arrangement) and nomos (law, science). Types of taxonomies include: Informal IS-A Hierarchy: An explicit hierarchy of classes where subclass relations are not strict. For example, the index of a library, where a category like ”Science” may include loosely related topics such as ”Physics” and ”Biology” without strictly defined boundaries. Formal IS-A Hierarchy: An explicit hierarchy of classes with strict subclass relations. For instance, in biology, ”Mammal” is a strict subclass of ”Animal,” and ”Dog” is a strict subclass of ”Mammal.” Formal Instance: A hierarchy that includes explicit class structures, strict subclass rela- tions, and allows instance-of relations. For example, the classification of a specific entity like ”Labrador Retriever” as an instance of the class ”Dog,” which is a subclass of ”Mammal.” A taxonomy can be defined as a controlled vocabulary organized into a hierarchical structure. As seen in 3. Figure 3: Taxonomy Example Key concepts in formal taxonomies include: SubClassOf : A relation pointing from a more specific concept to a more generic concept. Concept/Class: Represents the set of all entities of a specific type. Subsumption: A specialization relation pointing from a specific concept to a generic one. Subsumption/SubClass/Specialization Relation (in Formal IS-A Taxonomies) Seman- tics (Meaning): Subsumption in formal IS-A taxonomies ensures that if one class is a subclass of another, all instances of the subclass are also instances of the superclass. For example, if Herbivore is a subclass of Animal, all instances of Herbivore are also instances of Animal. Common Mistake: Subsumption is often mistakenly used to represent other types of relations, such as part-of (meronymy), which denotes a part-to-whole relationship rather than a class hierarchy. 7 Introduction to Semantic Systems - Handbook Max Tiessler 2.2.3 Heavyweight Heavyweight ontologies provide a rigorous framework for defining and organizing knowledge with a strong emphasis on logic and formal specifications. Key characteristics include: Rigorous Definition and Organization of Concepts: Concepts and their relationships are precisely defined, ensuring clarity and reducing ambiguity. Focus on Logic: Heavyweight ontologies prioritize formally correct deductions and inferences, enabling reliable reasoning and decision-making. Careful Formal Specification: A formal specification ensures consistency and eliminates contradictions within the ontology. Heavyweight ontologies are often used in applications requiring advanced reasoning, such as artificial intelligence, semantic web technologies, and complex domain modeling. They aim to create a shared, consistent understanding of knowledge that can be processed by both humans and machines. Examples of Heavyweight Ontologies Frames: Frames provide structured representations for defining classes and their properties. – Example: In a medical ontology, the frame for ”Disease” might include properties such as ”Symptoms,” ”Causes,” and ”Treatment.” Value Restrictions: These enforce constraints on the values that properties can take. – Example: In a wine ontology, ”Wine color” might be restricted to values like ”Red,” ”White,” or ”Rosé.” General Logic Constraints: These involve the application of logical rules to ensure consis- tency across the ontology. – Example: If ”Animal” is defined as disjoint from ”Plant,” no instance can belong to both classes simultaneously. Disjunctiveness: Ensures that certain concepts are mutually exclusive. – Example: ”Male” and ”Female” in a gender ontology might be disjoint concepts. Inversiveness: Defines inverse relationships between properties. – Example: If ”Parent” is a property, its inverse would be ”Child.” Part-of Relationships: These express compositional relationships. – Example: ”Engine” is a part of ”Car.” 8 Introduction to Semantic Systems - Handbook Max Tiessler 2.3 Ontology Ontology is a taxonomy extended with additional relations and further constraints, providing a more comprehensive framework for modeling knowledge. Relations within an ontology are directed, pointing from a Domain concept to a Range concept. These relations can also include: Inverse Relations: Relations that allow bidirectional reasoning. For example, if ”Tom eats Jerry,” the inverse relation could be ”Jerry is eaten by Tom.” Disjoint Concepts: Concepts that describe non-overlapping instance sets, ensuring that in- stances belong to distinct categories. For example, Carnivore and Herbivore may be disjoint concepts. 2.3.1 Mechanics The mechanics of an ontology focus on the logical and structural rules governing the relationships and organization of concepts, as seen in figure 4: Establishing the Domain and Range of relations to clarify which concepts are linked. Defining and maintaining consistency among concepts, relations, and instances. Implementing constraints, such as disjointness or cardinality, to refine the ontology’s structure and enforce rules. Figure 4: Ontology Mechanics 2.3.2 Instances/Entities Instances or entities represent individual objects in the universe of discourse. They provide specific examples or metadata tied to the defined concepts in an ontology. This can be seen in 5. 9 Introduction to Semantic Systems - Handbook Max Tiessler Figure 5: Ontology instances Key aspects include: Instance Representation: An instance corresponds to a real-world entity and is associated with one or more concepts. For example: – Tom is a Carnivore. – Jerry is an Animal. – Tom eats Jerry. Typing: An instance is typed with respect to a concept, meaning that it is classified as being of a particular type. For example, ”Tom” is an instance of the concept Carnivore. Relations Between Instances: Instances are connected through defined relations within the ontology, such as ”eats” in the example above. 2.4 Description Logics Description Logics (DL) are a family of formal knowledge representation languages used as the foundation for creating machine-readable ontologies. They are particularly suited for the Semantic Web and are based on a subset of First-Order Logics. DL provides a framework for representing and reasoning about knowledge in a structured and formal way. 2.4.1 Introduction Description Logics aim to: Represent knowledge in a way that is both human-readable and machine-readable. Enable computers to reason with data and draw logical conclusions. Provide a formal basis for defining and organizing ontologies. 10 Introduction to Semantic Systems - Handbook Max Tiessler A formal, logic-based language in DL offers: Syntax: Defines which expressions are considered valid. Semantics: Provides the meaning of those expressions. Calculus: Defines how to compute and determine the meaning of expressions. Semantic Web languages, such as OWL (Web Ontology Language), are built on Description Logics. 2.4.2 General DL Architecture The general architecture of a Description Logic system (can be seen in 6), involves the following components: Knowledge Base (KB): Composed of: – TBox (Terminological Knowledge): Contains definitions of concepts, attributes, and prop- erties of a domain. For example: Writer ≡ Person ⊓ ∃author.Book – ABox (Assertional Knowledge): Contains information about specific individuals or enti- ties. For example: Writer(GeorgeOrwell) Inference Engine: A component that reasons with the knowledge base to infer new informa- tion or check consistency. Interface: The mechanism for users or systems to interact with the ontology. Figure 6: DL architecture 11 Introduction to Semantic Systems - Handbook Max Tiessler 2.4.3 Notation / Syntax The syntax of DL includes: Atomic Types: – Concept Names: A, B,... – Special Concepts: ∗ ⊤: Universal concept (all objects in the domain). ∗ ⊥: Bottom concept (empty set). – Role Names: R, S,... Constructors: – Negation: ¬C – Conjunction: C ⊓ D – Disjunction: C ⊔ D – Existential Quantifier: ∃R.C – Universal Quantifier: ∀R.C Examples: Writer ≡ Person ⊓ ∃author.Book Novel ≡ Prose Novel ⊑ Book Herbivore ⊑ ¬ Carnivore PetOwner ⊑ Person ⊓ ∃hasPet.Animal Carnivore ⊑ Animal ⊓ ∀eats.Animal 2.4.4 Semantics Description Logics rely on model-theoretic semantics, where an interpretation consists of: A domain of discourse (∆): A collection of objects. Interpretative Functions (I): Functions mapping: – Classes (concepts) to sets of objects in the domain. – Properties (roles) to sets of pairs of objects. In a DL, a class description characterizes the individuals that are members of that class, allowing precise reasoning and inference based on defined relationships and constraints. It can be better seen in 7: 12 Introduction to Semantic Systems - Handbook Max Tiessler Figure 7: DL semantics 2.5 How to Build an Ontology Building an ontology involves several steps, each addressing specific aspects of knowledge represen- tation and organization. This process is iterative and is not strictly linear. Figure 8: Ontology engineering process 2.5.1 1 - Determine Scope (Competency Questions) The scope of the ontology should be determined by its intended use and anticipated extensions. Key questions to address include: 13 Introduction to Semantic Systems - Handbook Max Tiessler What is the domain that the ontology will cover? For what purposes will the ontology be used? What types of questions should the ontology answer? (Competency Questions) Who will use and maintain the ontology? Example Competency Questions for a Wine Recommender System: Which wine characteristics should I consider when choosing a wine? Is Bordeaux a red or white wine? Does Cabernet Sauvignon go well with seafood? What is the best choice of wine for grilled meat? 2.5.2 2 - Consider Reuse Reusing existing ontologies saves effort, improves interoperability, and leverages validated ontologies. Sources for reusable ontologies include: Protégé Ontology Library (http://protege.stanford.edu) NCBO Bioportal (http://bioontology.org) Linked Open Vocabularies (https://lov.linkeddata.es) 2.5.3 3 - Enumerate Terms Write down all relevant terms expected to appear in the ontology. This includes: Nouns: Basis for class names (e.g., wine, grape, winery). Verbs or Verb Phrases: Basis for property names (e.g., hasColor, madeFrom). Examples for a Wine Ontology: Terms: wine, grape, winery, region, sugar content. Properties: hasColor, locatedIn, madeFrom. 2.5.4 4 - Define Classes and a Taxonomy Classes represent concepts in the domain and are organized into a taxonomic hierarchy: A class is a collection of entities with similar properties (e.g., red wine, winery). Subclasses inherit properties from their superclasses. Example: Red Wine is a subclass of Wine. Every instance of Red Wine is also an instance of Wine. 14 Introduction to Semantic Systems - Handbook Max Tiessler 2.5.5 5 - Define Properties Properties describe: Attributes of instances (e.g., color, sugar content). Relationships between classes (e.g., Wine hasMaker Winery). Properties should: Be specified in the highest possible class in the hierarchy. Follow domain (parent class) and range (child class) rules. 2.5.6 6 - Define Constraints Constraints refine the ontology by adding logical rules: Cardinality: Specifies the number of values a property can have (e.g., each wine has exactly one maker). Existential Restrictions: Ensures that at least one property exists with a specified value (e.g., wines are located in regions, every employee works in at least one department, each student is enrolled in at least one course). Universal Restrictions: Ensures all values of a property are of a certain type (e.g., wines can only be made in wineries, all employees must be part of the organization, all courses must belong to a recognized department). Property Characteristics: Includes logical characteristics of properties: – Symmetry: If P (x, y) implies P (y, x). Example: ”marriedTo” implies if John is married to Mary, then Mary is married to John. Similarly, ”friendOf” and ”adjacentRegion” are symmetric properties. – Transitivity: If P (x, y) and P (y, z) imply P (x, z). Example: ”locatedIn” implies if City A is located in Region B, and Region B is located in Country C, then City A is located in Country C. Another example is ”hasAncestor,” where if John has an ancestor David, and David has an ancestor Robert, then John has an ancestor Robert. – Inverse Properties: If P (x, y) implies InvP(y, x). Example: ”hasParent(John, Bob)” implies ”hasChild(Bob, John).” Another example is ”owns(Car, Owner)” implies ”isOwnedBy(Own Car).” Examples: Wine ⊑ ≥1madeFrom.Grape Wine ⊑ ≤1hasMaker 2.5.7 7 - Create Instances Instances represent individual entities in the domain: The class becomes the direct type of the instance. 15 Introduction to Semantic Systems - Handbook Max Tiessler Instances inherit properties and constraints from their class hierarchy. Property values assigned to instances must conform to constraints. Example for a Wine Ontology: Chateau Margaux is an instance of Wine. Chateau Margaux hasMaker Margaux Winery. 2.5.8 8 - Check Anomalies Use the formal semantics of the ontology to: Validate the model: – Check for consistency. – Ensure satisfiability of concepts and properties. Derive additional knowledge: – Automatically classify instances. – Infer new relationships or properties. 2.6 Reasoning Reasoning is one of the key functionalities provided by ontologies due to their formal grounding in logic. It enables the inference of new knowledge based on already declared information. Reasoning is performed using specialized software called reasoners or inference engines. 2.6.1 Capabilities of Reasoning with Ontologies Consistency Checking: Ensures that the ontology model is free from logical contradictions. Class Inference: Discovers relationships between classes that were not explicitly declared. Instance Inference: Determines class membership of instances based on defined relationships and constraints. 2.6.2 Consistency Checking Consistency checking ensures that the ontology does not contain logical errors: Example: – Declared: Animal ⊑ ¬Plant – Declared: Plant(myAlgae) – Inferred: Animal(myAlgae) – Result: An inconsistency because myAlgae cannot be both an Animal and a Plant. 16 Introduction to Semantic Systems - Handbook Max Tiessler 2.6.3 Satisfiability Checking Satisfiability checking identifies concepts or classes that cannot possibly have any instances: Example: – Declared: Algae ⊑ Plant, Animal ⊑ ¬Plant, Algae ⊑ Animal – Result: The class Algae is unsatisfiable because it cannot belong to both Animal and Plant simultaneously. 2.6.4 Class Inference Class inference discovers new relationships among classes based on given knowledge: Example: – Declared: Carnivore ⊑ Animal ⊓ ∀eats.Animal – Declared: Cat ⊑ Animal ⊓ ∀eats.Mouse, Mouse ⊑ Animal – Inferred: Cat ⊑ Carnivore 2.6.5 Instance Inference Instance inference identifies class membership for specific entities: Example: – Declared: hasPet(Person, Animal), PetOwner ⊑ Person ⊓ ∃hasPet.Animal – Declared: Person(Pete), Animal(Spike), hasPet(Pete, Spike) – Inferred: PetOwner(Pete) 2.6.6 Class + Instance Inference Combining class and instance inference allows the discovery of both new classes and instance mem- berships: Example: – Declared: ∗ hasPet(Person, Animal) ∗ PetOwner ⊑ Person ⊓ ∃hasPet.Animal ∗ PetLover ⊑ Person⊓ > 3hasPet.Animal – Declared: ∗ Person(Pete), Animal(Tom), Animal(Jerry), Animal(Spike) ∗ hasPet(Pete, Spike), hasPet(Pete, Tom), hasPet(Pete, Jerry) ∗ {Spike} ⊑ ¬{T om, Jerry} – Inferred: 17 Introduction to Semantic Systems - Handbook Max Tiessler ∗ PetOwner(Pete) ∗ PetLover(Pete) Reasoning enables powerful, logic-based conclusions to be drawn from the ontology, enriching both its usability and reliability. 18 Introduction to Semantic Systems - Handbook Max Tiessler 3 Semantic Web, RDF, RDFS, and OWL 3.1 The Semantic Web The Semantic Web represents an extension of the traditional Web, aiming to enable machines to understand and process data in a way that is closer to human reasoning. According to Tim Berners- Lee in the Scientific American journal: “The Semantic Web is not a separate Web but an extension of the current one, in which information is given well-defined meaning, better enabling computers and people to work in cooperation.” In essence, it focuses on the meaningful interconnection of data to support better knowledge repre- sentation, information retrieval, and decision-making. 3.1.1 Key Concepts and Foundations Linked Data: The Semantic Web is built on the principle of Linked Data, which connects data across different resources using structured formats and qualified links. – Links between things/entities rather than just documents. – Knowledge is machine-readable, enabling automated reasoning. – Links are qualified to define relationships (e.g., dbo:city or owl:sameAs). Comparison with the Web of Documents: – The Web of Documents primarily links human-readable pages accessed via browsers. – The Web of Data (Semantic Web) links machine-readable entities accessed by programs and agents. Scientific Perspectives: – As emphasized by Sir Tim Berners-Lee: ”The more things you have to connect together, the more powerful it is.” – Decentralized databases underpin this ecosystem, supporting robust knowledge sharing and reasoning. 3.1.2 Semantic Web Language Design Principles The design of the Semantic Web is governed by specific principles that enable flexibility and inter- operability: AAA Slogan: On the Semantic Web, ”Anyone can say Anything about Any topic.” This principle highlights the openness of the web, allowing diverse sources to describe and link entities without centralized control. The Non-unique naming Assumption and the Open World Assumption stem from this slogan. 19 Introduction to Semantic Systems - Handbook Max Tiessler Non-unique Naming Assumption: The same entity may have multiple identifiers (URIs), reflecting its description by different sources. Explicit relationships such as owl:sameAs are necessary to state that two URIs refer to the same entity. Disjointness must also be specified explicitly when entities are distinct. Open World Assumption (OWA): Missing information is not treated as negative information. The Semantic Web assumes incomplete knowledge, enabling reasoning over partial data. For example: – If likes(PersonA, DrinkB) is asserted, the OWA does not infer not likes(PersonA, DrinkC). – Instead, it concludes don’t know whether PersonA likes DrinkC. This contrasts with the Closed World Assumption (CWA), where missing information is treated as false. 3.1.3 Benefits of Semantic Web Principles Enables a flexible and decentralized approach to knowledge representation. Facilitates reasoning and integration of data from disparate sources. Supports robust applications in fields like knowledge graphs, data interoperability, and intelli- gent agents. 3.1.4 Technological Foundations The Semantic Web leverages existing web technologies to achieve its goals. They are the bottom layer of the Semantic Web Technology stack, which can be seen in 9. The technologies used are: TCP/IP: Facilitates data transfer across networks. HTTP: Enables client-server communication using a request/response model. HTML and XML: – HTML structures and displays web content. – XML provides a flexible markup framework for defining custom data formats. URIs and IRIs: Identifiers for resources on the web. – URI Types: ∗ Uniform Resource Name (URN): Persistent, location-agnostic identifiers. 20 Introduction to Semantic Systems - Handbook Max Tiessler Figure 9: Semantic Web Stack ∗ Uniform Resource Locator (URL): Specifies access mechanisms for resources. – IRI: An internationalized extension of URI supporting Unicode characters. 3.1.5 Applications and Use Cases Killer Applications: – Intelligent agents retrieving, analyzing, and negotiating information. – Scheduling and coordination for multiple stakeholders (e.g., treatments or services). Ontology and Knowledge Representation: – Provides structured models to represent domains of knowledge. – Enhances the interoperability and reasoning capabilities of intelligent systems. 3.1.6 Challenges and Evolution The Semantic Web is still evolving, requiring: – Better adoption of Linked Data principles. – Tools for creating, managing, and consuming semantic data. Continues to build on the foundational technologies of the traditional web. 3.2 RDF The Resource Description Framework (RDF) is a W3C standard designed to describe resources on the web in a structured and machine-readable way. It is foundational to the Semantic Web and provides a framework for knowledge representation and sharing across diverse systems. 21 Introduction to Semantic Systems - Handbook Max Tiessler 3.2.1 Overview of RDF RDF was developed in the late 1990s, with its final W3C recommendation (RDF 1.1) released in 2004. It uses a graph-based data model that formalizes semantics, making it accessible to machines. RDF expresses knowledge as a collection of statements, where each statement is represented as an RDF triple. An RDF triple consists of: Subject: The resource being described, identified by a URI. Predicate: The relationship or property linking the subject to the object, also identified by a URI. Object: The value or related resource, which can be a URI or a literal. 3.2.2 RDF Graph Model RDF statements naturally form a directed labeled graph, where: Nodes represent resources (subjects or objects). Arcs represent predicates, connecting subjects to objects. For instance, the RDF triple: is visualized as a graph: worksIn John −−−−→ ProjectX. The object of one statement can act as the subject of another, enabling the integration of multiple graphs. 3.2.3 RDF Serialization Formats RDF provides multiple serialization formats for different use cases, including machine communication, human readability, and ease of implementation. Common formats include RDF/XML, N-Triples, Turtle, and JSON-LD. RDF/XML RDF/XML is one of the earliest serialization formats, suitable for inter-machine com- munication. Useful for inter-machine communication. Every Description element describes a resource, referred to by an IRI. Every attribute or nested element inside a Description is a property of that resource. An example: 22 Introduction to Semantic Systems - Handbook Max Tiessler N-Triples N-Triples is a simple, line-based format where each RDF statement (triple) is terminated by a period. **Every statement is terminated with a full stop.** **URIs are enclosed in angle brackets (< >).** **Literals are enclosed in quotes.** An example:. Another example adapted from Euclid learning materials by Barry Norton: "The Beatles".. In this example: The subject is. The predicate (property) is either or