7.1.2 Organizing the graphs


One simple way to organize your graphs is by including every graph in a structure, pairing each graph with an identifier.


Use facts of the following schema to organize graphs:

graph(graph-name, Graph)

For example:

graph(gr1, [Animal])

The graph-name should be an identifier.

In the literature, the normal way to refer to a specific place in a play is to refer to act, scene, and line. The graphs of the Macbeth knowledge base could be partitioned accordingly:

 Gr(act_x, scene_y, line_z, [graph]).

This would enable us to let a query report the exact location of a quote. For the present purposes, however, we shall only refer to the act number:

 Gr(act_x, [graph]).

PrevLite: 7.1.1 Organizing the knowledge base
NextLite: 7.1.3 Writing the graphs

Prev: 7.1.1 Organizing the knowledge base
Up: 7.1 Nuts and bolts
Next: 7.1.3 Writing the graphs