|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hp.hpl.jena.enhanced.Polymorphic
com.hp.hpl.jena.enhanced.EnhGraph
com.hp.hpl.jena.rdf.model.impl.ModelCom
com.hp.hpl.jena.db.ModelRDB
A persistent relational database implemention of the RDF API.
This implementation of the RDF API stores all its data in a relational database.
This is a prototype implementation, and should be considered to be alpha quality code and has not been well tested.
To construct a persistent RDB Model, first load the jdbc connector for your database - in this example, mysql:
Class.forName("com.mysql.jdbc.Driver");
Then create a connection to the database:
IDBConnection conn = new DBConnection("jdbc:mysql://localhost/test", "test", "", "MySQL");
Now, using that connection, you can construct Models in the database:
Model m = ModelRDB.createModel(conn);
Nested Class Summary |
Nested classes inherited from class com.hp.hpl.jena.shared.PrefixMapping |
com.hp.hpl.jena.shared.PrefixMapping.Factory, com.hp.hpl.jena.shared.PrefixMapping.IllegalPrefixException, com.hp.hpl.jena.shared.PrefixMapping.JenaLockedException |
Field Summary |
Fields inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
Standard |
Fields inherited from interface com.hp.hpl.jena.rdf.model.ModelLock |
READ, WRITE |
Constructor Summary | |
ModelRDB(GraphPersonality p,
GraphRDB graph)
A model which is stored persistently in a Relational DataBase Most applications should not need to deal directly with Graphs - use ModelRDB.createModel (to create a new model) or ModelRDB.open (to open an exising model). |
|
ModelRDB(IDBConnection dbcon)
Deprecated. Since Jena 2.0, this call is not recommended - in the short-term use ModelRDB.open or ModelRDB.createModel; in the longer-term use factory methods to construct persistent models. |
|
ModelRDB(IDBConnection dbcon,
java.lang.String modelID)
Deprecated. Since Jena 2.0, this call is not recommended - in the short-term use ModelRDB.open or ModelRDB.createModel; in the longer-term use factory methods to construct persistent models. |
Method Summary | |
void |
clear()
Deprecated. Since Jena 2.0 this call is not recommended (it's name is misleading) - to clear an entire database use DBConnection.cleanDB, to remove just this Model use Model.remove(). |
void |
close()
Close the Model and free up resources held. |
static ModelRDB |
create(IDBConnection dbcon,
java.lang.String databaseType)
Deprecated. Since Jena 2.0 this call is no longer needed - it is preferable to specify the database type when constructing the DBConnection. Then use the call ModelRDB.createModel(IDBConnection) |
static ModelRDB |
create(IDBConnection dbcon,
java.lang.String layoutType,
java.lang.String databaseType)
Deprecated. Since Jena 2.0 this call is no longer needed - it is preferable to specify the database type when constructing the DBConnection and to modify the layout by using the properties in the DBConnection. Then use the call ModelRDB.createModel(IDBConnection) |
static ModelRDB |
createModel(IDBConnection dbcon)
Create a new default model on an existing database. |
static ModelRDB |
createModel(IDBConnection dbcon,
Model modelProperties)
Create a new model on an existing database. |
static ModelRDB |
createModel(IDBConnection dbcon,
java.lang.String name)
Create a new model on an existing database. |
static ModelRDB |
createModel(IDBConnection dbcon,
java.lang.String name,
Model modelProperties)
Create a new model on an existing database. |
static void |
deleteModel(IDBConnection dbcon,
java.lang.String name)
Deprecated. Since Jena 2.0, to remove a model use the ModelRDB.remove() |
IDBConnection |
getConnection()
A convenience function to return the connection |
static Model |
getDefaultModelProperties(IDBConnection dbcon)
Retrieve a default set of model customization properties The returned default set of properties is suitable for use in a call to ModelRDB.create(..., modelProperties); |
Model |
getModelProperties()
Returns a Jena Model containing model-specific properties. |
static ExtendedIterator |
listModels(IDBConnection dbcon)
List the names of all models stored in the database |
Model |
loadAll()
Deprecated. Since Jena 2.0, this call is not recommended. Instead use the soon-to-be-released bulk-load functions. |
static ModelRDB |
open(IDBConnection dbcon)
Open the default model from an existing rdf database. |
static ModelRDB |
open(IDBConnection dbcon,
java.lang.String name)
Open an existing rdf database. |
void |
remove()
Remove all traces of this particular Model from the database. |
Methods inherited from class com.hp.hpl.jena.rdf.model.impl.ModelCom |
abort, adapt, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addNamespaces, asFilter, asModel, asNode, asStatement, asStatements, asStatements, asStatements, begin, commit, containerContains, containerIndexOf, containerSize, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsResource, createAlt, createAlt, createBag, createBag, createList, createList, createList, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createProperty, createProperty, createReifiedStatement, createReifiedStatement, createResource, createResource, createResource, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, enterCriticalSection, executeInTransaction, expandPrefix, findTriplesFrom, getAlt, getAlt, getAnyReifiedStatement, getBag, getBag, getGraph, getHiddenStatements, getModelLock, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, getProperty, getProperty, getProperty, getRDFNode, getReader, getReader, getResource, getResource, getSeq, getSeq, getWriter, getWriter, independent, intersection, isEmpty, isIsomorphicWith, isReified, leaveCriticalSection, listContainerMembers, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listReifiedStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, lock, mappy, query, queryBindingsWith, queryHandler, read, read, read, read, read, read, register, remove, remove, remove, remove, remove, removeAllReifications, removeReification, setNsPrefix, setNsPrefixes, setNsPrefixes, setReaderClassName, setWriterClassName, size, supportsSetOperations, supportsTransactions, toString, union, unregister, usePrefix, withHiddenStatements, write, write, write, write, write, write |
Methods inherited from class com.hp.hpl.jena.enhanced.EnhGraph |
asGraph, equals, getNodeAs, getNodeCacheControl, hashCode, isIsomorphicWith, isValid, setNodeCache |
Methods inherited from class com.hp.hpl.jena.enhanced.Polymorphic |
addView, supports |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFReaderF |
getReader, getReader, setReaderClassName |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFWriterF |
getWriter, getWriter, setWriterClassName |
Methods inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, lock, setNsPrefix, setNsPrefixes, setNsPrefixes, usePrefix |
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelLock |
enterCriticalSection, leaveCriticalSection |
Methods inherited from interface com.hp.hpl.jena.rdf.model.impl.ModelI |
containerContains, containerIndexOf, containerSize, listContainerMembers |
Constructor Detail |
public ModelRDB(IDBConnection dbcon) throws RDFRDBException
dbcon
- a Connection specifying the database connectionpublic ModelRDB(IDBConnection dbcon, java.lang.String modelID) throws RDFRDBException
dbcon
- a Connection specifying the database connectionmodelID
- is the identifier of an RDF model within the database.public ModelRDB(GraphPersonality p, GraphRDB graph) throws RDFRDBException
p
- the GraphPersonality of the resulting Modelgraph
- a GraphRDB to be exposed through the model interfaceMethod Detail |
public static ModelRDB open(IDBConnection dbcon) throws RDFRDBException
dbcon
- an IDBConnection specifying the database connection
RDFRDBException
public static ModelRDB open(IDBConnection dbcon, java.lang.String name) throws RDFRDBException
dbcon
- a IDBConnection specifying the database connectionname
- the name of the RDF model to open
RDFRDBException
public static ModelRDB createModel(IDBConnection dbcon) throws RDFRDBException
dbcon
- a DBConnectionI specifying the database connection
RDFRDBException
public static ModelRDB createModel(IDBConnection dbcon, Model modelProperties) throws RDFRDBException
dbcon
- a DBConnectionI specifying the database connectionmodelProperties
- a Model containing customization properties
RDFRDBException
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
RDFRDBException
public static ModelRDB createModel(IDBConnection dbcon, java.lang.String name, Model modelProperties) throws RDFRDBException
dbcon
- a DBConnectionI specifying the database connectionname
- the name to give the newly created modelmodelProperties
- a Model containing customization properties
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".databaseType
- the name of the database type. Currently one of:
"Interbase" "Postgresql" "Mysql" "Oracle". 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).
RDFRDBException
public static ModelRDB create(IDBConnection dbcon, java.lang.String databaseType) throws RDFRDBException
Uses a default layout format which is able to support multiple models in a single database.
dbcon
- a DBConnectionI specifying the database connectiondatabaseType
- the name of the database type. Currently one of:
"Interbase" "Postgresql" "Mysql" "Oracle". 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).
RDFRDBException
public Model getModelProperties()
public static Model getDefaultModelProperties(IDBConnection dbcon)
dbcon
- a DBConnectionI specifying the database connection
public static ExtendedIterator listModels(IDBConnection dbcon) throws RDFRDBException
RDFRDBException
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 Model
public void remove() throws RDFRDBException
RDFRDBException
public IDBConnection getConnection()
public void clear() throws RDFRDBException
RDFRDBException
public static void deleteModel(IDBConnection dbcon, java.lang.String name) throws RDFRDBException
dbcon
- a DBConnectionI specifying the database connectionname
- the name to give the newly created model
RDFRDBException
public Model loadAll()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |