You are on page 1of 46

Ontological engineering

1
Need for Ontological engineering
• Certain aspects of the real world are hard to capture in FOL:
– Almost all generalizations have exceptions
– They hold only to a degree
• Example:
– “Tomatoes are red” is a useful rule, but...
– Some tomatoes are green, yellow or orange.
• The ability to handle exceptions and uncertainty is extremely
important.
• Ontological engineering
• Uses Concepts like actions, time, physical object and beliefs
• Operates on a bigger scale
2
Ontological engineering
• What content to put into an agent’s knowledge base?
• How to represent facts about the world?
• An ontology organizes everything in the world into a hierarchy
of categories.
• An ontology formally represents knowledge as a set of concepts
within a domain, and the relationships among those concepts.
– Defining concepts in the domain (classes)
– Arranging the concepts in a hierarchy (subclass-superclass
hierarchy)
– Defining which attributes and properties (slots) classes can have
and constraints on their values
• An ontology is a specification for the KB

3
Example of a concept
• The concept “cheetah” has Eat meat
the following attributes and
corresponding values: Fast
Cheetah
– A1=food; Value=meat;
– A2=speed; Value=fast;
Fearful
– A3=character; Value=fearful;

4
Example of Ontology

5
Application of ontologies to natural
language processing
• Current AI challenges:
– Natural language understanding
• Software requirements understanding
– Image/video understanding
– Process/agents/services understanding
– Database understanding
– Web understanding

6
Ontology builders
• Knowledge engineers (KEs) build ontologies:
– based on knowledge about a domain
– to enable a stipulated group of people (users of the
ontology) to share and reuse that knowledge
Within the chosen area of work (the domain).

7
Categories and objects
• The organization of objects into categories is a vital part
of knowledge representation.
- An object is member of category
- A category is a subclass of another category
- All members of category have some properties
- Member of a category can be recognized by some
properties
Categories are used to make predictions about objects,
once they are classified.
• Example:
– From an object being a watermelon, one infers that it
would be useful for fruit salad.
8
• Categories are represented formally
• i) as predicates,
• Ex:1.Basketball(b), to say that b is a Basketball
• 2. Member (b, Basketballs) abbreviated as or
b∈Basketballs, to say that b is a member of the
category of basketballs.
• ii) as a special kind of objects
• Ex:1.Basketballs
• 2.Subset(Basketballs, Balls), abbreviated as
Basketballs ⊂ Balls, to say that Basketballs is a
subcategory of Balls.
9
Inheritance
• Categories are used to organize and simplify the
knowledge base through inheritance.
• With inheritance the properties of super class can
be inherited to sub classes
• Ex: If all instances of the category Food are
edible,
• and if Fruit is a subclass of Food and Apples is a
subclass of Fruit, then we can infer that every
apple is edible.
• We say that the individual apples inherit the
10
property of edibility,
Relating Objects to Category

11
12
A general example

13
14
15
Event calculus
• Events are the action with or without agent
• Event calculusUsed to describe how action changes
the world over the time
• Event calculus uses 3 types of arguments
• 1.Event/Action:
• Ex: Hit ,Move ,eat ….
• 2.Fluent:means the predicate that vary from one
situation to another
• Ex:Happy(me), At(John,School)….
• 3.Time: T1,T2….
• Events and Fluent are defined in the domain
16
• The complete set of predicates of the event calculus is
• T(f, t) Fluent f is true at time t
• Happens(e, i) Event e happens over the time interval i
• Initiates(e, f, t) Event e causes fluent f to start at time t
• Terminates(e, f, t) Event e causes fluent f to stop at
time t
• Clipped(f, i): some event causes Fluent f to be false
during time interval i
• Restored (f, i):Some event causes Fluent f becomes
true during time interval i

17
• the axioms are:
• Happens(e, (t1, t2)) ∧ Initiates(e, f, t1) ∧ ¬Clipped(f, (t1, t)) ∧ t1 < t ⇒T(f, t)
• Happens(e, (t1, t2)) ∧ Terminates(e, f, t1)∧ ¬Restored (f, (t1, t)) ∧ t1 < t ⇒¬T(f, t)

• where Clipped and Restored are defined by


