|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.mesa.rdf.jena.common.StoreCom | +--com.hp.hpl.mesa.rdf.jena.rdb.StoreRDB
Generic store implementation for RDB backed RDF storage.
The underlying database operations are implemented by separate driver
classes which conform to the
IRDBDriver
interface. Different driver instances may support different database table
layouts as well as different specific databases.
A single driver instance can be shared by several StoreRDB instances whereas each ModelRDB requires a separate StoreRDB instance.
Method Summary | |
void |
abort()
Abort the current transaction and abandon any changes in progress. |
void |
add(Statement s)
Add a new statement to the model and load it to the database |
void |
attachModel(ModelRDB m)
Note the model which this store is associated with. |
void |
begin()
Begin a new transation. |
void |
close()
Close this store |
void |
commit()
Commit the current transaction. |
boolean |
contains(Resource s,
Property p)
Return true if the model contains at least one statement with this subject/property pair |
boolean |
contains(Statement s)
Return true if the model contains a statements corresponding this triple |
IConstraints |
createConstraints(ModelRDB model)
Create a constraint object appropriate for this type of database layout |
static StoreRDB |
createDB(IRDBDriver driver)
Construct a new Store using the given database spec. |
Property |
createProperty(java.lang.String uri,
Model m)
Create a new property resource implementation for a model |
Property |
createProperty(java.lang.String namespace,
java.lang.String localPart,
Model m)
Create a new property resource implementation for a model |
Resource |
createResource(Model m)
Create a new resource implementation for a model |
Resource |
createResource(java.lang.String uri,
Model m)
Create a new resource implementation for a model |
IRDBDriver |
getDriver()
Return the database driver underpining this store |
Property |
getProperty(Property p)
Fetch a property, adding it to the database if necessary |
Resource |
getResource(java.lang.String uri,
Model m)
Fetch a resource, adding it to the database if necessary |
java.util.Iterator |
list()
List all the statements in this model |
java.util.Iterator |
list(Resource subject,
Property predicate,
RDFNode object)
List all statements with this s/p/o combination. |
java.util.Iterator |
listByObject(RDFNode object)
List all statements in the model with this object |
java.util.Iterator |
listByPredicate(Property property)
List all statements in the model with this predicate |
java.util.Iterator |
listBySubject(Resource subject)
List all statements in the model with this subject |
NsIterator |
listNameSpaces()
list namespaces of the predicates of all the statements in ths store. |
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) ). |
ResIterator |
listSubjects()
List all the subject resources in the model |
static StoreRDB |
openDB(IRDBDriver driver)
Open a named database and check that it is formated for RDF storage. |
void |
remove(Statement s)
remove a statement from the store |
int |
size()
Return the total number of statements in the model by a brute force - list and count! |
Methods inherited from class com.hp.hpl.mesa.rdf.jena.common.StoreCom |
createAlt, createAlt, createBag, createBag, createSeq, createSeq, createStatement, getAlt, getAlt, getBag, getBag, getProperty, getProperty, getSeq, getSeq, getStatement |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.common.Store |
createAlt, createAlt, createBag, createBag, createSeq, createSeq, createStatement, getAlt, getAlt, getBag, getBag, getProperty, getProperty, getSeq, getSeq, getStatement |
Method Detail |
public static StoreRDB createDB(IRDBDriver driver) throws RDFRDBException
driver
- defines the database driver, host machine, login details
and root path for the databases.RDFRDBException
- if the database cannot be openedpublic static StoreRDB openDB(IRDBDriver driver) throws RDFRDBException
driverpec
- defines the database driver, host machine, login details
and root path for the databases.RDFRDBException
- if the database cannot be opened or if once opened it does
not seem to contain a valid set of RDF storage tables.public void attachModel(ModelRDB m)
public IRDBDriver getDriver()
public void close()
close
in interface Store
close
in class StoreCom
public void begin() throws RDFException
All changes made to a model within a transaction, will either be made, or none of them will be made.
RDFException
- Generic RDF Exceptionpublic void abort() throws RDFException
RDFException
- Generic RDF Exceptionpublic void commit() throws RDFException
RDFException
- Generic RDF Exceptionpublic Resource createResource(Model m) throws RDFException
createResource
in interface Store
createResource
in class StoreCom
public Resource createResource(java.lang.String uri, Model m) throws RDFException
createResource
in interface Store
createResource
in class StoreCom
public Property createProperty(java.lang.String uri, Model m) throws RDFException
createProperty
in interface Store
createProperty
in class StoreCom
public Property createProperty(java.lang.String namespace, java.lang.String localPart, Model m) throws RDFException
createProperty
in interface Store
createProperty
in class StoreCom
public Resource getResource(java.lang.String uri, Model m) throws RDFException
getResource
in interface Store
getResource
in class StoreCom
public Property getProperty(Property p) throws RDFException
getProperty
in interface Store
getProperty
in class StoreCom
public void add(Statement s) throws RDFException
add
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
s
- the statement to addpublic void remove(Statement s) throws RDFException
Store
remove
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
s
- the statement to removepublic int size() throws RDFException
size
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
public boolean contains(Statement s) throws RDFException
contains
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
s
- the statement to test forpublic boolean contains(Resource s, Property p) throws RDFException
contains
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
s
- the subject of the statement to test forp
- the predicate of the statement to test forpublic java.util.Iterator list() throws RDFException
list
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
public java.util.Iterator list(Resource subject, Property predicate, RDFNode object) throws RDFException
list
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
subject
- the subject of the statements to be returned or nullpredicate
- the predicate of the statments to be returned or nullobject
- the object of the statements to be returned or nullpublic ResultSetIterator listStatements(IConstraints constraints, ModelRDB m) throws RDFException
createConstraints(com.hp.hpl.mesa.rdf.jena.rdb.ModelRDB)
).public IConstraints createConstraints(ModelRDB model)
public java.util.Iterator listBySubject(Resource subject) throws RDFException
listBySubject
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
subject
- the subject of the statements to be returnedpublic java.util.Iterator listByPredicate(Property property) throws RDFException
listByPredicate
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
property
- the predicate to search forpublic java.util.Iterator listByObject(RDFNode object) throws RDFException
listByObject
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
object
- the object to search forpublic ResIterator listSubjects() throws RDFException
listSubjects
in interface Store
public NsIterator listNameSpaces() throws RDFException
Store
Each namespace is listed only once.
listNameSpaces
in interface Store
com.hp.hpl.mesa.rdf.jena.common.Store
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |