|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectaminePlatform.kernel.ontology.CS
Title : ontology.CS Class
Description : As introduced in the class Ontology, an ontology in AminePlatform is a graph of nodes called Conceptual Structures (CS) defined by this class. Moreover, the nodes correspond to five categories of Conceptual Structures : Type, RelationType, Individual, Context, Situation and Rule. These categories are implemented as five subclasses of the class CS :
* Type CS/node (the class Type) : Each concept type and relation type is represented by this type of CS in the ontology. The definition and/or the canon of a type are stored in that node that represents the type in the ontology.
* RelationType CS/node (the class RelationType) : this a specialization of Type and it concerns Relation Type
* Individual CS/node (the class Individual) : An individual of a concept type is represented by an 'individual CS' that is immediately related to its type. The description of an individual is stored in this individual node.
* Situation CS/node (the class Situation) : A situation is stored in a situation node. A situation can be related to types, individuals and/or to other situations.
* Context CS/node (the class Context) : A Context is stored in a Context node.
* Rule CS/node (the class CSRule) : A Rule is stored in a CSRule node.
As noted in the comment about the class ontology.Ontology, it is important to note that the kind of description of a CS, i.e. description of a definition, a canon, an individual or a situation is not fixed at this level; a description could be any Java Object (see the declaration of the attribute 'description' below and the definition of the classes Type, Individual and Situation).
Thus, Lexicon, Ontology and Conceptual Structures are not committed to a particular knowledge description scheme.
Note also that the conceptual structures (CS) attached to identifiers, like definition, canon, individual or situation (indirectly), are not composed of identifiers but of references to other CSs and so they are 'natural language free descriptions'. The use of identifiers and hence languages occurs when the system has to communicate or express its knowledge (descriptions) to other language-based systems (like human).
As nodes of a graph, each CS cs refeers to the immediate CSs that cs specialize (the direct fathers of the CS cs) and to the immediate CSs that are specialization of the CS cs (the immediate children of the CS cs). Thus, the graph structure of the ontology is encoded implicitly by the links that are specified in each CS.
Note that the methods getDescription(), as well as setDescription() and removeDescription() are protected (not public) because they should not be public for any user of the class Type: public versions of them are provided by Individual and Situation classes, and Type class redefines them as getDefinition(), setDefinition() and removeDefinition() respectively. So, the three methods are not used by other classes (except the three subclasses) and are not public to other classes.
Subclasses : Type, RelationType, Individual, and Situation
Copyright: Copyright (c) Adil KABBAJ, 2004-2009
Field Summary | |
static java.lang.String |
S_CONTEXT
|
static java.lang.String |
S_CSRULE
|
static java.lang.String |
S_SITUATION
|
static java.lang.String |
S_TYPE
|
Constructor Summary | |
protected |
CS()
Constructors of CS are protected since only its subclasses can instantiate it |
protected |
CS(java.lang.Object description)
Create a CS with the specified description. |
Method Summary | |
boolean |
addCSRule(CSRule rule)
|
boolean |
addCSRule(java.lang.Object ante,
java.lang.Object consq)
Add a new rule to the current CS. |
void |
addIncomeEdge(Edge edge)
|
void |
addOutcomeEdge(Edge edge)
Implementation of Node Interface |
boolean |
addSituation(java.lang.Object obj)
Add a new situation to the current CS. |
boolean |
canBeRemoved()
Check if the current CS can be removed, i.e. if it has no children. |
void |
clear()
clear the fathers and children lists and the description of the current CS. |
Node |
copyNode()
This method is defined to implement the method copyNode of Node, but it should not be used directly since it returns null. |
void |
detach()
Detach the current CS from its fathers and children : remove all the links that relate the current CS, as a child, to its fathers, and remove all the links that relate the current CS, as a father, to its children. |
void |
finalize()
clear the fathers and children lists as well as the description of the current CS. |
java.util.ArrayList |
getAdjacentNodes()
|
java.util.ArrayList |
getArrayOfChildren()
|
java.util.ArrayList |
getArrayOfFathers()
|
java.util.Enumeration |
getChildren()
Get the children (the immediate specializations) of the current CS |
java.lang.Object |
getContent()
It returns the content of a CS ontNode depending on its type (Type, Situation, COntext or Individual). |
CSRule |
getCSRuleAt(int range)
Get the rule with the specified range among the rules of the current CS. |
java.util.ArrayList |
getCSRules()
Get all the CSRules that are attached directly to the current CS. |
java.util.ArrayList |
getCSRulesAntecedent()
Get all the rules antecedents that are attached directly to the current CS. |
java.util.ArrayList |
getCSRulesConcequence()
Get all the rules consequences that are attached directly to the current CS. |
protected java.lang.Object |
getDescription()
Get the description of the current CS. |
java.util.Enumeration |
getEdges()
|
java.util.Enumeration |
getFathers()
Get the fathers (the immediate generalizations) of the current CS |
protected void |
getImmSubTypes(Type type,
java.util.ArrayList imdtSubTypes)
Put in the ArrayList imdtSubTypes all the Immediate subTypes of type. |
protected void |
getImmSuperTypes2(java.util.ArrayList imdtSuperTypes)
|
java.util.Enumeration |
getIncomeEdges()
|
java.awt.Point |
getLeftTopPoint()
|
java.util.Enumeration |
getMetaphors()
Get an Enumeration over all the metaphors (An ArrayList of metaphors) that are attached directly to the current CS. |
int |
getNbrChildren()
|
int |
getNbrCSRules()
Get the number of rules attached directly to the current CS. |
int |
getNbrFathers()
|
int |
getNbrSituations()
Get the number of situations attached directly to the current CS. |
int |
getNumberofEdges()
|
java.util.Enumeration |
getOutcomeEdges()
|
Situation |
getSituationAt(int range)
Get the situation with the specified range among the situations of the current CS. |
java.util.Enumeration |
getSituations()
Get an Enumeration over all the situations (An ArrayList of Situation) that are attached directly to the current CS. |
java.util.Enumeration |
getSituationsDescription()
Get an Enumeration over all the situations description that are attached directly to the current CS. |
boolean |
hasContentToDisplay()
|
boolean |
isAntecedent(CS cs)
Check if the current CS is equal or an antecedent of the specified CS cs. |
boolean |
isChild(CS child)
Check if the specified child is among the children of the current CS |
boolean |
isConceptType()
Check if the current cs is a Concept Type CS |
boolean |
isContext()
|
static boolean |
isCS(java.lang.Object obj)
Check if the specified Object obj is a CS (Conceptual Structure); a concept type, a relation type, an individual or a situation. |
boolean |
isCSRule()
Check if the current CS is in fact a CSRule. |
boolean |
isDescendant(CS cs)
In general, a node has less fathers than children, that is why this method is defined in terms of isAntecedent(). |
boolean |
isFather(CS father)
Check if the specified father is among the fathers of the current CS. |
boolean |
isIndexedType()
|
boolean |
isIndividual()
Check if the current CS is in fact an Individual CS. |
boolean |
isMetaphor()
|
boolean |
isRelationType()
Check if the current CS is in fact a Relation Type CS. |
boolean |
isSituation()
Check if the current CS is in fact a Situation CS. |
boolean |
isType()
Check if the current CS is in fact a Type CS. |
boolean |
link(CS child)
add a father-child link between two CSs ; father (the current CS : this) and child (the parameter). |
CSRule |
removeCSRuleAt(int range)
Locate the rule with the specified range among the rules of the current CS, remove the link that relates the current CS to the rule and returns the rule. |
protected void |
removeDescription()
Nullify the description value of the current CS. |
boolean |
removeLink(CS cs)
Remove the link between the current CS (this) and the specified CS cs. |
boolean |
removeLink(Type subType,
Ontology ontology)
Deprecated. Use instead removeLink(CS cs) |
boolean |
removeLinkToSituation(Situation situation)
Remove the link between the current type (this) and the specified Situation if the situation is related to more than one CS |
Situation |
removeSituationAt(int range)
Locate the situation with the specified range among the situations of the current CS, remove the link that relates the current CS to the situation and returns the situation. |
boolean |
setChildren(java.util.ArrayList newChildren)
Set children as the children of the current CS. |
protected void |
setDescription(java.lang.Object description)
Set description as the description of the current CS. |
boolean |
setFathers(java.util.ArrayList newFathers)
Set the parameter fathers as the fathers of the current CS. |
void |
setIncomeEdges(java.util.ArrayList edges)
|
void |
setLeftTopPoint(java.awt.Point point)
|
void |
setOutcomeEdges(java.util.ArrayList edges)
|
void |
setRectangle(java.awt.Rectangle rectangle)
|
protected org.jdom.Element |
toChildren(Ontology ontology)
Parse the liste of CS's children to an element of the ontology document. |
protected org.jdom.Element |
toContent(Ontology ontology)
This method will be overriden by CS subclasses: Parse the content of the current cs to an element of the ontology document. |
protected org.jdom.Element |
toCSKind(java.lang.String key)
This method will be overriden by CS subclasses: it each CS should construct and return its XML header. |
java.lang.String |
toDisplayString(Lexicon currentLexicon)
|
protected org.jdom.Element |
toFathers(Ontology ontology)
Parse the list of CS's fathers to an element of the ontology document. |
protected org.jdom.Element |
toLexicon(Ontology ontology)
Return the XML format of the lexicon associated to the current cs which can be type or an individual. |
java.lang.String |
toString(Lexicon lexicon)
Implement the method toString(Lexicon) specified in the interface ToString. |
org.jdom.Element |
toXml(Ontology ontology,
java.lang.String key)
Parse the current cs to an element of the ontology document. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String S_TYPE
public static final java.lang.String S_SITUATION
public static final java.lang.String S_CONTEXT
public static final java.lang.String S_CSRULE
Constructor Detail |
protected CS()
protected CS(java.lang.Object description)
description
- An ObjectMethod Detail |
public void finalize()
public void clear()
protected java.lang.Object getDescription()
protected void setDescription(java.lang.Object description)
description
- An Objectprotected void removeDescription()
public java.util.Enumeration getFathers()
public java.util.ArrayList getArrayOfFathers()
public int getNbrFathers()
public int getNbrChildren()
public boolean setFathers(java.util.ArrayList newFathers)
newFathers
- An ArrayList of CS to be set as fathers of the current CS
public boolean isFather(CS father)
father
- A CS
public java.util.Enumeration getChildren()
public int getNumberofEdges()
public java.util.ArrayList getArrayOfChildren()
public boolean setChildren(java.util.ArrayList newChildren)
newChildren
- An ArrayList of CS to be set as children of the current CS
public boolean isChild(CS child)
child
- A CS
public static boolean isCS(java.lang.Object obj)
obj
- An object
public boolean isType()
public boolean isIndexedType()
public boolean isConceptType()
public boolean isRelationType()
public boolean isIndividual()
public boolean isCSRule()
public boolean isContext()
public boolean isMetaphor()
public boolean isSituation()
public boolean canBeRemoved()
public java.lang.Object getContent()
public boolean link(CS child)
child
- A CS that play the role of a child for the current CS
public void detach()
public boolean isAntecedent(CS cs)
cs
- A CS
public boolean isDescendant(CS cs)
cs
- A CS
protected void getImmSuperTypes2(java.util.ArrayList imdtSuperTypes)
protected void getImmSubTypes(Type type, java.util.ArrayList imdtSubTypes)
public java.util.Enumeration getSituations()
public java.util.Enumeration getSituationsDescription()
public Situation getSituationAt(int range)
range
- This parameter specifies the range of the direct situation among the other
situations that are directly attached to the current CS. This parameter doesn't
give the range of the situation among all the children of the current CS.
Note that range begins from 1 (not 0) : get the first situation (range = 1),
get the second situation (range = 2), etc.
public int getNbrSituations()
public boolean addSituation(java.lang.Object obj)
obj
- An object that could be a situation or a description
public boolean removeLink(Type subType, Ontology ontology)
subType
- A Type CSontology
- The Current ontology
public boolean removeLinkToSituation(Situation situation)
situation
- A Situation
public boolean removeLink(CS cs)
cs
- A CS
public Situation removeSituationAt(int range)
range
- : this parameter gives the range of the situation among the other situations
that are directly attached to the current cs. This parameter doesn't give
the range of the situation among all the children of the current cs.
Note that range begins from 1 (not 0) : remove the first situation (range = 1),
remove the second situation (range = 2), etc.
public java.util.Enumeration getMetaphors()
public java.util.ArrayList getCSRules()
public java.util.ArrayList getCSRulesAntecedent()
public java.util.ArrayList getCSRulesConcequence()
public CSRule getCSRuleAt(int range)
range
- This parameter specifies the range of the direct rule among the other
rules that are directly attached to the current CS. This parameter doesn't
give the range of the rule among all the children of the current CS.
Note that range begins from 1 (not 0) : get the first rule (range = 1),
get the second rule (range = 2), etc.
public int getNbrCSRules()
public boolean addCSRule(java.lang.Object ante, java.lang.Object consq)
public boolean addCSRule(CSRule rule)
public CSRule removeCSRuleAt(int range)
range
- : this parameter gives the range of the rule among the other rules
that are directly attached to the current cs. This parameter doesn't give
the range of the rule among all the children of the current cs.
Note that range begins from 1 (not 0) : remove the first rule (range = 1),
remove the second rule (range = 2), etc.
public java.lang.String toString(Lexicon lexicon) throws ToStringException
toString
in interface ToString
lexicon
- Lexicon to use for the textual formulation
ToStringAndParseException
- if an error occurs during the textual formulation
ToStringException
public void addOutcomeEdge(Edge edge)
addOutcomeEdge
in interface Node
public void addIncomeEdge(Edge edge)
addIncomeEdge
in interface Node
public java.util.Enumeration getOutcomeEdges()
getOutcomeEdges
in interface Node
public java.util.Enumeration getIncomeEdges()
getIncomeEdges
in interface Node
public java.util.Enumeration getEdges()
getEdges
in interface Node
public void setOutcomeEdges(java.util.ArrayList edges)
setOutcomeEdges
in interface Node
public void setIncomeEdges(java.util.ArrayList edges)
setIncomeEdges
in interface Node
public boolean hasContentToDisplay()
hasContentToDisplay
in interface Node
public java.lang.String toDisplayString(Lexicon currentLexicon) throws ToStringException
toDisplayString
in interface Node
ToStringException
public void setLeftTopPoint(java.awt.Point point)
setLeftTopPoint
in interface Node
public java.awt.Point getLeftTopPoint()
getLeftTopPoint
in interface Node
public void setRectangle(java.awt.Rectangle rectangle)
setRectangle
in interface Node
public Node copyNode()
copyNode
in interface Node
public java.util.ArrayList getAdjacentNodes()
getAdjacentNodes
in interface Node
protected org.jdom.Element toCSKind(java.lang.String key)
key
-
protected org.jdom.Element toLexicon(Ontology ontology)
ontology
-
protected org.jdom.Element toContent(Ontology ontology)
ontology
-
protected org.jdom.Element toChildren(Ontology ontology)
ontology
-
protected org.jdom.Element toFathers(Ontology ontology)
ontology
-
public org.jdom.Element toXml(Ontology ontology, java.lang.String key)
ontology
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |