All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ShoeKb.ShoeKb

java.lang.Object
   |
   +----ShoeKb.ShoeKb

public class ShoeKb
extends Object
A high-level interface for communicating with a SHOE knowledge base.


Variable Index

 o kb
 o ontman
 o P_EQUAL
 o P_EVERY_INSTANCE
 o P_GREATER
 o P_GREATER_OR_EQUAL
 o P_INSTANCE
 o P_ISA
 o P_LESS
 o P_LESS_OR_EQUAL
 o P_NOCASE_STRING_MATCH
 o P_NOT_EQUAL
 o P_STRING_MATCH
 o storedOnts

Constructor Index

 o ShoeKb(KBInterface, OntManager, PrintStream)
Constructs a new SHOE KB interface using the specified API and ontology manager.
 o ShoeKb(KBInterface, OntManager, PrintStream, boolean)
Constructs a new SHOE KB interface using the specified API and ontology manager.

Method Index

 o closeConnection()
Closes the current connection.
 o closeKB()
Closes the current knowledge base.
 o createKB(String)
Creates a new KB with the name supplied by the user.
 o establishConnection(String, int)
Establish a connection to the given host and port number.
 o getDocMessages()
Returns the messages generated during the course of storing the current document.
 o getKnownOntologies()
Returns a vector consisting of the OntDescriptors of every ontology known to the KB.
 o getOntDescriptor(String, String)
 o getOntSeqNumber(String, String)
 o getOntURL(String, String)
 o getStoredOntologies()
Retrieves the catalog information for ontologies from the KB.
 o getUniqueName(Ontology, String)
Given the name of an ontology object, and an ontology with which to reference the name, creates and returns a unique name for it.
 o getUniqueName(String, String, String)
Given the name of an ontology object, and the id of an ontology with which to reference the name, creates and returns a unique name for it.
 o getUniqueName(Unique_Elt)
 o issueQuery(Query)
Issues an arbitrary query to the KB using the default ontology.
 o issueQuery(String, String, String)
Issues a single atom, binary query to the KB using the default ontology.
 o issueQuery(String, String[])
Issues a single atom, n-ary query to the KB using the default ontology.
 o openKB(String)
Using a KBMS that was specified on construction of the object, opens the given knowledge base using the existing connection, if one exists.
 o openKB(String, String, int)
Using a KBMS that was specified on construction of the object, opens the given knowledge base using a connection specified by the given host and port number.
 o setDefaultOntology(String, String)
Sets the ontology against which queries will be issued unless the query explicitly specifies an ontology.
 o storeCategory(Category, String)
Given a SHOE category and the URL of the page on which it resides, stores it in the knowledge base.
 o storeDefCategory(Def_Category, Ontology)
Given a SHOE DEF_CATEGORY and its source ontology, stores it in the KB.
 o storeDefConstant(Def_Constant, Ontology)
Given a SHOE DEF_CONSTANT and its source ontology, stores it in the KB.
 o storeDefRelation(Def_Relation, Ontology)
Given a SHOE DEF_RELATION and its source ontology, stores it in the KB.
 o storeInferenceRule(Def_Inference, Ontology)
Given a SHOE DEF-INFERENCE rule and its source ontology, asserts it the KB.
 o storeInstance(Instance, String)
Given an instance and the URL of the page on which it resides, stores the claims made by the page in the KB.
 o storeNewOntologies(Enumeration)
Given an enumeration of Use-Ontologies, determines which of the referenced ontologies are not currently loaded into the KB, and stores them into it.
 o storeOntology(Ontology)
Stores the ontology's DEF_CATEGORYs, DEF_RELATIONs and DEF_CONSTANTs in the KB.
 o storeRelation(Relation, String, Hashtable)
Given a SHOE relation and the URL of the page on which it resides, stores it in the knowledge base.
 o storeSHOEDoc(SHOE_Doc, String)
Stores the SHOE information from the given document in the KB.
 o toKbAtom(Atom)
Given a generic Atom, transforms it into an Atom suitable for use with the KB.

Variables

 o ontman
 protected OntManager ontman
 o kb
 protected KBInterface kb
 o storedOnts
 protected Hashtable storedOnts
 o P_INSTANCE
 public static String P_INSTANCE
 o P_ISA
 public static String P_ISA
 o P_EVERY_INSTANCE
 public static String P_EVERY_INSTANCE
 o P_STRING_MATCH
 public static String P_STRING_MATCH
 o P_NOCASE_STRING_MATCH
 public static String P_NOCASE_STRING_MATCH
 o P_EQUAL
 public static String P_EQUAL
 o P_NOT_EQUAL
 public static String P_NOT_EQUAL
 o P_GREATER
 public static String P_GREATER
 o P_GREATER_OR_EQUAL
 public static String P_GREATER_OR_EQUAL
 o P_LESS_OR_EQUAL
 public static String P_LESS_OR_EQUAL
 o P_LESS
 public static String P_LESS

Constructors

 o ShoeKb
 public ShoeKb(KBInterface kb,
               OntManager ontman,
               PrintStream logOut)
Constructs a new SHOE KB interface using the specified API and ontology manager. Any messages reported by this object will be written to the specified log.

 o ShoeKb
 public ShoeKb(KBInterface kb,
               OntManager ontman,
               PrintStream logOut,
               boolean implicitClaims)
Constructs a new SHOE KB interface using the specified API and ontology manager. Any messages reported by this object will be written to the specified log.

Methods

 o establishConnection
 public void establishConnection(String host,
                                 int port) throws KBException
