edu.isi.powerloom.gui.serverinterface
Class KnowledgeManager

java.lang.Object
  |
  +--edu.isi.powerloom.gui.serverinterface.KnowledgeManager

public class KnowledgeManager
extends java.lang.Object

Singleton Class which keeps track of knowledge imported from the server, including caching info.

Since:
Fri Mar 01 00:52:59 2002
Author:
Eric Melz

Method Summary
 void clearKB(PLModule mod)
          Insert the method's description here.
 PLString destroyObject(PLModule module, java.lang.String objectName)
           
 java.lang.String evaluateLogicCommand(PLModule mod, java.lang.String command)
           
 PLQueryResult executeQuery(PLQuery query, boolean continueFlag)
           
 PLSearchResult executeSearch(java.lang.String modName, java.lang.String searchString, boolean isSearchConcept, boolean isSearchRelation, boolean isSearchInstance, boolean isCaseSensitive)
           
 PLSurrogate findOrCreateSurrogate(java.lang.Class type, java.lang.String id)
           
 PLSurrogateContainer getConceptAndRelationAndInstanceCompletions(java.lang.String modName, java.lang.String prefix)
           
 PLSurrogateContainer getConceptAndRelationCompletions(java.lang.String modName, java.lang.String prefix)
           
 PLSurrogateContainer getConceptCompletions(java.lang.String modName, java.lang.String prefix)
           
 PLConcept getConceptObject(PLModule module, java.lang.String conceptName)
           
 PLSurrogateContainer getConceptsForModule(PLModule module)
          STRATEGY: a 'null' as a hashtable value signifies that objects haven't yet been retrieved.
 PLObject getCurrentObject(java.lang.Class objectType, PLObject object)
           
 PLDirectoryContents getDefaultDirectoryListing(java.lang.String extensionFilter)
           
 PLSurrogateContainer getDirectInstancesForConcept(PLModule module, PLConcept concept)
           
 PLDirectoryContents getDirectoryListing(java.lang.String dirName, java.lang.String extensionFilter)
           
 java.lang.String getDocumentationForConcept(PLModule module, PLConcept concept)
           
 java.lang.String getDocumentationForInstance(PLModule module, PLInstance instance)
           
 java.lang.String getDocumentationForRelation(PLModule module, PLRelation relation)
           
 java.lang.String getExplanationForQuery(PLQuery query, int resultNum)
           
 PLQueryResult getExtensionForRelation(PLModule mod, java.lang.String relationName)
           
 PLSurrogateContainer getIncludesForModule(PLModule module)
           
 PLSurrogateContainer getInheritedRelationsForConcept(PLModule module, PLConcept concept)
           
static KnowledgeManager getInstance()
           
 PLSurrogateContainer getInstanceCompletions(java.lang.String modName, java.lang.String prefix)
           
 PLInstance getInstanceObject(PLModule module, java.lang.String instanceName)
           
 PLSurrogateContainer getInstancesForConcept(PLModule module, PLConcept concept)
           
 PLSurrogateContainer getInstancesForModule(PLModule module)
           
 java.util.Collection getLoadableKBs()
           
 PLModule getModuleFromName(java.lang.String name)
          Get Module object given string name.
 PLSurrogateContainer getModules()
           
 PLSurrogateContainer getModules(PLModule module)
          Return all modules under and including `module'.
 PLObject getPLObject(PLModule module, java.lang.String objectName)
           
 PLSurrogateContainer getPropositionsForConcept(PLModule module, PLConcept concept)
           
 PLSurrogateContainer getPropositionsForInstance(PLModule module, PLInstance instance)
           
 PLSurrogateContainer getPropositionsForInstanceAndRelation(PLModule mod, PLInstance instance, PLRelation relation)
           
 PLSurrogateContainer getPropositionsForRelation(PLModule module, PLRelation relation)
           
 PLSurrogateContainer getRelationCompletions(java.lang.String modName, java.lang.String prefix)
           
 PLRelation getRelationObject(PLModule module, java.lang.String relationName)
          Getxxx methods.
 PLSurrogateContainer getRelationsForConcept(PLModule module, PLConcept concept)
           
 PLSurrogateContainer getRelationsForModule(PLModule module)
           
 PLModule getRootModule()
           
 PLSurrogateContainer getRulesForConcept(PLModule module, PLConcept concept)
           
 PLSurrogateContainer getRulesForRelation(PLModule module, PLRelation relation)
           
 PLServerInfo getServerInfo()
           
 PLSurrogateContainer getShadowedSurrogatesForModule(PLModule module)
           
 java.lang.String getSourceForConcept(PLModule module, PLConcept concept)
           
 PLSurrogateContainer getSuperConceptsForConcept(PLModule module, PLConcept concept)
           
 PLSurrogateContainer getSuperRelationsForRelation(PLModule module, PLConcept concept)
           
 PLSurrogateContainer getSuperRelationsForRelation(PLModule module, PLRelation relation)
           
 PLSurrogateContainer getTypesForInstance(PLModule module, PLInstance instance)
           
 PLSurrogateContainer getUsesForModule(PLModule module)
           
 PLVariableList getVariablesForRelation(PLModule module, PLRelation relation)
           
 void initializeModules()
          Business object management
 void invalidateAllCaches()
           
 void invalidateConceptCaches()
          Cache management methods
 void invalidateInstanceCaches()
           
 void invalidatePropositionCaches()
           
 void invalidateRelationCaches()
           
 void invalidateRuleCaches()
           
 void loadKB(java.lang.String kbName)
           
 java.lang.String loadKB2(java.lang.String fileName)
           
 java.lang.String[] matchAllSurrogates(java.lang.String partialString)
           
 void saveKB(java.lang.String modName, java.lang.String kbName, java.lang.String description)
           
 void saveKB2(java.lang.String modName, java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static KnowledgeManager getInstance()
                                    throws AppException
AppException

findOrCreateSurrogate

public PLSurrogate findOrCreateSurrogate(java.lang.Class type,
                                         java.lang.String id)

initializeModules

public void initializeModules()
                       throws AppException
Business object management

AppException

getRootModule

public PLModule getRootModule()

getModules

public PLSurrogateContainer getModules()

getModules

public PLSurrogateContainer getModules(PLModule module)
Return all modules under and including `module'.


