Β© JK
Artificial Intelligence
Knowledge Representation
Prof. Dr. habil. Jana KoehlerArtificial Intelligence - Summer 2020
Deep thanks goes to Prof. Bernhard Nebel and Prof. Franz Baader for sharing their course material
Β© JK
Agenda Representation of conceptual knowledge
β Frames, Semantic Nets, Description Logics
The description logic πππππβ ABox and TBox representationsβ Reasoning procedures and complexity
Nonmonotonic reasoningβ Dealing with exceptionsβ Revising a knowledge base
Web ontologies and the W3C OWL standardβ Computing Subsumption in OWLβ Querying the semantic web with Sparql
2 Artificial Intelligence: Knowledge Representation
Β© JK
Recommended Reading
AIMA Chapter 12: Knowledge Representationβ 12.1 Ontological Engineeringβ 12.2 Categories and Objectsβ 12.5 Reasoning Systems for Categoriesβ 12.7 The Internet Shopping Worldβ 12.8 Summary
Artificial Intelligence: Knowledge Representation3
Β© JK
Additional Reading Knowledge Representation & Reasoning by R. Brachman, H. Levesque:
Morgan Kaufmann 2004 (available online)
F. Baader, C. Lutz, I. Horrocks, U. Sattler: An Introduction to Description Logic. Cambridge University Press, 2017
F. Baader, D. Calvanese, D. McGuinness, D. Nardi, P. Patel-Schneider: The Description Logic Handbook: Theory, Implementation, and Applications. Cambridge University Press, 2nd edition, 2007
M. Gelfond, Y. Kahl: Knowledge Representation, Reasoning, and the Design of Intelligent Agents: The Answer-Set Programming Approach, Cambridge University Press, 2014
Artificial Intelligence: Knowledge Representation4
Β© JK
Representation of Conceptual Knowledge
Artificial Intelligence: Knowledge Representation5
Β© JK
An Extract of My Conceptual Model of this Lecture
Artificial Intelligence: Knowledge Representation6
Rich Representations
of ObjectsIntelligent Agent
Modelneeds
interested in
Learning
isa
can be improved with
Clause Learning
Davis-Putnam LL
can be improved by
Resolution
inference possible with
isaCalculus
isa Propositional Logic
Mathematical Logic
isa
requires
First-Order Logic
Quantifier
isa
has exactly 2
State of the World
needs
Adversarial Search
finds
enables
isa A*
Heuristics
Optimal
Complete
relies on
is
is
Planning
Constraint Satisfaction
isaisa
can be represented with
Best possible
Action
State-based Search
Algorithm
isa
Β© JK
Remember: Symbolic Representations
Find a definitionβ using symbols, concepts, rules, some formalismβ apply automated reasoning procedures
Artificial Intelligence: Knowledge Representation7
A chairβ’ is a portable objectβ’ has a horizontal surface at a suitable height for sittingβ’ has a vertical surface suitably positioned for leaning against
Β© JK
Knowledge Representation
Agents need knowledge before they can start to act intelligently, they need to knowβ relevant objects in a domain, what properties these
objects have, and how they relate to each otherβ’ abstract concepts: βcarβ, βbookββ’ concrete instances of these concepts (objects): Citroen C3 βSB..ββ’ properties: βcar has wheels = exactly 4ββ’ concept-concept relations: βa car is a moving vehicleβ
β actions they can perform and how these affect the domainΒ΄s objects
β’ For example, PDDL and STRIPS are popular formalismsβ temporal relationships between events, spatio-temporal
relations between objects, physical laws,β¦
Artificial Intelligence: Knowledge Representation8
Β© JK
Knowledge Representation and (!) Reasoning
How can agents exploit the knowledge they have?
They need some reasoning component to ask various questions about the objects and concepts in their knowledge baseβ Is βCitroen C3 SB-CHβ¦β a moving vehicle?β How many wheels does it have?β Which other cars does the agent know about?β Are there moving vehicles which are not cars?
How can we formalize such a knowledge base and its calculus?
Artificial Intelligence: Knowledge Representation9
Β© JK
Categories and Objects
We need to describe the objects in our world using categories
Necessary to establish a common category system for different applications (in particular on the web)
There are a number of quite general categories everybody and every application uses
Artificial Intelligence: Knowledge Representation10
Β© JK
The Upper Ontology: A General Category Hierarchy
Artificial Intelligence: Knowledge Representation11
Β© JK
Frames β Semantic Nets β Description Logics
How to describe more specialized things?
Use definitions and/or necessary conditions referring to other already defined concepts:β A parent is a human with at least one child.
More complex description:β A proud-grandmother is a human, who is female with at
least two children who are parents and whose childrenare all computer science students.
Artificial Intelligence: Knowledge Representation12
Β© JK
Marvin Minsky: A Framework for Representing Knowledge
13
A frame is a data-structure for representing a stereotyped situation, like being in a certain kind of living room, or going to a child's birthday party. Attached to each frame are several kinds of information.
1974
Artificial Intelligence: Knowledge Representation
Β© JK
Semantic Networks
In 1909, Charles S. Peirce proposed a graphical notation of nodes and edges named existential graphs that he called "the logic of the futureβ
In 1956, Richard H. Richens proposes "Semantic Nets" as an "interlingua" for machine translation of natural languages
In 1963, M. Ross Quillian presented a βnotation for representing conceptual informationβ
Artificial Intelligence: Knowledge Representation14
Β© JK
A Semantic Network
Artificial Intelligence: Knowledge Representation15
Β© JK
Description Logics Many researchers contributed to the formalization of
semantic networks as a fragment of first-order predicate logic (PL1)β Semantics of DLs can be given using ordinary PL1β Alternatively, DLs can be considered as modal logics
β’ Extensions of PL1 with operators expressing modalities
β’ PL1: John is happyβ’ ML: John is always happy, John is sometimes happy
Reasoning problems in most DLs are decidable β A family of DL languages of varying complexity (KL-ONE,
CLASSIC, ALC, OWL) was developed over the yearsArtificial Intelligence: Knowledge Representation16
Β© JK
The Notion of Description Logics
Subfield of knowledge representation (KR), which is a subfield of AI
Description Logic: name of a research field in AI/KR
Description Logics: a family of knowledge representation languages
Description Logic X: a member of this family
Artificial Intelligence: Knowledge Representation17
Β© JK
General Goals when Developing a Solution for KR
Formalism: well-defined syntax and formal, unambiguous semantics
High-level description: only relevant aspects represented, others left out
Intelligent applications: must be able to reason about the knowledge, and infer implicit knowledge from the explicitly represented knowledge
Effectively used: need for practical reasoning tools and efficient implementations
Artificial Intelligence: Knowledge Representation18
Β© JK
Syntax
Explicit symbolic representation of knowledgeβ Not implicit as for example in neural networks
Artificial Intelligence: Knowledge Representation19
Woman β‘ Person β FemaleMan β‘ Person β Β¬FemaleMother β‘ Woman β βhas.Child.β€Person β‘ Man β Womanβ₯ β‘ Male β Female
hasChild(STEPHEN, MARC)hasChild(MARC, ANNA)hasChild(JOHN, MARIA)hasChild(ANNA, JASON)
Person(JOHN), Person(MARC), Person(STEPHEN), Person(JASON), Person(MICHELLE), Person(ANNA), Person(MARIA)
Male(JOHN), Male(MARC), Male(STEPHEN), Male(JASON), Female(MICHELLE), Female(ANNA), Female(MARIA)
Β© JK
(Declarative) Semantics
Mapping of symbolic expressions to an interpretation
Notion of truth, which allows us to determine whether a symbolic expression is true in the world under consideration (has a model)
Syntax & semantics determine the expressive power of a KR languageβ Not too low: can we represent all knowledge of interest?β Not too high: are the representation and reasoning
means adequate?
Artificial Intelligence: Knowledge Representation20
Β© JK
Reasoning
Deduce implicit knowledge from the explicitly represented knowledgeβ Results should only depend on the semantics of the
representation language, not on the syntactic representation
β Semantically equivalent knowledge should lead to the same result
Artificial Intelligence: Knowledge Representation21
βπ₯π₯,π¦π¦: ππππππππ π¦π¦ β§ βπ§π§: βπππ π _ππβππππππ π₯π₯, π§π§ β§ βπππ π _ππβππππππ π§π§,π¦π¦ βΆ βπππ π _πππππππππππ π ππππ(π₯π₯,π¦π¦)
βπππ π _ππβππππππ(π½π½ππβππ,πππππππ¦π¦)
βπππ π _ππβππππππ(πππππππ¦π¦,ππππππππ)
ππππππππ(ππππππππ)
Implicit knowledge:βπππ π _πππππππππππ π ππππ(π½π½ππβππ,ππππππππ)
Β© JK
Reasoning Procedure (Calculus)
Ideally, we want a decision procedure for the problem:β Soundness: positive answers are correctβ Completeness: negative answers are correctβ Termination: always gives an answer in finite time
As efficient as possible, preferable optimal w.r.t. the complexity of the problem and practical (easy to implement)
Artificial Intelligence: Knowledge Representation22
Β© JK
Challenge: Balancing Expressivity of Formalism and Efficiency of Reasoning Procedure
Artificial Intelligence: Knowledge Representation23
Satisfiability in first-order logic does not have a decision procedure
- full first-order logic is thus not an appropriate knowledge representation formalism
Satisfiability in propositional logic has a decision procedure, but the problem is NP-complete
- there are, however, highly optimized SAT solvers that behave well in practice
- expressive power is, however, often not sufficient to express the relevant knowledge
Β© JK
The Description Logic πππππ
Artificial Intelligence: Knowledge Representation24
Β© JK
The Description Logic πππππ
Artificial Intelligence: Knowledge Representation25
πππππ Attributive Language with Complement, see Schmidt-SchauΓ & Smolka, 1991
Naming scheme:
Basic language πππ
Extended with constructors whose βletterβ is added after πππ
ππ stand for complement, i.e., πππππ is obtained from πππ by adding the
complement operator (Β¬)
Β© JK
A Description Logic System
Artificial Intelligence: Knowledge Representation26
TBoxdefines the terminology of the application domain
ABoxstates facts about a specific βworldβ
constructors for building complex concepts out of atomic concepts and roles
formal, logic-based semantics
derive implicitly represented knowledge (e.g., subsumption)
βpracticalβ algorithms
knowledge base
description language
reasoning component
Β© JK Artificial Intelligence: Knowledge Representation27
An Example
Mammal
CanineHuman
FluffyMarko
4 truefalse2
inferred
subClassOf
type type
type type
hasFurnumberOfLegs numberOfLegs hasFur
bestFriend
TBoxABox
subClassOf
Β© JK
Syntax of πππππ
Let C and R be disjoint sets of concept names and role names, respectively.πππππ-concept descriptions are defined by induction: If π΄π΄ β C, then π΄π΄ is an πππππ-concept description If πΆπΆ,π·π· are πππππ-concept descriptions, and ππ β R, then the
following are πππππ-concept descriptions:β πΆπΆ β π·π· (conjunction)
β πΆπΆ β π·π· (disjunction)
β Β¬πΆπΆ (negation)
β βππ.πΆπΆ (universal role value restriction)
β βππ.πΆπΆ (existential role value restriction)Artificial Intelligence: Knowledge Representation28
Abbreviations:
- β€ βπ΄π΄ β Β¬π΄π΄ (top)
- β₯β π΄π΄ β Β¬π΄π΄ (bottom)
- πΆπΆ β π·π· β Β¬πΆπΆ β π·π· (implication)
Β© JK
πππππ Examples
Person β Female
Participant β βattends.Talk
Participant β βattends.(Talk β Β¬Boring)
Speaker β βgives.(Talk β βtopic.DL)
Speaker β βgives.(Talk β βtopic.(DL β FuzzyLogic))
Artificial Intelligence: Knowledge Representation29
Β© JK
Notation
Concept names are called atomic
All other descriptions are called complex
Instead of πππππ-concept description we often say πππππ-
concept or concept description or concept
π΄π΄,π΅π΅ often used for concept names
πΆπΆ,π·π· for complex concept descriptions
ππ, π π for role names
Artificial Intelligence: Knowledge Representation30
Β© JK
Semantics of πππππ
An interpretation πΌπΌ = βπΌπΌ ,οΏ½πΌπΌ consists of a non-empty domain βπΌπΌand an extension mapping οΏ½πΌπΌ: π΄π΄πΌπΌ β βπΌπΌ for all π΄π΄ β C concepts interpreted as sets
πππΌπΌ β βπΌπΌ Γ βπΌπΌ for all ππ β R roles interpreted as binary relations
The extension mapping is extended to complex πππππ-concept description as follows: πΆπΆ β π·π· πΌπΌ β πΆπΆπΌπΌ β© π·π·πΌπΌ
πΆπΆ β π·π· πΌπΌ β πΆπΆπΌπΌ βͺ π·π·πΌπΌ
Β¬πΆπΆ πΌπΌ β βπΌπΌ \ πΆπΆπΌπΌ
βππ.πΆπΆ πΌπΌ β ππ β βπΌπΌ | for all ππ β βπΌπΌ βΆ ππ, ππ β πππΌπΌ implies ππ β πΆπΆπΌπΌ
βππ.πΆπΆ πΌπΌ β ππ β βπΌπΌ | there is ππ β βπΌπΌ βΆ ππ, ππ β πππΌπΌ and ππ β πΆπΆπΌπΌ
Artificial Intelligence: Knowledge Representation31
Β© JK
Example of an Interpretation
Artificial Intelligence: Knowledge Representation32
NU FPerson Male
Person Male
Person Female
TalkTalkTalkTalk
DLFL ML MA
topic topic topic topic topictopic topic
gives gives gives gives
Β© JK
Relationship with First-Order Predicate Logic
Concept names are unary predicates, and role names are binary predicates
Interpretations for πππππ can then obviously be viewed as first-order interpretations for this signature
Concept descriptions corresponds to first-order formulae with one free variable
Given such a formula ππ(π₯π₯) with the free variable π₯π₯ and an interpretation πΌπΌ, the extension of ππ w.r.t. πΌπΌ is given by
πππΌπΌ β ππ β βπΌπΌ | πΌπΌ β¨ ππ(ππ) We can translate πππππ-concepts πΆπΆ into first-order formulae πππ₯π₯ πΆπΆ such that their extensions coincide
Artificial Intelligence: Knowledge Representation33
Β© JK
The TBox A general concept inclusion (GCI) is of the form πΆπΆ β π·π·
where πΆπΆ,π·π· are concept descriptions
A TBox is a finite set of GCIs
An interpretation πΌπΌ satisfies a GCI πΆπΆ β π·π· iff πΆπΆπΌπΌ β π·π·πΌπΌ
An interpretation πΌπΌ is a model of the TBox ππ iff it satisfies all GCIs in ππ
Two TBoxes are equivalent if they have the same models
Artificial Intelligence: Knowledge Representation34
Β© JK
Acyclic TBox
An acyclic TBox is a finite set of concept definitions, which
do not contain multiple definitions
do not contain cyclic definitions
A TBox ππ does not contain cyclic definitions iff there is no sequence π΄π΄1 β‘ πΆπΆ1, β¦ ,π΄π΄ππ β‘ πΆπΆππ β ππ ππ β₯ 1 such that
β π΄π΄ππ+1 occurs in πΆπΆππ (1 β€ ππ < ππ)β π΄π΄1 occurs in πΆπΆππ
35
π΄π΄ β‘ πΆπΆπ΄π΄ β‘ π·π· for πΆπΆ β π·π·
π΄π΄ β‘ π΅π΅ β βππ.πππ΅π΅ β‘ ππ β βππ.πΆπΆπΆπΆ β‘ βππ.π΄π΄
π΄π΄ β‘ ππ β βππ. βππ.π΄π΄ β βππ.ππ
Β© JK
Woman β‘ Person β Female
Man β‘ Person β Β¬Female
Talk β‘ βtopic.β€
Speaker β‘ Person β βgives.Talk
Participant β‘ Person β βattends.Talk
BusySpeaker β‘ Speaker β (β₯ 3 gives.Talk)
BadSpeaker β‘ Speaker β βgives.(βattendsβ. (Bored β Sleeping))
Concept Definitions in an Acyclic Tbox and GCI
Artificial Intelligence: Knowledge Representation36
if ππ is a role, then ππβ denotes its inverse: ππβ πΌπΌ β ππ,ππ | ππ, ππ β πππΌπΌ
Person
Woman
Female
Man
Β¬Female Talk
Speaker Participant
BadSpeaker
BusySpeaker
Β© JK
The ABox
An ABox A is a finite set of assertions An assertion is of the form
ππ βΆ πΆπΆ (concept assertion) or ππ, ππ βΆ ππ (role assertion)where πΆπΆ is a concept description, ππ is a role, and ππ, ππ are individual names from a set ππ of such names disjoint with ππ, ππ
πΌπΌ assigns elements πππΌπΌ of βπΌπΌ to individual names ππ β ππ An interpretation πΌπΌ is a model of an ABox π¨π¨ if it satisfies all
its assertions:πππΌπΌ β πΆπΆπΌπΌ for all ππ βΆ πΆπΆ β π¨π¨πππΌπΌ , πππΌπΌ β πππΌπΌ for all ππ, ππ βΆ ππ β π¨π¨
Artificial Intelligence: Knowledge Representation37
Β© JK
Example of an ABox
Artificial Intelligence: Knowledge Representation38
FRANZ : Lecturer
TU03 : Tutorial
REASONINGinDL : DL
(FRANZ, TU03) : teaches
(TU03, REASONINGinDL) : topic
Β© JK
Knowledge Bases
A knowledge base πΎπΎπ΅π΅ = ππ,π΄π΄ consists of a TBox ππ and an ABox π΄π΄
The interpretation πΌπΌ is a model of the knowledge base πΎπΎπ΅π΅ = ππ,π΄π΄ iff it is a model of ππ and a model of π΄π΄
Artificial Intelligence: Knowledge Representation39
Β© JK
Reasoning Services in Description Logics
Subsumptionβ Determine whether one description is more general than
(subsumes) the other Classification
β Create a subsumption hierarchy Satisfiability
β Is a description satisfiable? Instance relationship
β Is a given object an instance of a concept description? Instance retrieval
β Retrieve all objects for a given concept description
Artificial Intelligence: Knowledge Representation40
Β© JK
Formalization of Reasoning Services
Artificial Intelligence: Knowledge Representation41
Let ππ be a TBoxSatisfiability:
πΆπΆ is satisfiable w.r.t. ππ iff πΆπΆπΌπΌ β β for some model πΌπΌ of ππ
Subsumption:
πΆπΆ is subsumed by π·π· w.r.t. ππ (πΆπΆ βππ π·π·) iffπΆπΆπΌπΌ β π·π·πΌπΌ for all models πΌπΌ of the TBox ππ
Equivalence:
πΆπΆ is equivalent to π·π· w.r.t. ππ (πΆπΆ β‘ππ π·π·) iffπΆπΆπΌπΌ = π·π·πΌπΌ for all models πΌπΌ of the TBox ππ
Β© JK
Examples
π΄π΄ β Β¬π΄π΄ and βππ.π΄π΄ β βππ. Β¬π΄π΄ are not satisfiable (unsatisfiable)
π΄π΄ β Β¬π΄π΄ β‘ βππ.π΄π΄ β βππ. Β¬π΄π΄ (are equivalent)
π΄π΄ β π΅π΅ is subsumed by π΄π΄ and by π΅π΅
β π΄π΄ β π΅π΅ β π΄π΄ and π΄π΄ β π΅π΅ β π΅π΅
βππ. π΄π΄ β π΅π΅ is subsumed by βππ.π΄π΄ and by βππ.π΅π΅
β βππ. π΄π΄ β π΅π΅ β βππ.π΄π΄ and βππ. π΄π΄ β π΅π΅ β βππ.π΅π΅
βππ. π΄π΄ β π΅π΅ β‘ βππ.π΄π΄ β βππ.π΅π΅ (are equivalent)
βππ.π΄π΄ β βππ.π΅π΅ β βππ. π΄π΄ β π΅π΅
Artificial Intelligence: Knowledge Representation42
Β© JK
Formalization of Assertional Reasoning
Artificial Intelligence: Knowledge Representation43
Let πΎπΎπ΅π΅ = ππ,π΄π΄ be a knowledge base
Consistency:
πΎπΎπ΅π΅ is consistent iff there exists a model of πΎπΎπ΅π΅
Instance:
ππ is an instance of πΆπΆ w.r.t. πΎπΎπ΅π΅ iff πππΌπΌ β πΆπΆπΌπΌ for all models πΌπΌ of πΎπΎπ΅π΅
Β© JK
Realization
Computing the most specific concept names in the TBox to which an ABox individual belongs
Artificial Intelligence: Knowledge Representation44
Anna is a Person, a Woman, and a Motherβ Mother is the most specific concept
Woman β‘ Person β FemaleMan β‘ Person β Β¬FemaleMother β‘ Woman β βhas.Child.β€Person β‘ Man β Womanβ₯ β‘ Male β Female
hasChild(STEPHEN, MARC)hasChild(MARC, ANNA)hasChild(JOHN, MARIA)hasChild(ANNA, JASON)
Person(JOHN), Person(MARC), Person(STEPHEN), Person(JASON), Person(MICHELLE), Person(ANNA), Person(MARIA)
Male(JOHN), Male(MARC), Male(STEPHEN), Male(JASON), Female(MICHELLE), Female(ANNA), Female(MARIA)
Β© JK
More Equivalences
Let KB = ππ,π΄π΄ be a knowledge base, πΆπΆ,π·π· concept descriptions, and ππ β I
πΆπΆ β‘ππ π·π· iff πΆπΆ βππ π·π· and π·π· βππ πΆπΆπΆπΆ βππ π·π· iff πΆπΆ β‘ππ πΆπΆ β π·π·πΆπΆ βππ π·π· iff πΆπΆ β Β¬π·π· is unsatisfiable w.r.t. πππΆπΆ is satisfiable w.r.t ππ iff πΆπΆ β’ππ β₯πΆπΆ is satisfiable w.r.t ππ iff ππ, ππ βΆ πΆπΆ is consistentππ is an instance of πΆπΆ w.r.t πΎπΎπ΅π΅ iff ππ,π΄π΄ βͺ ππ: Β¬πΆπΆ is inconsistentπΎπΎπ΅π΅ is consistent iff ππ is not an instance of β₯ w.r.t. πΎπΎπ΅π΅
Artificial Intelligence: Knowledge Representation45
Β© JK
Complexity of Reasoning in πππππ
Satisfiability of a concept description w.r.t. a TBox is decidable for πππππ
Concept satisfiability and subsumption w.r.t. acyclic TBoxesare in PSpace for πππππ
Concept satisfiability and subsumption w.r.t. general TBoxesare in ExpTime for πππππ
Artificial Intelligence: Knowledge Representation46
Complexity classes:
PTime β NP β PSpace β ExpTime β NExpTime
Β© JK
Expressivity and Undecidability
Consider the following part of a TBox about universities:Course β βheldβat.UniversityLecturer β βteaches.Course β βemployedβby.University
To express that someone who teaches a course held at a university must be employed by that specific university, we need role value maps:
β€ β teaches β heldβat β employedβby
Though very useful, role value maps are not available in modern DL systems since they cause undecidabilityβ In the extension of πππππ with role value maps, concept
satisfiability and subsumption (without TBoxes) are undecidable
Artificial Intelligence: Knowledge Representation47
Β© JK
Nonmonotonic Reasoning
Artificial Intelligence: Knowledge Representation48
Β© JK
Limitations of Standard Logic Standard logic is monotonic:
β once you prove something is true, it is true forever
Monotonic Logic is not a good fit to realityβ If the wallet is in the purse, and the purse is in the car, we can
conclude that the wallet is in the carβ But what if we take the purse out of the car?β Where is the wallet?
Revising knowledge bases in the light of new information
Dealing with exceptions
Artificial Intelligence: Knowledge Representation49
Β© JK
Fundamental Challenges in Knowledge Bases Qualification problem: specifying all exceptions is
infeasibleβ Pepper can follow you unless it cannot detect you, its batteries are
empty, its vision system is broken, the ground is slippy, you are too fast,β¦
Frame problem: cannot explicitly specify what does notchange when an action is executedβ When Pepper answers a question, the furniture will stay in place, it
will not move outside a certain range, it will not loose any information, β¦
Ramification problem: how to represent what happens implicitly due to an actionβ When Pepper grasps a box and moves, the box will move with the
robot, all objects inside the box will also move with the box, the beads above the little box inside the big box will fall into the bigbox, β¦
Artificial Intelligence: Knowledge Representation50
Β© JK
The Frame Problem in AI
Specification of the properties that do not change as a result of an actionβ Impossible to enumerate explicitly
A more elegant way to solve the frame problem is to fully describe the successor situation: (inertia = things do not change unless otherwise specified)
Closed world Assumption: only the agent changes the situation (anything that is not mentioned as being changed, remains unchanged)
Artificial Intelligence: Knowledge Representation51
true after action βΊ [action made it true or it is already true and the action did not falsify it]
Β© JK
A Brief History of Nonmonotonic Logic
John McCarthy developed circumscription in 1977/80 to deal with the frame problem in AI
Yoav Shoham generalized circumscription to preferential entailment in 1987
Drew McDermott and Jon Doyle developed nonmonotonic logics based on "consistency with current beliefsβ in 1980
Ray Reiter developed default logic in 1978/80 Robert Moore developed autoepistemic logic in 1985 Ilkka NiemelΓ€ and others developed Answer Set
Programming (ASP) in 1999
Artificial Intelligence: Knowledge Representation52
Β© JK
Belief Revision Process of changing beliefs in the light of a new piece of
information To understand how nonmonotonic reasoning requires the
revision of beliefs, consider a standard example:
βAll birds fly.""Tweety is a bird.""Does Tweety fly?β
The obvious answer is yes, β however what if later we learned that Tweety had a broken wing,
then the answer becomes no, β what if we later learned that Tweety was a human airplane pilot and
that the information of it being a bird was wrong β¦Artificial Intelligence: Knowledge Representation53
Β© JK
A Historic Formalism: Inheritance Diagrams
Artificial Intelligence: Knowledge Representation54
Flying Things
BirdsOstriches
Fred Tweety
Normal Facts
Default
Β¬Default (an exception)
Β© JK
The Nixon Diamond
Quakers are pacifists
Republicans are not pacifists
Richard Nixon is both a Quaker and a Republican
Is Nixon a Pacifist?
Artificial Intelligence: Knowledge Representation55
Nixon
QuakersRepublicans
Pacifists
Default assumptions lead to mutually inconsistent conclusions
Β© JK
How many Legs does Pat have?
Pat is a Bat.
Bats are Mammals.
Bats can fly.
Bats have 2 legs.
Mammals cannot fly.
Mammals have 4 legs.
Artificial Intelligence: Knowledge Representation56
Β© JK
Web Ontologies and the W3C OWL Standard
Artificial Intelligence: Knowledge Representation57
Β© JK
Description Logic and Ontologies
The W3C standards for OWL βOntology Web Languageβ is based on Description Logic
DBpedia is a famous ontology based on OWL
Cyc https://www.cyc.com/ is another famous ontology based on description logics [Lenat & Guha, 1990]
Artificial Intelligence: Knowledge Representation58
Β© JK
The World of Data
Artificial Intelligence: Knowledge Representation59
Relational DatabasesEntities, Relations, Tables
(Distributed) NoSQL DatabasesAttribute-Value-Pairs, Columns/Graphs
Semantic Webconcepts, relationships, ontologies
Object-Oriented ProgrammingObjects, Properties, Methods
Deductive Databases Business Rules β¦
Β© JK
Semantic Web Architecture
60
W3C, 2006http://www.ansta.co.uk/blog/semantic-web-technologies-part-3-94/
We are here
Artificial Intelligence: Knowledge Representation
RDF Triples
Ontology editor https://protege.stanford.edu
subject objectpredicate
Β© JK
The OWL Family
61 Artificial Intelligence: Knowledge Representation
OWL DL is decidable The reasoner underlying any application will eventually answer
our question!
More expressive than ALC, but still decidable
undecidable
NEXPTIME-complete
EXPTIME-complete
Β© JK
OWL DL
62
hasEngine
Tesla
PCell
hasEngine hasEngineEngine
DieselTruck
Vehicle
subClassOf
isA
Ford
TBoxABox
Tesla
Β© JK
Reasoning in OWL-DL: Class-Class Relationships
Class subsumptionGiven classes C and D, determine if C is a subclass of D in the given ontologybuild the class/subsumption hierarchy
Class satisfiabilityGiven a class C, determine if C is satisfiable (consistent) in the given ontologyβ C is satisfiable iff πΆπΆ β’β₯
Artificial Intelligence: Knowledge Representation63
Β© JK
Reasoning in OWL-DL: Class-Instance Memberships
Class-instance membership β groundGiven a class πͺπͺ and an individual ππ, is ππ an instance of πͺπͺ in knowledge base πΎπΎπ΅π΅?
β openGiven a class πͺπͺ, determine all the individuals ππ,ππ, ππ, β¦ in πΎπΎπ΅π΅that are instances of πͺπͺ.
β ``all-classes''Given an individual ππ, determine all the (named) classes πͺπͺ,π«π«,π¬π¬, β¦ in πΎπΎπ΅π΅ of which ππ is an instance of.
Artificial Intelligence: Knowledge Representation64
Β© JK
Subsumption as Essential Class-Class Relationship
A class πͺπͺ is subsumed by a class π«π« if and only if every model (satisfiable
interpretation) of πͺπͺ is also a model of π«π«
CπΌπΌ β DπΌπΌ
D subsumes C
C is a (subclass of) D
D is more general than C
C logically implies D
CabernetSauvignon is a RedWine
CabernetSauvignon is subsumed by RedWine
RedWine subsumes CabernetSauvigon
Artificial Intelligence: Knowledge Representation65
DRedWine
CCabernet
Sauvignon
Β© JK
Computing Subsumption By Structural Comparison
1. Put class descriptions into a normal form representationexploiting equivalencesβ similar to the computation of normal forms (CNF/DNF) in
Propositional and First-Order Logics
2. Recursively descend into the structural parts of the descriptions and compare them to each otherβ if each (conjunctive) part of πΆπΆ is subsumed by some part
of π·π·, then πΆπΆ is subsumed by π·π·β often done with graph traversal algorithms
Artificial Intelligence: Knowledge Representation66
Β© JK
A Simple Example
Given two concepts: πΆπΆ β‘ Β¬ Β¬π΄π΄ β Β¬π΅π΅ π·π· β‘ π΄π΄
π·π·πππππ π πΆπΆ β π·π·? β‘ πΆπΆ β π·π·?
We use the following logical equivalences:Β¬ π΄π΄ β π΅π΅ β‘ Β¬π΄π΄ β Β¬π΅π΅Β¬ Β¬π΄π΄ β‘ π΄π΄
πΆπΆ β‘ Β¬ Β¬π΄π΄ β Β¬π΅π΅ ①¬¬π΄π΄ β ¬¬π΅π΅β‘ A β B
π΄π΄ β π΅π΅ β π΄π΄ which also means that π΄π΄ β π΅π΅ β π΄π΄ and thus πΆπΆ β π·π·
Artificial Intelligence: Knowledge Representation67
Β© JK
Example of Structural Comparison Rules for OWL-DL
Artificial Intelligence: Knowledge Representation68
Concept A Concept B Condition of π¨π¨ β π©π©βπ π .πΆπΆ βππ.π·π· Iff π π β ππ and πΆπΆ β π·π·βπ π .πΆπΆ βππ.π·π· Iff ππ β π π and πΆπΆ β π·π·β₯ πππ π .πΆπΆ β₯ ππππ.π·π· Iff π π β ππ and πΆπΆ β π·π· and ππ β₯ ππβ€ πππ π .πΆπΆ β€ ππππ.π·π· Iff ππ β π π and D β πΆπΆ and ππ β€ ππ
π π β ππ role subsumption and role hierarchies
π₯π₯, π¦π¦ π₯π₯, π¦π¦ β π π πΌπΌ β π€π€, π§π§ π€π€, π§π§ β πππΌπΌ
ππππππππππππππ β πππππππππ π ππππππππππππππππππππ ππππ βπ₯π₯βπ¦π¦(ππππππππππππππ(π₯π₯,π¦π¦) β πππππππππ π (π₯π₯,π¦π¦))
πππππππππ€π€ππππππ β πππππππππ€π€ππππππ
Β© JK
An Example
Artificial Intelligence: Knowledge Representation69
From Sebastian Rudolph:Foundations of Description Logics https://www.aifb.kit.edu/images/1/19/DL-Intro.pdf
Β© JK
An Example
Artificial Intelligence: Knowledge Representation70
WellRoundedCo β‘[AND Company [ALL : Manager [AND BβSchoolGrad
[EXISTS 1: TechnicalDegree]]]]
HighTechCo β‘[AND Company [FILLS : Exchange nasdaq] [ALL : Manager Techie]]
Techie β‘[EXISTS 2 : TechnicalDegree]
These definitions amount to a WellRoundedCo being a company whosemanagers are business school graduates who each have at least one technicaldegree, a HighTechCo being a company listed on the NASDAQ whosemanagers are all Techies, and a Techie being someone with at least twotechnical degrees.
Β© JK
Does CoolTecCo subsume HighTechCo?
Artificial Intelligence: Knowledge Representation71
CoolTecCo β‘[AND Company[ALL : Manager [AND BβSchoolGrad [EXISTS 2 : TechnicalDegree]]][FILLS : Exchange nasdaq]]
WellRoundedCo β‘[AND Company [ALL : Manager [AND : BβSchoolGrad
[EXISTS 1 βΆ TechnicalDegree]]]]
HighTechCo β‘[AND Company [FILLS : Exchange nasdaq [ALL : Manager Techie]]
Techie β‘ [EXISTS 2 : TechnicalDegree]
No
How about the intersection of WellRoundedCo and HighTechCo?
Β© JK
Join and Expand Definitions
Artificial Intelligence: Knowledge Representation72
WellRoundedCo β‘[AND Company [ALL : Manager [AND : BβSchoolGrad
[EXISTS 1 βΆ TechnicalDegree]]]]
HighTechCo β‘[AND Company [FILLS : Exchange nasdaq [ALL : Manager Techie]]
Techie β‘ [EXISTS 2 : TechnicalDegree]
We expand the definitions of WellRoundedCo and HighTechCo, and then Techie yielding:
[AND [AND Company[ALL : Manager [AND BβSchoolGrad
[EXISTS 1 : TechnicalDegree]]]][AND Company
[FILLS : Exchange nasdaq][ALL : Manager [EXISTS 2 : TechnicalDegree]]]]
Β© JK
Flatten and Combine AND Operators
Artificial Intelligence: Knowledge Representation73
[AND [AND Company[ALL : Manager [AND BβSchoolGrad
[EXISTS 1 : TechnicalDegree]]]][AND Company
[FILLS : Exchange nasdaq][ALL : Manager [EXISTS 2 : TechnicalDegree]]]]
We flatten the AND operators at the top level and then combine the ALLoperators over :Manager:
[AND Company[ALL : Manager [AND BβSchoolGrad
[EXISTS 1 : TechnicalDegree][EXISTS 2 : TechnicalDegree]]]
Company[FILLS : Exchange nasdaq]
Β© JK
We remove the redundant Company concept and combine the EXISTSoperators over :TechnicalDegree, yielding:
WellRoundedCo β HighTechCo β‘[AND Company
[ALL : Manager [AND BβSchoolGrad [EXISTS 2 : TechnicalDegree]]][FILLS : Exchange nasdaq]]
Remove Redundant Concepts and Combine Operators
Artificial Intelligence: Knowledge Representation74
[AND Company[ALL : Manager [AND BβSchoolGrad
[EXISTS 1 : TechnicalDegree][EXISTS 2 : TechnicalDegree]]]
Company[FILLS : Exchange nasdaq]
CoolTecCo β‘[AND Company
[ALL : Manager [AND BβSchoolGrad [EXISTS 2 : TechnicalDegree]]][FILLS : Exchange nasdaq]]
Β© JK
Another Example: Applying DL-Specific Structural Rules
Artificial Intelligence: Knowledge Representation75
?
ej subsumes di
π·π· β‘ [AND Company[ALL : Manager [AND BβSchoolGrad [EXISTS 2 : TechnicalDegree]]][FILLS : Exchange nasdaq]]
πΈπΈ β‘ [AND Company[ALL : Manager BβSchoolGrad][EXISTS 1: Exchange]]
If ππππ is of the form [EXISTS ππ ππ], then the corresponding ππππ must be of the form [EXISTS ππβ² ππ], for some πππ β₯ ππ; in the case where ππ = 1, the matching ππππ can be of the form [FILLS ππ ππ], for any constant ππ.
minCardinality vs. hasValue ?
π«π« β π¬π¬?
Β© JK
Computing Subsumption by Logical Proof
π«π« subsumes πͺπͺ if and only if πͺπͺ logically implies π«π«
For πΆπΆ β π·π· we need to show that
πΎπΎπ΅π΅ β¨ πΆπΆ β π·π·
πΎπΎπ΅π΅ β¨ Β¬πΆπΆ β¨ π·π·
πΎπΎπ΅π΅ β Β¬ Β¬πΆπΆ β¨ π·π·
πΎπΎπ΅π΅ β§ πΆπΆ β§ Β¬π·π· β¨ ππ
Artificial Intelligence: Knowledge Representation76
Two options:
Use a Tableau theoremprover to construct a satisfying instance
Use a SAT Checker toprove unsatisfiability
Β© JK
Querying the Semantic Web with SPARQL
Artificial Intelligence: Knowledge Representation77
We are here
Β© JK
RDF Stores on the Web
https://www.w3.org/wiki/SparqlEndpointsβ z.B. BBC, DBPedia, DBLP, data.gov, β¦
Artificial Intelligence: Knowledge Representation78
DBpedia Bubble Navigator
data.gov
Β© JK
RDF
79
7 triples (in the ABox)
Kurt lives in Cambridge Kurt owns an object car0 car0 is a car car0 was made by Ford car0 was made in Detroit Detroit is a city Cambridge is a city
Artificial Intelligence: Knowledge Representation
Kurt car0
Cambridge
car
Ford
Detroit
city
owns
livesIn
a
madeBy
madeIn
aa
Β© JK
Query an RDF Store - SPARQL
80 Artificial Intelligence: Knowledge Representation
Find all persons who own a car that was made in Detroit
all matches to the variable ?person such that ?person owns an entity represented by the variable ?car
where ?car is a car and was made in Detroit.
?person ?car
car
Detroit
a
madeIn
owns
Β© JK
Matching a Query Against an RDF Triplestore
Artificial Intelligence: Knowledge Representation81
subgraph matching problem
Kurt car0
Cambridge
car
Ford
Detroit
city
owns
livesIn
a
madeBy
madeIn
aa
?person ?car
car
Detroit
a
madeIn
owns
Β© JK
Subgraph Isomorphism
NP-complete [Cook, 1971]
For any fixed pattern π»π» with β vertices β polynomial ππ(ππβ) time
Planar subgraph isomorphism β linear time ππ(ππ) [Eppstein, 1999]
Artificial Intelligence: Knowledge Representation82
Let πΊπΊ = ππ,πΈπΈ , π»π» = ππβ²,πΈπΈπ be graphs. Is there a subgraph πΊπΊ0 = ππ0,πΈπΈ0 βΆ ππ0 β ππ,πΈπΈ0 β πΈπΈ β© ππ0 Γ ππ0 such that πΊπΊ0 β π»π»? I.e., does there exist an ππ:ππ0 β πππ such that ππ1, ππ2 β πΈπΈ0 βΊππ ππ1 ,ππ ππ2 β πΈπΈπ?
Β© JK
Answering the Query
83
Bind variables in the query to nodes in the data graph such that the query clauses align with the data triples
Artificial Intelligence: Knowledge Representation
SELECT ?personWHERE {?person :owns ?car .?car :a :car .?car :madeIn :Detroit .}
?person ?car
car
Detroit
a
madeIn
owns
Kurt car0
Cambridge
car
Ford
Detroit
city
owns
livesIn
a
madeBy
madeIn
aa
Β© JK
SPARQL - SPARQL Protocol and RDF Query Language
Artificial Intelligence: Knowledge Representation84
Declare prefixshortcuts (optional)
Query result clause
Query pattern
Query modifiers(optional)
Define the dataset (optional)
PREFIX foo: <β¦>PREFIX bar: <β¦>β¦SELECT β¦FROM <β¦>FROM NAMED <β¦>WHERE {
β¦}GROUP BY β¦HAVING β¦ORDER BY β¦LIMIT β¦OFFSET β¦VALUES β¦
+ Access Protocol(HTTP, SOAP)
Β© JK
Complex Query Patterns
Artificial Intelligence: Knowledge Representation85
Project out specific variables and expressions:SELECT ?c ?cap (1000 * ?people AS ?pop)
Project out all variables:SELECT *
Project out distinct combinations only:SELECT DISTINCT ?country
Results in a table of values (in XML or JSON):
SELECT queries
?c ?cap ?pop
ex:France ex:Paris 63,500,000
ex:Canada ex:Ottawa 32,900,000
ex:Italy ex:Rome 58,900,000
A . B ConjunctionJoin results by matching the values of any variables in common.
A OPTIONAL { B } Left JoinJoin results by matching if possible
{ A } UNION { B } Disjunction Results of solving A and the results of solving B
A MINUS { B } NegationInclude only results from solving A that are not compatible with any of the results from B
Β© JK
Querying Multiple RDF Triplestores
Artificial Intelligence: Knowledge Representation86
ex:g1
ex:g2
ex:g3
Default graph
Named graphs
ex:g1
ex:g4
PREFIX ex: <β¦>SELECT β¦FROM ex:g1FROM ex:g4FROM NAMED ex:g1FROM NAMED ex:g2FROM NAMED ex:g3WHERE {
β¦ A β¦GRAPH ex:g3 {
β¦ B β¦}GRAPH ?graph {
β¦ C β¦}
}OR
OR
Β© JK
Distributing Queries over Multiple Triplestores1. Query a local collection of
stores- Build local store with
copies of relevant external stores
2. Issue follow-up queries to external stores
3. Use Query Federation
4. Automatic Link TraversalArtificial Intelligence: Knowledge Representation87
ex:g1Local Graph Store
Web
Β© JK
(1) Build Local Store
88 Artificial Intelligence: Knowledge Representation
Reduce to the problem of querying a single store All relevant sources must be integrated and up to date
https://www.dajobe.org/talks/201105-sparql-11/
Β© JK
(2) Follow-Up Queries
Take results from a first query to substitute placeholders in subsequent query templates
Need to write explicit query program logic
Artificial Intelligence: Knowledge Representation89
String source = "http://cb.semsol.org/sparql";String source2 = "http://dbpedia.org/sparql";String query = "SELECT ?s WHERE { ...";ResultSet set = QueryExecutionFactory.sparqlService(source,query).execSelect();while (set.hasNext()) {
β¦.ResultSet set2=
QueryExecutionFactory.sparqlService(β¦).execSelect();while ( set2.hasNext() ) {
...}
}β¦.
Β© JK
(3) Query Federation
Query a mediator which distributes subqueries to relevant sources and integrates the retrieved results
Mediator solves the problemArtificial Intelligence: Knowledge Representation90
Β© JK
(4) Automatic Link Traversal
Traverse RDF links during query evaluation Link-Traversal based query execution (LTBQE)
No need to know all data sources in advance No need to write program logic Queried data is up to date But: Can take very longunsuitable for some queries results might be incomplete
Artificial Intelligence: Knowledge Representation91
Subject: http://dig.csail.mit.edu/data#DIGPredicate: http://xmlns.com/foaf/0.1/ memberObject: http://www.w3.org/People/Berners-Lee/card#i
"Tim Berners-Lee is a memberof the MIT DecentralizedInformation Group"
Β© JK
Important Research Directions in KR&R Argumentation, explanation finding, causal reasoning, abduction Belief revision and update, belief merging Computational aspects of knowledge representation Similarity-based and contextual reasoning Inconsistency- and exception tolerant reasoning, paraconsistent
logics Reasoning about preferences Preference-based reasoning Qualitative reasoning, reasoning about physical systems Reasoning about actions and change Spatial reasoning and temporal reasoning Uncertainty, representations of vagueness
Artificial Intelligence: Knowledge Representation92
Β© JK
Summary
Description logics are widely accepted formalisms torepresent conceptual knowledge (ontologies)
We distinguish between abstract concepts in the TBox(terminological knowledge) and concrete instances in theABox (assertional knowledge)
ALC is a well-studied decidable fragment of first-order logicand a basis for many description logics
Subsumption, classification and instance relationships areessential inference services needed for ontology data bases
Modern knowledge graphs use RDF to represent huge setsof subject-predicate-object triples
Sparql is a querying language for RDF storesArtificial Intelligence: Knowledge Representation93
Β© JK
Working Questions
1. What type of knowledge do we encode with descriptionlogics? What other types of knowledge do you know?
2. Explain the difference between the knowledge representedin the TBox and the one in the ABox.
3. Why are DLs of different expressivity defined?4. Given a simple statement in natural language, can you
encode it in the description logic ALC?5. What operators does ALC contain?6. Which DL reasoning services do you know? Explain them. 7. What can you say about the complexity of DL reasoning?8. How can we compute concept subsumption?
Artificial Intelligence: Knowledge Representation94
Β© JK
Working Questions Continued
9. Explain informally what nonmonotic reasoning is.10.What is the frame problem in AI?11.What is OWL? How does it relate to DLs such as ALC?12.How does an OWL ontology relate to a DL ABox/TBox?13.Do you know examples of OWL ontologies on the web?14.How can we query OWL ontologies?15.Which computational problem is at the core of Sparql
queries?
Artificial Intelligence: Knowledge Representation95
Top Related