• Clipped(f, (t1, t2)) ⇔
• ∃ e, t, t3 Happens(e, (t, t3)) ∧ t1 ≤ t < t2 ∧ Terminates(e, f, t)
• Restored (f, (t1, t2)) ⇔
• ∃ e, t, t3 Happens(e, (t, t3)) ∧ t1 ≤ t < t2 ∧ Initiates(e, f, t)

18
Time intervals
• two kinds of time intervals:
• 1.Moments
• 2.extended intervals.
• The distinction is that only moments have zero duration:
• i∈Moments ⇔ Duration(i)=Seconds(0) .
• Interval (i) ⇒ Duration(i)=(Time(End(i)) − Time(Begin(i))) .

19
• Complete set of interval relations
• Meet(i, j) ⇔ End(i)=Begin(j)
• Before(i, j) ⇔ End(i) < Begin(j)
• After (j, i) ⇔ Before(i, j)
• During(i, j) ⇔ Begin(j) < Begin(i) < End(i) < End(j)
• Overlap(i, j) ⇔ Begin(i) < Begin(j) < End(i) < End(j)
• Begins(i, j) ⇔ Begin(i) = Begin(j)
• Finishes(i, j) ⇔ End(i) = End(j)
• Equals(i, j) ⇔ Begin(i) = Begin(j) ∧ End(i) = End(j)

20
21
MENTAL EVENTS
• MENTAL EVENTS is any event that happens within the mind
• In real world Knowledge about knowledge of other agent is also important and is
useful for controlling inference
• The agent should know what it knows and what it does not know and how it can get it
know from other agents
• Ex:To buy a pen of certain brand; if it is not available in the shop; the agent should
know that it should ask the shop keeper “where the pen is ”
• This helps to construct future plans that helps to take relevant actions
• PROPOSITIONAL attitudes in mental objects:
• It’s the relationship b/w agent and mental object
• Ex PROPOSITIONAL attitudes :Believes, Knows, Wants, Intends, and Informs….
• Ex 1: Assume KB has
• knows(Ram,canfly(superman)) and (superman=Krish)
• then we must conclude that Ram knows krish can fly
• (superman=Krish) ∧ knows(Ram,canfly(superman)) ⇒
knows(Ram,canfly(krish))
22
• Ex 2: If agent knows 2+2=4 and 4<5. then we want our agent to know 2+2<5
• Modal logic :
• is designed to handle PROPOSITIONAL
attitudes .
• Regular logic is concerned with a single
modality of truth, allowing us to express “P is
true.”
• Modal logic includes special modal operators
that take agents and sentences (rather than
terms) as arguments.
• For example, “A knows P” is represented with
the notation KAP,
• Where K is modal operator it takes 2
23
arguments; an agent and sentence P
Reasoning systems for categories
• Semantic networks are systems specially designed
for organizing and reasoning with categories.
• They rep individual objects , categories of object
and relationship among objects
• They provide:
– graphical aid for visualizing a knowledge base
– efficient algorithms for inferring properties of an
object on the basis of its category membership.
• A semantic network is a graph in which:
– nodes represent concepts; categories and object
– (directed) arcs represent relations between concepts.
24
Semantic networks
MemberOf link between Mary and FemalePersons ,
corresponding to the logical assertion Mary ∈FemalePersons
SisterOf linkbetween Mary and John corresponds to the
assertion SisterOf (Mary, John).
SubsetOf linkbetween person and female person corresponds female person
HasMother (double lined rectangle) is a relation between person and female person
corresponds female
∀x x∈ Persons ⇒ [∀ y HasMother (x, y) ⇒ y ∈ FemalePersons ] .
Legs (rectangle) assetrts that person have 2 legs — that is,
∀x x∈ Persons ⇒ Legs(x, 2)

25
26
• Inheritance(is a relation) : Inheritance association can be
described using semantic n/w
• Being a person ,Mary inherits the property of having two
legs
• To find how many legs mary has; the algm links up the
hierachy until it finds the category for which there is a
rectangle Legs link
• Overriding Default values for categories:
• John has one leg;despite the fact that he is a person;all
persons have 2 legs
• In logical KB; this would be contradiction
• In semantic semantic n/w default is over ridden by more
specific value
• ∀x, x∈ Persons ∧ X ≠ John ⇒ legs(x,2)

