Knowledge Representation. Structured Objects. Structural knowledge is important e.g. viral meningitis is meningitis Representation is analogous to graphs or records. Motivation: Grouping of knowledge intuitively All knowledge about an entity is stored together
Knowledge Representation Structured Objects
Structural knowledge is important • e.g. viral meningitis is meningitis • Representation is analogous to graphs or records. • Motivation: • Grouping of knowledge intuitively • All knowledge about an entity is stored together • Having intuitive access paths • Inferencing via: • Generalisations of situations • Properties and interrelationships • Inheritance of properties • Same benefits of object-oriented design and programming e.g. Saves on storage
Structured Objects can be grouped into: • Semantic Networks • Frames
Semantic Networks • Concentrate on categories of objects and the relations between them BIRTHDAY-PARTY ELEMENT-OF JOHN’S-B-P food date CAKE AUGUST-3 guest place JOHN’S-B-P MARY
Subset LinkType SemanticsExample A B A B Cats Mammals A B A B Bill Cats A B R(A,B) Bill 12 A B x x A R(x,B) Birds 2 A B x y x A Birds Birds y B R(x,y) Member R Age R Legs Parent R
Example: Person member member (is-a) profession Mary lecturer married-to Joe profession engineer lives-in lives-in is-a Kingston city
Characteristics of Semantic Nets • Limited Expressiveness • Cannot express negation or disjunction • Quantification: Complex, using partitioned nets • Simple and easy to understand. • Syntax is not clear and consistent. • Semantics are intuitive and dependent on implementation • Inheritance is captured • Inferencing • Intersection Search • e.g. “What is the relationship between Joe and Mary?”
Frames • A data structure representing a stereotype situation. • The pulling together of procedural and declarative knowledge. • Has slot names and slot fillers • Usually arranged in a hierarchy • Frames lower down inherit slot fillers from frames higher up. • Properties high up are fixed • Properties with values lower down overwrite information higher up
Animals Alive: T Flies: F Subset Subset Birds Mammals Legs: 2 Legs: 4 Flies: T Subset Subset Subset Penguins Cats Bats Legs: 2 Flies: F Flies: T Member Member Member Opus Bill Pat Name: Pat Name: Opus Name: Bill Friend: Friend:
Types of Slots • Attribute-value slots • Primitive data types <name Jumbo> • Pointers to other frames <owner e56> • Attribute slots with value restrictions <owner (a person)> <mother (an elephant with <sex female>) > • Object hierarchy slots • super-class/subclass slots • member-of/instance slots • Procedure slots • Used for calculations • instead of storing the value e.g. salary • Used to propagate changes when a slot value is changed
Example: < e1 <member-of american-person dog-owner> <name “Mickey Mouse”> <address “Disneyland”> <owns e3> <personality unpleasant> > < e3 <member-of dog> <name “Pluto”> <owned-by e1> > < dog-owner <superclass person> <owns (a dog) > <must-have (a dog-licence) > <personality pleasant> > <dog <superclass pet carnivore > < address (Get address of owned-by) >
Reasoning in Frame Systems • Matching • Find a matching frame • Difficult because an instance frame may have values from several class frames. • Potential inefficiency • Inheritance • If the value of the slot is not found in the instance frame, search up the hierarchy. • E.g. Does Bill fly? No • Allows for Default Reasoning • e.g. Does Opus fly? • No, since instance value overrides class value.
Allowing multiple inheritance can cause conflicts in reasoning. • Example: • Does Tweety fly? Bird Move: Fly Ostrich Move: Walk, Not fly Cartoon Bird Tweety • Depends on the path taken for the search. • Strategy 1: Use path length (BFS) • Tweety does not fly.
Bird Move: Fly IS A • Problem with BFS: Does Tweety fly? IS A Ostrich Move: Walk, Not fly Cartoon Bird IS A Plumed Ostrich IS A White-Plumed Ostrich instance instance Tweety • Strategy 2: Use Inferential Distance • Tweety does not fly.
Republican Pacifist : false • Can still get a contradiction IS A Quaker Pacifist : true Conservative-Republican Instance Instance Dick Pacifist : ?
Advantages • More knowledge about the nature of the entities involved. • More than logic or production rules • Can represent highly structured knowledge • Easy • To maintain • To add new objects • Default Reasoning Possible • “The drawing of plausible inferences on the basis of less than conclusive evidence in the absence of evidence to the contrary.” (Moore 1985)
Disadvantages • Precise notion of meaning is absent • Translation work has been done, but has difficulties with default reasoning and procedural attachment. • Hard to represent rules (p,q r)
Problems • Draw a semantic net for the following information: Tweety is a canary who is a bird and all birds are animals. All animals breathe, typically birds have wings and their method of travel is by flying. A penguin is a bird whose method of travel is by walking. Discus how the queries “How does Tweety travel?”, “Does Tweety have wings?” and “What is the link between “Tweety and Penguins?” will be executed.
Birds are usually, covered with feathers, fly and reproduce by laying eggs. There are three groups of birds, flightless birds, songbirds and scavengers. Flightless birds do not fly. Song birds eat bugs and seeds while scavengers eat meat. Sparrows and canaries are both flightless birds, the difference between them being that canaries are found in tropical countries, while sparrows are found in North America. Penguins are flightless birds; they eat fish and are found in the South Pole. Opus, Tweety and Beaky are all birds; Opus is a penguin, Tweety is a canary and Beaky is a rather unusual bird as he is a mix between a penguin and a canary. Represent the information above using frames. What would be the results of the following queries? • “How does Opus reproduce?” • “Does Beaky fly?”