Menu

Facts, Rules, and Semantic Networks

Facts, Rules, and Semantic Networks

Representing Knowledge Using Facts

A fact is a statement that the system treats as true within a particular knowledge base.

For example:

facts = {
"employee": "Anita",
"department": "Engineering",
"location": "Bengaluru"
}
print(facts["employee"])

Output:

Anita

This example uses a Python dictionary to store simple information. A real knowledge-based system may use databases, logical expressions, graphs, or specialized knowledge representation tools.

Representing Knowledge Using Rules

Rules describe relationships between conditions and conclusions.

A common format is:

IF condition, THEN conclusion.

Examples:

  • If an account is verified, it may be eligible for certain account operations.
  • If an order is paid and stock is available, it may proceed to fulfillment.
  • If a product is outside the permitted return period, it may not qualify under the standard return policy.

The rules must reflect the actual requirements of the application. Real policies may include exceptions and additional conditions.

Example: A Simple Eligibility Rule

def check_discount(is_student, purchase_amount):
if is_student and purchase_amount >= 1000:
return "Student discount eligible"
return "Student discount not applicable"
print(check_discount(True, 1500))

Output:

Student discount eligible

The function applies two conditions: the customer must be a student, and the purchase amount must be at least 1,000.

This is a simple rule-based example rather than a full logical inference engine.

What Is a Semantic Network?

A semantic network represents knowledge as a graph.

  • Nodes represent entities or concepts.
  • Edges represent relationships between them.

For example:

Animal

|

is-a

|

Dog

|

has-a

|

Tail

This structure shows that a dog is an animal and has a tail.

Semantic networks are useful when the relationships between concepts are important.

What Is a Knowledge Graph?

A knowledge graph is a structured graph of entities and relationships that can be used to organize and query interconnected information.

For example:

A. P. J. Abdul Kalam

|

served as

|

President of India

A larger knowledge graph might connect people, organizations, locations, books, events, and other entities.

Knowledge graphs are commonly used in search systems, recommendation engines, information retrieval, and question-answering applications.

Facts vs. Rules vs. Relationships

Component

Purpose

Example

FactStores a statementProduct A costs ₹500
RuleDerives a conclusion or decisionIf price is below ₹1,000, classify as budget-friendly
RelationshipConnects entitiesProduct A belongs to Category B

Artificial Intelligence Tutorial

VA

Vishalini A



Learn via Video Course

Artificial Intelligence and Machine Learning Course Logo

Artificial Intelligence and Machine Learning Course

55 hrs



Get in Touch For Details