aminePlatform.kernel.lexicons
Class Lexicon

java.lang.Object
  extended byaminePlatform.kernel.lexicons.Lexicon
All Implemented Interfaces:
java.io.Serializable

public class Lexicon
extends java.lang.Object
implements java.io.Serializable

Title: lexicons.Lexicon class

Description: This class defines a "conceptual lexicon" ; a lexicon that records for each identifier of a specific language its associated Conceptual Structure (CS).

All CSs associated to the identifiers are contained in an ontology. Thus two main attributes of a "conceptual lexicon" are the language and the ontology that supports the lexicon. A lexicon represents the "lexical gate" to the conceptual ontology. Indeed, an ontology in Amine Platform is an "identifier free" and "language free" ontology. But from the lexicon of a language and the identifiers in that lexicon, we have an access to CSs that are parts of the ontology.

Amine Platform supports multi-lingua ontology; a lexicon is created for a specific language (french, english, deutsh, etc.) and for a specific ontology, but several lexicons could be associated to one ontology.

An identifier could be a concept type identifier, an individual identifier or a relation type identifier. A concept type and a relation type identifiers are associated to Type CSs while an individual identifier is associated to an Individual CS. To a Type CS or to an Individual CS it can be associated many synonyms in the same language and/or in different languages. Several methods are provided to get, add, change or remove entries from the current lexicon, other methods are offered to add, get or remove synonyms in the same language/lexicon and/or in other languages/lexicons, to get the identifier for a specific CS, etc.

The class Lexicon provides also a "lexical" version of methods that are defined in the ontology package : several methods are given to link the CSs of the specified identifiers (like linkSubTypesToType, linkIndividualsToType, ...) to get superTypes (or subTypes) identifiers of a given type identifier, etc. Logically speaking, these methods should be defined only in the ontology package since they concern the creation (and consultation) of links between CSs; the basic ontology operations. However and for practical purposes (human users manipulate identifiers and not CS directly), we offer the two versions of these methods : a) an 'identifier free' version defined in the classes of the ontology package where only CSs are involved, b) an 'identifier based' version defined in this class.

Let us consider now the detail of the lexicon implementation that satisfies the goal to have a bidirectional Lexicon : in some cases and for some treatments, Identifier should be the key (and CS the value) and in other cases CS should be the key (and Identifiers the value). The first case occurs for instance in parsing (from the identifier to the associated CS) and the second in generation (from the CS to the associated identifier). The two methods getCS(Identifier) and getIdentifier(CS)/getIdentifiers(CS) implement this bidirectional access : getCS(identifier) returns the CS associated to the given identifier while getIdentifier(CS cs) returns an identifier associated to the given CS.

We implement this bidirectional lexicon in terms of two lexicons (two HashMaps), the first lexicon (lexIdent2CS : from identifier to CS) specifies for each identifier its associated CS and the second lexicon (lexCS2Idents : from CS to identifiers) specifies for each CS its associated ArrayList of Identifier. The two lexicons (HashMaps) are two views of the same structure (the abstract lexicon).

This implementation of the lexicon, in terms of two HashMaps, is hidden from the user: methods are defined at the level of one (abstract) Lexicon.

Copyright: Copyright (c) Adil KABBAJ, 2004-2009

See Also:
Serialized Form

Constructor Summary
Lexicon(Identifier language, Ontology ontology)
          Construct a new (empty) lexicon for the specified new language and the specified ontology.
 
