KB representation-SemanticNetworks and Frames
KB representation-SemanticNetworks and Frames
Semantic Network:
• Formalism for representing information about objects, people, concepts
and specific relationship between them.
• The syntax of semantic net is simple. It is a network of labeled nodes and
links.
– It’s a directed graph with nodes corresponding to concepts, facts,
objects etc. and
– arcs showing relation or association between two concepts.
• The commonly used links in semantic net are of the following types.
– isa → subclass of entity (e.g., child hospital is subclass of hospital)
– inst → particular instance of a class (e.g., India is an instance of country)
• prop → property link (e.g., property of dog is ‘bark)
Representation of Knowledge in Sem Net
• “Every human, animal and bird is living thing who breathe and eat. All
birds can fly. All man and woman are humans who have two legs. Cat
is an animal and has a fur. All animals have skin and can move. Giraffe
is an animal who is tall and has long legs. Parrot is a bird and is green
in color”.
Representation in Predicate Logic
• Every human, animal and bird is living thing who breathe and eat.
• X [human(X) → living(X)]
• X [animal(X) → living(X)]
• X [bird(X) → living(X)]
• ● All birds are animal and can fly.
• X [bird(X) canfly(X)]
• ● Every man and woman are humans who have two legs.
• X [man(X) haslegs(X)]
• X [woman(X) haslegs(X)]
• X [human(X) has(X, legs)]
• ● Cat is an animal and has a fur.
• animal(cat) has(cat, fur)
• All animals have skin and can move.
• X [animal(X) → has(X, skin) canmove(X)]
• ● Giraffe is an animal who is tall and has long legs.
• animal(giraffe) has(giraffe, long_legs) is(giraffe, tall)
• ● Parrot is a bird and is green in color.
• bird(parrot) has(parrot, green_colour)
Representation in Semantic Net
Inheritance
• Inheritance mechanism allows knowledge to be stored at the highest possible
level of abstraction which reduces the size of knowledge base.
– It facilitates inferencing of information associated with semantic nets.
– It is a natural tool for representing taxonomically structured information and
ensures that all the members and sub-concepts of a concept share common
properties.
– It also helps us to maintain the consistency of the knowledge base by adding new
concepts and members of existing ones.
● Properties attached to a particular object (class) are to be inherited by all
subclasses and members of that class.
Property Inheritance Algorithm
• Input: Object, and property to be found from Semantic Net;
• Output: Yes, if the object has the desired property else return false;
• Procedure:
● Find an object in the semantic net; Found = false;
● While {(object ≠ root) OR Found } DO
{ If there is an attribute attached with an object then
{ Found = true;
else object=inst(object, class) OR isa(object, class)
};
● If Found = False then report ‘No’; Stop
Knowledge Representation using Frames
● Frames are more structured form of packaging knowledge,
– used for representing objects, concepts etc.
● Frames are organized into hierarchies or network of frames.
● Lower level frames can inherit information from upper level
frames in network.
● Nodes are connected using links viz.,
– ako / subc (links two class frames, one of which is subclass of other e.g.,
science_faculty class is ako of faculty class),
– is_a / inst ( connects a particular instance of a class frame e.g., Renuka
is_a science_faculty)
– a_part_of (connects two class frames one of which is contained in other e.g.,
faculty class is_part_of department class).
Knowledge Representation using Frames
• Property link of semantic net is replaced by SLOT fields.
● A frame may have any number of slots needed for describing object.
e.g.,
– faculty frame may have name, age, address, qualification etc as slot names.
● Each frame includes two basic elements : slots and facets.
– Each slot may contain one or more facets (called fillers) which may take
many forms such as:
value (value of the slot),
default (default value of the slot),
range (indicates the range of integer or enumerated values, a slot can have),
demons (procedural attachments such as if_needed, if_deleted, if_added etc.) and
other (may contain rules, other frames, semantic net or any type of other
information).
Frame Network – Example
Detailed Representation of Frame Network
frame0
frame1 frame2
frame11
frame12 frame13
Description of Frames
● The inference that “for every action of giving, there is an action of taking”
in clausal logic written as
ESNet
● The inference rule such as “an actor of taking action is also the recipient
of the action” can be easily represented in clausal logic as:
Action(e, take).
human human
Isa
X Isa
Isa
man john
john Isa
human human
Isa Isa
X X
Isa Isa Isa
man man