14.2 Flexible Representations

14.2.2 Graphical Representations

You can interpret the prop relation in terms of a directed graph, where the relation

prop(Ind,Prop,Val)

is depicted with Ind and Val as nodes with an arc labeled with Prop between them. Such a graph is called a semantic network or knowledge graph. There is a straightforward mapping form a knowledge graph into a knowledge base using the prop relation, as in the following example.

Figure 14.1: A semantic network
Example 14.7.

Figure 14.1 shows a semantic network for the delivery robot showing the sort of knowledge that the robot might have about a particular computer in a university department. Some of the knowledge represented in the network is

prop(comp_2347,owned_by,fran).
prop(comp_2347,managed_by,sam).
prop(comp_2347,model,lemon_laptop_10000).
prop(comp_2347,brand,lemon_computer).
prop(comp_2347,has_logo,lemon_icon).
prop(comp_2347,color,green).
prop(comp_2347,color,yellow).
prop(comp_2347,weight,light).
prop(fran,has_office,r107).
prop(r107,in_building,comp_sci).

The network also shows how the knowledge is structured. For example, it is easy to see that computer number 2347 is owned by someone (Fran) whose office (r107) is in the comp_sci building. The direct indexing evident in the graph can be used by humans and machines.

This graphical notation has a number of advantages:

  • It is easy for a human to see the relationships without being required to learn the syntax of a particular logic. The graphical notation helps the builders of knowledge bases to organize their knowledge.

  • You can ignore the labels of nodes that just have meaningless names – for example, the name b123 in Example 14.6, or comp_2347 in Figure 14.1. You can just leave these nodes blank and make up an arbitrary name if you must map to the logical form.