Method Summary
 boolean addAllEntries(java.lang.Object[] newIdentifiers, CS cs)
          This method adopts a strict interpretation of the method addEntries() : new entries will be added to the current lexicon only if all the identifiers in newIdentifiers are really new identifiers.
 boolean addAllSynonyms(java.lang.Object[] newSynonyms, Identifier identifier)
          This method adopts a strict interpretation of the method addSynonyms() : new entries will be added to the current lexicon only if all the identifiers in newSynonyms are really new identifiers in the current lexicon.
 boolean addAllSynonyms(java.lang.Object[] newSynonyms, Identifier newSynonymsLanguage, Identifier identifier)
          This method adopts a strict interpretation of the method addSynonyms() : new entries will be added to the current lexicon only if all the identifiers in newSynonyms are actually new identifiers in the lexicon of newSynonymsLanguage.
 Type addConceptTypeEntry(Identifier newTypeIdentifier)
          Add to the current lexicon a new entry for the new concept type identifier.
 boolean addConceptTypeEntry(Identifier newConceptTypeIdentifier, Type typeCS)
          Add a new entry to the current lexicon for a new concept type identifier and its associated Type CS.
 void addEntries(java.lang.Object[] newIdentifiers, CS cs)
          Add new entries to the current lexicon for each element of newIdentifiers with cs as the associated CS.
 boolean addEntry(java.lang.Object newIdentifier, CS cs)
          Add a new entry to the current lexicon for the specified new identifier and its associated CS cs.
 Individual addIndividualEntry(Identifier newIndividualIdentifier)
          Add to the current lexicon a new entry for the new individual identifier.
 Individual addIndividualEntry(Identifier typeIdentifier, Identifier newIndividualIdentifier)
          Add to the current lexicon a new entry for the new individual identifier with the specified typeIdentifier.
 boolean addIndividualEntry(Identifier newIndividualIdentifier, Individual individualCS)
          Add to the current lexicon a new entry for the new individual identifier and its Individual CS.
 RelationType addRelationTypeEntry(Identifier newRelationTypeIdentifier)
          Add to the current lexicon a new entry for the new concept type identifier.
 boolean addRelationTypeEntry(Identifier newRelationTypeIdentifier, RelationType typeCS)
          Add a new entry to the current lexicon for a new relation type identifier and its associated RelationType CS.
 boolean addSynonym(Identifier newSynonym, Identifier identifier)
          Add in the current lexicon a new synonym for the specified identifier.
 boolean addSynonym(Identifier newSynonym, Identifier newSynonymLanguage, Identifier identifier)
          Add a new synonym for the specified identifier, the new synonym is expressed in the specified newSynonymLanguage and identifier in the language of the current lexicon (or in the main lexicon if mixed language is allowed).
 void addSynonyms(java.lang.Object[] newSynonyms, Identifier identifier)
          Add new synonyms (the elements of the array newSynonyms) for the given identifier, both the identifiers in newSynonyms and identifier are specified in the language of the current lexicon.
 void addSynonyms(java.lang.Object[] newSynonyms, Identifier newSynonymsLanguage, Identifier identifier)
          Add new synonyms (the elements of the array newSynonyms) for the given identifier, identifier is specified in the language of the current lexicon and newSynonyms in newSynonymsLanguage.
 boolean areSynonyms(Identifier identifier1, Identifier identifier2)
          Check if the two specified identifiers are synonyms.
 boolean areSynonyms(Identifier identifier1, Identifier identifier2, Identifier identifier2Language)
          Check if the two specified identifiers are synonyms, the first is expressed in the current language and the second in the specified identifier2Language (or in the main language if mixed language is allowed).
 boolean canRemoveIdentifier(java.lang.Object identifier)
          The identifier can be removed from the current lexicon if it has synonyms in this lexicon or in other lexicons (in both cases, the CS associated to the identifier is still refeered by other identifiers).
 boolean canRemoveIdentifiers(CS cs)
          The identifiers associated to the CS cs in the current lexicon can be removed if cs has associated identifiers in other lexicons.
 void clear()
          Clear the content of the current lexicon, i.e. clear the two HashMaps that constitute the two views of the current lexicon.
 void finalize()
          Finalize will clear the current lexicon and remove it from the list of lexicons attached to the current ontology
 java.util.HashMap getAllIdentifiers(CS cs)
          Get for the specified CS cs all the identifiers in all the lexicons associated to the ontology of the current lexicon.
 java.util.HashMap getAllSynonyms(Identifier identifier)
          For the identifier contained in the current lexicon (or in the main lexicon if mixed language is allowed), get all the identifiers in all the lexicons associated to the ontology of the current lexicon.
 Type getConceptTypeCS(Identifier conceptTypeIdentifier)
          Given a concept type identifier, get the associated Type CS from the current lexicon or from the main Lexicon (if typeIdentifier is not found in the current lexicon and mixed language is allowed).
 CS getCS(Identifier identifier)
          Given an identifier, get the associated CS : get the CS (a Type or an Individual CS) for the given identifier in the current lexicon or in the main lexicon if the identifier is not found in the current lexicon and mixed language is allowed.
 CS getCS(Identifier identifier, boolean restricted)
           
 java.util.Enumeration getDirectSubTypes(Identifier typeIdentifier)
          Get from the current lexicon the identifiers of the direct subtypes of the given type identifier.
 java.util.Enumeration getDirectSuperTypes(Identifier typeIdentifier)
          Get from the current lexicon the direct super type identifiers of the given type identifier.
 Identifier getIdentifier(CS cs)
          Given a CS vs, get an associated identifier from the current lexicon.
 Identifier getIdentifier(java.lang.String name)
          Get from the current lexicon the identifier with the specified name.
 java.util.Enumeration getIdentifiers()
          Get an Enumeration over all the identifiers contained in the current lexicon.
 java.util.Enumeration getIdentifiers(CS cs)
          Given a CS cs, get an Enumeration over all the identifiers in the current lexicon (which are synonyms) that are associated to cs.
 java.util.Enumeration getIdentifiers(java.util.Enumeration css)
          A Mapping (or iterator) method that calls the method getIdentifier() on each element of the specified Enumeration of CS css : given an Enumeration of CS, return an Enumeration over an ArrayList of Identifier that will contain the first associated identifier in the current lexicon for each cs of css.
 Individual getIndividualCS(Identifier individualIdentifier)
          Given an individual identifier, get the associated Individual CS from the current lexicon or from the main Lexicon (if individualIdentifier is not found in the current lexicon and mixed language parameter is true).
 java.util.Enumeration getIndividualsOfType(Identifier typeIdentifier)
          Get from the current lexicon all the individual identifiers of the given type identifier.
 java.util.Set getKeySet()
           
 Identifier getLanguage()
          Get the language associated to the current lexicon.
 Identifier getMaxComSubType(Identifier typeIdentifier1, Identifier typeIdentifier2)
          Determine the maximal common subType identifier of the type with typeIdentifier1 and the type with typeIdentifier2, the three identifiers are contained in the current lexicon.
 Identifier getMinComSuperType(Identifier typeIdentifier1, Identifier typeIdentifier2)
          Determine the minimal common superType identifier of the type with typeIdentifier1 and the type with typeIdentifier2, the three identifiers are contained in the current lexicon.
 Ontology getOntology()
          Get the ontology associated to the current lexicon
 java.util.Set getRelationsSet()
           
 RelationType getRelationTypeCS(Identifier relationTypeIdentifier)
          Given a relation type identifier, get the associated RelationType CS from the current lexicon or from the main Lexicon (if typeIdentifier is not found in the current lexicon and mixed language is allowed).
 java.util.Enumeration getSubTypes(Identifier typeIdentifier)
          Get from the current lexicon all the subtypes identifiers of the given type identifier.
 java.util.Enumeration getSuperTypes(Identifier typeIdentifier)
          Get from the current lexicon all the super types identifiers of the given type identifier.
 java.util.Enumeration getSynonyms(Identifier identifier)
          Get from the current lexicon the synonyms of the specified identifier.
 java.util.Enumeration getSynonyms(Identifier identifier, Identifier synonymsLanguage)
          Given an identifier in the current lexicon (or in the main lexicon if mixed language is allowed), get its synonyms in the specified language.
 Type getTypeCS(Identifier typeIdentifier)
          Given a type identifier, get the associated Type CS from the current lexicon or from the main Lexicon (if typeIdentifier is not found in the current lexicon and mixed language is allowed).
 Identifier getTypeOfIndividual(Identifier individualIdentifier)
          Get from the current lexicon the type identifier of the given individual identifier.
 boolean isConceptTypeIdentifier(Identifier identifier)
          Check if the specified identifier is contained in the current lexicon as a concept type identifier, not as a relation type or an individual identifier.
 boolean isIdentifierKnown(Identifier identifier)
          Check if the specified identifier is contained in the current lexicon ;
 boolean isIdentifierKnown(java.lang.String name)
          Check if the specified name is the name of an identifier contained in the current lexicon.
 boolean isIndividualIdentifier(Identifier identifier)
          Check if the specified identifier is contained in the current lexicon as an individual identifier, not as a type identifier.
 boolean isIndividualOfType(Identifier individualIdentifier, Identifier typeIdentifier)
          Check in the current lexicon if the specified individual identifier is an individual of the type identifier.
 boolean isMainLexicon()
          Check if the current lexicon corresponds to the lexicon of the main language
 boolean isNewIdentifier(Identifier identifier)
          Check if the specified identifier is new (i.e. it is not contained) in the current lexicon.
 boolean isRelationTypeIdentifier(Identifier identifier)
          Check if the specified identifier is contained in the current lexicon as a relation type identifier, not as a concept type or an individual identifier.
 boolean isSubType(Identifier typeIdentifier1, Identifier typeIdentifier2)
          Check in the current lexicon if the type with typeIdentifier1 is equal or is a subtype of the type with typeIdentifier2.
 boolean isSuperType(Identifier typeIdentifier1, Identifier typeIdentifier2)
          Check in the current lexicon if the type with typeIdentifier1 is equal or is a superType of the type with typeIdentifier2.
 java.util.Enumeration linkAllConceptSubTypesToType(java.lang.Object[] subTypeIdentifiers, Identifier typeIdentifier)
          While the method linkSubTypesToType(subTypeIdentifiers, typeIdentifier) implements the flexible interpretation of the whole operation, this method implements the strict interpretation : each element in subTypeIdentifiers should be either a new identifier or an identifier known as a Type identifier (but not known as an Individual identifier).
 java.util.Enumeration linkAllIndividualsToType(java.lang.Object[] individualIdentifiers, Identifier typeIdentifier)
          While the method linkIndividualsToType(individualIdentifiers, typeIdentifier) implements the flexible interpretation of the whole operation, this method implements the strict interpretation : each element in individualIdentifiers should be either a new identifier or an identifier known as an individual identifier (but not known as a type identifier).
 java.util.Enumeration linkAllRelationSubTypesToType(java.lang.Object[] subTypeIdentifiers, Identifier typeIdentifier)
           
 java.util.Enumeration linkAllSubTypesToType(java.lang.Object[] subTypeIdentifiers, Identifier typeIdentifier)
          This method assumes that the specified typeIdentifier in already known, either as a concept type or as a relation type.
 java.util.Enumeration linkConceptSubTypesToType(java.lang.Object[] subTypeIdentifiers, Identifier typeIdentifier)
          Link the Type CS associated to typeIdentifier with the Type CS associated to each element (subTypeIdentifier) of subTypeIdentifiers.
 Type linkConceptSubTypeToType(Identifier subTypeIdentifier, Identifier typeIdentifier)
          This method is identical to linkTypeToSuperType()
 Type linkConceptTypeToSuperType(Identifier conceptTypeIdentifier, Identifier superTypeIdentifier)
          Link the Type CS associated to typeIdentifier with the Type CS associated to superTypeIdentifier, both are (supposed to be) contained in the current lexicon.
 java.util.Enumeration linkIndividualsToType(java.lang.Object[] individualIdentifiers, Identifier typeIdentifier)
          Link the Individual CS associated to each element (individualIdentifier) of the array individualIdentifiers to the Type CS associated to typeIdentifier.
 Individual linkIndividualToType(Identifier individualIdentifier, Identifier typeIdentifier)
          Link the Individual CS associated to the specified individualIdentifier with the Type CS associated to the specified typeIdentifier.
 java.util.Enumeration linkRelationSubTypesToType(java.lang.Object[] subTypeIdentifiers, Identifier typeIdentifier)
          Link the Type CS associated to typeIdentifier with the Type CS associated to each element (subTypeIdentifier) of subTypeIdentifiers.
 RelationType linkRelationSubTypeToType(Identifier subTypeIdentifier, Identifier typeIdentifier)
          This method is identical to linkRelationTypeToSuperType()
 RelationType linkRelationTypeToSuperType(Identifier relationTypeIdentifier, Identifier superTypeIdentifier)
          Link the RelationType CS associated to relationTypeIdentifier with the RelationType CS associated to superTypeIdentifier, both are (supposed to be) contained in the current lexicon.
 java.util.Enumeration linkSubTypesToType(java.lang.Object[] subTypeIdentifiers, Identifier typeIdentifier)
          This method assumes that the specified typeIdentifier is already known, either as a concept type or as a relation type.
 Type linkSubTypeToType(Identifier subTypeIdentifier, Identifier typeIdentifier)
          This method assumes that the specified superTypeIdentifier in already known, either as a concept type or as a relation type.
 Type linkTypeToAllSuperTypes(Identifier typeIdentifier, java.lang.Object[] superTypeIdentifiers)
          While the method linkTypeToSuperTypes(typeIdentifier, superTypeIdentifiers) implements the flexible interpretation of the whole operation, this method implements the strict interpretation : each element in superTypeIdentifiers should be either a new identifier or an identifier known as a Type identifier (but not known as an Individual identifier).
 Type linkTypeToSuperType(Identifier typeIdentifier, Identifier superTypeIdentifier)
          This method assumes that the specified superTypeIdentifier is already known, either as a concept type or as a relation type.
 Type linkTypeToSuperTypes(Identifier typeIdentifier, java.lang.Object[] superTypeIdentifiers)
          Link the Type CS associated to typeIdentifier to the Type CS associated to each element (superTypeIdentifier) of superTypeIdentifiers array, both typeIdentifier and elements of superTypeIdentifiers are (supposed to be) contained in the current lexicon.
 boolean removeAllEntries(CS cs)
          This remove method is equivalent to the method removeCS(cs) in the class Ontology.
 boolean removeEntries(CS cs)
          If the identifiers associated to the CS cs in the current lexicon can be removed then remove them : remove from the current lexicon all the entries that concern the specified cs; remove the entries for all the identifiers (which are synonyms) that are associated to cs in the current lexicon.
 void removeEntriesBis(CS cs)
          Remove from the current lexicon all the entries that concern the specified cs; remove the entries for all the identifiers (which are synonyms) that are associated to cs in the current lexicon.
 boolean removeEntry(java.lang.Object identifier)
          If the identifier can be removed from the current lexicon, then remove its entry.
 boolean removeLink(Identifier typeIdentifier, Identifier subTypeIdentifier)
          Remove a subType link between the Type with typeIdentifier and the subType with subTypeIdentifier.
 boolean replaceIdentifierName(Identifier identifier, java.lang.String newName)
          Replace the name of the specified identifier with newName if newName is not already a name of an identifier that is contained in the current lexicon.
 boolean replaceLanguageName(java.lang.String newName)
          Replace the name of the current lexicon language with the specified name if this later is not the name of a language that is already associated to the ontology of the current lexicon.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lexicon

public Lexicon(Identifier language,
               Ontology ontology)
        throws LexiconException
Construct a new (empty) lexicon for the specified new language and the specified ontology. If the language is not new in the specified ontology, the construction is aborted.

Parameters:
language - The identifier of the new language for which this lexicon is created
ontology - The ontology to which this language/lexicon will be associated
Throws:
LexiconException - if language already exists in the specified ontology.
Method Detail

clear

public void clear()
Clear the content of the current lexicon, i.e. clear the two HashMaps that constitute the two views of the current lexicon.


finalize

public void finalize()
Finalize will clear the current lexicon and remove it from the list of lexicons attached to the current ontology


getOntology

public Ontology getOntology()
Get the ontology associated to the current lexicon

Returns:
the ontology that is associated to the current lexicon.

getLanguage

public Identifier getLanguage()
Get the language associated to the current lexicon.

Returns:
the language associated to the current lexicon. The name of the language could be modified with the method replaceLanguageName().

replaceLanguageName

public boolean replaceLanguageName(java.lang.String newName)
Replace the name of the current lexicon language with the specified name if this later is not the name of a language that is already associated to the ontology of the current lexicon.

Parameters:
newName - The new name for the language associated to the current lexicon
Returns:
true if newName is not the name of a language that is already associated to the ontology of the current lexicon.

isMainLexicon

public boolean isMainLexicon()
Check if the current lexicon corresponds to the lexicon of the main language

Returns:
true if the current lexicon corresponds to the lexicon of the main language.

getCS

public CS getCS(Identifier identifier)
Given an identifier, get the associated CS : get the CS (a Type or an Individual CS) for the given identifier in the current lexicon or in the main lexicon if the identifier is not found in the current lexicon and mixed language is allowed.

Parameters:
identifier - An identifier of a concept type, a relation type or an individual
Returns:
the CS that is associated to the given identifier in the current lexicon (or in the main lexicon if mixed language is allowed). The returned CS is either a type (concept type or relation type) or an individual CS. The method returns null if identifier is null or unknown in the current lexicon (and in the main lexicon if mixed language is allowed).

getCS

public CS getCS(Identifier identifier,
                boolean restricted)

getIdentifier

public Identifier getIdentifier(CS cs)
Given a CS vs, get an associated identifier from the current lexicon. If the cs has no associated identifier in the current lexicon and mixed language is allowed, then the method looks for an identifier in the main lexicon. Of course, the cs should be either a Type or an Individual CS, but not a Situation CS.

Parameters:
cs - The CS for which an identifier is looked for in the current lexicon
Returns:
an identifier in the current lexicon for the specified cs (or in the main lexicon if mixed language is allowed). The method returns null if cs is null or is a situation CS, or if cs hasn't a synonym in the current lexicon (neither in the main lexicon if mixed language is allowed).

getIdentifiers

public java.util.Enumeration getIdentifiers()
Get an Enumeration over all the identifiers contained in the current lexicon.

Returns:
an Enumeration over all the identifiers contained in the current lexicon

getKeySet

public java.util.Set getKeySet()

getRelationsSet

public java.util.Set getRelationsSet()

getIdentifiers

public java.util.Enumeration getIdentifiers(CS cs)
Given a CS cs, get an Enumeration over all the identifiers in the current lexicon (which are synonyms) that are associated to cs.

Parameters:
cs - The CS for which all the associated identifiers in the current lexicon are looked for. cs should be a type or an individual CS (not a situation CS).
Returns:
an Enumeration over all the identifiers in the current lexicon that are associated to cs. Returns null if cs is null or a situation, or if cs has no associated identifiers in the current lexicon.

getAllIdentifiers

public java.util.HashMap getAllIdentifiers(CS cs)
Get for the specified CS cs all the identifiers in all the lexicons associated to the ontology of the current lexicon. The method returns a HashMap, an entry for each lexicon, the key of an entry is the lexicon's language and the associated value the Enumeration over the Identifiers that are associated to cs in that lexicon or null if cs has no associated identifiers in that lexicon.

Parameters:
cs - A CS for which all the identifiers in all the lexicons are looked for
Returns:
a HashMap that specifies for each lexicon associated to the current ontology its language (as the key) and an Enumeration over all the identifiers for cs in that lexicon. If cs has no associated identifiers in a lexicon, a null value will be associated to its language in the returned HashMap. Returns null if cs is null or if cs is a situation CS.

addEntry

public boolean addEntry(java.lang.Object newIdentifier,
                        CS cs)
Add a new entry to the current lexicon for the specified new identifier and its associated CS cs. However, if identifier is already associated in the current lexicon to cs or to another CS, then it is not added and false is returned.

Parameters:
newIdentifier - A new identifier to add to the current lexicon with the associated cs
cs - The CS for which newIdentifier is added to the current lexicon.
Returns:
true if newIdentifier and cs are not null and if newIdentifier was not contained in the current lexicon.

addEntries

public void addEntries(java.lang.Object[] newIdentifiers,
                       CS cs)
Add new entries to the current lexicon for each element of newIdentifiers with cs as the associated CS. The elements in newIdentifiers are synonyms in the current lexicon. If an element of newIdentifiers is already contained in the current lexicon, it is not added again and the operation continue for the other elements. A strict interpretation of this method is implemented in addAllEntries(newIdentifiers, cs) where the operation is done only if all the identifiers are new.

Parameters:
newIdentifiers - An array of Identifier that represent new identifiers in the current lexicon to associate with cs
cs - A CS to associate with elements of newIdentifiers in the current lexicon.

addAllEntries

public boolean addAllEntries(java.lang.Object[] newIdentifiers,
                             CS cs)
This method adopts a strict interpretation of the method addEntries() : new entries will be added to the current lexicon only if all the identifiers in newIdentifiers are really new identifiers. A flexible interpretation of this method is implemented in addEntries() where only the new identifiers in newIdentifiers are considered, the others are ignored.

