|
Protege 2.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protege.storage.jdbc.SimpleJdbcDatabaseManager
An implementation of the database schema interface that implements a very simple database schema. This schema is described in some detail, along with its rationale at http://protege.stanford.edu/doc/design/jdbc_backend.html This schema is quite convenient for Protege itself to use because it maps directly to the way Protege works. Everything is a slot value or a facet value. The schema is totally useless for someone trying to write reasonable SQL to get information out of their knowledge base. Such a backend could certainly be developed. This is not it though!
Nested Class Summary | |
static class |
SimpleJdbcDatabaseManager.ValueDBIndexPair
|
Field Summary |
Fields inherited from interface edu.stanford.smi.protege.storage.jdbc.DatabaseConstants |
TYPE_BOOLEAN, TYPE_CLASS, TYPE_FACET, TYPE_FLOAT, TYPE_INTEGER, TYPE_INVALID, TYPE_SIMPLE_INSTANCE, TYPE_SLOT, TYPE_STRING |
Constructor Summary | |
SimpleJdbcDatabaseManager(String driver,
String url,
String tablename,
String username,
String password,
Collection errors)
|
Method Summary | |
void |
addValue(Frame frame,
Slot slot,
Facet facet,
boolean isTemplate,
Object value)
|
boolean |
beginTransaction()
returns true if transaction started successfully |
void |
createIndexes()
|
void |
createTable()
|
void |
dispose()
|
boolean |
endTransaction(boolean doCommit)
return true if transation commited successfull |
Collection |
getAllFrameIDs()
|
Collection |
getDBReferences(Object o,
int maxMatches)
returns a collection of DBReference objects |
String |
getDriverLongvarcharName()
|
String |
getDriverName()
|
int |
getFrameCount(int type)
|
Collection |
getFrameIDs(FrameID slot,
FrameID facet,
boolean isTemplate,
String value)
|
Collection |
getFramesWithAnyValue(Slot slot,
Facet facet,
boolean isTemplate)
returns a collection of FrameIDs |
Collection |
getFramesWithValue(Slot slot,
Facet facet,
boolean isTemplate,
Object value)
returns a collection of FrameIDs |
int |
getFrameType(FrameID id)
|
String |
getLongvarcharName()
|
Collection |
getMatchingFrameIDs(FrameID slot,
FrameID facet,
boolean isTemplate,
String value,
int maxMatches)
|
String |
getParameterLongvarcharName()
|
String |
getTableName()
|
int |
getValueCount(FrameID frame,
FrameID slot,
FrameID facet,
boolean isTemplate)
|
List |
getValues(FrameID frame,
FrameID slot,
FrameID facet,
boolean isTemplate)
returns a collection of Objects. |
boolean |
hasValueAtSomeFrame(Slot slot,
Facet facet,
boolean isTemplate)
|
void |
removeAllReferences(Frame frame)
|
void |
removeAllValues(Frame frame,
Slot slot,
Facet facet,
boolean isTemplate)
|
void |
removeFramesWithValue(Slot slot,
Facet facet,
boolean isTemplate)
|
void |
removeSingleValue(Frame frame,
Slot slot,
Facet facet,
boolean isTemplate,
Object value)
|
void |
saveKnowledgeBase(KnowledgeBase kb)
|
void |
setTracing(boolean b)
|
void |
setValue(Frame frame,
Slot slot,
Facet facet,
boolean isTemplate,
Object value)
|
void |
setValues(Frame frame,
Slot slot,
Facet facet,
boolean isTemplate,
Collection values)
|
boolean |
supportsTransactions()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SimpleJdbcDatabaseManager(String driver, String url, String tablename, String username, String password, Collection errors)
Method Detail |
public void addValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value) throws SQLException
addValue
in interface DatabaseManager
SQLException
public boolean beginTransaction()
beginTransaction
in interface DatabaseManager
public void createIndexes() throws SQLException
SQLException
public void createTable() throws SQLException
SQLException
public void dispose()
dispose
in interface Disposable
public boolean endTransaction(boolean doCommit)
endTransaction
in interface DatabaseManager
public int getFrameCount(int type) throws SQLException
getFrameCount
in interface DatabaseManager
SQLException
public Collection getAllFrameIDs() throws SQLException
getAllFrameIDs
in interface DatabaseManager
SQLException
public Collection getDBReferences(Object o, int maxMatches) throws SQLException
DatabaseManager
getDBReferences
in interface DatabaseManager
o
- Description of Parameter
SQLException
- Description of Exceptionpublic String getDriverLongvarcharName() throws SQLException
SQLException
public String getDriverName()
getDriverName
in interface DatabaseManager
public Collection getFrameIDs(FrameID slot, FrameID facet, boolean isTemplate, String value) throws SQLException
getFrameIDs
in interface DatabaseManager
SQLException
public int getFrameType(FrameID id) throws SQLException
getFrameType
in interface DatabaseManager
SQLException
public String getLongvarcharName() throws SQLException
SQLException
public Collection getFramesWithValue(Slot slot, Facet facet, boolean isTemplate, Object value) throws SQLException
DatabaseManager
getFramesWithValue
in interface DatabaseManager
SQLException
public Collection getFramesWithAnyValue(Slot slot, Facet facet, boolean isTemplate) throws SQLException
DatabaseManager
getFramesWithAnyValue
in interface DatabaseManager
SQLException
public Collection getMatchingFrameIDs(FrameID slot, FrameID facet, boolean isTemplate, String value, int maxMatches) throws SQLException
getMatchingFrameIDs
in interface DatabaseManager
SQLException
public String getParameterLongvarcharName()
public String getTableName()
getTableName
in interface DatabaseManager
public int getValueCount(FrameID frame, FrameID slot, FrameID facet, boolean isTemplate) throws SQLException
getValueCount
in interface DatabaseManager
SQLException
public List getValues(FrameID frame, FrameID slot, FrameID facet, boolean isTemplate) throws SQLException
DatabaseManager
getValues
in interface DatabaseManager
SQLException
public boolean hasValueAtSomeFrame(Slot slot, Facet facet, boolean isTemplate) throws SQLException
hasValueAtSomeFrame
in interface DatabaseManager
SQLException
public void removeAllReferences(Frame frame) throws SQLException
removeAllReferences
in interface DatabaseManager
SQLException
public void removeAllValues(Frame frame, Slot slot, Facet facet, boolean isTemplate) throws SQLException
removeAllValues
in interface DatabaseManager
SQLException
public void removeFramesWithValue(Slot slot, Facet facet, boolean isTemplate) throws SQLException
removeFramesWithValue
in interface DatabaseManager
SQLException
public void removeSingleValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value) throws SQLException
removeSingleValue
in interface DatabaseManager
SQLException
public void saveKnowledgeBase(KnowledgeBase kb) throws SQLException
saveKnowledgeBase
in interface DatabaseManager
SQLException
public void setTracing(boolean b)
setTracing
in interface DatabaseManager
public void setValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value) throws SQLException
setValue
in interface DatabaseManager
SQLException
public void setValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values) throws SQLException
setValues
in interface DatabaseManager
SQLException
public boolean supportsTransactions()
supportsTransactions
in interface DatabaseManager
public String toString()
|
Protege 2.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |