5.1.5 maximalJoin

Introduction

The maximalJoin/3 goal is used to find the maximal join of two graphs.

Signature

The signature of maximalJoin/3 is as follows:

maximalJoin(g1,g2,g3)

where g1,g2,g3 are graphs.

Operation

The maximalJoin/3 goal is used for finding out what the largest maximal joinof the two graphs g1 and g2 is. The result is returned in g3.

A maximal join is sort of the opposite of a generalization.

Instead of finding what is common to both graphs, and taking everything away that is not common, maximalJoin joins two graphs on every possible connection point, thus producing a graph which is larger than either graph.

Instead of going upwards in the type-hierarchy to find the minimum common supertype of two matching concepts, maximalJoin looks downwards in the type-hierarchy to find the maximal common subtype of both concepts.

Example

//
// maximalJoin example
//
// Available in the AAU directory as maximalJoin.plgCG
//
// Ulrik Petersen
// Created: September 20, 2003
// Last update: September 20, 2003
//

// Type hierarchy
Entity > Physical, Abstract.
Abstract > Proposition, Property.
Property > Manner, Attribute.
Manner > Indignantly.
Attribute > Beautiful, Evil, Ugly, New, Scandalous.
Physical > Object, Process.
Process > Act.
Act > Buy, Say.
Object > Person, Artefact.
Arteface > Dress.
Person > Man, Woman, Married.
Man > Husband.
Woman > Wife.
Married > Husband, Wife.

// Catalog of instances
Woman = Sue, Gill.
Man = Mark.

// Graphs

// Sue says indignantly to Mark: "Gill bought a new, scandalous dress".
graph(graph1, [Say]-
        -AGNT->[Woman: Sue],
        -RCPT->[Man: Mark],
        -MANR->[Indignantly],
        -THME->[Proposition =
             [Buy]-
                -AGNT->[Woman: Gill],
                -THME->[Dress]-
                      -ATTR->[New],
                      -ATTR->[Scandalous]
                 ]).

// Sue is a beautiful married person, 
// and she has a husband whose name is Mark.
graph(graph2, [Married: Sue]-
                -POSS->[Husband : Mark],
                -ATTR->[Beautiful]).

// Sue says to the married person Mark: "Gill is an ugly, evil woman".
graph(graph3, [Say]-
          -AGNT->[Woman: Sue],
          -RCPT->[Married: Mark],
          -THME->[Proposition =
                [Woman: Gill]-
                   -ATTR->[Ugly],
                   -ATTR->[Evil]
                ]).

// Rule

join(L1, L2, g3) :-
     graph(L1, g1),
     graph(L2, g2),
     maximalJoin(g1, g2, g3).

graph2 and graph3

If we write the following query:

?- join(graph2, graph3, g3).

The answer is:

{g3 = [Say] -
            -AGNT->[Wife : Sue] -
                                -POSS->[Husband : Mark],
                                -ATTR->[Beautiful];,
            -RCPT->[Married : Mark],
            -THME->[Proposition = [Woman : Gill] -
                                                 -ATTR->[Ugly],
                                                 -ATTR->[Evil]]}

Note how:

  • The two graphs have been joined on Sue.
  • In graph2, Sue is a Married person, while in graph3, Sue is a Woman. Since the maximum common subtype of Married and Woman is Wife, that is the type-label used.
  • Other than that, graph3 has been kept intact, and graph2's ATTR and POSS branches have been added onto Sue's concept.

graph1 and graph2

If we now write the following query:

?- join(graph1, graph2, g3).

The answer is:

{g3 = [Say] -
            -AGNT->[Wife : Sue] -
                                -POSS->[Husband : Mark],
                                -ATTR->[Beautiful];,
            -RCPT->[Man : Mark],
            -MANR->[Indignantly],
            -THME->[Proposition = [Buy] -
                                        -AGNT->[Woman : Gill],
                                        -THME->[Dress] -
                                                       -ATTR->[New],
                                                       -ATTR->[Scandalous];]}

This is basically the same operation as the previous one.

graph1 and graph3

If we now write the following query:

?-join(graph1, graph3, g3).

The answer is:

{g3 = [Say] -
            -AGNT->[Woman : Sue],
            -RCPT->[Husband : Mark],
            -THME->[Proposition = [Buy] -
                                        -AGNT->[Woman : Gill] -
                                                              -ATTR->[Ugly],
                                                              -ATTR->[Evil];,
                                        -THME->[Dress] -
                                                       -ATTR->[New],
                                                       -ATTR->[Scandalous];],
            -MANR->[Indignantly]}

Note how:

  • Since in graph1, Mark is a Man, and in graph3, Mark is a Married person, he has become a Husband in the maximal join. This is because the maximum common subtype of Man and Married is Husband.
  • The join goes right into the inner parts of the nested graph inside the proposition. Thus gill not only buys a new, scandalous dress (graph1), she is also an ugly, evil woman (graph3).

Summary

Thus maximalJoin/3 is used to find the maximal join of two graphs.

A maximal join takes as much from both graphs as possible, joining on at least one concept, using the maximum common subtype of two concept types where possible.


PrevLite: 5.1.4 generalize
NextLite: 5.2 Type goals

Prev: 5.1.4 generalize
Up: 5.1 CG goals
Next: 5.2 Type goals