Knowledge representation
IntroductionWhat 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 relationshipsThe 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 ...
... links the entities
DanielBigham and
person via the
is_a relation.
The is_a relationshipThe most fundamental relation is the
is_a relationship. For example:
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 relationshipThe next most fundamental relation is the
has_a relationship. For example:
Graphical representationEntities 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.
ValuesThe next concept is that of a
value. For example:
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:
ListsThe 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 relationsIn some cases, relations need a parameter. For instance:
| DanielBigham has(count:0) brother |
|