Establish a connection to the given host and port number.

 o createKB
 public void createKB(String kbName) throws KBException
Creates a new KB with the name supplied by the user. The necessary meta structures for cataloging ontology information are also created.

 o openKB
 public void openKB(String kbName,
                    String host,
                    int port) throws KBException
Using a KBMS that was specified on construction of the object, opens the given knowledge base using a connection specified by the given host and port number.

 o openKB
 public void openKB(String kbName) throws KBException
Using a KBMS that was specified on construction of the object, opens the given knowledge base using the existing connection, if one exists.

 o closeKB
 public void closeKB()
Closes the current knowledge base.

 o closeConnection
 public void closeConnection()
Closes the current connection. Any open KBs will be closed as well.

 o storeSHOEDoc
 public void storeSHOEDoc(SHOE_Doc doc,
                          String sourceUrl)
Stores the SHOE information from the given document in the KB. Any claims originally stored for the source are deleted, and any new ontologies are loaded before the new claims are stored.

 o storeInstance
 public void storeInstance(Instance inst,
                           String sourceUrl)
Given an instance and the URL of the page on which it resides, stores the claims made by the page in the KB. If the implicitClaims variable is set, it also makes any claims implied by the instance. If the instance requires any ontologies that are not currently cataloged in the KB, it will store these ontologies in the KB first.

 o storeRelation
 public void storeRelation(Relation rel,
                           String sourceUrl,
                           Hashtable impCats)
Given a SHOE relation and the URL of the page on which it resides, stores it in the knowledge base. If the implicitClaims variable is set, it also tracks any claims implied by the relation.

 o storeCategory
 public void storeCategory(Category cat,
                           String sourceUrl)
Given a SHOE category and the URL of the page on which it resides, stores it in the knowledge base.

 o storeNewOntologies
 public void storeNewOntologies(Enumeration uontEnum)
Given an enumeration of Use-Ontologies, determines which of the referenced ontologies are not currently loaded into the KB, and stores them into it.

 o storeOntology
 public void storeOntology(Ontology ont)
Stores the ontology's DEF_CATEGORYs, DEF_RELATIONs and DEF_CONSTANTs in the KB. For DEF_CATEGORYs, the isa links and names are stored. For DEF_RELATIONs a new predicate of the correct arity is created. For DEF_CONSTANTs, only the instance links are stored. Stores catalog information about the ontology as well, including a sequence number assigned to it.

 o storeDefCategory
 public void storeDefCategory(Def_Category dcat,
                              Ontology ont)
Given a SHOE DEF_CATEGORY and its source ontology, stores it in the KB. The isa links and names are stored.

 o storeDefRelation
 public void storeDefRelation(Def_Relation drel,
                              Ontology ont)
Given a SHOE DEF_RELATION and its source ontology, stores it in the KB. A new predicate of the correct arity is created.

 o storeDefConstant
 public void storeDefConstant(Def_Constant dconst,
                              Ontology ont)
Given a SHOE DEF_CONSTANT and its source ontology, stores it in the KB. Only the instance links are stored.

 o storeInferenceRule
 public void storeInferenceRule(Def_Inference dinf,
                                Ontology ont)
Given a SHOE DEF-INFERENCE rule and its source ontology, asserts it the KB.

 o setDefaultOntology
 public void setDefaultOntology(String ontId,
                                String ontVer)
Sets the ontology against which queries will be issued unless the query explicitly specifies an ontology.

 o issueQuery
 public ResultSet issueQuery(String predicate,
                             String args[])
Issues a single atom, n-ary query to the KB using the default ontology. Variables arguments are preceded by question marks. The answers are returned in a matrix.

 o issueQuery
 public ResultSet issueQuery(String predicate,
                             String arg1,
                             String arg2)
Issues a single atom, binary query to the KB using the default ontology. Variables arguments are preceded by question marks. The answers are returned in a matrix.

 o issueQuery
 public ResultSet issueQuery(Query query)
Issues an arbitrary query to the KB using the default ontology. Variables arguments are preceded by question marks. The answers are returned in a matrix.

 o getUniqueName
 public String getUniqueName(Ontology refOnt,
                             String name)
Given the name of an ontology object, and an ontology with which to reference the name, creates and returns a unique name for it. The name is constructed by appending an ontology unique sequence number.

 o getUniqueName
 public String getUniqueName(String refOntId,
                             String refOntVer,
                             String name)
Given the name of an ontology object, and the id of an ontology with which to reference the name, creates and returns a unique name for it. The name is constructed by appending an ontology unique sequence number.

 o getUniqueName
 public String getUniqueName(Unique_Elt id)
 o getKnownOntologies
 public Vector getKnownOntologies()
Returns a vector consisting of the OntDescriptors of every ontology known to the KB.

 o getOntSeqNumber
 public int getOntSeqNumber(String ontId,
                            String ontVer)
 o getOntURL
 public String getOntURL(String ontId,
                         String ontVer)
 o getOntDescriptor
 public OntDescriptor getOntDescriptor(String ontId,
                                       String ontVer)
 o getDocMessages
 public String getDocMessages()
Returns the messages generated during the course of storing the current document.

 o getStoredOntologies
 protected Hashtable getStoredOntologies()
Retrieves the catalog information for ontologies from the KB.

 o toKbAtom
 protected Atom toKbAtom(Atom atom)
Given a generic Atom, transforms it into an Atom suitable for use with the KB. Transforms category names that appear in the strucutural predicates to their internal KB versions.


All Packages  Class Hierarchy  This Package  Previous  Next  Index