JTP API Documentation

jtp.classifier
Class Kb

java.lang.Object
  |
  +--jtp.classifier.Kb

public class Kb
extends Object

KB and interface for structural classification system. See http://ksl.stanford.edu/abstracts_by_author/Sanner,S..papers.html for more information about this sytem.


Field Summary
static int _A_LINK
           
protected static int _A_TABLE
           
protected static int _ALL
           
static int _C_LINK
           
protected static int _C_TABLE
           
static int _D_LINK
           
protected static int _D_TABLE
           
protected static int _EMPTY
           
protected static int _NKB_MARKER_SET
           
protected static int _NUM_TABLES
           
static int _S_LINK
           
protected static int _S_TABLE
           
protected static int _VISITED
           
 
Constructor Summary
Kb()
           
Kb(Classifier cl)
           
 
Method Summary
 Collection addConjunct(Object conjunct, Collection constituents)
          Adds and classifies conjunctively defined concept.
 Collection addDisjunct(Object disjunct, Collection constituents)
          Adds and classifies disjunctively defined concept.
 Collection addEquivalence(Object c1, Object c2)
          Collapses c1 and c2.
protected  void addResourceAlias(Object alias, Resource r)
           
 Collection addSubclassLink(Object csub, Object csuper)
          Adds a _SUBSUMED_BY link from csub to csuper.
protected  void addTripleLink(Resource o, Relation r, Resource v, int link_type)
           
protected  void addTripleLink(Resource o, Relation r, Resource v, int link_type, boolean add_inv)
           
protected  Collection classifyConjunctsWithMGSOnly(Collection conjuncts)
           
protected  Collection classifyDisjunctsWithMSSOnly(Collection disjuncts)
           
protected  void clearMarks(int default_pattern)
           
protected  Resource collapseCycle(Collection cycle)
          There should be no duplicates in the cycle.
protected  Modifier createModifier(Object name, Relation r, Resource c, Resource t, int card_val)
           
protected  Relation createRelation(Object name, Relation inv, Relation parent)
           
protected  Resource createResource(Object name)
           
protected  void deleteResource(Resource r)
           
protected  Resource detectAndCollapseCycle(Resource c, Relation rel)
          If Resource c is involved in a Relation rel cycle, c is collapsed with the other Resources in the cycle, and a new canonical Resource is returned.
protected  void findCycle(Resource r, Relation rel, LinkedList curPath, Collection cycle)
           
protected static int GetLink(int table)
           
protected  Modifier getOrCreateModifier(Object name, Relation r, Resource c, Resource t, int card_val)
           
protected  Relation getOrCreateRelation(Object name, Relation inv, Relation parent)
           
protected  Resource getOrCreateResource(Object name)
           
protected  Resource getResource(Object name)
           
protected static int GetTable(int link)
           
protected  Set getTripleLinkSet(Resource o, int link_type)
           
protected  Set getTripleLinkSet(Resource o, Resource r, int link_type)
           
 UndoManager getUndoManager()
           
protected  boolean isTripleLink(Resource o, Relation r, Resource v, int link_type)
           
protected  void maintainBottomLinks(Resource c)
           
protected  void maintainTopLinks(Resource c)
           
protected  Collection reClassifyDefinedConceptsAbove(Collection starts)
           
protected  Collection reClassifyDefinedConceptsAbove(Resource start)
           
protected  Collection reClassifyDefinedConceptsAboveAndBelow(Resource rsub, Resource rsuper)
           
protected  Collection reClassifyDefinedConceptsBelow(Collection starts)
           
protected  Collection reClassifyDefinedConceptsBelow(Resource start)
           
protected  void removeTripleLink(Resource o, Relation r, Resource v, int link_type)
           
protected  Collection replaceConstituents(Resource r, Collection constituents, Relation rel, int link_type)
          If any constituents is itself a conjunct or disjunct (depending on rel and link_type), in the return collection, it's replaced by its constituents.
protected  Collection replaceReferences(Resource referent, Collection constituents, Relation rel, int link_type)
          For all defined concepts that refer to referent as a constitent via link_type rel, replace the reference to referent with references to referent's constituents.
