|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Generic database interface used for implementing RDF Stores. Different database table layouts and different SQL dialects should all be supportable via this generic interface. Each driver instance can support multiple stores so long as "supportsMultipleModels" is true.
| Method Summary | |
void |
addStatement(Statement s,
ModelRDB m)
Register a statement in the database. |
IDBID |
allocateModelID(java.lang.String modelName)
Allocate a new databaseID for a new model in the same database. |
void |
attachStore(StoreRDB store)
Register a store as a user of this driver. |
void |
cleanDB()
Remove all RDF information from a database. |
void |
clear(ModelRDB model)
Remove all the statements from the given model. |
void |
close()
Close the databse connection |
IConstraints |
createConstraints(ModelRDB model)
Create a constraint object appropriate for this type of database layout |
void |
deleteModel(java.lang.String modelName)
Delete the named from from within the database. |
boolean |
deleteStatement(IDBID statementID,
ModelRDB m)
Delete the statement in the model corresponding to the given statement ID |
boolean |
deleteStatement(Resource subject,
Property predicate,
RDFNode object,
ModelRDB m)
Delete the statements in the model which match the given subject, predicate object. |
void |
detachStore(StoreRDB store)
Notify that a store is no longer using this driver. |
void |
formatDB()
Initialise a database ready to store RDF tables. |
StatementImplRDB |
getBareStatementResource(IDBID id,
ModelRDB m)
Fetch a reiefied statement resource just knowing its resource rdb-id. |
java.sql.Connection |
getConnection()
Return the jdbc connection to the database, opening it if necessary |
Literal |
getLiteral(IDBID id)
Fetch a literal just knowing its literal rdb-id |
Literal |
getLiteralFromCache(IDBID id)
Fetch a literal from the cache just knowing its literal rdb-id. |
IDBID |
getLiteralID(Literal l)
Return the database ID for the literal |
IDBID |
getModelID(java.lang.String modelName)
Return the databaseID for an existing named model within the database. |
java.lang.String |
getNamespace(IDBID nsid)
Return the namespace string corresponding to a given namespace id |
Property |
getProperty(IDBID id,
ModelRDB m)
Fetch a property just knowing its resource rdb-id. |
Property |
getProperty(java.lang.String uri,
ModelRDB m)
Fetch a property, knowing its uri. |
Property |
getPropertyFromCache(IDBID id,
ModelRDB m)
Fetch a property from the cache just knowing its resource rdb-id. |
Resource |
getResource(IDBID id,
ModelRDB m)
Fetch a resource just knowing its resource rdb-id. |
Resource |
getResource(java.lang.String uri,
ModelRDB m)
Fetch a resource, knowing its uri. |
Resource |
getResourceFromCache(IDBID id,
ModelRDB m)
Fetch a resource from the cache just knowing its resource rdb-id. |
IDBID |
getResourceID(Resource resource)
Lookup the unique ID for a resource. |
SQLCache |
getSQLCache()
Return the SQLCache used for low level database commands. |
void |
hintPropertyTable(Property p)
Hint to the store that the given property could be stored as an attribute table. |
boolean |
isDBFormatOK()
Check that the database has a legal set of RDF tables. |
boolean |
isStatementPresent(Resource subject,
Property predicate,
RDFNode object,
ModelRDB m)
Check if a statement is in the database. |
java.util.Iterator |
listModels()
List the names of all models in this database |
ResultSetIterator |
listNamespaces(ModelRDB m)
List all namespaces referenced in the model |
ResultSetIterator |
listReifiedStatements(ModelRDB m)
Return an iterator over all statements which are have been added as reified statements. |
ResultSetIterator |
listStatements(IConstraints constraints,
ModelRDB m)
List all the statements in the given moddel which make the given set of constraints (a constraint set can be obtained using createConstraints(com.hp.hpl.mesa.rdf.jena.rdb.ModelRDB)). |
ResultSetIterator |
listStatements(Resource subject,
Property predicate,
RDFNode object,
ModelRDB m)
List all the statements in the model which match the given subject, predicate object - each of which can be null (meaning wildcard). |
ResultSetIterator |
listSubjects(ModelRDB m)
List all the subject resources in the model |
void |
loadProperties(java.util.Properties props)
Load a set of configuration parameters into the driver. |
Property |
makeProperty(IDBID id,
java.lang.String localname,
IDBID nsid,
ModelRDB m)
Re-create a property from its local name and namespace identifier |
Resource |
makeResource(IDBID id,
java.lang.String localname,
IDBID nsidw,
ModelRDB m)
Re-create a resource from its local name and namespace identifier |
Resource |
makeResource(IDBID id,
java.lang.String localname,
IDBID nsid,
ModelRDB m,
IDBID stmtID)
Re-create a resource from its local name and namespace identifier. |
void |
preloadCaches(ModelRDB m)
Preload the resource and literal caches with all data in the DB. |
void |
setCacheLimits(int literalLimit,
int resourceLimit)
Set cache limits for caching resources and literals. |
void |
setConnection(IDBConnection dbcon)
Link an existing instance of the driver to a specific jdbc connection |
boolean |
supportsJenaReification()
Returns true if the database layout supports implicit reification of statements (i.e. |
boolean |
supportsMultipleModels()
Returns true if the database layout supports multiple RDF models in the same database. |
IDBID |
wrapDBID(java.lang.Object id)
Convert the raw SQL object used to store a database identifier into a java object which meets the IDBID interface |
| Method Detail |
public void setConnection(IDBConnection dbcon)
throws RDFRDBException
RDFRDBException
public java.sql.Connection getConnection()
throws RDFRDBException
RDFRDBException
public void close()
throws RDFRDBException
RDFRDBException - if there is an access problem
public boolean isDBFormatOK()
throws RDFRDBException
RDFRDBException - if the is a problem opening the connection or an internal SQL error.
public void formatDB()
throws RDFRDBException
RDFRDBException - if the is a problem opening the connection or an internal SQL error.public void cleanDB()
public IDBID allocateModelID(java.lang.String modelName)
throws RDFRDBException
RDFRDBException
public IDBID getModelID(java.lang.String modelName)
throws RDFRDBException
RDFRDBException
public void deleteModel(java.lang.String modelName)
throws RDFRDBException
RDFRDBException
public java.util.Iterator listModels()
throws RDFRDBException
RDFRDBExceptionpublic void loadProperties(java.util.Properties props)
public void setCacheLimits(int literalLimit,
int resourceLimit)
literalLimit - limit on number of literals to cache
public void preloadCaches(ModelRDB m)
throws RDFException
RDFException
public Resource getResourceFromCache(IDBID id,
ModelRDB m)
throws RDFException
RDFException
public Property getPropertyFromCache(IDBID id,
ModelRDB m)
throws RDFException
RDFExceptionpublic Literal getLiteralFromCache(IDBID id)
public Property makeProperty(IDBID id,
java.lang.String localname,
IDBID nsid,
ModelRDB m)
throws RDFException
RDFExceptionpublic void attachStore(StoreRDB store)
public void detachStore(StoreRDB store)
public void addStatement(Statement s,
ModelRDB m)
throws RDFException
RDFException
public boolean deleteStatement(Resource subject,
Property predicate,
RDFNode object,
ModelRDB m)
throws RDFException
RDFException
public boolean deleteStatement(IDBID statementID,
ModelRDB m)
throws RDFException
RDFException
public ResultSetIterator listSubjects(ModelRDB m)
throws RDFRDBException
RDFRDBException
public ResultSetIterator listNamespaces(ModelRDB m)
throws RDFRDBException
RDFRDBException
public ResultSetIterator listStatements(Resource subject,
Property predicate,
RDFNode object,
ModelRDB m)
throws RDFException
RDFException
public boolean isStatementPresent(Resource subject,
Property predicate,
RDFNode object,
ModelRDB m)
throws RDFException
RDFException
public ResultSetIterator listStatements(IConstraints constraints,
ModelRDB m)
throws RDFException
createConstraints(com.hp.hpl.mesa.rdf.jena.rdb.ModelRDB)).
RDFExceptionpublic IConstraints createConstraints(ModelRDB model)
public void clear(ModelRDB model)
throws RDFRDBException
RDFRDBExceptionpublic boolean supportsMultipleModels()
public boolean supportsJenaReification()
public ResultSetIterator listReifiedStatements(ModelRDB m)
throws RDFException
RDFException
public Resource makeResource(IDBID id,
java.lang.String localname,
IDBID nsidw,
ModelRDB m)
throws RDFException
RDFException
public Resource makeResource(IDBID id,
java.lang.String localname,
IDBID nsid,
ModelRDB m,
IDBID stmtID)
throws RDFException
RDFException
public IDBID wrapDBID(java.lang.Object id)
throws RDFException
RDFException
public Resource getResource(IDBID id,
ModelRDB m)
throws RDFException
RDFException
public StatementImplRDB getBareStatementResource(IDBID id,
ModelRDB m)
throws RDFException
RDFException
public Property getProperty(IDBID id,
ModelRDB m)
throws RDFException
RDFException
public Literal getLiteral(IDBID id)
throws RDFException
RDFException
public IDBID getLiteralID(Literal l)
throws RDFRDBException
RDFRDBException
public IDBID getResourceID(Resource resource)
throws RDFException
RDFException
public java.lang.String getNamespace(IDBID nsid)
throws RDFRDBException
RDFRDBExceptionpublic SQLCache getSQLCache()
public Resource getResource(java.lang.String uri,
ModelRDB m)
throws RDFException
RDFException
public Property getProperty(java.lang.String uri,
ModelRDB m)
throws RDFException
RDFException
public void hintPropertyTable(Property p)
throws RDFException
RDFException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||