Heterogenous Integration Process

by

Adil KABBAJ

 

 

Heterogenous Integration Process is relevant if knowledge to integrate can be a type definition, an individual description, a situation, or a rule. In Heterogenous Integration Process, a new description is compared to any current description, i.e. a type definition can be compared to another type definition, or to a situation or to an antecedent of a rule.

Figure 1 shows the selection of Heterogenous Integration Process from Dynamic Ontology GUI.

Figure 1: Heterogenous Integration Process

See Dynamic Ontology and Indepth Contextual Description Integration Process for examples.

Note: Since type definition integration process is being updated, Heterogenous Integration Process is also under a new update.

 

DynamicOntology API

Heterogenous Integration Process is implemented by the class DynamicOntology which provides three constructors for the creation of Heterogenous dynamic integration process:

 public DynamicOntology(Ontology ont);

 public DynamicOntology(Ontology ont, Lexicon lex);

 public DynamicOntology(Ontology ont, Lexicon lex, JTextArea txtArea);

DynamicOntology provides also three important static methods: ask() which implements the information retrieval operation, integrateDefinition() for the integration of a type definition, and integrateSituation() for the integration of a situation. These methods can be called from other components of Amine, like Prolog+CG or Synergy, or from any Java class.

public static AmineList ask(Ontology ontology, CG description, AmineList pertinentTypes);

public static IntegrationResult integrateDefinition(Ontology ontology, Identifier idType, CG description, AmineList pertinentTypes);

public static IntegrationResult integrateSituation(Ontology ontology, CG description, AmineList pertinentTypes);

Beside the three static methods introduced above, DynamicOntology class provides several methods for the integration of different kinds of information:

public IntegrationResult integrateDefOrSituation(Identifier ident, CG newCG, byte nodeType,
                                                 AmineList pertinentTypes, AmineList superTypesPertinentTypes);
public void integrateIndividual(Identifier type, Identifier individual, CG newCG);
public void integrateSynonym(Identifier ident1, Identifier ident2);
public void integrateTypeSubType(Identifier type, Identifier subType);
public IntegrationResult simulateIntegration(CG newCG, AmineList pertinentTypes,
                                             AmineList superTypesPertinentTypes); // for Information Retrieval

 

Implementation Issues/Details

public static AmineList ask(Ontology ontology, CG description, AmineList pertinentTypes): this method asks if the specified description exists in the specified ontology, using the specified pertinent types. The implementation of this methods considers two cases: a) the description is represented by a simple CG (without embedded contexts) and b) the description is represented by a compound CG. In the case of a simple CG, ask() calls simulateIntegration() method that simulates the integration process: no change is done to the ontology during the integration process, i.e. no links and no nodes are added (or deleted). Note also that if the new description has only some information in common with the current description, then the comparison is ignored. In the case of compound CG, ask() calls integrateDefOrSituation() method that performs an effective integration process. Any change (addition or remove of a link or a node) during the integration is recorded in a stack (called actions stack) and after the integration, any recorded action is undone. ask() retuns a list of answers, each answer corresponds to a SimulationObject instance. A SimulationObject records the current description, to which the new description is compared, and the result of the comparison.

public static AmineList ask(Ontology ontology, CG description, AmineList pertinentTypes) {
  IntegrationResult rslt = null;
  DynamicOntology dynamicOntology = null;
  try {
    dynamicOntology = new DynamicOntology(ontology, ontology.getMainLexicon());
    if (description != null && description.isCompoundCG()) {
        dynamicOntology.actions = new Stack();
        dynamicOntology.mainDescription = description;
        rslt = dynamicOntology.integrateDefOrSituation(null, description, SITUATION, pertinentTypes);
        dynamicOntology.undo();
        dynamicOntology.actions = null;
        dynamicOntology.mainDescription = null;
    }
    else
        rslt = dynamicOntology.simulateIntegration(description, pertinentTypes);
    }
  catch (Exception ex) {
    return null;
  }
  return dynamicOntology.getResultOfSimulation();
}

Here is for instance a call of ask method from a Prolog+CG program:

ask(G, L) :-   

    getOntology(_ontology), 

    _rslt is "aminePlatform.engines.dynamicOntology.DynamicOntology":ask(_ontology, G, L),

    writeRslt(_rslt), !.  

 

