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.
-
kb
-
-
ontman
-
-
P_EQUAL
-
-
P_EVERY_INSTANCE
-
-
P_GREATER
-
-
P_GREATER_OR_EQUAL
-
-
P_INSTANCE
-
-
P_ISA
-
-
P_LESS
-
-
P_LESS_OR_EQUAL
-
-
P_NOCASE_STRING_MATCH
-
-
P_NOT_EQUAL
-
-
P_STRING_MATCH
-
-
storedOnts
-
-
ShoeKb(KBInterface, OntManager, PrintStream)
- Constructs a new SHOE KB interface using the specified API and
ontology manager.
-
ShoeKb(KBInterface, OntManager, PrintStream, boolean)
- Constructs a new SHOE KB interface using the specified API and
ontology manager.
-
closeConnection()
- Closes the current connection.
-
closeKB()
- Closes the current knowledge base.
-
createKB(String)
- Creates a new KB with the name supplied by the user.
-
establishConnection(String, int)
- Establish a connection to the given host and port number.
-
getDocMessages()
- Returns the messages generated during the course of storing the
current document.
-
getKnownOntologies()
- Returns a vector consisting of the OntDescriptors of every
ontology known to the KB.
-
getOntDescriptor(String, String)
-
-
getOntSeqNumber(String, String)
-
-
getOntURL(String, String)
-
-
getStoredOntologies()
- Retrieves the catalog information for ontologies from the KB.
-
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.
-
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.
-
getUniqueName(Unique_Elt)
-
-
issueQuery(Query)
- Issues an arbitrary query to the KB using the default
ontology.
-
issueQuery(String, String, String)
- Issues a single atom, binary query to the KB using the default
ontology.
-
issueQuery(String, String[])
- Issues a single atom, n-ary query to the KB using the default
ontology.
-
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.
-
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.
-
setDefaultOntology(String, String)
- Sets the ontology against which queries will be issued unless
the query explicitly specifies an ontology.
-
storeCategory(Category, String)
- Given a SHOE category and the URL of the page on which it resides,
stores it in the knowledge base.
-
storeDefCategory(Def_Category, Ontology)
- Given a SHOE DEF_CATEGORY and its source ontology, stores it in
the KB.
-
storeDefConstant(Def_Constant, Ontology)
- Given a SHOE DEF_CONSTANT and its source ontology, stores it in
the KB.
-
storeDefRelation(Def_Relation, Ontology)
- Given a SHOE DEF_RELATION and its source ontology, stores it in
the KB.
-
storeInferenceRule(Def_Inference, Ontology)
- Given a SHOE DEF-INFERENCE rule and its source ontology, asserts it
the KB.
-
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.
-
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.
-
storeOntology(Ontology)
- Stores the ontology's DEF_CATEGORYs, DEF_RELATIONs and DEF_CONSTANTs
in the KB.
-
storeRelation(Relation, String, Hashtable)
- Given a SHOE relation and the URL of the page on which it resides,
stores it in the knowledge base.
-
storeSHOEDoc(SHOE_Doc, String)
- Stores the SHOE information from the given document in the KB.
-
toKbAtom(Atom)
- Given a generic Atom, transforms it into an Atom suitable for
use with the KB.
ontman
protected OntManager ontman
kb
protected KBInterface kb
storedOnts
protected Hashtable storedOnts
P_INSTANCE
public static String P_INSTANCE
P_ISA
public static String P_ISA
P_EVERY_INSTANCE
public static String P_EVERY_INSTANCE
P_STRING_MATCH
public static String P_STRING_MATCH
P_NOCASE_STRING_MATCH
public static String P_NOCASE_STRING_MATCH
P_EQUAL
public static String P_EQUAL
P_NOT_EQUAL
public static String P_NOT_EQUAL
P_GREATER
public static String P_GREATER
P_GREATER_OR_EQUAL
public static String P_GREATER_OR_EQUAL
P_LESS_OR_EQUAL
public static String P_LESS_OR_EQUAL
P_LESS
public static String P_LESS
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.
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.
establishConnection
public void establishConnection(String host,
int port) throws KBException
- Establish a connection to the given host and port number.
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.
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.
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.
closeKB
public void closeKB()
- Closes the current knowledge base.
closeConnection
public void closeConnection()
- Closes the current connection. Any open KBs will be closed as well.
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.
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.
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.
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.
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.
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.
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.
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.
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.
storeInferenceRule
public void storeInferenceRule(Def_Inference dinf,
Ontology ont)
- Given a SHOE DEF-INFERENCE rule and its source ontology, asserts it
the KB.
setDefaultOntology
public void setDefaultOntology(String ontId,
String ontVer)
- Sets the ontology against which queries will be issued unless
the query explicitly specifies an ontology.
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.
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.
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.
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.
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.
getUniqueName
public String getUniqueName(Unique_Elt id)
getKnownOntologies
public Vector getKnownOntologies()
- Returns a vector consisting of the OntDescriptors of every
ontology known to the KB.
getOntSeqNumber
public int getOntSeqNumber(String ontId,
String ontVer)
getOntURL
public String getOntURL(String ontId,
String ontVer)
getOntDescriptor
public OntDescriptor getOntDescriptor(String ontId,
String ontVer)
getDocMessages
public String getDocMessages()
- Returns the messages generated during the course of storing the
current document.
getStoredOntologies
protected Hashtable getStoredOntologies()
- Retrieves the catalog information for ontologies from the KB.
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