protected  Collection searchDownForDisjClasses(Collection starts)
           
protected  Collection searchDownForDisjClasses(Resource start)
           
protected  Collection searchUpForConjClasses(Collection starts)
           
protected  Collection searchUpForConjClasses(Resource start)
           
 void setUndoManager(UndoManager u)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_A_TABLE

protected static final int _A_TABLE
See Also:
Constant Field Values

_C_TABLE

protected static final int _C_TABLE
See Also:
Constant Field Values

_S_TABLE

protected static final int _S_TABLE
See Also:
Constant Field Values

_D_TABLE

protected static final int _D_TABLE
See Also:
Constant Field Values

_NUM_TABLES

protected static final int _NUM_TABLES
See Also:
Constant Field Values

_A_LINK

public static final int _A_LINK
See Also:
Constant Field Values

_C_LINK

public static final int _C_LINK
See Also:
Constant Field Values

_S_LINK

public static final int _S_LINK
See Also:
Constant Field Values

_D_LINK

public static final int _D_LINK
See Also:
Constant Field Values

_NKB_MARKER_SET

protected static final int _NKB_MARKER_SET
See Also:
Constant Field Values

_EMPTY

protected static final int _EMPTY
See Also:
Constant Field Values

_VISITED

protected static final int _VISITED
See Also:
Constant Field Values

_ALL

protected static final int _ALL
See Also:
Constant Field Values
Constructor Detail

Kb

public Kb()

Kb

public Kb(Classifier cl)
Method Detail

getUndoManager

public UndoManager getUndoManager()

setUndoManager

public void setUndoManager(UndoManager u)

addSubclassLink

public Collection addSubclassLink(Object csub,
                                  Object csuper)
                           throws ReasoningException
Adds a _SUBSUMED_BY link from csub to csuper. Discovers through classification new subsumption and equivalence relationships.

Returns:
A collection of Classifier.ClassifyInfo objects reporting newly discovered subsumption and equivalence relationships.
ReasoningException

addEquivalence

public Collection addEquivalence(Object c1,
                                 Object c2)
                          throws ReasoningException
Collapses c1 and c2. Discovers through classification new subsumption and equivalence relationships.

Returns:
A collection of Classifier.ClassifyInfo objects reporting newly discovered subsumption and equivalence relationships.
ReasoningException

addConjunct

public Collection addConjunct(Object conjunct,
                              Collection constituents)
                       throws ReasoningException
Adds and classifies conjunctively defined concept.

Returns:
A collection of Classifier.ClassifyInfo objects reporting newly discovered subsumption and equivalence relationships.
ReasoningException

addDisjunct

public Collection addDisjunct(Object disjunct,
                              Collection constituents)
                       throws ReasoningException
Adds and classifies disjunctively defined concept.

Returns:
A collection of Classifier.ClassifyInfo objects reporting newly discovered subsumption and equivalence relationships.
ReasoningException

classifyConjunctsWithMGSOnly

protected Collection classifyConjunctsWithMGSOnly(Collection conjuncts)
                                           throws ReasoningException
ReasoningException

classifyDisjunctsWithMSSOnly

protected Collection classifyDisjunctsWithMSSOnly(Collection disjuncts)
                                           throws ReasoningException
ReasoningException

reClassifyDefinedConceptsAbove

protected Collection reClassifyDefinedConceptsAbove(Resource start)
                                             throws ReasoningException
ReasoningException

reClassifyDefinedConceptsBelow

protected Collection reClassifyDefinedConceptsBelow(Resource start)
                                             throws ReasoningException
ReasoningException

reClassifyDefinedConceptsAbove

protected Collection reClassifyDefinedConceptsAbove(Collection starts)
                                             throws ReasoningException
ReasoningException

reClassifyDefinedConceptsBelow

protected Collection reClassifyDefinedConceptsBelow(Collection starts)
                                             throws ReasoningException
ReasoningException

reClassifyDefinedConceptsAboveAndBelow

