7.3.5 branchOfCG

The branchOfCG goal checks whether the branch B is a part of the (perhaps) larger CG G.

The goal does bind variables in the branch B to their counterparts in the graph G. This means that you can use branchOfCG to extract parts of a graph.

For example, if you have just used subsume to check that a graph conforms to a certain pattern, you can extract nested, inner parts of that pattern with branchOfCG. Then you can do more analysis of the inner parts.

Or, as another example, you can get certain parts of a branch of the graph:

// The car is thirsty
graph(CarIsThirsty, [Car: X]-ATTR->[Metaphor = [Car: X]<-EXPR-[Thirsty] ]).

// The head of the department is a snake in the grass
graph(HeadIsSnake, [Person: X]-
                      -CHRC->[Title: Head_of_department],
                      -ATTR->[Metaphor = [Snake]-LOC->[Grass]]).

// Rule

// Find the source domain of a metaphor
source(L, S) :-
    graph(L, G),   // Get the graph and its label
    subsume([Metaphor], G),  // Check that it has a metaphor
    branchOfCG(S-R->[Metaphor], G).  // Find the source domain 
                  // Note how the variable S stands for the whole concept
                  // Note also how we used the variable R to mean any relation

PrevLite: 7.3.4 Garfield
NextLite: 7.3.6 concOfCG

Prev: 7.3.4 Garfield
Up: 7.3 Examples
Next: 7.3.6 concOfCG