Parameters:
newIdentifiers - An array of Identifier that should represent new identifiers in the current lexicon to associate with cs
cs - The CS to associate with the elements of newIdentifiers in the current lexicon.
Returns:
true if cs and newIdentifiers are not null and all the identifiers in newIdentifiers are new.

canRemoveIdentifier

public boolean canRemoveIdentifier(java.lang.Object identifier)
The identifier can be removed from the current lexicon if it has synonyms in this lexicon or in other lexicons (in both cases, the CS associated to the identifier is still refeered by other identifiers). Otherwise, the identifier is the only reference to the associated CS and its remove from the lexicon will render the CS without any reference (at the lexical level). In this case the remove of the identifier will involve the remove of the CS and this is possible only if the CS is not the root neither the relation root and CS has no children; the CS has no children that depend on it. Otherwise, the identifier and the associated CS can not be removed.

Parameters:
identifier - An identifier to remove from the current lexicon
Returns:
true if the identifier can be removed from the current lexicon. Returns false if it can not be removed or if identifier is null or not contained in the current lexicon.

removeEntry

public boolean removeEntry(java.lang.Object identifier)
If the identifier can be removed from the current lexicon, then remove its entry. If identifier is the only reference (at the lexical level) to its associated cs, then the remove of the identifier will involve also the remove (but not the destruction) of the cs from the ontology.

Parameters:
identifier - An identifier to remove from the current lexicon. identifier could be a concept type, a relation type or an individual identifier.
Returns:
true if identifier can be removed from the current lexicon.

canRemoveIdentifiers

public boolean canRemoveIdentifiers(CS cs)
The identifiers associated to the CS cs in the current lexicon can be removed if cs has associated identifiers in other lexicons. Otherwise, the identifiers are the only reference to the associated CS and their remove from the current lexicon will render the CS without any reference (at the lexical level). In this case the remove of the identifiers will involve the remove of the CS and this is possible only if the CS is not the root neither the relation root and the CS has no children; the CS has no children that depend on it. Otherwise, the identifiers and the associated CS can not be removed.

Parameters:
cs - The CS to which the identifiers in the current lexicon are associated
Returns:
true if the identifiers associated to cs can be removed from the current lexicon.

removeEntries

public boolean removeEntries(CS cs)
If the identifiers associated to the CS cs in the current lexicon can be removed then remove them : remove from the current lexicon all the entries that concern the specified cs; remove the entries for all the identifiers (which are synonyms) that are associated to cs in the current lexicon. If the removed identifiers are the only references (at the lexical level) to the associated cs, then their remove will involve also the remove (but not the destruction) of the cs from the ontology.

Parameters:
cs - A CS for which all the associated identifiers in the current lexicon are removed. cs should not be null and should be either a type or an individual CS (not a situation).
Returns:
true if the identifiers associated to the CS cs in the current lexicon can be removed.

removeEntriesBis

public void removeEntriesBis(CS cs)
Remove from the current lexicon all the entries that concern the specified cs; remove the entries for all the identifiers (which are synonyms) that are associated to cs in the current lexicon. This method is called by the method removeEntries(CS cs) defined in this class and by the method removeCS(cs) defined in the class Ontology. To remove all the identifiers that are associated to a CS in the current lexicon, it is safe to use the method removeEntries(cs) instead of this removeEntriesBis(cs).

Parameters:
cs - The CS for which all the associated identifiers in the current lexicon are removed.

removeAllEntries

public boolean removeAllEntries(CS cs)
This remove method is equivalent to the method removeCS(cs) in the class Ontology. In fact, the current method is a simple call to the method removeCS(cs). The method checks first that the given cs is neither the main root nor the relation root and that cs can be removed (cs should not have children). Remove cs corresponds first to remove all links that relate cs as a child to its fathers. The cs is thus detached from all the other CSs that were connected to it but cs itself is not destroyed. Second, the method will remove all the entries in all the lexicons associated to the current ontology for all the identifiers associated to the specified cs.

Parameters:
cs - A CS for which all the associated identifiers in all the lexicons are removed. The cs itself is removed (but not destroyed) from the ontology.
Returns:
true if cs can be removed.

getIdentifiers

public java.util.Enumeration getIdentifiers(java.util.Enumeration css)
A Mapping (or iterator) method that calls the method getIdentifier() on each element of the specified Enumeration of CS css : given an Enumeration of CS, return an Enumeration over an ArrayList of Identifier that will contain the first associated identifier in the current lexicon for each cs of css. It returns null value for an element cs of css if cs is a situation or if no identifier is associated to cs in the current lexicon (and in the main lexicon if mixed language is allowed).

Parameters:
css - An Enumeration over An arrayList of CSs (Type or Individual CSs)
Returns:
an Enumeration over an ArrayList of Identifiers that correspond to the identifiers, in the current lexicon (or in the main lexicon), of the CSs specified in css. Returns null if css is null or empty. If one element cs of css is a situation or if cs is unknown in the current lexicon (and also in the main lexicon if mixed language is allowed), then null value is inserted in the returned Enumeration for that element cs.

getTypeCS

public Type getTypeCS(Identifier typeIdentifier)
Given a type identifier, get the associated Type CS from the current lexicon or from the main Lexicon (if typeIdentifier is not found in the current lexicon and mixed language is allowed). This method specializes the method getCS(); it checks that typeIdentifier is indeed a type identifier (not an individual identifier) and return the associated Type CS.

Parameters:
typeIdentifier - A type identifier (of a concept type or of a relation type).
Returns:
the type CS associated to typeIdentifier if this later is not null and typeIdentifier is indeed an identifier of a type contained in the current lexicon (or in the main lexicon if mixed language is allowed).

getConceptTypeCS

public Type getConceptTypeCS(Identifier conceptTypeIdentifier)
Given a concept type identifier, get the associated Type CS from the current lexicon or from the main Lexicon (if typeIdentifier is not found in the current lexicon and mixed language is allowed). This method specializes the method getCS(); it checks that typeIdentifier is indeed a concept type identifier (not an individual identifier or a relation type identifier) and return the associated Type CS.

Parameters:
conceptTypeIdentifier - A concept type identifier.
Returns:
the type CS associated to typeIdentifier if this later is not null and typeIdentifier is indeed an identifier of a concept type contained in the current lexicon (or in the main lexicon if mixed language is allowed).

getRelationTypeCS

public RelationType getRelationTypeCS(Identifier relationTypeIdentifier)
Given a relation type identifier, get the associated RelationType CS from the current lexicon or from the main Lexicon (if typeIdentifier is not found in the current lexicon and mixed language is allowed). This method specializes the method getCS(); it checks that typeIdentifier is indeed a relation type identifier (not an individual identifier or a concept type identifier) and return the associated Type CS.

Parameters:
relationTypeIdentifier - A relation type identifier.
Returns:
the type CS associated to typeIdentifier if this later is not null and typeIdentifier is indeed an identifier of a type contained in the current lexicon (or in the main lexicon if mixed language is allowed).

addConceptTypeEntry

public boolean addConceptTypeEntry(Identifier newConceptTypeIdentifier,
                                   Type typeCS)
Add a new entry to the current lexicon for a new concept type identifier and its associated Type CS. If however newConceptTypeIdentifier already exists in the current lexicon, then nothing is done.

Parameters:
newConceptTypeIdentifier - The new type identifier to add with its Type CS typeCS
typeCS - The Type CS for newConceptTypeIdentifier
Returns:
true if newTypeIdentifier is not null and it is not contained in the current lexicon (before this add method).

addConceptTypeEntry

public Type addConceptTypeEntry(Identifier newTypeIdentifier)
Add to the current lexicon a new entry for the new concept type identifier. An 'empty' Type CS (a CS without definition or canon) is created and associated to newConceptTypeIdentifier in the current lexicon. If however newTypeIdentifier already exists in the current lexicon then nothing is done. Later, the user can set a definition or a canon for the CS associated to newConceptTypeIdentifier.

Returns:
the type CS created and associated to newConceptTypeIdentifier, or return null if newConceptTypeIdentifier is null or it is already contained in the current lexicon.

addRelationTypeEntry

public boolean addRelationTypeEntry(Identifier newRelationTypeIdentifier,
                                    RelationType typeCS)
Add a new entry to the current lexicon for a new relation type identifier and its associated RelationType CS. If however newRelationTypeIdentifier already exists in the current lexicon, then nothing is done.

