| java.lang.Object com.hp.hpl.jena.db.impl.PSet_TripleStore_RDB
All known Subclasses: com.hp.hpl.jena.db.impl.PSet_ReifStore_RDB,
PSet_TripleStore_RDB | public class PSet_TripleStore_RDB implements IPSet(Code) | | Handles Physical storage for implementing SpecializedGraphs.
Different PSet classes are needed for different databases and different
layout schemes.
This class is a base implemention from which database-specific
drivers can inherit. It is not generic in the sense that it will work
on any minimal SQL store and so should be treated as if it were
an abstract class.
The SQL statements which implement each of the functions are
loaded in a separate file etc/[layout]_[database].sql from the classpath.
See
SQLCache SQLCache documentation for more information on the
format of this file.
Based on Driver* classes by Dave Reynolds.
author: Harumi Kuno version: $Revision: 1.58 $ on $Date: 2008/01/02 12:08:23 $ |
Method Summary | |
public void | cleanDB() Remove all RDF information about this pset from a database. | public void | close() | public void | deleteTriple(Triple t, IDBID graphID) Attempt to remove a statement from an Asserted_Statement table,
if it is present. | public void | deleteTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements) Attempt to remove a statement from an Asserted_Statement table,
if it is present. | public void | deleteTripleAR(Triple t, IDBID graphID, Node reifNode, boolean isBatch, Hashtable batchedPreparedStatements) Attempt to remove a statement from an Asserted_Statement table,
if it is present. | public void | deleteTripleList(List triples, IDBID my_GID) Attempt to remove a list of triples from the specialized graph.
As each triple is successfully deleted it is removed from the List. | public IRDBDriver | driver() | public Triple | extractTripleFromRowData(String subj, String pred, String obj) Convert the current row of a result set from a ResultSet
to a Triple. | public ExtendedIterator | find(TripleMatch t, IDBID graphID) | public Node_Literal | getLiteralFromCache(IDBID id) Fetch a literal from the cache just knowing its literal rdb-id. | public PreparedStatement | getPreparedStatement(String op, String tableName, boolean isBatch, Hashtable batchedPreparedStatements) Given an operation name, a table name, whether or not this operation is part of a batched update, and
a table of batched prepared statements, find or create an appropriate PreparedStatement. | public SQLCache | getSQLCache() | public String | getTblName() Accessor for m_tblName. | public void | removeStatementsFromDB(IDBID graphID) | public int | rowCount(int gid) Compute the number of rows in a table. | public void | setCachePreparedStatements(boolean value) | public void | setDriver(IRDBDriver driver) | public void | setSQLCache(SQLCache cache) | public void | setSQLType(String value) | public void | setSkipDuplicateCheck(boolean value) | public void | setTblName(String tblName) Sets m_tblName variable. | public boolean | statementTableContains(IDBID graphID, Triple t) Tests if a triple is contained in the specialized graph.
Parameters: t - is the triple to be tested Parameters: graphID - is the id of the graph. | public void | storeTriple(Triple t, IDBID graphID) Attempt to store a statement into an Asserted_Statement table. | public void | storeTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements) Attempt to store a statement into an Asserted_Statement table. | public void | storeTripleAR(Triple t, IDBID graphID, Node reifNode, boolean hasType, boolean isBatch, Hashtable batchedPreparedStatements) Attempt to store a statement into an Asserted_Statement table. | public void | storeTripleList(List triples, IDBID my_GID) Attempt to add a list of triples to the specialized graph.
As each triple is successfully added it is removed from the List. | public String | toString() | public int | tripleCount(IDBID graphId) Compute the number of unique triples added to the Specialized Graph. | public IDBID | wrapDBID(Object id) Convert the raw SQL object used to store a database identifier into a java object
which meets the IDBID interface. | public Object | wrapFlag(boolean flag) Wrap up a boolean flag as a object which the jdbc driver can assert into a boolean/short column. |
CACHE_PREPARED_STATEMENTS | protected boolean CACHE_PREPARED_STATEMENTS(Code) | | Set to true to enable cache of pre-prepared statements
|
DEFAULT_CACHE | final protected static int DEFAULT_CACHE(Code) | | default size for literal and resource caches
|
ID_SQL_TYPE | protected String ID_SQL_TYPE(Code) | | The SQL type to use for storing ids (compatible with wrapDBID)
|
SKIP_DUPLICATE_CHECK | protected boolean SKIP_DUPLICATE_CHECK(Code) | | Set to true if the insert operations already check for duplications
|
literalCache | protected ICache literalCache(Code) | | Cache of literals
|
logger | protected static Log logger(Code) | | |
m_sql | protected SQLCache m_sql(Code) | | The table of sql driver statements
|
m_tblName | public String m_tblName(Code) | | Holds name of AssertedStatement table (defaults to JENA_SYS_AssStatements).
Every triple store has at least one tables for AssertedStatements.
|
resourceCache | protected ICache resourceCache(Code) | | Cache of resources
|
PSet_TripleStore_RDB | public PSet_TripleStore_RDB()(Code) | | Constructor.
|
cleanDB | public void cleanDB()(Code) | | Remove all RDF information about this pset from a database.
|
close | public void close()(Code) | | Close this PSet
|
deleteTriple | public void deleteTriple(Triple t, IDBID graphID)(Code) | | Attempt to remove a statement from an Asserted_Statement table,
if it is present. Return without error if the statement is not
present.
Parameters: subj_uri - is the URI of the subject Parameters: pred_uri - is the URI of the predicate (property) Parameters: obj_node - is the URI of the object (can be URI or literal) Parameters: graphID - is the ID of the graph Parameters: complete - is true if this handler is capable of adding this triple. |
deleteTriple | public void deleteTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements)(Code) | | Attempt to remove a statement from an Asserted_Statement table,
if it is present. Return without error if the statement is not
present.
Parameters: subj_uri - is the URI of the subject Parameters: pred_uri - is the URI of the predicate (property) Parameters: obj_node - is the URI of the object (can be URI or literal) Parameters: graphID - is the ID of the graph Parameters: complete - is true if this handler is capable of adding this triple. |
deleteTripleAR | public void deleteTripleAR(Triple t, IDBID graphID, Node reifNode, boolean isBatch, Hashtable batchedPreparedStatements)(Code) | | Attempt to remove a statement from an Asserted_Statement table,
if it is present. Return without error if the statement is not
present.
Parameters: subj_uri - is the URI of the subject Parameters: pred_uri - is the URI of the predicate (property) Parameters: obj_node - is the URI of the object (can be URI or literal) Parameters: stmtURI - is the URI of the statement if reified, null for asserted Parameters: graphID - is the ID of the graph Parameters: complete - is true if this handler is capable of adding this triple. |
deleteTripleList | public void deleteTripleList(List triples, IDBID my_GID)(Code) | | Attempt to remove a list of triples from the specialized graph.
As each triple is successfully deleted it is removed from the List. If
complete is true then the entire List was added and the List will be
empty upon return. if complete is false, then at least one triple remains
in the List.
If a triple can't be stored for any reason other than incompatability
(for example, a lack of disk space) then the implemenation should throw a
runtime exception.
Parameters: triples - List of triples to be added. This is modified by the call. Parameters: my_GID - ID of the graph. |
extractTripleFromRowData | public Triple extractTripleFromRowData(String subj, String pred, String obj)(Code) | | Convert the current row of a result set from a ResultSet
to a Triple.
Expects row to contain:
S.SubjRes, S.PropRes, S.ObjRes, S.ObjStr, S.ObjLiteral
Parameters: rs - the resultSet to be processed. |
getLiteralFromCache | public Node_Literal getLiteralFromCache(IDBID id)(Code) | | Fetch a literal from the cache just knowing its literal rdb-id.
If it is not in the cache, do not attempt to retrieve it from the database.
|
getPreparedStatement | public PreparedStatement getPreparedStatement(String op, String tableName, boolean isBatch, Hashtable batchedPreparedStatements) throws SQLException(Code) | | Given an operation name, a table name, whether or not this operation is part of a batched update, and
a table of batched prepared statements, find or create an appropriate PreparedStatement.
Parameters: op - Parameters: tableName - Parameters: isBatch - Parameters: batchedPreparedStatements - the prepared statement throws: SQLException - |
getTblName | public String getTblName()(Code) | | Accessor for m_tblName.
name of the Statement table. |
removeStatementsFromDB | public void removeStatementsFromDB(IDBID graphID)(Code) | | |
rowCount | public int rowCount(int gid)(Code) | | Compute the number of rows in a table.
int count. |
setCachePreparedStatements | public void setCachePreparedStatements(boolean value)(Code) | | |
setSkipDuplicateCheck | public void setSkipDuplicateCheck(boolean value)(Code) | | |
setTblName | public void setTblName(String tblName)(Code) | | Sets m_tblName variable.
Parameters: tblName - the name of the Statement Table |
statementTableContains | public boolean statementTableContains(IDBID graphID, Triple t)(Code) | | Tests if a triple is contained in the specialized graph.
Parameters: t - is the triple to be tested Parameters: graphID - is the id of the graph. boolean result to indicte if the tripple was contained |
storeTriple | public void storeTriple(Triple t, IDBID graphID)(Code) | | Attempt to store a statement into an Asserted_Statement table.
Parameters: subj_uri - is the URI of the subject Parameters: pred_uri - is the URI of the predicate (property) Parameters: obj_node - is the URI of the object (can be URI or literal) Parameters: graphID - is the ID of the graph Parameters: complete - is true if this handler is capable of adding this triple. |
storeTriple | public void storeTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements)(Code) | | Attempt to store a statement into an Asserted_Statement table.
Parameters: subj_uri - is the URI of the subject Parameters: pred_uri - is the URI of the predicate (property) Parameters: obj_node - is the URI of the object (can be URI or literal) Parameters: graphID - is the ID of the graph Parameters: isBatch - is true if this request is part of a batch operation. |
storeTripleAR | public void storeTripleAR(Triple t, IDBID graphID, Node reifNode, boolean hasType, boolean isBatch, Hashtable batchedPreparedStatements)(Code) | | Attempt to store a statement into an Asserted_Statement table.
Parameters: subj_uri - is the URI of the subject Parameters: pred_uri - is the URI of the predicate (property) Parameters: obj_node - is the URI of the object (can be URI or literal) Parameters: stmtURI - is the URI of the statement if reified, null for asserted Parameters: hasType - is true if the hasType flag should be set for a reified stmt Parameters: graphID - is the ID of the graph Parameters: isBatch - is true if this request is part of a batch operation. |
storeTripleList | public void storeTripleList(List triples, IDBID my_GID)(Code) | | Attempt to add a list of triples to the specialized graph.
As each triple is successfully added it is removed from the List. If
complete is true then the entire List was added and the List will be
empty upon return. if complete is false, then at least one triple remains
in the List.
If a triple can't be stored for any reason other than incompatability
(for example, a lack of disk space) then the implemenation should throw a
runtime exception.
Parameters: triples - List of triples to be added. This is modified by the call. Parameters: my_GID - ID of the graph. |
toString | public String toString()(Code) | | Printable name for the driver configuration
|
tripleCount | public int tripleCount(IDBID graphId)(Code) | | Compute the number of unique triples added to the Specialized Graph.
int count. |
wrapDBID | public IDBID wrapDBID(Object id) throws RDFRDBException(Code) | | Convert the raw SQL object used to store a database identifier into a java object
which meets the IDBID interface.
|
wrapFlag | public Object wrapFlag(boolean flag)(Code) | | Wrap up a boolean flag as a object which the jdbc driver can assert into a boolean/short column.
|
|
|