aminePlatform.util.cg
Class CG

java.lang.Object
  extended byaminePlatform.util.cg.CG
All Implemented Interfaces:
AmineConstants, AmineObject, DescriptionWithGenus, Graph, Matching, ParseCSDescription, java.io.Serializable, ToString, ToXML

public class CG
extends java.lang.Object
implements AmineConstants, java.io.Serializable, Matching, AmineObject, DescriptionWithGenus, ParseCSDescription, ToXML, Graph

Title : util.cg.CG Class

Description : A CG has one attribute : concepts, which is an ArrayList of Concepts. Relations are specified implicitly, as income and/or outcome relations of concepts. The method getRelations() returns the relations of the current CG.

CG can be implemented in different ways. In Amine Web Site, we provide reasons for our implementation.

Also, we consider the case of functionalCG and headedCG:

- A functional CG is a CG where each concept has mutually different income relations types, and mutually different outcome relations types.

- A headed CG is a is a CG in which the first concept (in Concepts) plays the role of the head. In textual notation, the head is the first concept specified (both in LF and in CGIF).

Copyright : Copyright (c) Adil KABBAJ 2004-2009

See Also:
Serialized Form

Field Summary
static CG cgCSDescr
           
 
Fields inherited from interface aminePlatform.util.AmineConstants
ANALOGY, B_ASSIGN, B_DSPLY_WT_DELAY, B_DSPLY_WTT_DELAY, B_TRIGGER, B_WTT_DSPLY, BLOCK_BACKWARD_PROPAGATION, BLOCK_FORWARD_PROPAGATION, CANON, CGIF, CGRAPHIC, CHECK_PRECONDITIONS, COMPARE, COMPOSED_GOAL, CONCEPT_TYPE_IDENT, CONTEXT, COVERED_BY, CPLTE_CONTRACT, DEFINITION, EQ_OR_MORE_SPCFQ, EQUAL, EXPAND, FALSE_FOCUS_LIST, FUNCTIONAL, GENERALISE, GENERALIZE, HAVE_AN_INTERSECTION, ID_ADD, ID_DIV, ID_EQ, ID_INF, ID_IS, ID_MESSAGE, ID_MUL, ID_NOT, ID_NULL, ID_OPER_AND, ID_OPER_OR, ID_SUB, ID_SUP, IN_ACTIVATION, IN_MODE, IN_MODE2, INDIVIDUAL, INDIVIDUAL_IDENT, INTEGRATED, IS_CANONIC, KEY_GLOBAL_RULE, LC_ADD, LC_AMINE_BOOLEAN, LC_AMINE_DOUBLE, LC_AMINE_INTEGER, LC_AND, LC_BOOLEAN, LC_CG, LC_CLOSE_BRKT, LC_CLOSE_PARENT, LC_CLOSE_SET, LC_COMMA, LC_COMMA_SEMI, LC_CONCEPT, LC_CONSTRUCTOR, LC_CS, LC_CUT, LC_DIFF, LC_DIV, LC_DOUBLE, LC_DSBL_BKWRD_PRPGTN, LC_DSBL_FRWRD_PRPGTN, LC_EOF, LC_EQ, LC_FOUR_POINTS, LC_IDENTIFIER, LC_IF, LC_INF, LC_INTEGER, LC_INTEROG, LC_IS, LC_JAVA_OBJECT, LC_LEFT_ARROW, LC_LIST, LC_NULL, LC_OPEN_BRKT, LC_OPEN_PARENT, LC_OPEN_SET, LC_OPER_AND, LC_OPER_OR, LC_POINT, LC_RELATION, LC_RGHT_ARROW, LC_SEMI_COMMA, LC_SET, LC_STAR, LC_STATE, LC_STRING, LC_SUB, LC_SUP, LC_TERM, LC_TWO_POINTS, LC_VAR_LIST_CONSTRUCTOR, LC_VARIABLE, LF, MAXIMAL_JOIN, MORE_GENERAL, MORE_SPECIFIC, NOTHING_TO_INTEGRATE, OPERS_WITH_RSLT, OUT_MODE, OUT_MODE2, PARTIAL_CONTRACT, PARTIAL_SUBSUME, PRJCT_OPERS, PROJECT, READ, READ_SENTENCE, RELATION_TYPE_IDENT, S_AND, S_BOOLEAN, S_CG, S_CLOSE_BRKT, S_CLOSE_PARENT, S_CLOSE_SET, S_COMMA, S_CONCEPT, S_CONSTRUCTOR, S_CUT, S_DIFF, S_DOUBLE, S_EOF, S_EQUAL, S_EXPAND, S_FALSE, S_FOUR_POINTS, S_GENERALISE, S_GENERALIZE, S_IDENTIFIER, S_IF, S_INTEGER, S_INTEROG, S_IS, S_IS_CANONIC, S_LEFT_ARROW, S_LIST, S_MAXIMAL_JOIN, S_OPEN_BRKT, S_OPEN_PARENT, S_OPEN_SET, S_POINT, S_RGHT_ARROW, S_SEMI_COMMA, S_SOURCE, S_SPECIALIZE, S_STATE, S_STRING, S_SUBSUME, S_SUBSUME_WITH_RESULT, S_SUPER, S_TARGET, S_TERM, S_THIS, S_TRUE, S_TWO_POINTS, S_UNIFY, S_VARIABLE, SITUATION, SPECIALIZE, STEADY, SUBSUME, SUBSUME_WITH_RSLT, TRIGGER, UNCOMPARABLE, UNIFY, VAR_SUPER, WAIT_ASSIGNMENT, WAIT_END_OF_ASSIGNMENT, WAIT_PRECONDITIONS, WAIT_VALUE
 
Constructor Summary
CG()
           
CG(java.util.ArrayList concepts)
          Create a CG with the specified arrayList of concepts.
CG(int s)
           
 
Method Summary
 boolean addConcept(Concept concept)
          Add the parameter concept to the current CG, if concept is not null and it is not already a concept of the current CG.
 void addEdge(Edge edge)
           
 void addNode(Node node)
           
 boolean addRelation(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object relationType, java.lang.Object bindInfRelType, Concept srceConc, Concept trgtConc)
          Add a relation to the current CG given its type, its source concept and its target concept.
 boolean addRelation(BindingContext bindContext, java.lang.Object bindInf, Relation relation, java.lang.Object bindInfRel)
           
 boolean addRelation(java.lang.Object relationType, Concept srceConc, Concept trgtConc)
          Add a relation to the current CG given its type, its source concept and its target concept.
 boolean addRelation(java.lang.Object relationType, java.lang.String suffix, Concept srceConc, Concept trgtConc)
           
 boolean addRelation(java.lang.Object relationType, java.lang.String suffix, Concept srceConc, Concept trgtConc, java.awt.Point posRelName, java.util.ArrayList segmentPoints)
          NEW Amine 2.5, by Adil: we consider the case of SYNERGY relations and the presence of special attributes that are stored in suffix field of the relation.
 boolean addRelation(Relation relation)
          Add the specified relation to the current CG.
 boolean analogizeType(Concept conc, Type type)
          This method implements the following elementary analog operation : replace the type of the specified concept conc, that should exist in the current CG, by the given type.
 void analogy(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          analogy() determine the structural matching of the two CG and then transfer to the target CG (this CG) all the elements that are specific to the source CG and that respect the canonicity of the targetCG.
 void analogy(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
          analogy() determine the structural matching of the two CG and then transfer to the target CG (this CG) all the elements that are specific to the source CG and that respect the canonicity of the targetCG.
 void analogy(Concept e1, CG cg, Concept e2)
          analogy: this new version does not consider binding context and binding information
 void analogy(java.lang.Object obj)
          analogy() determine the structural matching of the two CG and then transfer to the target CG (this CG) all the elements that are specific to the source CG and that respect the canonicity of the targetCG.
static boolean areConcepts(java.util.ArrayList concepts)
          Check that all the elements of concepts are Concept
 void clear()
          Clear the content of the current CG : all concepts and relations of the current CG are cleared, but the CG still exists as an (empty) java object, so that we can add to it new concepts and relations.
 java.lang.Object clone()
          Performs a deep copy of the current CG.
 java.lang.Object clone(BindingContext bindContext, java.lang.Object bindInf)
          This method is equivalent to copy(bindContext, bindInf).
 CompareCGResult compare(Concept entryPoint1, CG cg2, Concept entryPoint2)
          Compare two CGs cg1 and cg2 : The operation starts by computing the generalization between the two CG cg1 and cg2.
static CG constructCG(java.util.Iterator i)
          Construct a CG from the specified Enumeration of relation.
 boolean contractTypeDefinition(BindingContext bindContext, java.lang.Object bindInf, Concept concept)
          Contract the definition of the type of the specified concept from the current CG, using the specified concept as the entry point.
 boolean contractTypeDefinition(BindingContext bindContext, java.lang.Object bindInf, Concept concept, Type type)
          Contract the definition of the specified Type from the current CG, using the specified concept as the entry point.
 boolean contractTypeDefinition(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          This is a variant of the previous definition: instead of a Concept as third parameter, this variant allows an object with the specification of its binding information.
 boolean contractTypeDefinition(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object objConcept, java.lang.Object bindInfObj1, java.lang.Object objType, java.lang.Object bindInfObj2)
          This is a variant of the previous definition: instead of a Concept as third parameter and Type as forth parameter, this variant accepts two objects with the specification of their binding information.
 boolean contractTypeDefinition(Concept concept)
          Contract the definition of the type of the specified concept from the current CG, using the specified concept as the entry point.
 boolean contractTypeDefinition(Concept concept, Type type)
          Contract the definition of the specified Type from the current CG, using the specified concept as the entry point.
 boolean contractTypeDefinition(Type type)
          Contract the definition of the specified Type from the current CG.
 CG copy()
          Performs a deep copy of the current CG.
 CG copy(BindingContext bindContext, java.lang.Object bindInf)
          Perform a deep copy of the current CG and considers the presence of variables and their binding: the copy will concern the variable's value too.
 CG copy(BindingContext bindContext, java.lang.Object bindInf, CorefMatchList corefMatchL, int indx)
           
static Relation copyRelation(BindingContext bindContext, Relation relation, java.lang.Object bindInfRel, java.util.HashMap mapCopy)
          Create a copy of the current relation, using mapCopy that specifies for each concept its copy.
 java.util.Enumeration coveredBy(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          coveredBy determine which part of the current CG G1 (a subgraph S1) covers a part of obj G2 (a subgraph S2), i.e.
 java.util.Enumeration coveredBy(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
          coveredBy determine which part of the current CG G1 (a subgraph S1) covers a part of obj G2 (a subgraph S2), i.e.
 java.util.Enumeration coveredBy(java.lang.Object obj)
          coveredBy determine which part of the current CG G1 (a subgraph S1) covers a part of obj G2 (a subgraph S2), i.e.
static byte determineCGForm(java.lang.String cgInString)
          Determine the nature of the CG form (linear form or CGIF) from the textual formulation (a String) of the given CG.
 boolean equal(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Check that the current CG is equal with the specified object obj.
 boolean equal(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 boolean equal(Concept e1, CG cg, Concept e2)
          equal: this new version does not consider binding context and binding information
 boolean equal(java.lang.Object obj)
          Check that the current CG is equal with the specified object obj.
 CG expand(BindingContext bindContext, java.lang.Object bindInf, Concept conc)
          Expand the current CG by the maximal join of the definition of the concept type of the specified conc which should be contained in the current CG.
 CG expand(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object objConceptOrRelation, java.lang.Object bindInfObj)
           
 CG expand(BindingContext bindContext, java.lang.Object bindInf, Relation rel)
          Expand the current CG by the maximal join of the definition of the relation type of the specified rel which should be contained in the current CG.
 CG expand(Concept conc)
          Expand the current CG by the maximal join of the definition of the concept type of the specified conc which should be contained in the current CG.
 CG expand(Relation rel)
          Expand the current CG by the maximal join of the definition of the relation type of the specified rel which should be contained in the current CG.
 void finalize()
          Finalize the current CG.
 Concept findConcept(BindingContext bindContext, java.lang.Object bindInf, Concept concept, java.lang.Object bindInfConc)
          Search for the first concept conc in the specified CG cg so that the parameter concept is equal (in content) to conc, taking into account the binding of variables that could occur in the current CG and in concept.
 Concept findConcept(Concept concept)
          Search for the first concept conc in the current CG so that the parameter concept is equal to conc, according to their content.
 java.util.Enumeration findConcepts(BindingContext bindContext, java.lang.Object bindInf, Concept concept, java.lang.Object bindInfConc)
          Find all concepts in the specified CG cg that are equal (in content) with the specified concept.
 java.util.Enumeration findConcepts(Concept concept)
          Find all the concepts in the current CG that are equal (in content) with the specified concept.
 java.util.Enumeration findConceptsWithDesignator(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object designator, java.lang.Object bindInfDsgntr)
          Unlike the method findConceptWithDesignator() which search only one concept with the specified designator, this version searchs for all the concepts that could have a designator equal to the specified one.
 java.util.Enumeration findConceptsWithDesignator(java.lang.Object designator)
          This is a simplified version of findConceptsWithDesignator(); binding context and binding information about variables are not considered.
 java.util.Enumeration findConceptsWithType(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object type, java.lang.Object bindInfType)
          Find all the concepts in the current CG that have the type equal to the specified type, taking into account the binding of variables that could occur in the current CG and in type.
 java.util.Enumeration findConceptsWithType(java.lang.Object type)
          Find all concepts in the current CG that have the type equal to the specified type.
 Concept findConceptWithDesignator(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object designator, java.lang.Object bindInfDsgn)
          Search for the concept in the current CG so that its designator is equal to the given designator, taking into account the binding of variables that could occur in the current CG and in designator.
 Concept findConceptWithDesignator(java.lang.Object designator)
          Search for the concept in the current CG so that its designator is equal to the given designator.
 Concept findConceptWithType(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object type, java.lang.Object bindInfType)
          Search for the first concept in the current CG so that its type is equal to the given type, taking into account the binding of variables that could occur in the current CG and in type.
 Concept findConceptWithType(java.lang.Object type)
          Search for the first concept in the current CG so that its type is equal to the given type.
 AmineList findRelations(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object type, java.lang.Object bindInfType)
           
 AmineList findRelations(java.lang.Object type)
          Find all the relations in the current CG that have the given type as their type.
 boolean generalise(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Perform a generalization of the current object with the specified object obj.
 boolean generalise(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 boolean generalise(java.lang.Object obj)
          Perform a generalization of the current object with the specified object obj.
 java.lang.Object generalize(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects.
 ResMatchCG generalize(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 ResMatchCG generalize(Concept e1, CG cg, Concept e2)
          generalize: this new version does not consider binding context and binding information
 java.lang.Object generalize(java.lang.Object obj)
          Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects.
 CG generalize(Type pertinentType1, CG g2, Type pertinentType2)
           
 boolean generalizeDescriptor(Concept conc)
          Generalize the descriptor of the specified concept conc, that should exist in the current CG, to a null descriptor.
 boolean generalizeDescriptor(Concept conc, java.lang.Object descriptor)
          Generalize the descriptor of the specified concept conc, that should exist in the current CG, to the given descriptor.
 boolean generalizeDesignator(Concept conc)
          Generalize the designator of the specified concept conc, that should exist in the current CG, to a null designator.
 boolean generalizeDesignator(Concept conc, java.lang.Object designator)
          Generalize the designator of the specified concept conc, that should exist in the current CG, to the given designator.
 boolean generalizeType(Concept conc, Type type)
          Generalize the type of the specified concept conc, that should exist in the current CG, to the given type.
 java.util.ArrayList getAllTypes()
           
 void getAllTypes(java.util.ArrayList allTypes)
           
 java.lang.Object[] getArrayConcepts()
          NEW method: Amine 2.5, by Adil Get the concepts of the current CG in an array
 java.util.ArrayList getArrayListConcepts()
           
 java.util.ArrayList getArrayListRelations()
           
 java.lang.Object[] getArrayRelations()
          NEW method: Amine 2.5, by Adil Get the relations of the current CG in an array
static boolean getCanonicity()
          Get the value of canonicity static attribute
 Concept getConcept(int indx)
          Get the concept at the specified range in the ArrayList concepts of the current CG.
 Concept getConcept(java.lang.Object type, java.lang.Object designator)
          Get the concept from the current CG with the specified type and designator.
 java.util.Enumeration getConcepts()
          Get an Array over the concepts of the current CG.
 java.util.Enumeration getConceptsWithDesignator(java.lang.Object designator)
          Unlike findConceptsWithDesignator() which attempt to find concepts in the current CG with a designator equal (method in Matching) to the specified designator, this method use the method equals which is more strict than equal (based on matching).
 java.util.Enumeration getConceptsWithType(java.lang.Object type)
          Unlike findConceptsWithType() which attempts to find concepts in the current CG with a type equal (method in Matching) to the specified type, this method use the method equals which is more strict than equal (based on matching).
 AmineList getConceptTypes()
          getConceptTypes returns the types (without duplication) used in concepts of the current CG.
 Concept getConceptWithCoreferent(Variable coref)
           
 Concept getConceptWithDescriptor(java.lang.Object descr)
           
 Concept getConceptWithDesignator(java.lang.Object designator)
          Unlike findConceptWithDesignator() which attempt to find a concept in the current CG with a designator equal (method in Matching) to the specified designator, this method use the method equals which is more strict than equal (based on matching).
 Concept getConceptWithType(java.lang.Object type)
          Unlike findConceptWithType() which attempts to find the first concept in the current CG with a type equal (method in Matching) to the specified type, this method use the method equal which is more strict than equal (based on matching).
 Concept getConceptWithVarDescriptor(Variable descr)
           
 java.util.Enumeration getEdges()
           
static boolean getFunctionalCG()
          Get the value of the functional CG static attribute
 java.util.Enumeration getGenus()
          If the current CG is the definition body of a concept type, it will contain genus (concept(s) with "super" as designator).
 java.util.Enumeration getGenusConcepts()
          Similar to getGenus()/getGenusTypes() except that it returns enumeration of concepts
 java.util.Enumeration getGenusTypes()
          A method equivalent to getGenus().
 Concept getHead()
          Get the head (the first concept) if CGs are headedCGs, else return null.
static boolean getHeadedCG()
          Get the value of the static attribute headedCG
 int getNbrConcepts()
          Get the number of concepts in the current CG
 int getNbrRelations()
          Get the number of relations of the current CG
 java.util.Enumeration getNodes()
          Getters and Setters
 java.util.Enumeration getRelations()
          Get all the relations of the current CG (an ArrayList of Relation)
 java.util.ArrayList getRelationsInArrayList()
           
 java.util.HashMap getRelationsInHmp()
          Get all the relations of the current CG in a HashMap.
 java.util.HashMap getRelationsInHmp(AmineInteger nbrRels)
          This method is a variante of the method getRelationsInHmp(); it returns the HashMap of all the relations in the current CG and also the number of relations of the current CG.
 java.util.HashMap getRelationsInHmp(BindingContext bindContext, java.lang.Object bindInf)
          Get all the relations of the current CG in a HashMap.
 java.util.HashMap getRelationsInHmp(BindingContext bindContext, java.lang.Object bindInf, AmineInteger nbrRels)
          This method is a variante of the method getRelationsInHmp(); it returns the HashMap of all the relations in the current CG and also the number of relations of the current CG.
 java.util.ArrayList getRelationsWithType(java.lang.Object relType)
          This method returns an Enumeration of all relations in current CG that have the specified relation type relType
 int getSize()
          Methods on Concepts
 int getSupCoref()
          public void generateCorefs(ArrayList concs) { Concept conc; int supCoref = this.getSupCoref(); supCoref++; Enumeration concepts = this.getConcepts(); while (concepts.hasMoreElements()) { conc = (Concept) concepts.nextElement(); // (conc.getNbrIncomeRels() > 1 || conc.getNbrOutcomeRels() > 1) New Adil : Amine 2.5 06/08/04 if ((conc.getNbrIncomeRels() > 1 ) && // && conc.getNbrOutcomeRels() > 1 // (conc.getDesignator() == null || conc.getCoreferent() == null || conc.getDescriptor() == null)) { try { Variable coref = new Variable("*p" + supCoref); conc.setCoreferent(coref); concs.add(conc); } catch (Exception ex) {}; supCoref++; // increment the value of pseudoDsgn } } } public Variable generateCoref() { int indx = this.getSupCoref(); indx++; Variable coref = new Variable("*p" + indx); return coref; } /** scan the current CG, taking into account embeeded CG, to identify the coreferent with the greater indice value; for coreferents with the form "*pINTEGER".
 void getVariables(java.util.ArrayList varsIdent)
          getVariables is an utility method that looks for all the variables used in the current CG.
 boolean isAConcept()
          Check if the current CG contains only one concept without any relation.
 boolean isARelation()
          Check if the current CG corresponds to a relation : it contains only a relation with its source and target concepts.
 boolean isCanonic()
          Check if current CG is canonic: a) for each type (concept type or relation type) in the current CG, search its canon (if it has) and checks that the canon subsumes the current CG.
 boolean isCanonic(BindingContext bindContext, java.lang.Object bindInf)
          Check if current CG is canonic: a) for each type (concept type or relation type) in the current CG, search its canon (if it has) and checks that the canon subsumes the current CG.
static boolean isCanonicity()
          Check if the value of the static attribute canonicity is true
static boolean isCG(java.lang.Object obj)
          Check if the specified Object obj is a CG.
 boolean isCompoundCG()
          Check if the current CG contains a concept that is a context; a concept that have a CG as description.
 boolean isConceptInCG(Concept concept)
          Check if the parameter concept is contained in the current CG.
 boolean isEmpty()
          Check if the current CG is empty; it contains no concept (and so no relation)
static boolean isFunctionalCG()
          Check if the value of the static attribute functionalCG is true
 boolean isGenus(Type type)
           
 boolean isHead(Concept conc)
          Check if the specified concept conc is the head of the current CG
static boolean isHeadedCG()
          Check if CGs are HeadedCG (the static attribute headedCG is true)
 boolean isRelationInCG(Relation relation)
          Check if the specified relation is contained in the current CG.
 CG join(Concept conc1, CG cg2, Concept conc2)
          Join the current CG with the specified CG cg2, with the specified conc1 and conc2 as two concepts of the current CG and cg2 respectively, and conc1 is identical to conc2.
static CG load(java.lang.String filePath)
          Load to the main memory, by deserialization, the CG stored in filePath and return the CG.
 void makeEmpty()
           
 java.lang.Object match(byte matchOperation, BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Match the current CG with the specified object obj, according to the value of the parameter matchOperation.
 ResMatchCG match(byte matchOperation, BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 ResMatchCG match(byte matchOperation, Concept entryConcept1, CG cg, Concept entryConcept2)
           
 ResMatchCG match(byte matchOperation, Concept entryConcept1, Concept concept, Concept entryConcept2)
           
 java.lang.Object match(byte matchOperation, java.lang.Object obj)
          Match the current CG with the specified object, according to the value of the parameter matchOperation.
 java.lang.Object maximalJoin(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Perform a maximal join of the current object with the specified object obj.
 ResMatchCG maximalJoin(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 ResMatchCG maximalJoin(Concept e1, CG cg, Concept e2)
          maximalJoin: this new version does not consider binding context and binding information
 java.lang.Object maximalJoin(java.lang.Object obj)
          Perform a maximal join of the current object with the specified object obj.
 Node newNode(java.lang.String contenu, Lexicon lexicon)
           
static CG open(java.lang.String filePath)
          This method is equivalent to the method load(String filePath)
static CG parse(java.lang.String cgInString, Lexicon lexicon)
          Parse the textual formulation of a CG (parameter cgInString) using the specified lexicon and produce its internal representation. cgInString could be in a Linear Form (LF) or in CGIF form.
static CG parseCGIF(java.lang.String cgInCGIF, Lexicon lexicon)
          Given a CG as a String in CGIF form and using the specified lexicon, this method parses the string and produces the internal representation of the CG.
 java.lang.Object parseCSDescr(java.lang.String stgDescr, Lexicon lexicon)
           
static CG parseLF(java.lang.String cgInLF, Lexicon lexicon)
          Given a CG as a String in linear form and the lexicon to use, this method parses the string and produces the internal representation of the CG.
static CG relaxedParserLF(java.lang.String cgInLF, Lexicon lexicon, AmineList newTypes)
           
 boolean removeConcept(Concept concept)
          Remove the specified concept from the current CG.
 void removeEdge(Edge edge)
           
 void removeNode(Node node)
           
 boolean removeRelation(Relation relation)
          Remove the specified relation from the current CG.
 boolean replaceConcept(Concept conc1, Concept conc2)
          Replace, in the current CG, the concept conc1 by the concept conc2: conc1 should exist in the current CG and conc2 coud be a concept of the current CG or a new concept
 boolean restrictDescriptor(Concept conc, java.lang.Object descriptor)
          Restrict the descriptor of the specified concept conc, that should exist in the current CG, to the given descriptor.
 boolean restrictDesignator(Concept conc, java.lang.Object designator)
          Restrict the designator of the specified concept conc, that should exist in the current CG, to the given designator.
 boolean restrictType(Concept conc, Type type)
          Restrict the type of the specified concept conc, that should exist in the current CG, to the given type.
 void save(java.lang.String filePath)
          This method is equivalent to the method store(String filePath)
 Concept selectHead()
          select a head for the currant CG.
static void setCanonicity(boolean mode)
          Set the specified boolean mode as the value for the static attribute canonicity
 boolean setConcepts(java.util.ArrayList concepts)
          Assign the parameter concepts as the concepts of the current CG.
static void setFunctionalCG(boolean mode)
          Set the specified boolean mode as the value for the static attribute functionalCG
static void setHeadedCG(boolean mode)
          Set the specified boolean mode as the value for the static attribute headedCG
 boolean specialize(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Perform a specialization of the current object with the specified object obj.
 boolean specialize(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 boolean specialize(java.lang.Object obj)
          Perform a specialization of the current object with the specified object obj.
 boolean specializeByExpansion(BindingContext bindContext, java.lang.Object bindInf, Concept concept)
          specializeByExpansion performs the expansion in the current CG (this); it does NOT create a new CG that represents the result of the expansion.
 boolean specializeByExpansion(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object objConcept, java.lang.Object bindInfObj)
           
 boolean specializeByExpansion(Concept concept)
          specializeByExpansion performs the expansion in the current CG (this); it does NOT create a new CG that represents the result of the expansion.
 void store(java.lang.String filePath)
          Store, by serialization, the current CG in the file filePath.
 boolean subsume(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Check that the current CG subsumes (is more general than) the specified object obj.
 boolean subsume(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 boolean subsume(Concept e1, CG cg, Concept e2)
          subsume: this new version does not consider binding context and binding information
 boolean subsume(java.lang.Object obj)
          Check that the current object subsumes (is more general than) the specified object obj.
 java.lang.Object subsumeWithResult(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Check that the current object subsumes (is more general than) the specified object obj.
 ResMatchCG subsumeWithResult(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 java.lang.Object subsumeWithResult(java.lang.Object obj)
          Check that the current object subsumes (is more general than) the specified object obj.
 java.lang.String toCGIF(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
          This method returns the CGIF notation of the specified cg.
 java.lang.String toCGIF(Lexicon lexicon)
          This method is similar to toLF().
 java.lang.String toCGIFWithDrawingInf(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
          This method is similar to the method toCGIF() that consider variable binding except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.
 java.lang.String toCGIFWithDrawingInf(Lexicon lexicon)
          This method is similar to the method toCGIF() except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.
 Concept toConcept()
          Convert the current CG to a concept if the CG corresponds to only one concept without relations (the conversion will not change the CG itself but returns the concept that composes the CG).
 java.lang.String toLF(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
          This method returns the Linear Form (LF) of the curreng cg.
 java.lang.String toLF(Lexicon lexicon)
          This method is the equivalent to the method toString() associated to any Java Object.
 java.lang.String toLFWithDrawingInf(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
          This method is similar to the method toLF() that consider variable binding except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.
 java.lang.String toLFWithDrawingInf(Lexicon lexicon)
          This method is similar to the method toLF() except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.
 Relation toRelation()
          Convert the current CG to a relation if the CG corresponds to only one relation (the conversion will not change the CG itself but returns the relation that composes the CG).
 java.lang.String toString(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
          By default, the textualization of a CG will be in Linear Form.
 java.lang.String toString(Lexicon lexicon)
          By default, the textualization of a CG will be in Linear Form.
 java.lang.String toXML(Lexicon lexicon)
           
 void trimToSize()
          Optimize the storage of the current CG
 boolean unify(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Unify the current CG with the specified object obj.
 boolean unify(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object entryConcept1, java.lang.Object bindInfEntry1, java.lang.Object obj, java.lang.Object bindInfObj, java.lang.Object entryConcept2, java.lang.Object bindInfEntry2)
           
 boolean unify(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cgCSDescr

public static CG cgCSDescr
Constructor Detail

CG

public CG()

CG

public CG(int s)
Parameters:
s - : the initial capacity of the CG' concepts which is an ArrayList

CG

public CG(java.util.ArrayList concepts)
Create a CG with the specified arrayList of concepts. The constructor checks first that concepts is indeed an ArrayList of Concept, if it is not the constructor creates a CG with an empty ArrayList of concepts.

Parameters:
concepts -
Method Detail

finalize

public void finalize()
Finalize the current CG. Finalize performs a "weak" destruction: it will not destroy the structures that could be included in the concepts, like a DesignatorSet or any descriptor structure because those structures could be shared with other structures (in the context of Prolog+CG for instance). Use the method clear() for a "strong" destruction.

Specified by:
finalize in interface AmineObject

clear

public void clear()
Clear the content of the current CG : all concepts and relations of the current CG are cleared, but the CG still exists as an (empty) java object, so that we can add to it new concepts and relations. This method should be used with care since it will destroy the structures that could be included in the concepts (like DesignatorSet and descriptor). Such a destruction could not be safe if the structures are shared with other structures (in the context of Prolog+CG for instance). In such a context, use the method finalize() instead.

Specified by:
clear in interface AmineObject

makeEmpty

public void makeEmpty()
Specified by:
makeEmpty in interface Graph

newNode

public Node newNode(java.lang.String contenu,
                    Lexicon lexicon)
             throws java.lang.Exception
Specified by:
newNode in interface Graph
Throws:
java.lang.Exception

clone

public java.lang.Object clone()
Performs a deep copy of the current CG.

Specified by:
clone in interface AmineObject
Returns:
a clone of the current CG

clone

public java.lang.Object clone(BindingContext bindContext,
                              java.lang.Object bindInf)
This method is equivalent to copy(bindContext, bindInf). The copy is a deep copy and it considers the presence of variables and their binding.

Specified by:
clone in interface AmineObject
Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and the current CG
Returns:
a clone of the current CG

copy

public CG copy()
Performs a deep copy of the current CG. This copy() is a special case of the method copy(bindingContext, bindInf) which takes into account the binding of variables that could occur in the current CG.

Returns:
a copy of the current CG

copy

public CG copy(BindingContext bindContext,
               java.lang.Object bindInf)
Perform a deep copy of the current CG and considers the presence of variables and their binding: the copy will concern the variable's value too.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and the current CG
Returns:
a copy of the current CG. Return null if CG is null.

copy

public CG copy(BindingContext bindContext,
               java.lang.Object bindInf,
               CorefMatchList corefMatchL,
               int indx)

copyRelation

public static Relation copyRelation(BindingContext bindContext,
                                    Relation relation,
                                    java.lang.Object bindInfRel,
                                    java.util.HashMap mapCopy)
Create a copy of the current relation, using mapCopy that specifies for each concept its copy.

Parameters:
bindContext - The binding context for this operation.
relation - The relation to copy
bindInfRel - The binding information associated to relation
mapCopy - A HashMap that stores each concept and its copy
Returns:
the copy of relation.

parseCSDescr

public java.lang.Object parseCSDescr(java.lang.String stgDescr,
                                     Lexicon lexicon)
                              throws java.lang.Exception
Specified by:
parseCSDescr in interface ParseCSDescription
Throws:
java.lang.Exception

getGenus

public java.util.Enumeration getGenus()
If the current CG is the definition body of a concept type, it will contain genus (concept(s) with "super" as designator). The method will return the types of these concepts.

Specified by:
getGenus in interface DescriptionWithGenus
Returns:
an enumeration of Type; types of the genus concept(s) found in the current CG Return null if no genus concept is found in the current CG

getGenusTypes

public java.util.Enumeration getGenusTypes()
A method equivalent to getGenus(). It makes explicit that the returned enumeration contain types (and not concepts).

Returns:
Enumeration

getGenusConcepts

public java.util.Enumeration getGenusConcepts()
Similar to getGenus()/getGenusTypes() except that it returns enumeration of concepts

Returns:
Enumeration of concepts

isGenus

public boolean isGenus(Type type)

getVariables

public void getVariables(java.util.ArrayList varsIdent)
getVariables is an utility method that looks for all the variables used in the current CG. This method is used by the Prolog+CG interpreter. Nothing is done if the parameter varsIdent is null.

Specified by:
getVariables in interface AmineObject
Parameters:
varsIdent - : an ArrayList of Variable objects. The method inserts in varsIdent all the variables used in the current CG

isCG

public static boolean isCG(java.lang.Object obj)
Check if the specified Object obj is a CG.

Parameters:
obj - : an object
Returns:
true if obj is a CG

isCompoundCG

public boolean isCompoundCG()
Check if the current CG contains a concept that is a context; a concept that have a CG as description.

Returns:
true if the current CG contains a concept that is a context

isEmpty

public boolean isEmpty()
Check if the current CG is empty; it contains no concept (and so no relation)

Specified by:
isEmpty in interface Graph
Returns:
true if the current CG is empty; it contains no concept (and so no relation).

isAConcept

public boolean isAConcept()
Check if the current CG contains only one concept without any relation.

Returns:
true if the current CG contains only one concept without any relation

isARelation

public boolean isARelation()
Check if the current CG corresponds to a relation : it contains only a relation with its source and target concepts.

Returns:
true if the current CG corresponds to a relation

toConcept

public Concept toConcept()
Convert the current CG to a concept if the CG corresponds to only one concept without relations (the conversion will not change the CG itself but returns the concept that composes the CG).

Returns:
the concept that composes the current CG or return null otherwise

toRelation

public Relation toRelation()
Convert the current CG to a relation if the CG corresponds to only one relation (the conversion will not change the CG itself but returns the relation that composes the CG).

Returns:
the relation that composes the current CG or return null otherwise

load

public static CG load(java.lang.String filePath)
               throws java.lang.Exception
Load to the main memory, by deserialization, the CG stored in filePath and return the CG. The file store the result of the serialization of a CG.

Parameters:
filePath - is the file path for the file that contain an internal representation of the CG
Returns:
a CG in term of a Java Object.
Throws:
: - exceptions can occur during the deserialization process
java.lang.Exception

open

public static CG open(java.lang.String filePath)
               throws java.lang.Exception
This method is equivalent to the method load(String filePath)

Parameters:
filePath - is the file path for the file that contain an internal representation of the CG
Returns:
a CG in term of a Java Object.
Throws:
: - exceptions can occur during the deserialization process
java.lang.Exception

store

public void store(java.lang.String filePath)
           throws java.lang.Exception
Store, by serialization, the current CG in the file filePath.

Parameters:
filePath - is the file path for the file where the internal representation of the CG will be stored
Throws:
java.lang.Exception

save

public void save(java.lang.String filePath)
          throws java.lang.Exception
This method is equivalent to the method store(String filePath)

Parameters:
filePath - is the file path for the file where the internal representation of the CG will be stored
Throws:
java.lang.Exception

getNodes

public java.util.Enumeration getNodes()
Getters and Setters

Specified by:
getNodes in interface Graph

getConcepts

public java.util.Enumeration getConcepts()
Get an Array over the concepts of the current CG.

Returns:
an Enumeration over the concepts of the current CG (note a copy of the value)

getArrayListConcepts

public java.util.ArrayList getArrayListConcepts()

getArrayConcepts

public java.lang.Object[] getArrayConcepts()
NEW method: Amine 2.5, by Adil Get the concepts of the current CG in an array

Returns:
the concepts of the current CG in an array

getAllTypes

public void getAllTypes(java.util.ArrayList allTypes)

getAllTypes

public java.util.ArrayList getAllTypes()

setConcepts

public boolean setConcepts(java.util.ArrayList concepts)
Assign the parameter concepts as the concepts of the current CG. Please note that it is the value of the parameter that is assigned to the attribute concepts of the current CG not a copy of the value. The method checks first that concepts contains only Concepts. If the current CG has already a content, it is deleted before the new assignment is done. Like the method clear(), this method should be used with care since all the structures related to the old concepts will be cleared, such a destruction could not be safe in a programming context with sharing structures like Prolog+CG.

Parameters:
concepts - the ArrayList of Concept to set as the concepts of the current CG. concepts could not be null.
Returns:
true if concepts is not null and all its elements are Concept, otherwise, it returns false. A CG can't have the concepts attribute equal to null. However, its concepts can be cleared by the method clear().

areConcepts

public static boolean areConcepts(java.util.ArrayList concepts)
Check that all the elements of concepts are Concept

Parameters:
concepts - : An ArrayList that should be of Concept
Returns:
true if all the elements of concepts are Concept and false otherwise

getFunctionalCG

public static boolean getFunctionalCG()
Get the value of the functional CG static attribute

Returns:
the value of the static attribute functionalCG

isFunctionalCG

public static boolean isFunctionalCG()
Check if the value of the static attribute functionalCG is true

Returns:
true if the value of the static attribute functionalCG is true

setFunctionalCG

public static void setFunctionalCG(boolean mode)
Set the specified boolean mode as the value for the static attribute functionalCG

Parameters:
mode - The value to set for the static attribute functionalCG

getHeadedCG

public static boolean getHeadedCG()
Get the value of the static attribute headedCG

Returns:
the value of the static attribute headedCG

isHeadedCG

public static boolean isHeadedCG()
Check if CGs are HeadedCG (the static attribute headedCG is true)

Returns:
true if CGs are HeadedCG (the static attribute headedCG is true)

setHeadedCG

public static void setHeadedCG(boolean mode)
Set the specified boolean mode as the value for the static attribute headedCG

Parameters:
mode - The value to set for the static attribute headedCG

getCanonicity

public static boolean getCanonicity()
Get the value of canonicity static attribute

Returns:
the value of the static attribute canonicity

isCanonicity

public static boolean isCanonicity()
Check if the value of the static attribute canonicity is true

Returns:
true if the value of the static attribute canonicity is true

setCanonicity

public static void setCanonicity(boolean mode)
Set the specified boolean mode as the value for the static attribute canonicity

Parameters:
mode - The value to set for the static attribute canonicity

trimToSize

public void trimToSize()
Optimize the storage of the current CG


getSize

public int getSize()
Methods on Concepts

Specified by:
getSize in interface Graph

getNbrConcepts

public int getNbrConcepts()
Get the number of concepts in the current CG

Returns:
the number of concepts in the current CG

isConceptInCG

public boolean isConceptInCG(Concept concept)
Check if the parameter concept is contained in the current CG. Note that the test is based on the equality of the concept reference, not the equality of the content of two concepts.

Parameters:
concept - : the concept to look for in the current CG
Returns:
true if concept is not null and it is a concept of the current CG

findConcepts

public java.util.Enumeration findConcepts(Concept concept)
Find all the concepts in the current CG that are equal (in content) with the specified concept. This definition of findConcepts() does not consider the values of variables and it is a special case of the method findConcepts(bindContext, bindInf, concept, bindInfConc) which takes into account the binding of variables that could occur in the current CG and in concept.

Parameters:
concept - : a concept
Returns:
an Enumeration over all the concepts of the current CG that are equivalent (equal in content) to the parameter concept, or return null if no such concept is found or if the parameter concept is null.

findConcepts

public java.util.Enumeration findConcepts(BindingContext bindContext,
                                          java.lang.Object bindInf,
                                          Concept concept,
                                          java.lang.Object bindInfConc)
Find all concepts in the specified CG cg that are equal (in content) with the specified concept. This definition of findConcepts() takes into account the binding of variables that could occur in the current CG and in concept.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
concept - A concept
bindInfConc - The binding information related to the binding context and to concept
Returns:
an Enumeration over all the concepts in cg that are equal (in content) to the parameter concept, or return null if no such concept is found or if concept or cg is null.

findConceptsWithType

public java.util.Enumeration findConceptsWithType(java.lang.Object type)
Find all concepts in the current CG that have the type equal to the specified type. This definition of findConceptsWithType() does not consider the values of variables and it is a special case of the method findConceptsWithType(bindContext, bindInf, concept, bindInfConc) which takes into account the binding of variables that could occur in the current CG and in type.

Parameters:
type - A type that could be a Type CS or a variable
Returns:
an Enumeration over all the concepts of the current CG that have the type equal to the specified type, or return null if no such concept is found or if the parameter type is null.

findConceptsWithType

public java.util.Enumeration findConceptsWithType(BindingContext bindContext,
                                                  java.lang.Object bindInf,
                                                  java.lang.Object type,
                                                  java.lang.Object bindInfType)
Find all the concepts in the current CG that have the type equal to the specified type, taking into account the binding of variables that could occur in the current CG and in type.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
type - A type that could be a Type CS or a variable
bindInfType - The binding information related to the binding context and to type
Returns:
an Enumeration over all the concepts of the current CG that have the type equal to the specified type, or return null if no such concept is found or if the parameter type or cg is null.

findConcept

public Concept findConcept(Concept concept)
Search for the first concept conc in the current CG so that the parameter concept is equal to conc, according to their content. This definition of findConcept() does not take into account the binding of variables that could occur in the current CG and in concept.

Parameters:
concept - A concept
Returns:
the first concept, in the current CG that is equivalent (equal in content) to the parameter concept, or return null if no such concept is found or if the parameter concept is null.

findConcept

public Concept findConcept(BindingContext bindContext,
                           java.lang.Object bindInf,
                           Concept concept,
                           java.lang.Object bindInfConc)
Search for the first concept conc in the specified CG cg so that the parameter concept is equal (in content) to conc, taking into account the binding of variables that could occur in the current CG and in concept.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
concept - A concept
bindInfConc - The binding information related to the binding context and to concept
Returns:
the first concept in cg that is equal (in content) to the parameter concept, or return null if no such concept is found or if concept or cg is null.

findConceptWithType

public Concept findConceptWithType(java.lang.Object type)
Search for the first concept in the current CG so that its type is equal to the given type. This definition of findConceptWithType() does not consider the values of variables and it is a special case of the method findConceptWithType(bindContext, bindInf, type, bindInfType) which takes into account the binding of variables that could occur in the current CG and in type.

Parameters:
type - A type that could be a Type CS or a variable
Returns:
the first concept in the current CG with the type type. Returns null if such a concept is not found or if the parameter type is null.

findConceptWithType

public Concept findConceptWithType(BindingContext bindContext,
                                   java.lang.Object bindInf,
                                   java.lang.Object type,
                                   java.lang.Object bindInfType)
Search for the first concept in the current CG so that its type is equal to the given type, taking into account the binding of variables that could occur in the current CG and in type.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
type - A type that could be a Type CS or a variable
bindInfType - The binding information related to the binding context and to type
Returns:
the first concept in the current CG with the type type. Returns null if such a concept is not found or if the parameter type is null.

findConceptWithDesignator

public Concept findConceptWithDesignator(java.lang.Object designator)
Search for the concept in the current CG so that its designator is equal to the given designator. This definition of findConceptWithDesignator() does not consider the values of variables and it is a special case of the method findConceptWithDesignator(bindContext, bindInf, designator, bindInfDsgn) which takes into account the binding of variables that could occur in the current CG and in designator.

Parameters:
designator - The designator of the concept to look for.
Returns:
the concept in the current CG with the designator equal to designator. Returns null if such a concept is not found.

findConceptWithDesignator

public Concept findConceptWithDesignator(BindingContext bindContext,
                                         java.lang.Object bindInf,
                                         java.lang.Object designator,
                                         java.lang.Object bindInfDsgn)
Search for the concept in the current CG so that its designator is equal to the given designator, taking into account the binding of variables that could occur in the current CG and in designator.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
designator - the designator of the concept to look for.
bindInfDsgn - The binding information related to the binding context and to designator
Returns:
the concept in the current CG with the designator equal to designator. Returns null if such a concept is not found.

findConceptsWithDesignator

public java.util.Enumeration findConceptsWithDesignator(java.lang.Object designator)
This is a simplified version of findConceptsWithDesignator(); binding context and binding information about variables are not considered. See the complete version for more detail

Parameters:
designator - A designator
Returns:
an Enumeration over all the concepts of the current CG that have the designator equal to the specified designator, or return null if no such concept is found or if the parameter designator is null.

findConceptsWithDesignator

public java.util.Enumeration findConceptsWithDesignator(BindingContext bindContext,
                                                        java.lang.Object bindInf,
                                                        java.lang.Object designator,
                                                        java.lang.Object bindInfDsgntr)
Unlike the method findConceptWithDesignator() which search only one concept with the specified designator, this version searchs for all the concepts that could have a designator equal to the specified one. Except for the designator "super" (i.e. in a CG that represents a definition of a Type, several different concepts could have "super" as designator), a CG that respects the unicity principle should not have different concepts with the same designator (unicity principle states that each concept in a CG is different from the other concepts in the same CG).

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
designator - the designator of the concept to look for.
Returns:
an Enumeration over all the concepts of the current CG that have the designator equal to the specified designator, or return null if no such concept is found or if the parameter designator is null.

findRelations

public AmineList findRelations(java.lang.Object type)
Find all the relations in the current CG that have the given type as their type.

Parameters:
type - A relation Type.
Returns:
an AmineList that contains all the relations of the current CG that have the type specified in argument. Return null if no relation is found with the given type or if type is null.

findRelations

public AmineList findRelations(BindingContext bindContext,
                               java.lang.Object bindInf,
                               java.lang.Object type,
                               java.lang.Object bindInfType)

getConcept

public Concept getConcept(int indx)
Get the concept at the specified range in the ArrayList concepts of the current CG. This method can be used if the index of the desired concept is known.

Parameters:
indx - The index of the desired concept in the array of concepts
Returns:
the concept at the specified concept. Returs null if indx is outOfBound.

getConceptsWithType

public java.util.Enumeration getConceptsWithType(java.lang.Object type)
Unlike findConceptsWithType() which attempts to find concepts in the current CG with a type equal (method in Matching) to the specified type, this method use the method equals which is more strict than equal (based on matching).

Parameters:
type - A type that could be a Type CS or a variable
Returns:
an Enumeration over all the concepts of the current CG that have the type equal to the specified type, or return null if no such concept is found or if the parameter type is null.

getRelationsWithType

public java.util.ArrayList getRelationsWithType(java.lang.Object relType)
This method returns an Enumeration of all relations in current CG that have the specified relation type relType

Parameters:
relType - Object
Returns:
ArrayList of Relations in the current CG
Since:
20/01/06

getConceptWithType

public Concept getConceptWithType(java.lang.Object type)
Unlike findConceptWithType() which attempts to find the first concept in the current CG with a type equal (method in Matching) to the specified type, this method use the method equal which is more strict than equal (based on matching).

Parameters:
type - A type that could be a Type CS or a variable
Returns:
the first concept in the current CG with the type type. Returns null if such a concept is not found or if the parameter type is null.

getConcept

public Concept getConcept(java.lang.Object type,
                          java.lang.Object designator)
Get the concept from the current CG with the specified type and designator. The method uses equals() to test equality.

Parameters:
type - A type that could be a Type CS or a variable
designator - A Designator
Returns:
A Concept from the current CG with the specified type and designator or return null if no such a concept exists

getConceptWithDesignator

public Concept getConceptWithDesignator(java.lang.Object designator)
Unlike findConceptWithDesignator() which attempt to find a concept in the current CG with a designator equal (method in Matching) to the specified designator, this method use the method equals which is more strict than equal (based on matching).

Parameters:
designator - A Designator
Returns:
the concept in the current CG with the designator equal to designator. Returns null if such a concept is not found.

getConceptWithCoreferent

public Concept getConceptWithCoreferent(Variable coref)

getConceptWithDescriptor

public Concept getConceptWithDescriptor(java.lang.Object descr)

getConceptWithVarDescriptor

public Concept getConceptWithVarDescriptor(Variable descr)

getConceptsWithDesignator

public java.util.Enumeration getConceptsWithDesignator(java.lang.Object designator)
Unlike findConceptsWithDesignator() which attempt to find concepts in the current CG with a designator equal (method in Matching) to the specified designator, this method use the method equals which is more strict than equal (based on matching).

Parameters:
designator -
Returns:
an Enumeration over all the concepts of the current CG that have the designator equal to the specified designator, or return null if no such concept is found or if the parameter designator is null.

addNode

public void addNode(Node node)
Specified by:
addNode in interface Graph

addConcept

public boolean addConcept(Concept concept)
Add the parameter concept to the current CG, if concept is not null and it is not already a concept of the current CG.

Parameters:
concept - : a concept to add to the current CG
Returns:
true if the parameter concept is not null and it is not already a concept of the current CG.

replaceConcept

public boolean replaceConcept(Concept conc1,
                              Concept conc2)
Replace, in the current CG, the concept conc1 by the concept conc2: conc1 should exist in the current CG and conc2 coud be a concept of the current CG or a new concept

Parameters:
conc1 - The concept to replace
conc2 - The concept that will replace conc1
Returns:
true if replaceConcept was done.

removeConcept

public boolean removeConcept(Concept concept)
Remove the specified concept from the current CG. If CGs are headedCG and the specified concept is the head of the current CG, then the concept is not removed. Remove involves the destruction of all the relations related to concept. If an adjacent concept is no more connected to any other concept due to this remove, it will not be destroyed too. It is the caller of this method to decide if the disconnected concepts, that can result from this remove, should be removed or not. Note that the concept itself is not destroyed by this method.

Parameters:
concept - The concept to remove from the current CG
Returns:
true if concept is not null, it was a concept of the current CG and it was not the head of the current CG (in the case of headedCG).

removeNode

public void removeNode(Node node)
Specified by:
removeNode in interface Graph

isHead

public boolean isHead(Concept conc)
Check if the specified concept conc is the head of the current CG

Parameters:
conc - A Concept
Returns:
true if CGs are headedCG and conc is the head (the first concept) of the current CG.

getHead

public Concept getHead()
Get the head (the first concept) if CGs are headedCGs, else return null.

Returns:
the head (the first concept) if CGs are headedCGs, else return null

selectHead

public Concept selectHead()
select a head for the currant CG. If CGs are headedCG, then returns its head (the first concept). Otherwise, the method looks for a concept which is the ost connected. This is done by counting the relations connected to each concept. This method is used for instance by the linear form generator.

Returns:
the concept in the current CG that is selected as head

getSupCoref

public int getSupCoref()
public void generateCorefs(ArrayList concs) { Concept conc; int supCoref = this.getSupCoref(); supCoref++; Enumeration concepts = this.getConcepts(); while (concepts.hasMoreElements()) { conc = (Concept) concepts.nextElement(); // (conc.getNbrIncomeRels() > 1 || conc.getNbrOutcomeRels() > 1) New Adil : Amine 2.5 06/08/04 if ((conc.getNbrIncomeRels() > 1 ) && // && conc.getNbrOutcomeRels() > 1 // (conc.getDesignator() == null || conc.getCoreferent() == null || conc.getDescriptor() == null)) { try { Variable coref = new Variable("*p" + supCoref); conc.setCoreferent(coref); concs.add(conc); } catch (Exception ex) {}; supCoref++; // increment the value of pseudoDsgn } } } public Variable generateCoref() { int indx = this.getSupCoref(); indx++; Variable coref = new Variable("*p" + indx); return coref; } /** scan the current CG, taking into account embeeded CG, to identify the coreferent with the greater indice value; for coreferents with the form "*pINTEGER". This search is important to avoid the generation of a coreferent that exists already in the CG.

Returns:
int

isRelationInCG

public boolean isRelationInCG(Relation relation)
Check if the specified relation is contained in the current CG. Note that the test is based on the equality of the relation reference, not the content of the relation.

Parameters:
relation - : the relation to look for in the current CG
Returns:
true if relation is not null and it is in the current CG and false otherwise

getNbrRelations

public int getNbrRelations()
Get the number of relations of the current CG

Returns:
the number of relations of the current CG

getEdges

public java.util.Enumeration getEdges()
Specified by:
getEdges in interface Graph

getRelations

public java.util.Enumeration getRelations()
Get all the relations of the current CG (an ArrayList of Relation)

Returns:
an Enumeration over all the relations of the current CG. If the current CG doesn't contain any relation, the method returns null.

getArrayRelations

public java.lang.Object[] getArrayRelations()
NEW method: Amine 2.5, by Adil Get the relations of the current CG in an array

Returns:
the relations of the current CG in an array

getArrayListRelations

public java.util.ArrayList getArrayListRelations()

getRelationsInArrayList

public java.util.ArrayList getRelationsInArrayList()

getRelationsInHmp

public java.util.HashMap getRelationsInHmp()
Get all the relations of the current CG in a HashMap. An entry in the HashMap concerns all the relations in the current CG with the same relation type.

Returns:
a HashMap of all the relations of the current CG with : Key : relationType and Value : ArrayList of Relation with the same relationType If the current CG has no relation, the method returns null.

getRelationsInHmp

public java.util.HashMap getRelationsInHmp(BindingContext bindContext,
                                           java.lang.Object bindInf)
Get all the relations of the current CG in a HashMap. An entry in the HashMap concerns all the relations in the current CG with the same relation type.

Parameters:
bindContext - The Binding Context
bindInf - The binding information associated to the current CG
Returns:
a HashMap of all the relations of the current CG with : Key : relationType and Value : ArrayList of Relation with the same relationType If the current CG has no relation, the method returns null.

getRelationsInHmp

public java.util.HashMap getRelationsInHmp(AmineInteger nbrRels)
This method is a variante of the method getRelationsInHmp(); it returns the HashMap of all the relations in the current CG and also the number of relations of the current CG. In this version, we do not consider variable binding, for relation types that are variables.

Parameters:
nbrRels - : an AmineInteger object that will contain at the end the number of relations of the current CG. AmineInteger is a wrapper class for int. It play the role of an inout parameter. This parameter could be null; if the user is not interested by the number of relations.
Returns:
the HashMap of all the relations of the current CG, and in nbrRels it returns the number of relations of the current CG The method returns null if the current CG does not contain any relation.

getRelationsInHmp

public java.util.HashMap getRelationsInHmp(BindingContext bindContext,
                                           java.lang.Object bindInf,
                                           AmineInteger nbrRels)
This method is a variante of the method getRelationsInHmp(); it returns the HashMap of all the relations in the current CG and also the number of relations of the current CG. In this version, we consider variable binding, for relation types that are variables.

Parameters:
bindContext - The Binding Context
bindInf - The binding information associated to the current CG
nbrRels - : an AmineInteger object that will contain at the end the number of relations of the current CG. AmineInteger is a wrapper class for int. It play the role of an inout parameter. This parameter could be null; if the user is not interested by the number of relations.
Returns:
the HashMap of all the relations of the current CG, and in nbrRels it returns the number of relations of the current CG The method returns null if the current CG does not contain any relation.

addEdge

public void addEdge(Edge edge)
Specified by:
addEdge in interface Graph

addRelation

public boolean addRelation(Relation relation)
Add the specified relation to the current CG. Addition of a relation to a CG corresponds to the addition of the relation as an outcome relation for the relation source concept (srceConc) and as income relation for its target concept (trgtConc). The addition of a relation in the current CG is thus implicit. If functionalCG static attribute is true, the current method checks that with the addition of this new relation, the CG will remain functional : if there is already a relation with the same type and direction but different target (or source), then the method aborts and returns false.

Parameters:
relation - : the relation to add to the current CG
Returns:
true if relation is not null, was not contained in the current CG and its addition will not violate the functional constraint (if functionalCG static attribute is true).

addRelation

public boolean addRelation(BindingContext bindContext,
                           java.lang.Object bindInf,
                           Relation relation,
                           java.lang.Object bindInfRel)

addRelation

public boolean addRelation(java.lang.Object relationType,
                           Concept srceConc,
                           Concept trgtConc)
                    throws RelationException
Add a relation to the current CG given its type, its source concept and its target concept. This method calls the method addRelation(Relation).

Returns:
true if the addition of the new relation will not violate the functional constraint (if functionalCG static attribute is true)
Throws:
RelationException

addRelation

public boolean addRelation(BindingContext bindContext,
                           java.lang.Object bindInf,
                           java.lang.Object relationType,
                           java.lang.Object bindInfRelType,
                           Concept srceConc,
                           Concept trgtConc)
                    throws RelationException
Add a relation to the current CG given its type, its source concept and its target concept. This method calls the method addRelation(Relation).

Parameters:
bindContext - The Binding Context for this operation
bindInf - The binding information associated to this CG
relationType - The relation Type
bindInfRelType - The binding information associated to relationType
srceConc - The source concept
trgtConc - The target concept
Returns:
true if the addition of the new relation will not violate the functional constraint (if functionalCG static attribute is true)
Throws:
RelationException

addRelation

public boolean addRelation(java.lang.Object relationType,
                           java.lang.String suffix,
                           Concept srceConc,
                           Concept trgtConc,
                           java.awt.Point posRelName,
                           java.util.ArrayList segmentPoints)
                    throws RelationException
NEW Amine 2.5, by Adil: we consider the case of SYNERGY relations and the presence of special attributes that are stored in suffix field of the relation. Add a relation to the current CG given its type, its source concept and its target concept. This method calls the method addRelation(Relation).

Returns:
true if the addition of the new relation will not violate the functional constraint (if functionalCG static attribute is true)
Throws:
RelationException

addRelation

public boolean addRelation(java.lang.Object relationType,
                           java.lang.String suffix,
                           Concept srceConc,
                           Concept trgtConc)
                    throws RelationException
Throws:
RelationException

removeRelation

public boolean removeRelation(Relation relation)
Remove the specified relation from the current CG. This is done by removing the relation from the outcomeRelations of its source concept and by removing it from the incomeRelations of its target concept. If the source or the target concept is no more connected, it is not destroyed. The decision to remove or not such a disconnected concept should be taken by the caller of this method. Note that the relation itself is not destroyed by this method.

Returns:
true if relation is not null and it was contained in the current CG

removeEdge

public void removeEdge(Edge edge)
Specified by:
removeEdge in interface Graph

constructCG

public static CG constructCG(java.util.Iterator i)
Construct a CG from the specified Enumeration of relation. The constructed CG is more a view of another CG, Enumeration parameter specifies which relations (and concepts) of an existent cg should be included in the view (the cg to construct and return).

Returns:
a CG that is a (partial) view of another cg

restrictType

public boolean restrictType(Concept conc,
                            Type type)
Restrict the type of the specified concept conc, that should exist in the current CG, to the given type. The new type should be a subType of the conc type, and the designator of conc should be conform to the new type.

Parameters:
conc - The Concept from the current CG to restrict its type
type - The new type for conc
Returns:
true if the restriction was done

restrictDesignator

public boolean restrictDesignator(Concept conc,
                                  java.lang.Object designator)
Restrict the designator of the specified concept conc, that should exist in the current CG, to the given designator. The new designator should be conform to conc type.

Parameters:
conc - The Concept from the current CG to restrict its designator
designator - The new designator for conc
Returns:
true if the restriction was done

restrictDescriptor

public boolean restrictDescriptor(Concept conc,
                                  java.lang.Object descriptor)
Restrict the descriptor of the specified concept conc, that should exist in the current CG, to the given descriptor.

Parameters:
conc - The Concept from the current CG to restrict its descriptor
descriptor - The new descriptor for conc
Returns:
true if the restriction was done

generalizeType

public boolean generalizeType(Concept conc,
                              Type type)
Generalize the type of the specified concept conc, that should exist in the current CG, to the given type. The new type should be a superType of the conc type.

Parameters:
conc - The Concept from the current CG to generalize its type
type - The new type for conc
Returns:
true if the generalization was done

generalizeDesignator

public boolean generalizeDesignator(Concept conc,
                                    java.lang.Object designator)
Generalize the designator of the specified concept conc, that should exist in the current CG, to the given designator. The new designator should be conform to conc type.

Parameters:
conc - The Concept from the current CG to generalize its designator
designator - The new designator for conc
Returns:
true if the generalization was done

generalizeDesignator

public boolean generalizeDesignator(Concept conc)
Generalize the designator of the specified concept conc, that should exist in the current CG, to a null designator.

Parameters:
conc - The Concept from the current CG to generalize its designator
Returns:
true if the generalization was done

generalizeDescriptor

public boolean generalizeDescriptor(Concept conc,
                                    java.lang.Object descriptor)
Generalize the descriptor of the specified concept conc, that should exist in the current CG, to the given descriptor.

Parameters:
conc - The Concept from the current CG to generalize its descriptor
descriptor - The new descriptor for conc
Returns:
true if the generalization was done

generalizeDescriptor

public boolean generalizeDescriptor(Concept conc)
Generalize the descriptor of the specified concept conc, that should exist in the current CG, to a null descriptor.

Parameters:
conc - The Concept from the current CG to generalize its descriptor
Returns:
true if the generalization was done

join

public CG join(Concept conc1,
               CG cg2,
               Concept conc2)
Join the current CG with the specified CG cg2, with the specified conc1 and conc2 as two concepts of the current CG and cg2 respectively, and conc1 is identical to conc2.

Parameters:
conc1 - A concept in the current CG
cg2 - The CG to join
conc2 - The concept in cg2 to join with conc1
Returns:
A new CG that results from the join of the current CG and cg2.

analogizeType

public boolean analogizeType(Concept conc,
                             Type type)
This method implements the following elementary analog operation : replace the type of the specified concept conc, that should exist in the current CG, by the given type. The new type and the type to replace should have a common superType (other than the root type of the ontology). According to this definition, analoy is not limited to direct sibling, it includes indirect sibling also.

Parameters:
conc - The Concept from the current CG to analogize its type
type - The new type for conc
Returns:
true if the analogy was done

toLF

public java.lang.String toLF(Lexicon lexicon)
                      throws ToStringException
This method is the equivalent to the method toString() associated to any Java Object. We does not override it because "toString" of a CG could be done in LF or in CGIF. So, the two methods toLF() and toCGIF() are two variants of toString() method. Given the lexicon to use, this method returns the linear form of the current CG. This definition of toLF() does not consider the values of variables. Use the method toLF(bindContext, bindInf, lexicon) if variable binding should be considered.

Parameters:
lexicon - The lexicon in use during the textual formulation of the current CG
Returns:
the linear form of the current CG using the specified lexicon, or return null if the parameter lexicon is null.
Throws:
ToStringException - if an error occurs during the textualization

toLF

public java.lang.String toLF(BindingContext bindContext,
                             java.lang.Object bindInf,
                             Lexicon lexicon)
                      throws ToStringException
This method returns the Linear Form (LF) of the curreng cg. If variable binding is considered, the values of the variables will be textualized too.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
lexicon - The lexicon in use during the textual formulation of the CG cg
Returns:
a String that represents the linear form of cg.
Throws:
ToStringException - if an error occurs during the textualization

toLFWithDrawingInf

public java.lang.String toLFWithDrawingInf(Lexicon lexicon)
                                    throws ToStringException
This method is similar to the method toLF() except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.

Parameters:
lexicon - The lexicon in use during the textual formulation of the current CG
Returns:
the linear form of the current CG using the specified lexicon, or return null if the parameter lexicon is null.
Throws:
ToStringException - if an error occurs during the textualization

toLFWithDrawingInf

public java.lang.String toLFWithDrawingInf(BindingContext bindContext,
                                           java.lang.Object bindInf,
                                           Lexicon lexicon)
                                    throws ToStringException
This method is similar to the method toLF() that consider variable binding except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
lexicon - The lexicon in use during the textual formulation of the CG cg
Returns:
a String that represents the linear form of cg.
Throws:
ToStringException - if an error occurs during the textualization

toXML

public java.lang.String toXML(Lexicon lexicon)
                       throws java.lang.Exception
Specified by:
toXML in interface ToXML
Throws:
java.lang.Exception

toString

public java.lang.String toString(Lexicon lexicon)
                          throws ToStringException
By default, the textualization of a CG will be in Linear Form. Thus, this method calls toLF(lexicon) method.

Specified by:
toString in interface ToString
Parameters:
lexicon - The lexicon to use during the textual formulation of the current CG
Returns:
a String that represents the linear form of the current CG.
Throws:
ToStringException - if an error occurs during the textualization

toString

public java.lang.String toString(BindingContext bindContext,
                                 java.lang.Object bindInf,
                                 Lexicon lexicon)
                          throws ToStringException
By default, the textualization of a CG will be in Linear Form. Thus, this method calls toLF(bindContext, bindInf, lexicon) method which considers the presence of variables.

Specified by:
toString in interface AmineObject
Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
lexicon - The lexicon to use during the textual formulation of the current concept
Returns:
a String that represents the linear form of the current concept.
Throws:
ToStringException - if an error occurs during the textualization

toCGIF

public java.lang.String toCGIF(Lexicon lexicon)
                        throws ToStringException
This method is similar to toLF(). Given the lexicon in use, this method returns the CGIF form for the current CG. This definition of toCGIF() does not consider the values of variables. Use the method toCGIF(bindContext, bindInf, lexicon) if variable binding should be considered.

Parameters:
lexicon - The lexicon in use during the textual formulation of the current CG
Returns:
the CGIF form of the current CG using the specified lexicon, or return null if the parameter lexicon is null.
Throws:
ToStringException - if an error occurs during the textualization

toCGIF

public java.lang.String toCGIF(BindingContext bindContext,
                               java.lang.Object bindInf,
                               Lexicon lexicon)
                        throws ToStringException
This method returns the CGIF notation of the specified cg. If variable binding is considered, the values of the variables will be textualized too.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
lexicon - The lexicon in use during the textual formulation
Returns:
a String that represents the CGIF notation of the current CG.
Throws:
ToStringException

toCGIFWithDrawingInf

public java.lang.String toCGIFWithDrawingInf(Lexicon lexicon)
                                      throws ToStringException
This method is similar to the method toCGIF() except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.

Parameters:
lexicon - The lexicon in use during the textual formulation of the current CG
Returns:
the CGIF form of the current CG using the specified lexicon, or return null if the parameter lexicon is null.
Throws:
ToStringException - if an error occurs during the textualization

toCGIFWithDrawingInf

public java.lang.String toCGIFWithDrawingInf(BindingContext bindContext,
                                             java.lang.Object bindInf,
                                             Lexicon lexicon)
                                      throws ToStringException
This method is similar to the method toCGIF() that consider variable binding except that we formulate also the drawing information; the leftTop point of each concept, the position of each relation type and the points that define the segments of the relation.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current CG
lexicon - The lexicon in use during the textual formulation
Returns:
a String that represents the CGIF notation of the current CG.
Throws:
ToStringException

parseLF

public static CG parseLF(java.lang.String cgInLF,
                         Lexicon lexicon)
                  throws ParsingException
Given a CG as a String in linear form and the lexicon to use, this method parses the string and produces the internal representation of the CG. This method checks the canonicity parameter of CG: if canoncity is true, then it checks that the CG is canonic.

Parameters:
cgInLF - The CG in linear form
lexicon - The lexicon in use during the parsing
Returns:
a CG object; the internal representation of the CG given as a String, or return null if the parameter cgInLF or lexicon is null.
Throws:
java.lang.Exception - if problems occur during the parsing
ParsingException

relaxedParserLF

public static CG relaxedParserLF(java.lang.String cgInLF,
                                 Lexicon lexicon,
                                 AmineList newTypes)
                          throws ParsingException
Throws:
ParsingException

parseCGIF

public static CG parseCGIF(java.lang.String cgInCGIF,
                           Lexicon lexicon)
                    throws ParsingException
Given a CG as a String in CGIF form and using the specified lexicon, this method parses the string and produces the internal representation of the CG. This method checks the canonicity parameter of CG: if canoncity is true, then it checks that the CG is canonic.

Parameters:
cgInCGIF - The CG in CGIF form
lexicon - The lexicon in use during the parsing
Returns:
a CG object; the internal representation of the CG given as a String, or return null if the parameter cgInCGIF or lexicon is null.
Throws:
java.lang.Exception - if problems occur during the parsing
ParsingException

parse

public static CG parse(java.lang.String cgInString,
                       Lexicon lexicon)
                throws ParsingException
Parse the textual formulation of a CG (parameter cgInString) using the specified lexicon and produce its internal representation. cgInString could be in a Linear Form (LF) or in CGIF form. This method checks the canonicity parameter of CG: if canoncity is true, then it checks that the CG is canonic.

Parameters:
cgInString - A textual formulation of a CG that could be in a LF or in CGIF
lexicon - The lexicon in use during the parsing
Returns:
the internal representation (Java Object) of the CG
Throws:
ParsingException

determineCGForm

public static byte determineCGForm(java.lang.String cgInString)
                            throws ParsingException
Determine the nature of the CG form (linear form or CGIF) from the textual formulation (a String) of the given CG. This method is a static version of the method determineCGForm() defined in parserGenerator.ObjectParsing class. See the comment that is associated to the method in ObjectParsing class for more detail.

Parameters:
cgInString - A textual formulation of a CG that could be in a LF or in CGIF
Returns:
the nature of the CG form : return the constant LF if the CG is in a Linear Form and return the constant CGIF if the CG is in a CGIF form (see utilitiesAmine.AmineConstant interface for the values of these constants).
Throws:
ParsingException

match

public java.lang.Object match(byte matchOperation,
                              BindingContext bindContext,
                              java.lang.Object bindInf,
                              java.lang.Object obj,
                              java.lang.Object bindInfObj)
Match the current CG with the specified object obj, according to the value of the parameter matchOperation. The matching considers the binding context and the binding information for the two objects.

Specified by:
match in interface Matching
Parameters:
matchOperation - A byte value that specifies which kind of matching to apply
bindContext - The binding context
bindInf - The binding information for the current CG
obj - The object to match with the current CG
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the match operation

match

public ResMatchCG match(byte matchOperation,
                        BindingContext bindContext,
                        java.lang.Object bindInf,
                        java.lang.Object entryConcept1,
                        java.lang.Object bindInfEntry1,
                        java.lang.Object obj,
                        java.lang.Object bindInfObj,
                        java.lang.Object entryConcept2,
                        java.lang.Object bindInfEntry2)

match

public java.lang.Object match(byte matchOperation,
                              java.lang.Object obj)
Match the current CG with the specified object, according to the value of the parameter matchOperation. This version of matching does not consider the binding context and resolution. Atually, these values are defined in AmineConstants interface and are: EQUAL, UNIFY, SUBSUME, SUBSUME_WITH_RSLT, MAXIMAL_JOIN, GENERALIZE, SPECIALIZE, and GENERALISE.

Specified by:
match in interface Matching
Parameters:
matchOperation - A byte value that specifies which kind of matching to apply
obj - The object to match with the current CG
Returns:
an object which is the result of the match operation

match

public ResMatchCG match(byte matchOperation,
                        Concept entryConcept1,
                        CG cg,
                        Concept entryConcept2)

match

public ResMatchCG match(byte matchOperation,
                        Concept entryConcept1,
                        Concept concept,
                        Concept entryConcept2)

equal

public boolean equal(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj)
Check that the current CG is equal with the specified object obj. The equality is a kind of matching and this version considers the binding context and the binding information for the two objects.

Specified by:
equal in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current CG
obj - The object to check the equality with the current CG
bindInfObj - The binding information for the parameter obj
Returns:
true if the two objects are equal and false otherwise

equal

public boolean equal(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object entryConcept1,
                     java.lang.Object bindInfEntry1,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj,
                     java.lang.Object entryConcept2,
                     java.lang.Object bindInfEntry2)

equal

public boolean equal(Concept e1,
                     CG cg,
                     Concept e2)
equal: this new version does not consider binding context and binding information

Parameters:
e1 - Concept: entry concept for this CG
cg - CG
e2 - Concept: entry concept for cg
Returns:
true if the two objects are equal and false otherwise

equal

public boolean equal(java.lang.Object obj)
Check that the current CG is equal with the specified object obj. The equality is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Specified by:
equal in interface Matching
Parameters:
obj - The object to check the equality with the current CG
Returns:
true if the two objects are equal and false otherwise

unify

public boolean unify(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj)
Unify the current CG with the specified object obj.

Specified by:
unify in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to unify with the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the two objects can be unified and false otherwise

unify

public boolean unify(BindingContext bindContext,
                     java.lang.Object bindInf,
                     java.lang.Object entryConcept1,
                     java.lang.Object bindInfEntry1,
                     java.lang.Object obj,
                     java.lang.Object bindInfObj,
                     java.lang.Object entryConcept2,
                     java.lang.Object bindInfEntry2)

unify

public boolean unify(java.lang.Object obj)

subsume

public boolean subsume(BindingContext bindContext,
                       java.lang.Object bindInf,
                       java.lang.Object obj,
                       java.lang.Object bindInfObj)
Check that the current CG subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version considers the binding context and the binding information for the two objects.

Specified by:
subsume in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current CG
obj - The object to check its subsumption by the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the current CG subsumes the specified object obj

subsume

public boolean subsume(BindingContext bindContext,
                       java.lang.Object bindInf,
                       java.lang.Object entryConcept1,
                       java.lang.Object bindInfEntry1,
                       java.lang.Object obj,
                       java.lang.Object bindInfObj,
                       java.lang.Object entryConcept2,
                       java.lang.Object bindInfEntry2)

subsume

public boolean subsume(Concept e1,
                       CG cg,
                       Concept e2)
subsume: this new version does not consider binding context and binding information

Parameters:
e1 - Concept: entry concept for this CG
cg - CG
e2 - Concept: entry concept for cg
Returns:
boolean: true if this CG subsumes cg

subsume

public boolean subsume(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Specified by:
subsume in interface Matching
Parameters:
obj - The object to check its subsumption by the current object
Returns:
true if the current object subsumes the specified object obj

subsumeWithResult

public java.lang.Object subsumeWithResult(BindingContext bindContext,
                                          java.lang.Object bindInf,
                                          java.lang.Object obj,
                                          java.lang.Object bindInfObj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version considers the binding context and the binding information for the two objects.

Specified by:
subsumeWithResult in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to check its subsumption by the current object
bindInfObj - The binding information for the parameter obj
Returns:
the image, in obj, of the current object

subsumeWithResult

public ResMatchCG subsumeWithResult(BindingContext bindContext,
                                    java.lang.Object bindInf,
                                    java.lang.Object entryConcept1,
                                    java.lang.Object bindInfEntry1,
                                    java.lang.Object obj,
                                    java.lang.Object bindInfObj,
                                    java.lang.Object entryConcept2,
                                    java.lang.Object bindInfEntry2)

subsumeWithResult

public java.lang.Object subsumeWithResult(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Specified by:
subsumeWithResult in interface Matching
Parameters:
obj - The object to check its subsumption by the current object
Returns:
the image, in obj, of the current object

maximalJoin

public java.lang.Object maximalJoin(BindingContext bindContext,
                                    java.lang.Object bindInf,
                                    java.lang.Object obj,
                                    java.lang.Object bindInfObj)
Perform a maximal join of the current object with the specified object obj. The join considers the binding context and the binding information for the two objects.

Specified by:
maximalJoin in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to join with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the join operation

maximalJoin

public ResMatchCG maximalJoin(BindingContext bindContext,
                              java.lang.Object bindInf,
                              java.lang.Object entryConcept1,
                              java.lang.Object bindInfEntry1,
                              java.lang.Object obj,
                              java.lang.Object bindInfObj,
                              java.lang.Object entryConcept2,
                              java.lang.Object bindInfEntry2)

maximalJoin

public ResMatchCG maximalJoin(Concept e1,
                              CG cg,
                              Concept e2)
maximalJoin: this new version does not consider binding context and binding information

Parameters:
e1 - Concept: entry concept for this CG
cg - CG
e2 - Concept: entry concept for cg
Returns:
an object which is the result of the maximalJoin operation

maximalJoin

public java.lang.Object maximalJoin(java.lang.Object obj)
Perform a maximal join of the current object with the specified object obj. This version of join does not considers the binding context and the binding information for the two objects.

Specified by:
maximalJoin in interface Matching
Parameters:
obj - The object to join with the current object
Returns:
an object which is the result of the join operation

specialize

public boolean specialize(BindingContext bindContext,
                          java.lang.Object bindInf,
                          java.lang.Object obj,
                          java.lang.Object bindInfObj)
Perform a specialization of the current object with the specified object obj. The current CG will be specialized by its maximalJoin with obj. The specialization considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to join to the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the specialization was successfull.

specialize

public boolean specialize(BindingContext bindContext,
                          java.lang.Object bindInf,
                          java.lang.Object entryConcept1,
                          java.lang.Object bindInfEntry1,
                          java.lang.Object obj,
                          java.lang.Object bindInfObj,
                          java.lang.Object entryConcept2,
                          java.lang.Object bindInfEntry2)

specialize

public boolean specialize(java.lang.Object obj)
Perform a specialization of the current object with the specified object obj. The current CG will be specialized by its maximalJoin with obj. This version of specialize does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The object to join to the current object

specializeByExpansion

public boolean specializeByExpansion(BindingContext bindContext,
                                     java.lang.Object bindInf,
                                     Concept concept)
specializeByExpansion performs the expansion in the current CG (this); it does NOT create a new CG that represents the result of the expansion.

Parameters:
bindContext - The Binding Context
bindInf - The bindinf information related to the current CG
concept - The Concept in the current CG that contains the type to expand
Returns:
true if the specialization have been done, and false otherwise (if concept is null or concept is not a concept in the current CG or the type of the concept has not a definition or the specialization was not possible).

specializeByExpansion

public boolean specializeByExpansion(BindingContext bindContext,
                                     java.lang.Object bindInf,
                                     java.lang.Object objConcept,
                                     java.lang.Object bindInfObj)

specializeByExpansion

public boolean specializeByExpansion(Concept concept)
specializeByExpansion performs the expansion in the current CG (this); it does NOT create a new CG that represents the result of the expansion.

Parameters:
concept - The Concept in the current CG that contains the type to expand
Returns:
true if the specialization have been done, and false otherwise (if concept is null or concept is not a concept in the current CG or the type of the concept has not a definition or the specialization was not possible).

contractTypeDefinition

public boolean contractTypeDefinition(BindingContext bindContext,
                                      java.lang.Object bindInf,
                                      Concept concept,
                                      Type type)
Contract the definition of the specified Type from the current CG, using the specified concept as the entry point. After, the contraction, the type of the specified concept will be replaced by the specified type. contractTypeDefinition is the inverse of the specializeByExpansion operation. Note that the contraction concerns the CG itself. To proceed otherwise, you can give a copy of the CG to the present method.

Parameters:
bindContext - The Binding Context for the current CG
bindInf - Binding information for current CG
concept - A concept that should be contained in the current CG
type - A type that should replace the contracted definition
Returns:
true if the contraction has been done.

contractTypeDefinition

public boolean contractTypeDefinition(BindingContext bindContext,
                                      java.lang.Object bindInf,
                                      java.lang.Object objConcept,
                                      java.lang.Object bindInfObj1,
                                      java.lang.Object objType,
                                      java.lang.Object bindInfObj2)
This is a variant of the previous definition: instead of a Concept as third parameter and Type as forth parameter, this variant accepts two objects with the specification of their binding information. This variant is usefull in a programming context (with a variable that could have a concept or a type as value).

Parameters:
bindContext - The Binding Context for the current CG
bindInf - Binding information for current CG
objConcept - An Object that could be a concept or a variable with concept as value
bindInfObj1 - Binding information for objConcept
objType - An Object that could be a Type or a variable with Type as value
bindInfObj2 - Binding information for objType
Returns:
true if the contraction has been done.

contractTypeDefinition

public boolean contractTypeDefinition(Concept concept,
                                      Type type)
Contract the definition of the specified Type from the current CG, using the specified concept as the entry point. After, the contraction, the type of the specified concept will be replaced by the specified type. contractTypeDefinition is the inverse of the specializeByExpansion operation. Note that the contraction concerns the CG itself. To proceed otherwise, you can give a copy of the CG to the present method.

Parameters:
concept - A concept that should be contained in the current CG
type - A type that should replace the contracted definition
Returns:
true if the contraction has been done.

contractTypeDefinition

public boolean contractTypeDefinition(Type type)
Contract the definition of the specified Type from the current CG. contractTypeDefinition is the inverse of the specializeByExpansion operation. Note that the contraction concerns the CG itself. To proceed otherwise, you can give a copy of the CG to the present method.

Parameters:
type - A type that should replace the contracted definition
Returns:
true if the contraction has been done.

contractTypeDefinition

public boolean contractTypeDefinition(BindingContext bindContext,
                                      java.lang.Object bindInf,
                                      Concept concept)
Contract the definition of the type of the specified concept from the current CG, using the specified concept as the entry point. contractTypeDefinition is the inverse of the specializeByExpansion operation. Note that the contraction concerns the CG itself. To proceed otherwise, you can give a copy of the CG to the present method.

Parameters:
concept - A concept that should be contained in the current CG
Returns:
true if the contraction has been done.

contractTypeDefinition

public boolean contractTypeDefinition(BindingContext bindContext,
                                      java.lang.Object bindInf,
                                      java.lang.Object obj,
                                      java.lang.Object bindInfObj)
This is a variant of the previous definition: instead of a Concept as third parameter, this variant allows an object with the specification of its binding information. This variant is usefull in a programming context (with a variable that could have a concept as value).

Parameters:
bindContext - A BindingContext
bindInf - Binding information for the current CG
bindInfObj - Binding information for objConcept
Returns:
true if the contraction is performed.

contractTypeDefinition

public boolean contractTypeDefinition(Concept concept)
Contract the definition of the type of the specified concept from the current CG, using the specified concept as the entry point. contractTypeDefinition is the inverse of the specializeByExpansion operation. Note that the contraction concerns the CG itself. To proceed otherwise, you can give a copy of the CG to the present method.

Parameters:
concept - A concept that should be contained in the current CG
Returns:
true if the contraction has been done.

generalize

public java.lang.Object generalize(BindingContext bindContext,
                                   java.lang.Object bindInf,
                                   java.lang.Object obj,
                                   java.lang.Object bindInfObj)
Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects. The generalize operation considers the binding context and the binding information for the two objects.

Specified by:
generalize in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to generalize with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the generalization operation

generalize

public ResMatchCG generalize(BindingContext bindContext,
                             java.lang.Object bindInf,
                             java.lang.Object entryConcept1,
                             java.lang.Object bindInfEntry1,
                             java.lang.Object obj,
                             java.lang.Object bindInfObj,
                             java.lang.Object entryConcept2,
                             java.lang.Object bindInfEntry2)

generalize

public ResMatchCG generalize(Concept e1,
                             CG cg,
                             Concept e2)
generalize: this new version does not consider binding context and binding information

Parameters:
e1 - Concept: entry concept for this CG
cg - CG
e2 - Concept: entry concept for cg
Returns:
an object which is the result of the generalization operation

generalize

public java.lang.Object generalize(java.lang.Object obj)
Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects. This version of generalize operation does not considers the binding context and the binding information for the two objects.

Specified by:
generalize in interface Matching
Parameters:
obj - The object to generalize with the current object
Returns:
an object which is the result of the generalization operation

generalize

public CG generalize(Type pertinentType1,
                     CG g2,
                     Type pertinentType2)

generalise

public boolean generalise(BindingContext bindContext,
                          java.lang.Object bindInf,
                          java.lang.Object obj,
                          java.lang.Object bindInfObj)
Perform a generalization of the current object with the specified object obj. The current CG will be generalized by its generalization with obj. The generalization considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to generalize to the current object
bindInfObj - The binding information for the parameter obj

generalise

public boolean generalise(BindingContext bindContext,
                          java.lang.Object bindInf,
                          java.lang.Object entryConcept1,
                          java.lang.Object bindInfEntry1,
                          java.lang.Object obj,
                          java.lang.Object bindInfObj,
                          java.lang.Object entryConcept2,
                          java.lang.Object bindInfEntry2)

generalise

public boolean generalise(java.lang.Object obj)
Perform a generalization of the current object with the specified object obj. The current CG will be generalized by its generalization with obj. This version of generalise does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The object to generalize with the current object

analogy

public void analogy(BindingContext bindContext,
                    java.lang.Object bindInf,
                    java.lang.Object obj,
                    java.lang.Object bindInfObj)
analogy() determine the structural matching of the two CG and then transfer to the target CG (this CG) all the elements that are specific to the source CG and that respect the canonicity of the targetCG. The analogy considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The source
bindInfObj - The binding information for the parameter obj

analogy

public void analogy(BindingContext bindContext,
                    java.lang.Object bindInf,
                    java.lang.Object entryConcept1,
                    java.lang.Object bindInfEntry1,
                    java.lang.Object obj,
                    java.lang.Object bindInfObj,
                    java.lang.Object entryConcept2,
                    java.lang.Object bindInfEntry2)
analogy() determine the structural matching of the two CG and then transfer to the target CG (this CG) all the elements that are specific to the source CG and that respect the canonicity of the targetCG. The analogy considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
entryConcept1 - A Concept in the current CG used as an entry point
bindInfEntry1 - The binding information for the parameter entryConcept1
obj - The source
bindInfObj - The binding information for the parameter obj
entryConcept2 - A Concept in obj used as an entry point
bindInfEntry2 - The binding information for the parameter obj entryConcept2

analogy

public void analogy(Concept e1,
                    CG cg,
                    Concept e2)
analogy: this new version does not consider binding context and binding information

Parameters:
e1 - Concept: entry concept for this CG
cg - CG
e2 - Concept: entry concept for cg

analogy

public void analogy(java.lang.Object obj)
analogy() determine the structural matching of the two CG and then transfer to the target CG (this CG) all the elements that are specific to the source CG and that respect the canonicity of the targetCG. This version of analogy does not considers the binding context and the binding information for the two objects.

Parameters:
obj - The CG that represents the source
Returns:
true if the analogy is successfull

compare

public CompareCGResult compare(Concept entryPoint1,
                               CG cg2,
                               Concept entryPoint2)
Compare two CGs cg1 and cg2 : The operation starts by computing the generalization between the two CG cg1 and cg2. Then, the operation proceeds to determine the type of the relation between the two CGs :

- the two CG are equal if: the matched concepts are equal, the same number of concepts

and the same number of relations (and all the relations have been matched).

- else, newCG is more general than G2 if: the number of concepts of newCG is equal to

the number of matched concepts, and the number of relations of newCG is equal to the number of matched relations, and the matched concepts are equals to the corresponding concepts in newCG.

- else, newCG is more specific than G2 if: the number of concepts of currentCG is equal to

the number of matched concepts, and the number of relations of currentCG is equal to the number of matched relations, and the matched concepts are equals to the corresponding concepts in currentCG.

- else, newCG and currentCG have common information if the result of the generalization is not null and it doesn't correspond to the specified fatherOntNode or to its description.

- else, newCG and currentCG are incomparable.

Parameters:
entryPoint1 - Entry concept for the current CG. entryPoint1 is a (and should be) concept in the current CG
cg2 - a CG to compare with the current CG
entryPoint2 - Entry concept for cg2. entryPoint2 is a (and should be) concept in cg2
Returns:
a CompareCGResults where the detail of the comparison is recorded
Throws:
java.lang.Exception - if some problems occur during the comparison

coveredBy

public java.util.Enumeration coveredBy(BindingContext bindContext,
                                       java.lang.Object bindInf,
                                       java.lang.Object obj,
                                       java.lang.Object bindInfObj)
coveredBy determine which part of the current CG G1 (a subgraph S1) covers a part of obj G2 (a subgraph S2), i.e. S1 covers S2 if S1 is equal or more specific than S2. coveredBy can be complete if all G1 cover a subgraph from G2: if G1 is equal or more specific than a subgraph of G2. coveredBy is partial if only a subgraph of G1 cover a subgraph of G2. Note that the result, if not null, is a new CG G that is a "view" of G2: concepts and relations of G are (exactly) concepts and relations of G2; they are NOT copies of these concepts/relations. This operation is used by our Ontology Information Retrieval Process. coveredBy considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to consider with the current object
bindInfObj - The binding information for the parameter obj
Returns:
null if obj is not a CG or there is nothing toCover or return an Enumeration of relations that represents the subgraph, from obj, that is covered.

coveredBy

public java.util.Enumeration coveredBy(BindingContext bindContext,
                                       java.lang.Object bindInf,
                                       java.lang.Object entryConcept1,
                                       java.lang.Object bindInfEntry1,
                                       java.lang.Object obj,
                                       java.lang.Object bindInfObj,
                                       java.lang.Object entryConcept2,
                                       java.lang.Object bindInfEntry2)
coveredBy determine which part of the current CG G1 (a subgraph S1) covers a part of obj G2 (a subgraph S2), i.e. S1 covers S2 if S1 is equal or more specific than S2. coveredBy can be complete if all G1 cover a subgraph from G2: if G1 is equal or more specific than a subgraph of G2. coveredBy is partial if only a subgraph of G1 cover a subgraph of G2. Note that the result, if not null, is a new CG G that is a "view" of G2: concepts and relations of G are (exactly) concepts and relations of G2; they are NOT copies of these concepts/relations. This operation is used by our Ontology Information Retrieval Process. coveredBy considers the binding context and the binding information for the two objects.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
entryConcept1 - A Concept in the current CG used as an entry point
bindInfEntry1 - The binding information for the parameter entryConcept1
obj - The object to consider with the current object
bindInfObj - The binding information for the parameter obj
entryConcept2 - A Concept in obj used as an entry point
bindInfEntry2 - The binding information for the parameter obj entryConcept2
Returns:
null if obj is not a CG or there is nothing toCover or return an Enumeration of relations that represents the subgraph, from obj, that is covered.

coveredBy

public java.util.Enumeration coveredBy(java.lang.Object obj)
coveredBy determine which part of the current CG G1 (a subgraph S1) covers a part of obj G2 (a subgraph S2), i.e. S1 covers S2 if S1 is equal or more specific than S2. coveredBy can be complete if all G1 cover a subgraph from G2: if G1 is equal or more specific than a subgraph of G2. coveredBy is partial if only a subgraph of G1 cover a subgraph of G2. Note that the result, if not null, is a new CG G that is a "view" of G2: concepts and relations of G are (exactly) concepts and relations of G2; they are NOT copies of these concepts/relations. This operation is used by our Ontology Information Retrieval Process.

Parameters:
obj - The object to consider should be a CG
Returns:
null if obj is not a CG or there is nothing toCover or return an Enumeration of relations that represents the subgraph, from obj, that is covered.

isCanonic

public boolean isCanonic(BindingContext bindContext,
                         java.lang.Object bindInf)
Check if current CG is canonic: a) for each type (concept type or relation type) in the current CG, search its canon (if it has) and checks that the canon subsumes the current CG. A canon specifies the minimal constraints for the semantically correct use of a type.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current CG
Returns:
true if the current CG is canonic

isCanonic

public boolean isCanonic()
Check if current CG is canonic: a) for each type (concept type or relation type) in the current CG, search its canon (if it has) and checks that the canon subsumes the current CG. In this variant, the binding context and binding information are not considered.

Returns:
true if the current CG is canonic

expand

public CG expand(BindingContext bindContext,
                 java.lang.Object bindInf,
                 Concept conc)
Expand the current CG by the maximal join of the definition of the concept type of the specified conc which should be contained in the current CG. The expansion is not done directly on the current CG, but a new CG is created that corresponds to expanded form of the initial CG.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current CG
conc - The concept in the current CG that should be expanded
Returns:
a CG that result from the expansion of the current CG by the definition of the concept type of the specified conc

expand

public CG expand(BindingContext bindContext,
                 java.lang.Object bindInf,
                 java.lang.Object objConceptOrRelation,
                 java.lang.Object bindInfObj)

expand

public CG expand(Concept conc)
Expand the current CG by the maximal join of the definition of the concept type of the specified conc which should be contained in the current CG. The expansion is not done directly on the current CG, but a new CG is created that corresponds to expanded form of the initial CG. In this variant, the binding context and binding information are not considered.

Parameters:
conc - The concept in the current CG that should be expanded
Returns:
a CG that result from the expansion of the current CG by the definition of the concept type of the specified conc

expand

public CG expand(BindingContext bindContext,
                 java.lang.Object bindInf,
                 Relation rel)
Expand the current CG by the maximal join of the definition of the relation type of the specified rel which should be contained in the current CG. The expansion is not done directly on the current CG, but a new CG is created that corresponds to expanded form of the initial CG.

Parameters:
bindContext - The binding context
bindInf - The binding information for the current CG
rel - The relation in the current CG that should be expanded
Returns:
a CG that result from the expansion of the current CG by the definition of the relation type of the specified relation

expand

public CG expand(Relation rel)
Expand the current CG by the maximal join of the definition of the relation type of the specified rel which should be contained in the current CG. The expansion is not done directly on the current CG, but a new CG is created that corresponds to expanded form of the initial CG. In this variant, the binding context and binding information are not considered.

Parameters:
rel - The relation in the current CG that should be expanded
Returns:
a CG that result from the expansion of the current CG by the definition of the relation type of the specified relation

getConceptTypes

public AmineList getConceptTypes()
getConceptTypes returns the types (without duplication) used in concepts of the current CG.

Returns:
Set
Since:
20/01/06