Parameters:
newRelationTypeIdentifier - The new relation type identifier to add with its RelationType CS
typeCS - The RelationType CS for newRelationTypeIdentifier
Returns:
true if newRelationTypeIdentifier is not null and it is not contained in the current lexicon (before this add method).

addRelationTypeEntry

public RelationType addRelationTypeEntry(Identifier newRelationTypeIdentifier)
Add to the current lexicon a new entry for the new concept type identifier. An 'empty' Type CS (a CS without definition or canon) is created and associated to newConceptTypeIdentifier in the current lexicon. If however newTypeIdentifier already exists in the current lexicon then nothing is done. Later, the user can set a definition or a canon for the CS associated to newConceptTypeIdentifier.

Returns:
the type CS created and associated to newConceptTypeIdentifier, or return null if newRelationTypeIdentifier is null or it is already contained in the current lexicon.

getIndividualCS

public Individual getIndividualCS(Identifier individualIdentifier)
Given an individual identifier, get the associated Individual CS from the current lexicon or from the main Lexicon (if individualIdentifier is not found in the current lexicon and mixed language parameter is true). This method specializes the method getCS(), it checks that individualIdentifier is indeed an individual identifier (and not a type identifier) and return the associated Individual CS.

Parameters:
individualIdentifier - An individual identifier
Returns:
the Individual CS that is associated to individualIdentifier in the current lexicon. Returns null if cs is null or individualIdentifier is not an individual identifier in the current lexicon (neither in the main lexicon if mixed language is allowed).

addIndividualEntry

public boolean addIndividualEntry(Identifier newIndividualIdentifier,
                                  Individual individualCS)
Add to the current lexicon a new entry for the new individual identifier and its Individual CS. If however newIndividualIdentifier already exists in the current lexicon, then nothing is done.

Parameters:
newIndividualIdentifier - The new individual identifier to add to the current lexicon
individualCS - The individual CS to associate to newIndividualIdentifier
Returns:
return true if newIndividualIdentifier is not null and it is not already contained in the currrent lexicon.

addIndividualEntry

public Individual addIndividualEntry(Identifier newIndividualIdentifier)
Add to the current lexicon a new entry for the new individual identifier. An 'empty' Individual CS (a CS without description) is created and associated to newIndividualIdentifier in the current lexicon. However, if newIndividualIdentifier is already contained in the current lexicon, then nothing is done.

Parameters:
newIndividualIdentifier - A new individual identifier to add to the current lexicon
Returns:
the individual CS created and associated to newIndividualIdentifier, or return null if newIndividualIdentifier is null or it is already contained in the current lexicon.

addIndividualEntry

public Individual addIndividualEntry(Identifier typeIdentifier,
                                     Identifier newIndividualIdentifier)
Add to the current lexicon a new entry for the new individual identifier with the specified typeIdentifier. An 'empty' Individual CS (a CS without description) is created and associated to newIndividualIdentifier in the current lexicon. However, if newIndividualIdentifier is already contained in the current lexicon, then nothing is done.

Parameters:
typeIdentifier - The type of the identifier
newIndividualIdentifier - A new individual identifier to add to the current lexicon
Returns:
the individual CS created and associated to newIndividualIdentifier, or return null if newIndividualIdentifier is null, if typeIdentifier is not a concept type, or if newIndividualIdentifier is already contained in the current lexicon.

isNewIdentifier

public boolean isNewIdentifier(Identifier identifier)
Check if the specified identifier is new (i.e. it is not contained) in the current lexicon. This method is basically the negation of the method isIdentifierKnown(identifier).

Parameters:
identifier - An identifier of a concept type, a relation type or an individual
Returns:
true if the given identifier is not null and it is an identifier that is not contained in the current lexicon.

isIdentifierKnown

public boolean isIdentifierKnown(Identifier identifier)
Check if the specified identifier is contained in the current lexicon ;

Parameters:
identifier - An identifier of a concept type, a relation type or an individual
Returns:
true if the given identifier is not null and it is an identifier that is contained in the current lexicon.

isIdentifierKnown

public boolean isIdentifierKnown(java.lang.String name)
Check if the specified name is the name of an identifier contained in the current lexicon.

Parameters:
name - A name of an identifier of a concept type, a relation type or an individual.
Returns:
true if the given name is not null and it is the name of an identifier that is contained in the current lexicon.

isConceptTypeIdentifier

public boolean isConceptTypeIdentifier(Identifier identifier)
Check if the specified identifier is contained in the current lexicon as a concept type identifier, not as a relation type or an individual identifier.

Returns:
true if identifier is contained in the current lexicon as a concept type identifier

isRelationTypeIdentifier

public boolean isRelationTypeIdentifier(Identifier identifier)
Check if the specified identifier is contained in the current lexicon as a relation type identifier, not as a concept type or an individual identifier.

Returns:
true if identifier is contained in the current lexicon as a relation type identifier

isIndividualIdentifier

public boolean isIndividualIdentifier(Identifier identifier)
Check if the specified identifier is contained in the current lexicon as an individual identifier, not as a type identifier.

Returns:
true if identifier is contained in the current lexicon as an individual identifier

getIdentifier

public Identifier getIdentifier(java.lang.String name)
Get from the current lexicon the identifier with the specified name.

Parameters:
name - A name of an identifier
Returns:
the identifier with the specified name. Return null if name is null or if no identifier with the specified name exists in the current lexicon.

replaceIdentifierName

public boolean replaceIdentifierName(Identifier identifier,
                                     java.lang.String newName)
Replace the name of the specified identifier with newName if newName is not already a name of an identifier that is contained in the current lexicon.

Parameters:
identifier - The identifier to replace its name with newName
newName - The new name for the specified identifier
Returns:
true if both identifier and newName are not null and if identifier is contained in the current lexicon but no identifier exists with the name newName.

getSynonyms

public java.util.Enumeration getSynonyms(Identifier identifier)
Get from the current lexicon the synonyms of the specified identifier.

Parameters:
identifier - An identifier for which the synonyms are looked for in the current lexicon
Returns:
an Enumeration over an ArrayList of synonyms for the specified identifier from the current lexicon, or return null if identifier is null or it is not contained in the current lexicon (neither in the main lexicon if mixed language is allowed) or it has no synonyms in the current lexicon.

getSynonyms

public java.util.Enumeration getSynonyms(Identifier identifier,
                                         Identifier synonymsLanguage)
Given an identifier in the current lexicon (or in the main lexicon if mixed language is allowed), get its synonyms in the specified language.

Parameters:
identifier - An identifier for which the synonyms are looked for in the lexicon of synonymsLanguage
synonymsLanguage - The language for the synonyms
Returns:
an Enumeration over an ArrayList of synonyms in synonymsLanguage for the specified identifier, or return null if one of the parameter is null or if identifier is not contained in the current lexicon (neither in the main lexicon if mixed language is allowed) or no synonyms are found for identifier in the lexicon of synonymsLanguage.

getAllSynonyms

public java.util.HashMap getAllSynonyms(Identifier identifier)
For the identifier contained in the current lexicon (or in the main lexicon if mixed language is allowed), get all the identifiers in all the lexicons associated to the ontology of the current lexicon. The method returns a HashMap, an entry for each lexicon, the key of an entry is a lexicon's language and the associated value an Enumeration over an ArrayList of Identifiers or null if identifier has no synonyms in this lexicon.

Parameters:
identifier - An identifier in the current lexicon for which all the synonyms are looked for
Returns:
a HashMap that specifies for each lexicon associated to the current ontology its language (as the key) and all the synonyms (an Enumeration over an ArrayList of Identifier) for identifier. If identifier has no synonyms in a lexicon, a null value will be associated to its language in the returned HashMap. Return null if identifier is null or if identifier is not contained in the current lexicon (neither in the main lexicon if mixed language is allowed).

areSynonyms

public boolean areSynonyms(Identifier identifier1,
                           Identifier identifier2)
Check if the two specified identifiers are synonyms.

Parameters:
identifier1 - An identifier
identifier2 - An identifier
Returns:
true if the two identifiers are equals or synonyms.

areSynonyms

public boolean areSynonyms(Identifier identifier1,
                           Identifier identifier2,
                           Identifier identifier2Language)
Check if the two specified identifiers are synonyms, the first is expressed in the current language and the second in the specified identifier2Language (or in the main language if mixed language is allowed).

Parameters:
identifier1 - An identifier in the current lexicon
identifier2 - An identifier in the lexicon of identifier2Language
identifier2Language - The language in which identifier2 is expressed
Returns:
true if the two identifiers are not null and are synonyms.

addSynonym

public boolean addSynonym(Identifier newSynonym,
                          Identifier identifier)
Add in the current lexicon a new synonym for the specified identifier. identifier should be contained in the current lexicon (or in the main lexicon if mixed language is allowed) but not the new synonym.

Parameters:
newSynonym - A new synonym for identifier in the current lexicon
identifier - An identifier contained in the current lexicon
Returns:
true if the two parameters are not null, if identifier is known in the current lexicon (or in the main lexicon if mixed language is allowed) but not newSynonym.

addSynonym

public boolean addSynonym(Identifier newSynonym,
                          Identifier newSynonymLanguage,
                          Identifier identifier)
Add a new synonym for the specified identifier, the new synonym is expressed in the specified newSynonymLanguage and identifier in the language of the current lexicon (or in the main lexicon if mixed language is allowed). The parameter identifier should be contained in the current lexicon (or in the main lexicon if mixed language is allowed) and the new synonym should not be contained in the lexicon of newSynonymLanguage. If newSynonymLanguage is not a language already associated to the current ontology, then a new lexicon is created for this new language and this new couple is associated to the current ontology.

Parameters:
newSynonym - A new synonym in newSynonymLanguage for identifier
newSynonymLanguage - The language where newSynonym is expressed.
identifier - An identifier contained in the current lexicon for which newSynonym is given
Returns:
true if the parameters are not null, if identifier is known in the current lexicon (or in the main lexicon if mixed language is allowed) but newSynonym is not contained in the lexicon of newSynonymLanguage.

addSynonyms

public void addSynonyms(java.lang.Object[] newSynonyms,
                        Identifier identifier)
Add new synonyms (the elements of the array newSynonyms) for the given identifier, both the identifiers in newSynonyms and identifier are specified in the language of the current lexicon. If identifier is not contained in the current lexicon (or in the main lexicon if mixed language is allowed), nothing is done. However, if an element of newSynonyms is not new, then nothing is done for this element but the addition of the other synonyms is considered. A strict interpretation of this method is implemented by the method addAllSynonyms().

Parameters:
newSynonyms - An array of Identifier, the new synonyms for identifier in the current lexicon
identifier - An identifier in the current lexicon for which newSynonyms are given.

addSynonyms

public void addSynonyms(java.lang.Object[] newSynonyms,
                        Identifier newSynonymsLanguage,
                        Identifier identifier)
Add new synonyms (the elements of the array newSynonyms) for the given identifier, identifier is specified in the language of the current lexicon and newSynonyms in newSynonymsLanguage. If identifier is not contained in the current lexicon (or in the main lexicon if mixed language is allowed), no addition is done. However, if an element of newSynonyms is not new then nothing is done for this element but the addition of the other newSynonyms will be considered. A strict interpretation of this method is implemented by the method addAllSynonyms(). If newSynonymsLanguage is not a language already associated to the current ontology, then a new lexicon is created for it and this new couple is associated to the current ontology.

Parameters:
newSynonyms - An array of Identifier, the new synonyms in newSynonymsLanguage for identifier
newSynonymsLanguage - The language in which newSynonyms are expressed
identifier - An identifier in the current lexicon for which newSynonyms are given.

addAllSynonyms

public boolean addAllSynonyms(java.lang.Object[] newSynonyms,
                              Identifier identifier)
This method adopts a strict interpretation of the method addSynonyms() : new entries will be added to the current lexicon only if all the identifiers in newSynonyms are really new identifiers in the current lexicon. A flexible interpretation of this method is implemented by the method addSynonyms().

Parameters:
newSynonyms - An array of Identifier, the new synonyms for identifier in the current lexicon
identifier - An identifier in the current lexicon for which newSynonyms are given.
Returns:
true if newSynonyms and identifier are not null and all the identifiers in newSynonyms are new.

addAllSynonyms

public boolean addAllSynonyms(java.lang.Object[] newSynonyms,
                              Identifier newSynonymsLanguage,
                              Identifier identifier)
This method adopts a strict interpretation of the method addSynonyms() : new entries will be added to the current lexicon only if all the identifiers in newSynonyms are actually new identifiers in the lexicon of newSynonymsLanguage. If newSynonymsLanguage is not a language already associated to the current ontology, then a new lexicon is created for it and this new couple is associated to the current ontology. A flexible interpretation of this method is implemented by the method addSynonyms().

Parameters:
newSynonyms - An array of Identifier, the new synonyms in newSynonymsLanguage for identifier
newSynonymsLanguage - The language in which newSynonyms are expressed
identifier - An identifier in the current lexicon for which newSynonyms are given.
Returns:
true if newSynonyms and identifier are not null and all the identifiers in newSynonyms are new.

linkIndividualToType

public Individual linkIndividualToType(Identifier individualIdentifier,
                                       Identifier typeIdentifier)
Link the Individual CS associated to the specified individualIdentifier with the Type CS associated to the specified typeIdentifier. If individualIdentifier or typeIdentifier is new (not contained in the current lexicon) then a new (and empty) CS is created and associated to it. The link will not be added if individualIdentifier already exists in the current lexicon as a type identifier or if typeIdentifier already exists as an individual identifier. Also, the link will not be added if it already exists between the two CS of individualIdentifier and typeIdentifier.

Parameters:
individualIdentifier - An identifier for an individual of typeIdentifier
typeIdentifier - The identifier for the type of individualIdentifier
Returns:
the Individual CS associated to individualIdentifier. Return null if one of the parameter is null, or if individualIdentifier already exists in the current lexicon as a type identifier or if typeIdentifier already exists as an individual identifier.

linkIndividualsToType

public java.util.Enumeration linkIndividualsToType(java.lang.Object[] individualIdentifiers,
                                                   Identifier typeIdentifier)
Link the Individual CS associated to each element (individualIdentifier) of the array individualIdentifiers to the Type CS associated to typeIdentifier. If an individualIdentifier or typeIdentifier is new (not contained in the current lexicon), then a new (and empty) CS is created and associated to it. If typeIdentifier is contained in the current lexicon as an individual identifier, nothing is done and the method returns null. A link will not be added if an individualIdentifier already exists in the current lexicon as a type identifier or if the link already exists between the CS of an individualIdentifier and the CS of typeIdentifier. This method adopts a flexible interpretation of the whole operation : if an individualIdentifier turns to be a type identifier it is ignored and the operation considers the remaining identifiers. A strict interpretation of the same operation is implemented by the method linkAllIndividualsToType().

Parameters:
individualIdentifiers - An array of identifiers for individuals of typeIdentifier
typeIdentifier - The identifier for the type of individualIdentifiers
Returns:
an Enumeration over an ArrayList of Individual CS associated to individualIdentifiers. If an individualIdentifier already exists as a type identifier, then null is inserted in the returned enumeration for this identifier. If one of the parameter is null or if typeIdentifier already exists as an individual identifier, then return null.

linkAllIndividualsToType

public java.util.Enumeration linkAllIndividualsToType(java.lang.Object[] individualIdentifiers,
                                                      Identifier typeIdentifier)
While the method linkIndividualsToType(individualIdentifiers, typeIdentifier) implements the flexible interpretation of the whole operation, this method implements the strict interpretation : each element in individualIdentifiers should be either a new identifier or an identifier known as an individual identifier (but not known as a type identifier). If this constraint holds, the present method behaves like the method linkIndividualsToType(individualIdentifiers, typeIdentifier), else nothing is done and the method returns null.

Parameters:
individualIdentifiers - An array of identifiers for individuals of typeIdentifier. If an element in individualIdentifiers already exists as a type identifier then the method will return null.
typeIdentifier - The identifier for the type of individualIdentifiers
Returns:
an Enumeration over an ArrayList of Individuals CS associated to individualIdentifiers. If one of the parameter is null or if typeIdentifier already exists in the current lexicon as an individual identifier or if an element in individualIdentifiers already exists as a type identifier then return null.

linkConceptTypeToSuperType

public Type linkConceptTypeToSuperType(Identifier conceptTypeIdentifier,
                                       Identifier superTypeIdentifier)
Link the Type CS associated to typeIdentifier with the Type CS associated to superTypeIdentifier, both are (supposed to be) contained in the current lexicon. If typeIdentifier or superTypeIdentifier is new (not contained in the current lexicon), then a new (and empty) Type CS is created and associated to it. Specifically, the method will get the type CS of the type identifier or will create a new Type CS if the type identifier is new and in this case it will add a new entry in the current lexicon for typeIdentifier and its new Type CS. The same is done for superTypeIdentifier. Then it will link the two CSs (if they are not already linked).

Parameters:
superTypeIdentifier - The supertype identifier. If it is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null.
Returns:
the Type CS associated to typeIdentifier. Return null if one of the parameters is null or if typeIdentifier or superTypeIdentifier already exist in the current lexicon as an individual identifier.

linkRelationTypeToSuperType

public RelationType linkRelationTypeToSuperType(Identifier relationTypeIdentifier,
                                                Identifier superTypeIdentifier)
Link the RelationType CS associated to relationTypeIdentifier with the RelationType CS associated to superTypeIdentifier, both are (supposed to be) contained in the current lexicon. If relationTypeIdentifier or superTypeIdentifier is new (not contained in the current lexicon), then a new (and empty) RelationType CS is created and associated to it. Specifically, the method will get the RelationType CS of the relation type identifier or will create a new RelationType CS if the relation type identifier is new and in this case it will add a new entry in the current lexicon for relationTypeIdentifier and its new RelationType CS. The same is done for superTypeIdentifier. Then it will link the two CSs (if they are not already linked).

Parameters:
relationTypeIdentifier - A relation type identifier. If it is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null.
superTypeIdentifier - The supertype identifier. If it is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null.
Returns:
the RelationType CS associated to relationTypeIdentifier. Return null if one of the parameter is null or if relationTypeIdentifier or superTypeIdentifier already exist in the current lexicon as an individual identifier.

linkTypeToSuperType

public Type linkTypeToSuperType(Identifier typeIdentifier,
                                Identifier superTypeIdentifier)
This method assumes that the specified superTypeIdentifier is already known, either as a concept type or as a relation type.

Parameters:
typeIdentifier - A Type Identifier
superTypeIdentifier - The superType identifier
Returns:
the Type CS associated to typeIdentifier. Return null if superTypeIdentifier is an unknown identifier.

linkTypeToSuperTypes

public Type linkTypeToSuperTypes(Identifier typeIdentifier,
                                 java.lang.Object[] superTypeIdentifiers)
Link the Type CS associated to typeIdentifier to the Type CS associated to each element (superTypeIdentifier) of superTypeIdentifiers array, both typeIdentifier and elements of superTypeIdentifiers are (supposed to be) contained in the current lexicon. If typeIdentifier or a superTypeIdentifier is new (not contained in the current lexicon), then a new (and empty) Type CS is created and associated to it in the current lexicon. If typeIdentifier is known in the current lexicon as an individual identifier, nothing is done and the method returns null. A link will not be added if a superTypeIdentifier already exists in the current lexicon as an Individual identifier or if the link already exists between the CS of the superTypeIdentifier and the CS of typeIdentifier. This method adopts a flexible interpretation of the whole operation. A strict interpretation of the same operation is implemented in the method linkTypeToAllSuperTypes().

Parameters:
typeIdentifier - The type identifier. If this identifier is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null
superTypeIdentifiers - An array of identifiers for superTypes of typeIdentifier
Returns:
the Type CS associated to typeIdentifier. Return null if one of the parameters is null or if typeIdentifier already exists as an individual identifier.

linkTypeToAllSuperTypes

public Type linkTypeToAllSuperTypes(Identifier typeIdentifier,
                                    java.lang.Object[] superTypeIdentifiers)
While the method linkTypeToSuperTypes(typeIdentifier, superTypeIdentifiers) implements the flexible interpretation of the whole operation, this method implements the strict interpretation : each element in superTypeIdentifiers should be either a new identifier or an identifier known as a Type identifier (but not known as an Individual identifier). If this constraint holds, the present method behaves like the method linkTypeToSuperTypes(typeIdentifier, superTypeIdentifiers), else nothing is done and the method returns null.

Parameters:
typeIdentifier - The type identifier. If this identifier is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null
superTypeIdentifiers - An array of identifiers for superTypes of typeIdentifier.
Returns:
the Type CS associated to typeIdentifier. Return null if one of the parameter is null or if typeIdentifier already exists as an individual identifier, or if an element in superTypeIdentifiers already exists as an Individual identifier.

linkConceptSubTypesToType

public java.util.Enumeration linkConceptSubTypesToType(java.lang.Object[] subTypeIdentifiers,
                                                       Identifier typeIdentifier)
Link the Type CS associated to typeIdentifier with the Type CS associated to each element (subTypeIdentifier) of subTypeIdentifiers. If typeIdentifier or a subTypeIdentifier is new (not contained in the current lexicon), then a new (and empty) Type CS is created and associated to it in the current lexicon. If typeIdentifier is known in the current lexicon as an individual identifier, nothing is done and the method returns null. A link will not be added if a subTypeIdentifier already exists in the current lexicon as an Individual identifier or if the link exists already between the CS of the subTypeIdentifier and the CS of typeIdentifier. This method adopts a flexible interpretation of the whole operation. A strict interpretation of the same operation is implemented in the method linkAllSubTypesToType().

Parameters:
subTypeIdentifiers - An array of identifiers for subTypes of typeIdentifier
typeIdentifier - The type identifier. If this identifier is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null
Returns:
an Enumeration over an ArrayList of Type CSs associated to the specified subTypeIdentifiers. If a subTypeIdentifier already exists as an individual identifier, then null is inserted in the returned enumeration for this identifier. Return null if one of the parameter is null or if typeIdentifier already exists as an individual identifier.

linkRelationSubTypesToType

public java.util.Enumeration linkRelationSubTypesToType(java.lang.Object[] subTypeIdentifiers,
                                                        Identifier typeIdentifier)
Link the Type CS associated to typeIdentifier with the Type CS associated to each element (subTypeIdentifier) of subTypeIdentifiers. If typeIdentifier or a subTypeIdentifier is new (not contained in the current lexicon), then a new (and empty) Type CS is created and associated to it in the current lexicon. If typeIdentifier is known in the current lexicon as an individual identifier, nothing is done and the method returns null. A link will not be added if a subTypeIdentifier already exists in the current lexicon as an Individual identifier or if the link exists already between the CS of the subTypeIdentifier and the CS of typeIdentifier. This method adopts a flexible interpretation of the whole operation. A strict interpretation of the same operation is implemented in the method linkAllSubTypesToType().

Parameters:
subTypeIdentifiers - An array of identifiers for subTypes of typeIdentifier
typeIdentifier - The type identifier. If this identifier is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null
Returns:
an Enumeration over an ArrayList of Type CSs associated to the specified subTypeIdentifiers. If a subTypeIdentifier already exists as an individual identifier, then null is inserted in the returned enumeration for this identifier. Return null if one of the parameter is null or if typeIdentifier already exists as an individual identifier.

linkSubTypeToType

public Type linkSubTypeToType(Identifier subTypeIdentifier,
                              Identifier typeIdentifier)
This method assumes that the specified superTypeIdentifier in already known, either as a concept type or as a relation type.

Parameters:
subTypeIdentifier - A Type identifier
typeIdentifier - A Type identifier
Returns:
the Type CS for subTypeIdentifier. Return null if typeIdentifier is unknown.

linkSubTypesToType

public java.util.Enumeration linkSubTypesToType(java.lang.Object[] subTypeIdentifiers,
                                                Identifier typeIdentifier)
This method assumes that the specified typeIdentifier is already known, either as a concept type or as a relation type.

Parameters:
subTypeIdentifiers - An array of Identifier
typeIdentifier - A Type identifier
Returns:
an Enumeration of Type CS for the identifiers in the array subTypeIdentifiers. Return null if typeIdentifier is an unknown identifier.

linkAllConceptSubTypesToType

public java.util.Enumeration linkAllConceptSubTypesToType(java.lang.Object[] subTypeIdentifiers,
                                                          Identifier typeIdentifier)
While the method linkSubTypesToType(subTypeIdentifiers, typeIdentifier) implements the flexible interpretation of the whole operation, this method implements the strict interpretation : each element in subTypeIdentifiers should be either a new identifier or an identifier known as a Type identifier (but not known as an Individual identifier). If this constraint holds, the present method behaves like the method linkSubTypesToType(subTypeIdentifiers, typeIdentifier), else nothing is done and the method returns null.

