|
|||||||||
| 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.ModelCom
|
+--com.hp.hpl.mesa.rdf.jena.rdb.ModelRDB
This implementation of the Model interface uses a relational database to hold the model statements. This provides persistence, transactions and scaling at the expense of performance. It doesn't provide query support since the jena query interface is currently procedural rather than declarative.
Different SQL dialects and different table layout structures are supported by delegating all database access to a separate IRDBSpec implementation.
The constructor will open the default model on a jdbc url whereas a variety of static factory methods are available for creating and reopening database.
| Constructor Summary | |
ModelRDB(IDBConnection dbcon)
Return the default model from the specified database. |
|
| Method Summary | |
Model |
abort()
Abort the current transaction and abandon any changes in progress. |
Model |
begin()
Begin a new transation. |
void |
close()
Close the Model and free up resources held. |
Model |
commit()
Commit the current transaction. |
Property |
convert(Property p)
Convert a property to a database implementation |
RDFNode |
convert(RDFNode n)
Convert a node (property, resource or literal) to a database implementation |
Resource |
convert(Resource r)
Convert a resource to a database implementation |
static ModelRDB |
create(IDBConnection dbcon,
java.lang.String layoutType,
java.lang.String databaseType)
Create a new database suitable for storing RDF data. |
IConstraints |
createConstraints()
Create a constraint object appropriate for this type of database layout |
static ModelRDB |
createModel(IDBConnection dbcon,
java.lang.String name)
Create a new model on an existing, preformatted database. |
Model |
difference(Model model)
Create a new model containing all the statements in this model which are not in another. |
IDBID |
getDBID()
Return the database index id for this model. |
StoreRDB |
getStore()
Return the store which underpins this model |
boolean |
independent()
Determine whether this model is independent. |
Model |
intersection(Model model)
Create a new model containing all the statements which are in both this model and another. |
static java.util.Iterator |
listModels(IDBConnection dbcon)
List the name of all models stored in the database |
StmtIterator |
listStatements(IConstraints constraints)
List all the statements in the given moddel which make the given set of constraints (a constraint set can be obtained using createConstraints()). |
static ModelRDB |
open(IDBConnection dbcon)
Open an existing rdf database. |
static ModelRDB |
open(IDBConnection dbcon,
java.lang.String name)
Open an existing rdf database. |
Model |
query(Selector selector)
Create a new model containing the statements matching a query. |
boolean |
supportsSetOperations()
Determine whether this model supports set operations. |
boolean |
supportsTransactions()
Determine whether this model supports transactions. |
Model |
union(Model model)
Create a new model containing all the statements in this model together with all of those in another given model. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Model |
add, add, add, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, createLiteral, createLiteral, createProperty, createResource, createResource, createStatement, equals, getProperty, getProperty, getResource, isReified, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, read, read, read, read, remove, size, write, write, write |
| Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.ModelCon |
add, add, add, add, add, add, add, add, add, add, add, contains, contains, contains, contains, contains, contains, contains, contains, createAlt, createAlt, createBag, createBag, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createProperty, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, getAlt, getAlt, getBag, getBag, getProperty, getResource, getSeq, getSeq, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, remove, remove |
| Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFReaderF |
getReader, getReader, setReaderClassName |
| Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFWriterF |
getWriter, getWriter, setWriterClassName |
| Methods inherited from interface com.hp.hpl.mesa.rdf.jena.common.ModelI |
containerContains, containerIndexOf, containerSize, listContainerMembers |
| Constructor Detail |
public ModelRDB(IDBConnection dbcon)
throws RDFRDBException
dbcon - a DBConnectionI specifying the database connectionRDFRDBException - if the database cannot be opened| Method Detail |
public static ModelRDB open(IDBConnection dbcon,
java.lang.String name)
throws RDFRDBException
dbcon - a DBConnectionI specifying the database connectionname - the name of the RDF model to open, some database layouts support
multiple models in a single database
public static ModelRDB open(IDBConnection dbcon)
throws RDFRDBException
dbcon - a DBConnectionI specifying the database connection
public static ModelRDB createModel(IDBConnection dbcon,
java.lang.String name)
throws RDFRDBException
dbcon - a DBConnectionI specifying the database connectionname - the name to give the newly created model
public static java.util.Iterator listModels(IDBConnection dbcon)
throws RDFRDBException
public static ModelRDB create(IDBConnection dbcon,
java.lang.String layoutType,
java.lang.String databaseType)
throws RDFRDBException
The appropriate RDF-RDB driver to use is assumed to be the class Driver
dbcon - a DBConnectionI specifying the database connectionlayoutType - the name of the layout style to use. Currently one of:
"Generic", "Hash", "MMGeneric", "MMHash", "Proc", "ThinProc" etc.databaseType - the name of the database type. Currently one of:
"Interbase" "Postgresql" etc. This may seem a little redundant
given that the jdbc uri implicitly contains this information but there is no
standard way of extracting this (esp. if the user connects via a bridge).
public void close()
Not all implementations of Model require this method to be called. But some do, so in general its best to call it when done with the object, rather than leave it to the finalizer.
close in interface Modelclose in class ModelCompublic StoreRDB getStore()
public IDBID getDBID()
public StmtIterator listStatements(IConstraints constraints)
throws RDFException
createConstraints()).public IConstraints createConstraints()
public Resource convert(Resource r)
throws RDFException
convert in interface ModelIconvert in class ModelComcom.hp.hpl.mesa.rdf.jena.common.ModelIr - RDFException -
public Property convert(Property p)
throws RDFException
convert in interface ModelIconvert in class ModelComcom.hp.hpl.mesa.rdf.jena.common.ModelIp - RDFException -
public RDFNode convert(RDFNode n)
throws RDFException
convert in interface ModelIconvert in class ModelComcom.hp.hpl.mesa.rdf.jena.common.ModelIn - RDFException -
public Model begin()
throws RDFException
All changes made to a model within a transaction, will either be made, or none of them will be made.
begin in interface Modelbegin in class ModelComRDFException - Generic RDF Exception
public Model abort()
throws RDFException
abort in interface Modelabort in class ModelComRDFException - Generic RDF Exception
public Model commit()
throws RDFException
commit in interface Modelcommit in class ModelComRDFException - Generic RDF Exceptionpublic boolean independent()
For efficiency reasons, some implementations may create models which which are dependent on others, i.e. a change in one model may cause a change in another. If this is the case this method will return false, otherwise it will return true.
independent in interface Modelindependent in class ModelCompublic boolean supportsTransactions()
supportsTransactions in interface Modelpublic boolean supportsSetOperations()
ModelsupportsSetOperations in interface Modelcom.hp.hpl.mesa.rdf.jena.model.Model
public Model query(Selector selector)
throws RDFException
ModelA statment is considered to match if the test method
of s returns true when called on s.
query in interface Modelcom.hp.hpl.mesa.rdf.jena.model.Models - A selector object.RDFException - Generic RDF exception.
public Model union(Model model)
throws RDFException
Modelunion in interface Modelcom.hp.hpl.mesa.rdf.jena.model.Modelmodel - The other model whose statements are to be included.RDFException - Generic RDF Exception
public Model intersection(Model model)
throws RDFException
Modelintersection in interface Modelcom.hp.hpl.mesa.rdf.jena.model.Modelmodel - The other model.RDFException - Generic RDF Exception
public Model difference(Model model)
throws RDFException
Modeldifference in interface Modelcom.hp.hpl.mesa.rdf.jena.model.Modelmodel - the other model whose statements are to be excluded.RDFException - Generic RDF Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||