protected Collection reClassifyDefinedConceptsAboveAndBelow(Resource rsub,
                                                            Resource rsuper)
                                                     throws ReasoningException
ReasoningException

getResource

protected Resource getResource(Object name)

createResource

protected Resource createResource(Object name)
                           throws ReasoningException
ReasoningException

getOrCreateResource

protected Resource getOrCreateResource(Object name)

deleteResource

protected void deleteResource(Resource r)
                       throws ReasoningException
ReasoningException

addResourceAlias

protected void addResourceAlias(Object alias,
                                Resource r)
                         throws ReasoningException
ReasoningException

createModifier

protected Modifier createModifier(Object name,
                                  Relation r,
                                  Resource c,
                                  Resource t,
                                  int card_val)
                           throws ReasoningException
ReasoningException

getOrCreateModifier

protected Modifier getOrCreateModifier(Object name,
                                       Relation r,
                                       Resource c,
                                       Resource t,
                                       int card_val)
                                throws ReasoningException
ReasoningException

createRelation

protected Relation createRelation(Object name,
                                  Relation inv,
                                  Relation parent)
                           throws ReasoningException
ReasoningException

getOrCreateRelation

protected Relation getOrCreateRelation(Object name,
                                       Relation inv,
                                       Relation parent)
                                throws ReasoningException
ReasoningException

GetTable

protected static int GetTable(int link)

GetLink

protected static int GetLink(int table)

maintainTopLinks

protected void maintainTopLinks(Resource c)

maintainBottomLinks

protected void maintainBottomLinks(Resource c)

detectAndCollapseCycle

protected Resource detectAndCollapseCycle(Resource c,
                                          Relation rel)
                                   throws ReasoningException
If Resource c is involved in a Relation rel cycle, c is collapsed with the other Resources in the cycle, and a new canonical Resource is returned.

Returns:
A new canonical Resource if cycle is detected and collapsed; null otherwise.
ReasoningException

findCycle

protected void findCycle(Resource r,
                         Relation rel,
                         LinkedList curPath,
                         Collection cycle)

collapseCycle

protected Resource collapseCycle(Collection cycle)
                          throws ReasoningException
There should be no duplicates in the cycle. All Resources in the cycle will be collapsed into a single Resource, generally the first member returned by cycle's iterator.

ReasoningException

addTripleLink

protected void addTripleLink(Resource o,
                             Relation r,
                             Resource v,
                             int link_type)

addTripleLink

protected void addTripleLink(Resource o,
                             Relation r,
                             Resource v,
                             int link_type,
                             boolean add_inv)

getTripleLinkSet

protected Set getTripleLinkSet(Resource o,
                               int link_type)

getTripleLinkSet

protected Set getTripleLinkSet(Resource o,
                               Resource r,
                               int link_type)

isTripleLink

protected boolean isTripleLink(Resource o,
                               Relation r,
                               Resource v,
                               int link_type)

removeTripleLink

protected void removeTripleLink(Resource o,
                                Relation r,
                                Resource v,
                                int link_type)

replaceConstituents

protected Collection replaceConstituents(Resource r,
                                         Collection constituents,
                                         Relation rel,
                                         int link_type)
If any constituents is itself a conjunct or disjunct (depending on rel and link_type), in the return collection, it's replaced by its constituents. As a side effect, a structural link will be added between r and any replaced constituents to prevent known info from being returned to the user.


replaceReferences

protected Collection replaceReferences(Resource referent,
                                       Collection constituents,
                                       Relation rel,
                                       int link_type)
For all defined concepts that refer to referent as a constitent via link_type rel, replace the reference to referent with references to referent's constituents. As a side effect, a structural link will be added between the referent and referer to prevent known info from being returned to the user.


searchUpForConjClasses

protected Collection searchUpForConjClasses(Collection starts)

searchUpForConjClasses

protected Collection searchUpForConjClasses(Resource start)

searchDownForDisjClasses

protected Collection searchDownForDisjClasses(Collection starts)

searchDownForDisjClasses

protected Collection searchDownForDisjClasses(Resource start)

clearMarks

protected void clearMarks(int default_pattern)

JTP API Documentation