In addition to the ontology and the graphs, a knowledge base often contains a number of predicates, suggesting how the knowledge base might be used.
The built-in goals of Prolog+CG provide for a variety of ways in which knowledge can be extracted from a knowledge base.
You can open the macbeth.plgCG program from the AAU directory and run the following predicates to see how they work:
Lists branches of all graphs:
branches(B):- gr(L,G), branchOfCG(B,G).
Lists all concepts from the outer context:
concepts(C):- gr(L,G), concOfCG(C,G).
Lists all concepts from graphs embedded as the referent of propositions.
conceptsProp(C):- gr(L,G), subsume([proposition],G), branchOfCG([proposition = P], G), concOfCG(C, P).
Combining the two previous goals:
AllConcepts(C):- concepts(C). AllConcepts(C):- conceptsProp(C).
Subsuming graphs in which a person is the agent of some action:
action(G):- gr(L,G), subsume([act]-agnt->[person],G).
Resolving the referents of a graph containing an action:
actor(a,b):- gr(L,G), subsume([act]-agnt->[person],G), branchOfCG([act:a]-agnt->[person: b],G).
PrevLite: 7.1.4 The ontology
NextLite: 7.1.6 Adding knowledge
Prev: 7.1.4 The ontology
Up: 7.1 Nuts and bolts
Next: 7.1.6 Adding knowledge