Tuesday 7 July 2015

Semantic Nets


Semantic Nets:
These are an alternative to predicate logic as a form of knowledge representation.
The idea is that we can store our knowledge in form of a graph with nodes representing object in the world and arcs representing relationships between those objects.
For example:


It is intended to represent the data:
Tom is a cat.
Tom caught a bird.
Tom is owned by John.
Tom is ginger in color.
Cat likes cream.
The cat sat on the mat.
A cat is a mammal.
A bird is an animal.
All mammals are animals.
Mammals have fur.
The is_a link has two different meanings. It can mean that one object is an individual item from a class and other is one class is a subset of another.
We can clean up the representation by distinguishing between nodes representing individual or instances and nodes and representing classes.
The name instance and subclass are often used in place of is_a and ako(a kind of).
Prolog representation can be used, with classes represented by predicates.
Cat(tom)
Cat(cat1)
Mat(mat1)
Sat_on(cat1,mat1).
Bird(bird1).
Caught(tom,bird1).
Like(x,cream):-cat(x).
Mammal(x):-cat(x).
Has(x,fur):-mammal(x).
Animal(x):-mammal(x).
Animal(x):-bird(x).
Owns(John,tom).
Is_colored(tom,ginger).
In general, an is_a link between a class c and an individual m is represented by fact c(m).
An a_kind_of link between a subclass c and a superclass s is represented by s(x):-c(x).

INHERITANCE:
The prolog equivalent captures an important property of semantic nets that they may be used for a form of inference known as inheritance.
The idea of this is that if an object belongs to class, it inherits all the properties of that class.
For example: As we have a “likes” link between cats and cream, meaning in “all the cats like cream”, we can infer that any object which  has an is_a link to cats will like cream. So both TOM and CAT1 will like cream.
Inheritance also applies across the a_kind_of links. For example, any property of mammals or animals will automatic be a property of cats. So, we can infer, for example, that TOM has fur, since TOM is a cat, a cat is a kind of animal, all animals are mammals and all mammals have fur.



FRAMES:
 Frames are a variant of semantic networks. A frame is a data structure for representing a stereo typical situation.
All the information relevant to a concept is stored in a single complex entity called a frame.
Superficially, frames look like record, data structures or class, frames also support inheritance.
In frame based systems we refer to:
·       Objects      - mammal
·       Slots           - properties such as color and size
·       Slot values- values stored in slots such as grey and large.
Slots and the corresponding slot values are inherited through the class hierarchy.
FEATURES:
These are more natural support of values then semantic nets.
Frames can be easily implemented using object oriented programming technique.
In Frames based system, Inheritance is easily controlled.
BENEFITS:
·       Easily understood by non-developers.
·       Expressive power.
·       Easy to include default information and detect missing values.
DRAWBACKS:
·       No standards.
·       No inference mechanism.