27
Description logics
• DESCRIPTION LOGIC are notations that are
designed to make it easier to describe definitions
and properties of categories.
• principal inference tasks for description logics are
• 1.subsumption :
• checking if one CLASSIFICATION category is a
subset of another by comparing their definitions
• 2.classification:
• checking whether an object belongs to a category
• 3. consistency :It checks whether the membership
criteria are logically satisfiable
28
29
• Example1: to say that bachelors are unmarried adult
males
• Bachelor = And(Unmarried, Adult ,Male) .
• The equivalent in FOL is
• Bachelor (x) ⇔ Unmarried(x) ∧ Adult(x) ∧ Male(x)
• Example 2: to describe the set of men with at least three
sons who are all unemployed and married to doctors,
and at most two daughters who are all professors in
physics or math departments,
• And(Man, AtLeast(3, Son), AtMost(2, Daughter ),
All(Son, And(Unemployed,Married, All(Spouse,
Doctor ))), All(Daughter , And(Professor ,
Fills(Department , Physics,Math)))) .

30
REASONING WITH DEFAULT
INFORMATION
• So far we have seen monotonic reasoning
• In monotonic reasoning the conclusion that we derived
from fact is not changed if we add more facts
• In non monotonic reasoning the some conclusion may
be invalidated if we add more facts into the KB
• So conclusion can be retracted
• Ex:On seeing the car parked on road ;its believed that
the car has 4 wheels; But on seeing owner carries on
wheel and car jacked up then the conclusion ‘car has 4
wheels’ can be retracted

31
• How to handle Non monotonic Reasoning
• If the KB has
• ∀x, Bird(x) ⇒ fly(x) on adding the new facts Bird(ostrich) ; then the conclusion is invalid
• 2 methods of Non monotonic Reasoning
• 1.Circumscription
• 2.Default logic
• Circumscription
• Idea is to specify particular predicate i.e false for every object except those for which they
are known to be true
• ⸫we introduce a predicate Abnormal(x) ( i.e Abnormal with respect to the abilty to fly)
• In Circumscription we add a new implication
• Bird(x) ∧ ¬Abnormal 1(x) ⇒ Flies(x)
• If the new fact is Bird(tweety)
• Then we can infer ” tweety can fly”
• If the new facts are “ tweety= ostrich “ and “¬ fly(ostrich)”
• Then we can infer tweety cannot fly

32
• 2.default logic
• It uses default rules of the form P:J1,J2….Jn/C ;
• Where P is prerequisite J1,J2….Jn are justification and
C is conclusion
• If P is true, and J1,J2….Jnare consistent with KB then
C can be concluded
• Default rules tells what conclusion can be drawn
based on what context
• Ex: The default rule is Bird(x):Flies(x)/Flies
• If the KB has Bird(tweety) , tweety=ostrich ,
¬Flies(ostritch)
• ⸫ Flies is not consistent with Bird(x). ⸫ “tweety
cannot fly” can be inferred 33
Prolog Pgmg
• Prolog is a AI programming language
• It is a declarative language;Since it declares set of
facts and rules declared
• Program consists of DB of facts and rules
• Program consists of set of definite clauses
• Running pgm means querying the prolog to prove
the sentence
• When asked a question; a pgm searches through
the DB and determine the answer
• It uses backward chaining to answer for the query
34
Syntax of Prolog
• Capital letter symbol denotes variable
• Small letter denotes constants
• P⇒ Q is rep by Q:=P
• Comma rep AND symbol
• Ex: Consider the FOL sentence
• American(x) ∧ weapon (y) ∧ hostile(z) ∧ sells(x,y,z) ⇒Criminal(x)
• In prolog
• Criminal(x):=American(x),weapon (y),hostile(z),sells(x,y,z)
• Facts and Rules
• Consider the prolog program with facts Parent(Ram,krishna) ,Parent(Krishna,Siva) and a rule
• GrandParent(x,z):=Parent(x,y), Parent(y,z)
• If the Query is
• ?:Parent(Ram,Krishna)
• o/p:Yes
• If the Query is
• ?:GrandParent(x,siva)
• o/p: Ram
35
Application of ontologies to natural
language processing

36
Application of ontologies to natural
language processing

37
Application of ontologies to natural
language processing

38
Application of ontologies to natural
language processing

39
Application of ontologies to natural
language processing

40
Application of ontologies to natural
language processing

41
Application of ontologies to natural
language processing

42
Application of ontologies to natural
language processing

43
Application of ontologies to natural
language processing

44
Application of ontologies to natural
language processing

45
Application of ontologies to natural
language processing

46

You might also like