Knowledge representation

Introduction

What is knowledge representation? It is a scheme for representing information about the world in a structured way. The specific knowledge representation I'm using is the project's inmost layer and is what got me excited to work on the project.

Entities and relationships

The knowledge representation I'm using draws upon a couple main ideas:

1.An entity represents a thing or a concept.
2.A relationship can be used to relate two things via a relation.

For example, DanielBigham, person, and is_a are all entities in the system, and the relationship ...

DanielBigham is_a person

... links the entities DanielBigham and person via the is_a relation.

The is_a relationship

The most fundamental relation is the is_a relationship. For example:

DanielBigham is_a person

The is_a relation can be used to create hierarchies, such as:

Ben is_a golden_retriever
golden_retriever is_a dog
dog is_a animal

etc.

The has_a relationship

The next most fundamental relation is the has_a relationship. For example:

person has_a age

Graphical representation

Entities and relationships can be conveniently represented using a directed graph. For example:



This is part of what "feels right" about this knowledge representation. Its graph-like nature, involving nodes and edges, seems, at least in a rough way, topologically analogous to the brain.

Values

The next concept is that of a value. For example:

DanielBigham.age = 28

What this says is that Daniel's age is 28. A prerequisite of making this statement is knowing that DanielBigham is a person, and that person has an age.

Something I've struggled with is that this notation makes a deviation, somewhat unnecessarily, from a simple entity-relationship model. In a sense it might be best to use it merely as a notation which is analogous to:

DanielBigham age 28

Lists

The problem with saying:

DanielBigham.sister = RebekahDeBueger

... is that I have another sister named Hannah. The convention I'm using for these cases is to define a list like this:

DanielBigham sister RebekahDeBueger
DanielBigham sister HannahBigham

Parametrized relations

In some cases, relations need a parameter. For instance:

DanielBigham has(count:0) brother