public static IntegrationResult integrateDefinition(Ontology ontology, Identifier idType, CG description, AmineList pertinentTypes): integrate the specified description of the definition of the specified type identifier, according to the specified pertinent types.

 public static IntegrationResult integrateDefinition(Ontology ontology, Identifier idType,
                                                     CG description, AmineList pertinentTypes) {
    IntegrationResult rslt = null;
    try {
        DynamicOntology dynamicOntology = new DynamicOntology(ontology, ontology.getMainLexicon());
        rslt = dynamicOntology.integrateDefOrSituation(idType, description, DEFINITION, pertinentTypes);
    }
    catch (Exception ex) {
        return null;
    }
    return rslt;
 }

public static IntegrationResult integrateSituation(Ontology ontology, CG description, AmineList pertinentTypes): integrate the specified description of a situation, according to the specified pertinent types.

 public static IntegrationResult integrateSituation(Ontology ontology, CG description, AmineList pertinentTypes) {
    IntegrationResult rslt = null;
    try {
        DynamicOntology dynamicOntology = new DynamicOntology(ontology, ontology.getMainLexicon());
        rslt = dynamicOntology.integrateDefOrSituation(null, description, SITUATION, pertinentTypes);
    }
    catch (Exception ex) {
        return null;
    }
    return rslt;
 }

Here is a call of integrationSituation method from a Prolog+CG program:

integrateSituation(G, L):- //call the method integrateSituation() to integrate a situation with pertinent types 

    getOntology(_ontology),   // getOntology() is a primitive goal in Prolog+CG

    "aminePlatform.engines.dynamicOntology.DynamicOntology":integrateSituation(_ontology, G, L), !.

 

Let us consider now some implementation details about the core of the integration process which concerns the integration of a definition or of a situation (soft or indepth integration process). We recall the main steps of the integration process:

  1. Explicitation of the newCG and treatment of the case of synonymy,

  2. Creation of a new ontology node for the newCG, according to the type of the information to integrate (definition, canon, individual, situation, context),

  3. Update the list of pertinentTypes by the types of the contexts (in the current newCG),

  4. Integration of the contexts, if the description of the newOntNode is a compound CG,

  5. Integration of newOntNode via all the contexts that are contained in it, i.e. the integration of the newNode starts by its propagation via the contexts that are contained in it,

  6. Given the list of the pertinent types (specified as parameter of the integration procedure), determine for each pertinent type the associated entry points for the current CG to integrate; an associated entry point for a pertinent type is a concept in the current CG with a type equal to the pertinent type,

  7. Given the list of the superTypesPertinentTypes types (specified as parameter of the integration procedure), determine for each superTypePertinentType the associated entry points for the current CG to integrate; an associated entry point for a superTypePertinentType is a concept in the current CG with a type subtype to the superTypePertinentType,

  8. Perform a second propagation of the new description: integrate the new ontology node starting from each focus present in focusHshMap. And for each focus, the new description is integrated according to each entry point associated to the current focus.

For the detail of this treatment, see the body of the method:

 public IntegrationResult integrateDefOrSitOrCtxt(Object obj, CG newCG, byte nodeType,
                                AmineList pertinentTypes, AmineList superTypesPertinentTypes, boolean simulation,
                                ArrayList contextsToIntegrate, CG mainContext)

 

Let us consider now step 4 in more detail: integration of contexts. This operation searches for contexts in the new description G. For each context located, the operation integrates the context and replaces the context in G by the reference to the Context node and adds the concept/context in focusHshMap. Here is the main steps of this operation:

  1. Integrate first any context with a definitional coreference. This should be done first before the integration of the other contexts because these contexts can contain concepts with bind coreferences; coreferences that refeer to contexts of the main context. We assume, in this current version of the integration process, that all definitional coreferences are defined in the main context only. Later, it is possible to maintain a list of antecedent contexts in order to perform an upward search of definitional coreferences in the embedded contexts.

  2. Consider any concept C in G that has a bind coreference that is not resolved yet; the refered context is not integrated yet (and so the descriptor of C is null). In this case, locate in the main context the refered context (a concept with the same coreference but as a definitional coreference) and check if this context is in the contextsToIntegrate. If it is so, throws an exception because we have a case of a cyclic integration. If not, integrate the context.

  3. Integrate the other contexts.

For the detail of this treatment, see the body of the method:

void integrateContexts(CG mainContext, ArrayList contextsToIntegrate, CG cg, AmineList pertinentTypes,
                                AmineList superTypesPertinentTypes)