getConceptsForModule

public PLSurrogateContainer getConceptsForModule(PLModule module)
                                          throws AppException
STRATEGY: a 'null' as a hashtable value signifies that objects haven't yet been retrieved. An empty container such as 'PLConceptContainer' signifies that objejcts have been retrieved but none are available.

AppException

getInstancesForModule

public PLSurrogateContainer getInstancesForModule(PLModule module)
                                           throws AppException
AppException

getRelationsForModule

public PLSurrogateContainer getRelationsForModule(PLModule module)
                                           throws AppException
AppException

getInstancesForConcept

public PLSurrogateContainer getInstancesForConcept(PLModule module,
                                                   PLConcept concept)
                                            throws AppException
AppException

getDirectInstancesForConcept

public PLSurrogateContainer getDirectInstancesForConcept(PLModule module,
                                                         PLConcept concept)
                                                  throws AppException
AppException

getDocumentationForConcept

public java.lang.String getDocumentationForConcept(PLModule module,
                                                   PLConcept concept)
                                            throws AppException
AppException

getSourceForConcept

public java.lang.String getSourceForConcept(PLModule module,
                                            PLConcept concept)
                                     throws AppException
AppException

getSuperConceptsForConcept

public PLSurrogateContainer getSuperConceptsForConcept(PLModule module,
                                                       PLConcept concept)
                                                throws AppException
AppException

getPropositionsForInstance

public PLSurrogateContainer getPropositionsForInstance(PLModule module,
                                                       PLInstance instance)
                                                throws AppException
AppException

getRelationsForConcept

public PLSurrogateContainer getRelationsForConcept(PLModule module,
                                                   PLConcept concept)
                                            throws AppException
AppException

getInheritedRelationsForConcept

public PLSurrogateContainer getInheritedRelationsForConcept(PLModule module,
                                                            PLConcept concept)
                                                     throws AppException
AppException

getPropositionsForConcept

public PLSurrogateContainer getPropositionsForConcept(PLModule module,
                                                      PLConcept concept)
                                               throws AppException
AppException

getPropositionsForRelation

public PLSurrogateContainer getPropositionsForRelation(PLModule module,
                                                       PLRelation relation)
                                                throws AppException
AppException

getRulesForConcept

public PLSurrogateContainer getRulesForConcept(PLModule module,
                                               PLConcept concept)
                                        throws AppException
AppException

getRulesForRelation

public PLSurrogateContainer getRulesForRelation(PLModule module,
                                                PLRelation relation)
                                         throws AppException
AppException

getPropositionsForInstanceAndRelation

public PLSurrogateContainer getPropositionsForInstanceAndRelation(PLModule mod,
                                                                  PLInstance instance,
                                                                  PLRelation relation)
                                                           throws AppException
AppException

evaluateLogicCommand

public java.lang.String evaluateLogicCommand(PLModule mod,
                                             java.lang.String command)
                                      throws AppException
AppException

executeQuery

public PLQueryResult executeQuery(PLQuery query,
                                  boolean continueFlag)
                           throws AppException
AppException

getExtensionForRelation

public PLQueryResult getExtensionForRelation(PLModule mod,
                                             java.lang.String relationName)
                                      throws AppException
AppException

executeSearch

public PLSearchResult executeSearch(java.lang.String modName,
                                    java.lang.String searchString,
                                    boolean isSearchConcept,
                                    boolean isSearchRelation,
                                    boolean isSearchInstance,
                                    boolean isCaseSensitive)
                             throws AppException
AppException

getConceptCompletions

public PLSurrogateContainer getConceptCompletions(java.lang.String modName,
                                                  java.lang.String prefix)
                                           throws AppException
AppException

getRelationCompletions

public PLSurrogateContainer getRelationCompletions(java.lang.String modName,
                                                   java.lang.String prefix)
                                            throws AppException
