| com.hp.hpl.jena.db.impl.IRDBDriver
All known Subclasses: com.hp.hpl.jena.db.impl.DriverRDB,
IRDBDriver | public interface IRDBDriver (Code) | | Generic database interface used for implementing RDF Stores.
Different database table layouts and different SQL dialects should all
be supportable via this generic interface.
In earlier versions of Jena the Driver was exposed to some applications -
that is no longer the case, and no application should need to use these
functions directly.
Based in part on the Jena 1.0 implementation by der.
author: csayers version: $Revision: 1.25 $ |
Inner Class :public class GenSQLAnd | |
Method Summary | |
public boolean | DBisLocked() Return true if the mutex is held. | public Node | RDBStringToNode(String RDBString) Convert an RDB string to the node that it encodes. | public void | abort() Aborts the open transaction, then turns autocommit on. | public String | addEscape(String strToMatch) | public void | begin() | public void | cleanDB() Remove all RDF information from a database. | public void | close() Close the databse connection. | public void | commit() Commits the open transaction, then turns autocommit on. | public List | createSpecializedGraphs(String graphName, Graph requestedProperties) Construct and return a list of specialized graphs. | abstract String | createTable(int graphId, boolean isReif) | abstract void | deleteTable(String tableName) Delete a table. | public void | formatDB() Initialise a database ready to store RDF tables.
Currently the table format depends on the RDBSpec type. | public String | genSQLEscapeKW() | public String | genSQLFromList(int aliasCnt, String table) Generate an SQL string for a from list of a select stmt.
Parameters: aliasCnt - The number of table aliases in the from list. Parameters: table - The name of the table to be queried. | public String | genSQLJoin(int lhsAlias, char lhsCol, int rhsAlias, char rhsCol) Generate an SQL string to joing two table columns.
Parameters: lhsAlias - The left side table alias for the join. Parameters: lhsCol - The left side column to join, one ofS,P,O,N,T. Parameters: rhsAlias - The right side table alias to join. Parameters: rhsCol - The right side column to join. | public String | genSQLLikeKW() | public String | genSQLQualConst(int alias, char col, Node lit) Generate an SQL string to match a table column value to a constant.
If the literal does not occur in the database, a match condition
is generated that will always return false.
There's a known bug in this method. | public String | genSQLQualGraphId(int alias, int graphId) Generate an SQL string to match a graph id. | public String | genSQLQualParam(int alias, char col) Generate an SQL string to match a table column value to a parameter.
Parameters: alias - The table alias for this match. Parameters: col - The column to match, one of S,P,O,N,T for subject,predicate, object, statement or type, respectively. | public String | genSQLReifQualAnyObj(boolean objIsStmt) Generate an SQL string for a reified statement to match on any subject,
predicate or object column.
Parameters: objIsStmt - If true, the object value is rdf:Statement so also matchon the hasType column. | public String | genSQLReifQualConst(int alias, char pred, Node lit) Similar to genSQLQualConst except that it generates SQL strings
for the reification statement table. | public String | genSQLReifQualObj(char reifProp, boolean hasObj) Generate an SQL string for a reified statement to match on a property column.
Parameters: reifProp - The property column to match, one of S,P,O,T for subject,predicate, object or type, respectively. Parameters: hasObj - If true, the object value is known so do equality match. | public String | genSQLReifQualStmt() Generate an SQL string for a reified statement to match on the stmt URI. | public String | genSQLResList(int resIndex, VarDesc[] binding) Generate an SQL string for a result list of a select stmt.
Parameters: binding - Array of Var containing the result list bindings. | public String | genSQLSelectStmt(String res, String from, String where) Generate an SQL Select statement given the result list,
the from list and the where clause;
Parameters: res - The result list as a string. Parameters: from - The from list as a string. Parameters: where - The where qualifier as a string. | public String | genSQLStringMatch(int alias, char col, String fun, String stringToMatch) | public String | genSQLStringMatchEscape() | public String | genSQLStringMatchLHS(boolean ignCase, String var) | public String | genSQLStringMatchLHS_IC(String var) | public String | genSQLStringMatchOp(boolean ignCase, String fun) | public String | genSQLStringMatchOp(String fun) | public String | genSQLStringMatchOp_IC(String fun) | public String | genSQLStringMatchRHS(boolean ignCase, boolean pfxMatch, String strToMatch) | public String | genSQLStringMatchRHS_IC(String strToMatch) | public int | getCompressCacheSize() | public int | getCompressURILength() | public IDBConnection | getConnection() | String | getDatabaseType() Return a string identifying underlying database type. | DBPropGraph | getDefaultModelProperties() Obtain a default set of model properties. | public boolean | getDoCompressURI() | public boolean | getDoDuplicateCheck() | public int | getIndexKeyLength() | public int | getIndexKeyLengthMax() | public int | getInsertID(String tableName) Return an auto-generated identifier for a table row.
Parameters: tableName - The name of the table for the insert. | public boolean | getIsTransactionDb() | public int | getLongObjectLength() | public int | getLongObjectLengthMax() | public String | getStoreWithModel() | public SpecializedGraph | getSystemSpecializedGraph(boolean doInit) Return the specialized graph containing system properties.
Formats the database and constucts a new one if doInit is true.
Parameters: doInit - if true, format the database if needed. | public int | getSystemTableCount() Return the number of system tables. | public String | getSystemTableName(int i) | public String | getTableNamePrefix() | public int | graphIdAlloc(String graphName) Allocate an identifier for a new graph.
Parameters: graphName - The name of a new graph. | public void | graphIdDealloc(int graphId) Deallocate an identifier for a new graph. | public boolean | isDBFormatOK() Test if the database has previously been formatted (there's no other
way to easily tell, since getSpecializedGraph will always return
something). | public void | lockDB() Acquire the mutex lock in the database. | public String | nodeToRDBString(Node node, boolean addIfLong) Convert a node to a string to be stored in a statement table.
Parameters: Node - The node to convert to a string. | public List | recreateSpecializedGraphs(DBPropGraph graphProperties) Reconstruct and return a list of specialized graphs.
Parameters: graphProperties - A set of customization properties for the graph. | public void | removeSpecializedGraphs(DBPropGraph graphProperties, List specializedGraphs) Remove the specialized graph, erasing all trace of a Graph. | public void | setCompressCacheSize(int count) Set the value of CompressCacheSize. | public void | setCompressURILength(int len) Set the value of CompressURILength. | public void | setConnection(IDBConnection dbcon) | void | setDatabaseProperties(Graph databaseProperties) Method setDatabaseProperties. | public void | setDoCompressURI(boolean bool) Set the value of DoCompressURI. | public void | setDoDuplicateCheck(boolean bool) Set the value of DoDuplicateCheck. | public void | setIndexKeyLength(int len) Set the value of IndexKeyLength. | public void | setIsTransactionDb(boolean bool) Set the value of IsTransactionDb. | public void | setLongObjectLength(int len) Set the value of LongObjectLength. | public void | setStoreWithModel(String modelName) Set the value of StoreWithModel. | public void | setTableNamePrefix(String prefix) Set the value of TableNamePrefix. | public String | stringMatchAllChar() | public String | stringMatchEscapeChar() | public boolean | stringMatchNeedsEscape(String strToMatch) | public boolean | supportsJenaReification() Returns true if the database layout supports implicit reification.
of statements (i.e. | public boolean | supportsMultipleModels() Returns true if the database layout supports multiple RDF models in the same database. | public boolean | transactionsSupported() Returns true if the underlying database supports transactions. | public boolean | tryLockDB() Return true if the database is locked, else false. | public void | unlockDB() Release the mutex lock in the database. |
RDBStringToNode | public Node RDBStringToNode(String RDBString)(Code) | | Convert an RDB string to the node that it encodes. Return null if failure.
Parameters: RDBstring - The string to convert to a node. The node. |
abort | public void abort() throws RDFRDBException(Code) | | Aborts the open transaction, then turns autocommit on.
|
begin | public void begin() throws RDFRDBException(Code) | | Turns autocommit off, then opens a new transaction. *
|
cleanDB | public void cleanDB()(Code) | | Remove all RDF information from a database.
There should be no need for an application to call this function
directly - instead use DBConnection.cleanDB().
|
close | public void close() throws RDFRDBException(Code) | | Close the databse connection.
throws: RDFDBException - if there is an access problem |
commit | public void commit() throws RDFRDBException(Code) | | Commits the open transaction, then turns autocommit on.
|
createSpecializedGraphs | public List createSpecializedGraphs(String graphName, Graph requestedProperties)(Code) | | Construct and return a list of specialized graphs.
Parameters: graphName - TODO Parameters: requestedProperties - TODO List of SpecializedGraphs to store a Graph since: Jena 2.0 |
createTable | abstract String createTable(int graphId, boolean isReif)(Code) | | |
deleteTable | abstract void deleteTable(String tableName)(Code) | | Delete a table.
For internal use only.
|
formatDB | public void formatDB() throws RDFRDBException(Code) | | Initialise a database ready to store RDF tables.
Currently the table format depends on the RDBSpec type. In future it
may become an explicit part of operations like this.
throws: RDFDBException - if the is a problem opening the connection or an internal SQL error. |
genSQLFromList | public String genSQLFromList(int aliasCnt, String table)(Code) | | Generate an SQL string for a from list of a select stmt.
Parameters: aliasCnt - The number of table aliases in the from list. Parameters: table - The name of the table to be queried. SQL string (not prefixed by "From"). |
genSQLJoin | public String genSQLJoin(int lhsAlias, char lhsCol, int rhsAlias, char rhsCol)(Code) | | Generate an SQL string to joing two table columns.
Parameters: lhsAlias - The left side table alias for the join. Parameters: lhsCol - The left side column to join, one ofS,P,O,N,T. Parameters: rhsAlias - The right side table alias to join. Parameters: rhsCol - The right side column to join. SQL string. |
genSQLQualConst | public String genSQLQualConst(int alias, char col, Node lit)(Code) | | Generate an SQL string to match a table column value to a constant.
If the literal does not occur in the database, a match condition
is generated that will always return false.
There's a known bug in this method. the literal is converted to
a string BEFORE the query is run. consequently, there's a race
condition. if the (long) literal is not in the database
when the query is compiled but is added prior to running the
query, then the query will (incorrectly) return no results.
for now, we'll ignore this case and document it as a bug.
Parameters: alias - The table alias for this match. Parameters: col - The column to match, one of S,P,O,N,T for subject,predicate, object, statement or type, respectively. Parameters: lit - The literal value to match. SQL string. |
genSQLQualGraphId | public String genSQLQualGraphId(int alias, int graphId)(Code) | | Generate an SQL string to match a graph id.
Parameters: alias - The table alias for this match. Parameters: graphId - The identifer of the graph to match. SQL string. |
genSQLQualParam | public String genSQLQualParam(int alias, char col)(Code) | | Generate an SQL string to match a table column value to a parameter.
Parameters: alias - The table alias for this match. Parameters: col - The column to match, one of S,P,O,N,T for subject,predicate, object, statement or type, respectively. SQL string. |
genSQLReifQualAnyObj | public String genSQLReifQualAnyObj(boolean objIsStmt)(Code) | | Generate an SQL string for a reified statement to match on any subject,
predicate or object column.
Parameters: objIsStmt - If true, the object value is rdf:Statement so also matchon the hasType column. qualifier string |
genSQLReifQualConst | public String genSQLReifQualConst(int alias, char pred, Node lit)(Code) | | Similar to genSQLQualConst except that it generates SQL strings
for the reification statement table.
|
genSQLReifQualObj | public String genSQLReifQualObj(char reifProp, boolean hasObj)(Code) | | Generate an SQL string for a reified statement to match on a property column.
Parameters: reifProp - The property column to match, one of S,P,O,T for subject,predicate, object or type, respectively. Parameters: hasObj - If true, the object value is known so do equality match. Otherwise,just check for non-null value. qualifier string |
genSQLReifQualStmt | public String genSQLReifQualStmt()(Code) | | Generate an SQL string for a reified statement to match on the stmt URI.
qualifier string |
genSQLResList | public String genSQLResList(int resIndex, VarDesc[] binding)(Code) | | Generate an SQL string for a result list of a select stmt.
Parameters: binding - Array of Var containing the result list bindings. SQL string (not prefixed by "Select"). |
genSQLSelectStmt | public String genSQLSelectStmt(String res, String from, String where)(Code) | | Generate an SQL Select statement given the result list,
the from list and the where clause;
Parameters: res - The result list as a string. Parameters: from - The from list as a string. Parameters: where - The where qualifier as a string. SQL statement. |
genSQLStringMatchEscape | public String genSQLStringMatchEscape()(Code) | | |
genSQLStringMatchRHS | public String genSQLStringMatchRHS(boolean ignCase, boolean pfxMatch, String strToMatch)(Code) | | |
getCompressCacheSize | public int getCompressCacheSize()(Code) | | Get the value of CompressCacheSize
int |
getCompressURILength | public int getCompressURILength()(Code) | | Get the value of CompressURILength
int |
getDatabaseType | String getDatabaseType()(Code) | | Return a string identifying underlying database type.
|
getDefaultModelProperties | DBPropGraph getDefaultModelProperties()(Code) | | Obtain a default set of model properties.
Return the default properties for a new model stored in this database
DBPropGraph containg the default properties for a new model |
getDoCompressURI | public boolean getDoCompressURI()(Code) | | Get the value of DoCompressURI
bool |
getDoDuplicateCheck | public boolean getDoDuplicateCheck()(Code) | | Get the value of DoDuplicateCheck
bool |
getIndexKeyLength | public int getIndexKeyLength()(Code) | | Get the value of IndexKeyLength
int |
getIndexKeyLengthMax | public int getIndexKeyLengthMax()(Code) | | Get the maximum possible value of IndexKeyLength
int |
getInsertID | public int getInsertID(String tableName)(Code) | | Return an auto-generated identifier for a table row.
Parameters: tableName - The name of the table for the insert. the auto-generated identifier.. |
getIsTransactionDb | public boolean getIsTransactionDb()(Code) | | Get the value of IsTransactionDb
bool |
getLongObjectLength | public int getLongObjectLength()(Code) | | Get the value of LongObjectLength
int |
getLongObjectLengthMax | public int getLongObjectLengthMax()(Code) | | Get the maximum possible value of LongObjectLength
int |
getStoreWithModel | public String getStoreWithModel()(Code) | | Get the value of StoreWithModel
String |
getSystemSpecializedGraph | public SpecializedGraph getSystemSpecializedGraph(boolean doInit)(Code) | | Return the specialized graph containing system properties.
Formats the database and constucts a new one if doInit is true.
Parameters: doInit - if true, format the database if needed. SpecializedGraph holding properties of this database since: Jena 2.0 |
getSystemTableCount | public int getSystemTableCount()(Code) | | Return the number of system tables.
|
getSystemTableName | public String getSystemTableName(int i)(Code) | | Return the name of a system table
|
getTableNamePrefix | public String getTableNamePrefix()(Code) | | Get the value of TableNamePrefix
String |
graphIdAlloc | public int graphIdAlloc(String graphName)(Code) | | Allocate an identifier for a new graph.
Parameters: graphName - The name of a new graph. the identifier of the new graph. |
graphIdDealloc | public void graphIdDealloc(int graphId)(Code) | | Deallocate an identifier for a new graph.
Parameters: graphId - The graph identifier. |
isDBFormatOK | public boolean isDBFormatOK()(Code) | | Test if the database has previously been formatted (there's no other
way to easily tell, since getSpecializedGraph will always return
something).
boolean true if database is correctly formatted, false on any error. |
lockDB | public void lockDB() throws RDFRDBException(Code) | | Acquire the mutex lock in the database. This
is used to implement critical sections to prevent
concurrent Jena threads from inteferring with
each other when creating/destroying models,
formatting databases, etc.
There should be no need for an application to
call this method.
|
nodeToRDBString | public String nodeToRDBString(Node node, boolean addIfLong)(Code) | | Convert a node to a string to be stored in a statement table.
Parameters: Node - The node to convert to a string. Must be a concrete node. Parameters: addIfLong - If the node is a long object and is not in the database, add it. the string. |
recreateSpecializedGraphs | public List recreateSpecializedGraphs(DBPropGraph graphProperties)(Code) | | Reconstruct and return a list of specialized graphs.
Parameters: graphProperties - A set of customization properties for the graph. List of SpecializedGraphs to store a Graph since: Jena 2.0 |
removeSpecializedGraphs | public void removeSpecializedGraphs(DBPropGraph graphProperties, List specializedGraphs)(Code) | | Remove the specialized graph, erasing all trace of a Graph.
Parameters: graphProperties - The properties for the graph to be removed. since: Jena 2.0 |
setCompressCacheSize | public void setCompressCacheSize(int count)(Code) | | Set the value of CompressCacheSize.
int |
setCompressURILength | public void setCompressURILength(int len)(Code) | | Set the value of CompressURILength. Throws an exception if
the database has been initialized.
int |
setDatabaseProperties | void setDatabaseProperties(Graph databaseProperties)(Code) | | Method setDatabaseProperties.
Sets the current properties for the database.
Parameters: databaseProperties - is a Graph containing a full set of database properties |
setDoCompressURI | public void setDoCompressURI(boolean bool)(Code) | | Set the value of DoCompressURI. Throws an exception if
the database has been initialized.
Parameters: bool - |
setDoDuplicateCheck | public void setDoDuplicateCheck(boolean bool)(Code) | | Set the value of DoDuplicateCheck.
Parameters: bool - |
setIndexKeyLength | public void setIndexKeyLength(int len)(Code) | | Set the value of IndexKeyLength. Throws an exception if
the database has been initialized.
int |
setIsTransactionDb | public void setIsTransactionDb(boolean bool)(Code) | | Set the value of IsTransactionDb. Throws an exception if
the database has been initialized.
Parameters: bool - |
setLongObjectLength | public void setLongObjectLength(int len)(Code) | | Set the value of LongObjectLength. Throws an exception if
the database has been initialized.
int |
setStoreWithModel | public void setStoreWithModel(String modelName)(Code) | | Set the value of StoreWithModel.
Parameters: String - |
setTableNamePrefix | public void setTableNamePrefix(String prefix)(Code) | | Set the value of TableNamePrefix.
Parameters: String - |
stringMatchEscapeChar | public String stringMatchEscapeChar()(Code) | | |
stringMatchNeedsEscape | public boolean stringMatchNeedsEscape(String strToMatch)(Code) | | |
supportsJenaReification | public boolean supportsJenaReification()(Code) | | Returns true if the database layout supports implicit reification.
of statements (i.e. statements can be treated as resources).
boolean true if the database supports jena 1.0 reification. |
supportsMultipleModels | public boolean supportsMultipleModels()(Code) | | Returns true if the database layout supports multiple RDF models in the same database.
boolean true if the database supports multiple models |
transactionsSupported | public boolean transactionsSupported()(Code) | | Returns true if the underlying database supports transactions.
|
tryLockDB | public boolean tryLockDB() throws RDFRDBException(Code) | | Return true if the database is locked, else false.
|
|
|