Implementation Issues

by

Adil KABBAJ

 

 

 

 

 

Introduction

Kernel (Ontology and Lexicon)

Organization of Amine Platform packages

 

 

Introduction

This document summarizes some implementation details concerning the Kernel (Ontology and Lexicon) and discusses the organization of the packages. Implementation detail on Amine structures and structures matching can be found in Structures Matching. Implementation detail on CG, Concept, Relation, CG matching, and CG matching-based operations can be found in CG Implementation.  Implementation detail on Amine GUIs is provided in GUIs Implementation Issues. See Prolog+CG, DynamicOntology and Synergy for implementation details concerning these engines. For more detail, reader can consult the open source code.

 

Kernel (Ontology and Lexicon)

An ontology in Amine is implemented as a class with the following attributes: a Type root, a RelationType root, a collection of lexicons that are associated to the ontology, and the common attribute MixedLanguage. In addition, we specify the main lexicon that is associated to the main language.

 public class Ontology implements Serializable {
    private ArrayList lexicons;
    private Lexicon mainLexicon = null;
    private boolean mixedLanguage = true;
    private Type root;
    private RelationType relationRoot;
    private String name;

    ...

 }

An ontology in Amine Platform is a graph of nodes that correspond to Conceptual Structures (CSs). A CS is either a Type, a RelationType, a Situation or an Individual CS. At the implementation level, we have a class, called CS, with three subclasses: Type, Individual and Situation. Type is itself specialized in RelationType. The graph structure of the ontology is implicitly encoded by the links that are specified in each CS: as nodes of a graph, each CS s refers to the immediate CSs that s specialize (the direct fathers of s) and to the immediate CSs that are specialization of s (the immediate children of s). While it is redundant to specify both the fathers and the children of a CS, it is however more efficient for the traversal, search and update of the ontology. Both Individual and Situation CS inherit the attribute "description" (declared as a Java Object) from CS. Type and RelationType CSs use the inherited attribute "description" to formulate the "definition" of the type and they have a specific attribute, "canon", which is declared as a Java Object, to formulate the canon of the type.

 public class CS implements java.io.Serializable, ToString {

    private Object description = null;
    private ArrayList fathers = null; // elements are CS subclasses
    private ArrayList children = null; // elements are CS subclasses

    ...

 }

 public class Situation extends CS implements java.io.Serializable {

    ... // no specific attribute

 }

 public class Individual extends CS implements java.io.Serializable {

    ... // no specific attribute

 }

 public class Type extends CS implements java.io.Serializable {

    private
Object canon;

    ...

 }

 public class RelationType extends Type implements java.io.Serializable {

    ... // no specific attribute

 }

 

 public class Lexicon implements Serializable {
    private Identifier language;
    private Ontology ontology;
    private HashMap lexIdent2CS;
// a collection of couples : <Identifier, CS>
    private HashMap lexCS2Idents;
//a collection of couples <CS, Array of Identifiers>

    ...

 }

 

Organization of Amine Platform packages

The organization of Amine packages reflects the specification of  Amine Platform: the source code is composed of the main package aminePlatform that contains packages which correspond to Amine layers: kernel package for the kernel layer (ontology and lexicon), util package for the algebraic layer, engines for the engines/programming layer and guis package for all Amine GUIs. aminePlatform contains also test and samples packages for test and samples. Next version will contain a package for Multi Agents Systems.

The kernel package is composed of two packages: lexicons and ontology packages, the former for Lexicon API and the latter for Ontology API. The ontology package includes classes that define the six types of Conceptual Structures (CS) used in Amine Platform: Type, RelationType, Individual, Situation, Context and Metaphor. The Canon CS is integrated in the Type CS (a type can have a definition and/or a canon). Ontology API is partitioned over all the classes of the ontology package.  The kernel package (lexicons and ontology packages) is independent from the other packages and it can be used alone.

The package util (like the package with the same name in Java) contains the basic structures and operations of Amine Platform. An object in Amine can be an elementary Java object (Integer, Double, Boolean, and String), an elementary Amine object (AmineInteger, AmineDouble, AmineBoolean, and Identifier, a CS), an Amine collection object (AmineSet and AmineList), and an Amine complex object (Term, Concept, Relation, and CG). Also, any Java Object that implements AmineObject and Matching interfaces becomes an Amine object and can be used as a component of an Amine structure. The common operations (clear(), clone(), toString()) are specified in AmineObject interface. Another set of common operations are matching-based operations (match(), equal(), unify(), subsume(), maximalJoin(), and generalize()). These operations are specified in the Matching interface. The two interfaces are implemented by all Amine structures.

util package contains a package called cg for CG, Concept, Relation structures, and related operations. cg package is inserted in util package because CG, Concept, and Relation are viewed as "basic" structures/classes, like AmineList or Term. Several interfaces (Muable, ToString, AmineObject, Matching, etc. most of them are defined in util package) have been defined and used to enhance the genericity and "openess" (ease of extension and integration) of Amine Platform. See Ontology, Structures, and CG for further details on this important aspect. Note also that all Amine constants have been collected and defined in AmineConstants interface (aminePlatform.util.AmineConstants).

