Skip to main content
โšก Calmops

Semantic Networks and Frames: Structured Knowledge Representation

Introduction

Semantic networks and frames provide intuitive, structured approaches to representing knowledge. Rather than using pure logic, these formalisms organize knowledge into networks of concepts and relationships (semantic networks) or object-oriented structures with properties (frames). This article explores these representation methods and their applications.

Semantic Networks

Structure

Nodes: Concepts or entities Edges: Relationships between concepts Labels: Describe relationship types

Example:

    Dog
    โ†‘ is-a
    Fido
    โ†“ color
    Brown

Relationship Types

is-a: Inheritance relationship part-of: Composition relationship has-property: Attribute relationship related-to: General relationship

Inference

Inheritance: Properties inherited from parent concepts Spreading Activation: Activate related concepts

Example:

Dog is-a Animal
Animal has-property breathes
Therefore: Dog has-property breathes
Therefore: Fido has-property breathes

Frames

Structure

Frame: Object-oriented representation Slots: Attributes or relationships Values: Specific values or constraints Defaults: Default values for slots

Example:

Frame: Dog
  Slots:
    - species: Canine
    - legs: 4
    - sound: bark
    - color: (any)
    - owner: (any Person)

Inheritance

Single Inheritance: Frame inherits from one parent Multiple Inheritance: Frame inherits from multiple parents

Example:

Frame: ServiceDog
  Inherits from: Dog, WorkingAnimal
  Slots:
    - training: specialized
    - handler: Person

Demons (Triggers)

Idea: Procedures triggered when slot accessed or modified

Example:

Frame: BankAccount
  Slots:
    - balance: number
    - deposit: (trigger: update-balance)
    - withdraw: (trigger: check-sufficient-funds)

Comparison

Aspect Semantic Networks Frames
Structure Graph Object-oriented
Expressiveness Limited More expressive
Efficiency Good for queries Good for inheritance
Intuitiveness Visual Structured
Reasoning Spreading activation Slot-based

Practical Example: University Domain

Semantic Network

University
  โ”œโ”€ has-part โ†’ Department
  โ”œโ”€ has-part โ†’ Library
  โ”œโ”€ employs โ†’ Faculty
  โ””โ”€ enrolls โ†’ Student

Department
  โ”œโ”€ part-of โ†’ University
  โ”œโ”€ offers โ†’ Course
  โ””โ”€ employs โ†’ Faculty

Faculty
  โ”œโ”€ employed-by โ†’ Department
  โ”œโ”€ teaches โ†’ Course
  โ””โ”€ advises โ†’ Student

Student
  โ”œโ”€ enrolled-in โ†’ University
  โ”œโ”€ takes โ†’ Course
  โ””โ”€ advised-by โ†’ Faculty

Frames

Frame: University
  Slots:
    - name: string
    - location: string
    - departments: list of Department
    - faculty: list of Faculty
    - students: list of Student

Frame: Department
  Inherits from: Organization
  Slots:
    - name: string
    - university: University
    - faculty: list of Faculty
    - courses: list of Course
    - budget: number

Frame: Faculty
  Inherits from: Person
  Slots:
    - faculty-id: string
    - department: Department
    - courses: list of Course
    - students-advised: list of Student
    - office: string
    - phone: string

Frame: Student
  Inherits from: Person
  Slots:
    - student-id: string
    - university: University
    - major: Department
    - courses: list of Course
    - advisor: Faculty
    - gpa: number

Advantages and Disadvantages

Semantic Networks

Advantages:

  • Intuitive visual representation
  • Efficient for certain queries
  • Natural for hierarchical knowledge

Disadvantages:

  • Limited expressiveness
  • Ambiguous semantics
  • Difficult to handle complex constraints

Frames

Advantages:

  • Organized, structured representation
  • Supports inheritance
  • Efficient for property lookup

Disadvantages:

  • Limited reasoning capabilities
  • Complexity with multiple inheritance
  • Difficult to handle exceptions

Glossary

Demon: Procedure triggered by slot access Frame: Object-oriented knowledge representation Inheritance: Property inheritance from parent Semantic Network: Graph-based knowledge representation Slot: Attribute or relationship in frame Spreading Activation: Activate related concepts

Practice Problems

Problem 1: Create a semantic network for a restaurant domain.

Solution:

Restaurant
  โ”œโ”€ serves โ†’ Food
  โ”œโ”€ has โ†’ Menu
  โ”œโ”€ employs โ†’ Staff
  โ””โ”€ located-in โ†’ City

Food
  โ”œโ”€ served-by โ†’ Restaurant
  โ”œโ”€ has-ingredient โ†’ Ingredient
  โ””โ”€ is-type โ†’ CuisineType

Problem 2: Design frames for a library system.

Solution:

Frame: Library
  Slots:
    - name: string
    - location: string
    - books: list of Book
    - members: list of Member

Frame: Book
  Slots:
    - title: string
    - author: string
    - isbn: string
    - copies: number
    - available: number

Frame: Member
  Slots:
    - member-id: string
    - name: string
    - borrowed-books: list of Book
    - max-books: 5

Problem 3: Explain how inheritance works in frames.

Solution: A frame can inherit slots from a parent frame. If a slot is not defined in the child frame, it uses the parent’s definition. This allows code reuse and organization.

Conclusion

Semantic networks and frames provide intuitive, structured approaches to knowledge representation. While less formally rigorous than pure logic, they offer practical advantages for organizing and reasoning about knowledge in AI systems.

Understanding these representation methods is essential for anyone working with knowledge bases, ontologies, or AI systems. The combination of semantic networks and frames with logical reasoning creates powerful knowledge representation systems.

Comments