Parameters:
subTypeIdentifiers - An array of identifiers for subTypes of typeIdentifier
typeIdentifier - The type identifier. If this identifier is already known in the current lexicon as an individual identifier, then nothing is done and the method returns null
Returns:
an Enumeration over an ArrayList of Type CSs associated to the specified subTypeIdentifiers. If one of the parameter is null or if typeIdentifier already exists in the current lexicon as an individual identifier or if an element in subTypeIdentifiers already exists as a type identifier then return null.

linkAllRelationSubTypesToType

public java.util.Enumeration linkAllRelationSubTypesToType(java.lang.Object[] subTypeIdentifiers,
                                                           Identifier typeIdentifier)

linkAllSubTypesToType

public java.util.Enumeration linkAllSubTypesToType(java.lang.Object[] subTypeIdentifiers,
                                                   Identifier typeIdentifier)
This method assumes that the specified typeIdentifier in already known, either as a concept type or as a relation type.

Parameters:
subTypeIdentifiers -
typeIdentifier -
Returns:

linkConceptSubTypeToType

public Type linkConceptSubTypeToType(Identifier subTypeIdentifier,
                                     Identifier typeIdentifier)
This method is identical to linkTypeToSuperType()

Parameters:
subTypeIdentifier - SubType identifier
typeIdentifier - Type identifier
Returns:
the Type CS associated to subTypeIdentifier. Return null if one of the parameters is null or if subTypeIdentifier or typeIdentifier already exists in the current lexicon as an individual identifier.

linkRelationSubTypeToType

public RelationType linkRelationSubTypeToType(Identifier subTypeIdentifier,
                                              Identifier typeIdentifier)
This method is identical to linkRelationTypeToSuperType()

Parameters:
subTypeIdentifier - SubType identifier
typeIdentifier - Type identifier
Returns:
the RelationType CS associated to subTypeIdentifier. Return null if one of the parameters is null or if subTypeIdentifier or typeIdentifier already exists in the current lexicon as an individual identifier.

removeLink

public boolean removeLink(Identifier typeIdentifier,
                          Identifier subTypeIdentifier)
Remove a subType link between the Type with typeIdentifier and the subType with subTypeIdentifier. Once the two Types CS associated to typeIdentifier and subTypeIdentifier have been located, the method calls the removeLink() method of Ontology.CS class

Parameters:
typeIdentifier - The identifier of the Type CS
subTypeIdentifier - The identifier of the sub-Type CS
Returns:
true if the two parameters are not null and there was a link between their Types CS. Note that if subType has no more father after the remove of the link, then it will be linked as a child to the Root of the ontology.

getDirectSuperTypes

public java.util.Enumeration getDirectSuperTypes(Identifier typeIdentifier)
Get from the current lexicon the direct super type identifiers of the given type identifier.

Parameters:
typeIdentifier - A type identifier for which the direct superType identifiers are seeked
Returns:
an Enumeration over an ArrayList of Identifier; the direct super type identifiers specified in the current lexicon for the given type identifier. Return null if typeIdentifier is null or unknown as type identifier in the current lexicon or if the type has no superType.

getSuperTypes

public java.util.Enumeration getSuperTypes(Identifier typeIdentifier)
Get from the current lexicon all the super types identifiers of the given type identifier.

Parameters:
typeIdentifier - A type identifier for which all the superType identifiers are seeked
Returns:
an Enumeration over an ArrayList of Identifier; all the super types identifiers of typeIdentifier, both are contained in the current lexicon. Return null if typeIdentifier is null or unknown as type identifier in the current lexicon, or if the type has no superType.

getDirectSubTypes

public java.util.Enumeration getDirectSubTypes(Identifier typeIdentifier)
Get from the current lexicon the identifiers of the direct subtypes of the given type identifier.

Parameters:
typeIdentifier - A type identifier for which its direct subType identifiers are seeked
Returns:
an Enumeration over an ArrayList of Identifier; the direct subType Identifiers specified in the current lexicon for the given type identifier. Return null if typeIdentifier is null or unknown as type identifier in the current lexicon, or if the type has no subType.

getSubTypes

public java.util.Enumeration getSubTypes(Identifier typeIdentifier)
Get from the current lexicon all the subtypes identifiers of the given type identifier.

Parameters:
typeIdentifier - A type identifier for which all the subType identifiers are seeked
Returns:
an Enumeration over an ArrayList of Identifier; all the subType identifiers of typeIdentifier, both are contained the current lexicon. Return null if typeIdentifier is null or unknown as type identifier in the current lexicon, or if the type has no subType.

getTypeOfIndividual

public Identifier getTypeOfIndividual(Identifier individualIdentifier)
Get from the current lexicon the type identifier of the given individual identifier.

Parameters:
individualIdentifier - An individual identifier for which we seek the type
Returns:
the type identifier of individualIdentifier. Return null if individualIdentifier is null, if individualIdentifier is unknow to the current lexicon (at least, as an individual), or if the type of individualIdentifier has no associated identifier in the current lexicon.

isIndividualOfType

public boolean isIndividualOfType(Identifier individualIdentifier,
                                  Identifier typeIdentifier)
Check in the current lexicon if the specified individual identifier is an individual of the type identifier.

Parameters:
individualIdentifier - An individual identifier
typeIdentifier - A type identifier
Returns:
true if individualIdentifier is an individual of typeIdentifier, both identifiers are contained in the current lexicon.

getIndividualsOfType

public java.util.Enumeration getIndividualsOfType(Identifier typeIdentifier)
Get from the current lexicon all the individual identifiers of the given type identifier.

Parameters:
typeIdentifier - A type identifier for which all its individual identifiers are seeked
Returns:
an Enumeration over an ArrayList of Identifier; all the individual identifiers of typeIdentifier, both are contained in the current lexicon. Return null if typeIdentifier is null or unknown as type identifier in the current lexicon, or if the type has no individual.

isSubType

public boolean isSubType(Identifier typeIdentifier1,
                         Identifier typeIdentifier2)
Check in the current lexicon if the type with typeIdentifier1 is equal or is a subtype of the type with typeIdentifier2.

Parameters:
typeIdentifier1 - A type identifier in the current lexicon
typeIdentifier2 - A type identifier in the current lexicon
Returns:
true if the type with typeIdentifier1 is equal or is a subtype of the type with typeIdentifier2. Return false if one of the parameters is null or is unknown as type identifier in the current lexicon or if the type with typeIdentifier1 is not equal and not a subtype of the type with typeIdentifier2.

isSuperType

public boolean isSuperType(Identifier typeIdentifier1,
                           Identifier typeIdentifier2)
Check in the current lexicon if the type with typeIdentifier1 is equal or is a superType of the type with typeIdentifier2.

Parameters:
typeIdentifier1 - A type identifier in the current lexicon
typeIdentifier2 - A type identifier in the current lexicon
Returns:
true if the type with typeIdentifier1 is equal or is a superType of the type with typeIdentifier2. Return false if one of the parameters is null or is unknown as type identifier in the current lexicon or if the type with typeIdentifier1 is not equal and not a supertype of the type with typeIdentifier2.

getMinComSuperType

public Identifier getMinComSuperType(Identifier typeIdentifier1,
                                     Identifier typeIdentifier2)
Determine the minimal common superType identifier of the type with typeIdentifier1 and the type with typeIdentifier2, the three identifiers are contained in the current lexicon.

Parameters:
typeIdentifier1 - A type identifier in the current lexicon
typeIdentifier2 - A type identifier in the current lexicon
Returns:
the minimal common superType identifier of the type with typeIdentifier1 and the type with typeIdentifier2. Return null if one of the parameters is null or not contained in the current lexicon or if the type with typeIdentifier1 and the type with typeIdentifier2 have no minimal common superType.

getMaxComSubType

public Identifier getMaxComSubType(Identifier typeIdentifier1,
                                   Identifier typeIdentifier2)
Determine the maximal common subType identifier of the type with typeIdentifier1 and the type with typeIdentifier2, the three identifiers are contained in the current lexicon.

Parameters:
typeIdentifier1 - A type identifier in the current lexicon
typeIdentifier2 - A type identifier in the current lexicon
Returns:
the maximal common subType identifier of the type with typeIdentifier1 and the type with typeIdentifier2. Return null if one of the parameters is null or not contained in the current lexicon or if the type with typeIdentifier1 and the type with typeIdentifier2 have no maximal common subType.