util package contains also a package called graph which contains several Java interfaces for the specification of a graph structure (CG and Ontology are specific graphs and they implements these interfaces). graph is used currently by graph drawing component of Amine platform.

util package contains also a package called parserGenerator which concerns parsing and textual formulation of all Amine structures. Our approach in parsing is to proceed in three steps: a) lexical analysis which receives a string/text in input and returns/produces an ArrayList of couples <token, tokenType>, b) syntactic analysis, and c) production of the internal representation. The class TextTokenizer in the package parserGenerator is responsible of lexical analysis. The class ObjectParsing is responsible of syntactic analysis and production of basic structures. Classes LFParserGenerator and CGIFParserGenerator are responsible of CG LF and CGIF parsing (and the production of CG internal representation) respectively. They are responsible also for the inverse: the generation of the LF notation and the CGIF notation from the internal representation of the CG. LFParserGenerator and CGIFParserGenerator are defined as specialization of ObjectParsing (methods of ObjectParsing, like concept parsing and structures parsing, are used by both subclasses).

The engines package contains five packages: basicOntologyProcesses, dynamicOntology, metaphor, prologPlusCG and synergy.

  1. basicOntologyProcesses package contains a class that implements some basic ontology processes: elaboration, elicitation and information retrieval. See basicOntologyProcesses for more detail. Amine offers a GUI, basicOntologyProcessesGUI, that enables the user to call these processes.

  2. dynamicOntology package contains a class, DynamicOntology, that implements dynamic ontology process. It contains also a package, util package, that include auxiliary classes used by DynamicOntology. See dynamicOntology for more detail. Amine offers a GUI, dynamicOntologyGUI, that enables the user to call dynamic ontology process.

  3. metaphor package contains a class that offers a partial implementation of metaphor creation and resolution. See metaphor processes for more detail.

  4. prologPlusCG package contains four packages: util, parser, bindingContext and interpreter. util package contains classes that define structures used in Prolog+CG (like Rule and Rules) as well as structures used by the interpreter (like GoalToResolve and ResolutionStack). parser package contains a class that implements the parser of a Prolog+CG program. bindingContext package contains a class that implement BindingContext interface and it contains other auxiliary classes (like UnificationStack and related structures). interpreter package contains two classes that implement the interpreter of Prolog+CG: Resolution class which concerns the Core of the interpreter and Interpreter class which implements the interpretation of Prolog+CG primitives and the interface with Java. See Prolog+CG for more detail. Amine offers a GUI, prologPlusCGGUIs, that enables the user to use Prolog+CG.

  5. synergy package contains three packages: util, bindingContext and interpreter. util package contains classes that are used by the interpreter of Synergy. bindingContext package contains a class that implement BindingContext interface and it contains also other auxiliary classes. interpreter package contains a class, Interpreter, that implements the interpreter of Synergy. See Synergy for more detail. Amine offers a GUI, synergyGUI, that enables the user to use Synergy.

Finally, Amine's source code contains a package called guis which contains itself packages that implement all GUIs provided by Amine and that are associated with the different components of Amine. It contains also packages for Graph and CG drawing capabilities:

  1. aminePlatformGUI package implements aminePlatformGUI which is associated to the whole project (i.e. AminePlatform project) and gives access to all the other GUIs. See aminePlatformGUI for more detail.

  2. lexiconsOntologyGUI package implements lexiconsOntology GUI and it is associated to the kernel layer. See lexiconsOntologyGUI for more detail.

  3. cgNotationsGUI package implements cgNotations GUI and it is associated to the algebraic layer and in particular to CG notations. See CGNotationsGUI for more detail.

  4. cgOperationsGUI package implements cgOperations GUI and it is associated to the algebraic layer and in particular to CG operations. See CGOperationsGUI for more detail.

  5. basicOntologyProcessesGUI package implements basicOntologyProcesses GUI that enables the user to call the basic ontology processes. See basicontologyProcessesGUI for more detail.

  6. dynamicOntologyGUI package implements dynamicOntology GUI that enables the user to call  dynamic ontology process. See dynamicOntologyGUI for more detail.

  7. prologPlusCGGUIs package contains three packages: console, debuger and prologPlusCGGUI. They implement Prolog+CG GUIs that enable the user to use Prolog+CG language. See prologPlusCGGUIs for more detail.

  8. synergyGUI package implements Synergy GUI that enables the user to use Synergy language. See synergyGUI for more detail.

  9. graphDrawing package implements a generic GraphDrawing GUI. See Graph Drawing for more detail.

  10. cgDrawing and cgDrawingGUI packages implements CG Drawing Editor and automatic CG drawing. They are a specialization of GraphDrawing. See Graph Drawing for more detail.

  11. ontologyDrawingGUI package implements an OntologyDrawing GUI that provides a graphic editor and automatic drawing for ontology. This GUI needs further development.

  12. util package contains classes that are used by the various GUIs.

See GUIs Implementation Issues for further details on GUIs implementation.