AppException

getInstanceCompletions

public PLSurrogateContainer getInstanceCompletions(java.lang.String modName,
                                                   java.lang.String prefix)
                                            throws AppException
AppException

getConceptAndRelationCompletions

public PLSurrogateContainer getConceptAndRelationCompletions(java.lang.String modName,
                                                             java.lang.String prefix)
                                                      throws AppException
AppException

getConceptAndRelationAndInstanceCompletions

public PLSurrogateContainer getConceptAndRelationAndInstanceCompletions(java.lang.String modName,
                                                                        java.lang.String prefix)
                                                                 throws AppException
AppException

destroyObject

public PLString destroyObject(PLModule module,
                              java.lang.String objectName)
                       throws AppException
AppException

getExplanationForQuery

public java.lang.String getExplanationForQuery(PLQuery query,
                                               int resultNum)
                                        throws AppException
AppException

getServerInfo

public PLServerInfo getServerInfo()
                           throws AppException
AppException

invalidateConceptCaches

public void invalidateConceptCaches()
Cache management methods


invalidateInstanceCaches

public void invalidateInstanceCaches()

invalidateRelationCaches

public void invalidateRelationCaches()

invalidatePropositionCaches

public void invalidatePropositionCaches()

invalidateRuleCaches

public void invalidateRuleCaches()

invalidateAllCaches

public void invalidateAllCaches()

matchAllSurrogates

public java.lang.String[] matchAllSurrogates(java.lang.String partialString)
Returns:
an array of surrogate Id's whose beginning matches partialString

getDocumentationForRelation

public java.lang.String getDocumentationForRelation(PLModule module,
                                                    PLRelation relation)
                                             throws AppException
AppException

getSuperRelationsForRelation

public PLSurrogateContainer getSuperRelationsForRelation(PLModule module,
                                                         PLConcept concept)
                                                  throws AppException
AppException

getSuperRelationsForRelation

public PLSurrogateContainer getSuperRelationsForRelation(PLModule module,
                                                         PLRelation relation)
                                                  throws AppException
AppException

getVariablesForRelation

public PLVariableList getVariablesForRelation(PLModule module,
                                              PLRelation relation)
                                       throws AppException
AppException

getIncludesForModule

public PLSurrogateContainer getIncludesForModule(PLModule module)
                                          throws AppException
AppException

getShadowedSurrogatesForModule

public PLSurrogateContainer getShadowedSurrogatesForModule(PLModule module)
                                                    throws AppException
AppException

getUsesForModule

public PLSurrogateContainer getUsesForModule(PLModule module)
                                      throws AppException
AppException

getDocumentationForInstance

public java.lang.String getDocumentationForInstance(PLModule module,
                                                    PLInstance instance)
                                             throws AppException
AppException

getLoadableKBs

public java.util.Collection getLoadableKBs()
                                    throws AppException
AppException

loadKB

public void loadKB(java.lang.String kbName)
            throws AppException
AppException

loadKB2

public java.lang.String loadKB2(java.lang.String fileName)
                         throws AppException
AppException

clearKB

public void clearKB(PLModule mod)
             throws AppException
Insert the method's description here. Creation date: (4/24/2002 3:36:02 PM)

Parameters:
mod - edu.isi.powerloom.gui.xmlobject.PLModule
Throws:
AppException - The exception description.

getTypesForInstance

public PLSurrogateContainer getTypesForInstance(PLModule module,
                                                PLInstance instance)
                                         throws AppException
AppException

saveKB

public void saveKB(java.lang.String modName,
                   java.lang.String kbName,
                   java.lang.String description)
            throws AppException
AppException

saveKB2

public void saveKB2(java.lang.String modName,
                    java.lang.String fileName)
             throws AppException
AppException

getDefaultDirectoryListing

public PLDirectoryContents getDefaultDirectoryListing(java.lang.String extensionFilter)
                                               throws AppException
AppException

getDirectoryListing

public PLDirectoryContents getDirectoryListing(java.lang.String dirName,
                                               java.lang.String extensionFilter)
                                        throws AppException
AppException

getRelationObject

public PLRelation getRelationObject(PLModule module,
                                    java.lang.String relationName)
                             throws AppException
Getxxx methods. These methods always go to the server to retrieve the latest object.

AppException

getConceptObject

public PLConcept getConceptObject(PLModule module,
                                  java.lang.String conceptName)
                           throws AppException
AppException

getInstanceObject

public PLInstance getInstanceObject(PLModule module,
                                    java.lang.String instanceName)
                             throws AppException
AppException

getCurrentObject

public PLObject getCurrentObject(java.lang.Class objectType,
                                 PLObject object)
                          throws AppException
AppException

getPLObject

public PLObject getPLObject(PLModule module,
                            java.lang.String objectName)
                     throws AppException
AppException

getModuleFromName

public PLModule getModuleFromName(java.lang.String name)
                           throws AppException
Get Module object given string name. This handles module prefixes.

AppException


Copyright © 2002 University of Southern California Information Sciences Institute. All Rights Reserved.