|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.enhanced.EnhGraph com.hp.hpl.jena.rdf.model.impl.ModelCom com.hp.hpl.jena.db.ModelRDB
public class ModelRDB
A persistent relational database implemention of the RDF API.
This implementation of the RDF API stores all its data in a relational database.
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/interfaces inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException |
Field Summary |
---|
Fields inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
Extended, Standard |
Fields inherited from interface com.hp.hpl.jena.shared.Lock |
---|
READ, WRITE |
Constructor Summary | |
---|---|
ModelRDB(GraphRDB graph)
|
|
ModelRDB(Personality<RDFNode> p,
GraphRDB graph)
A model which is stored persistently in a Relational DataBase Most applications should not call the constructor - use ModelRDB.createModel (to create a new model) or ModelRDB.open (to open an exising model). |
Method Summary | |
---|---|
void |
close()
Close the Model and free up resources held. |
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. |
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); |
boolean |
getDoDuplicateCheck()
Get the value of DoDuplicateCheck |
boolean |
getDoFastpath()
Get the value of DoFastpath. |
Model |
getModelProperties()
Returns a Jena Model containing model-specific properties. |
boolean |
getQueryFullReified()
Get the value of QueryFullReified. |
boolean |
getQueryOnlyAsserted()
Get the value of QueryOnlyAsserted. |
boolean |
getQueryOnlyReified()
Get the value of QueryOnlyReified. |
static com.hp.hpl.jena.util.iterator.ExtendedIterator<java.lang.String> |
listModels(IDBConnection dbcon)
List the names of all models stored in the database |
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. |
void |
setDoDuplicateCheck(boolean bool)
Set the value of DoDuplicateCheck. |
void |
setDoFastpath(boolean val)
Set the value of DoFastpath. |
void |
setDoImplicitJoin(boolean val)
Set the value of DoImplicitJoin. |
void |
setQueryFullReified(boolean opt)
Set the value of QueryFullReified. |
void |
setQueryOnlyAsserted(boolean opt)
Set the value of QueryOnlyAsserted. |
void |
setQueryOnlyReified(boolean opt)
Set the value of QueryOnlyReified. |
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, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addNamespaces, asFilter, asModel, asNode, asRDFNode, asStatement, asStatements, asStatements, asStatements, begin, commit, contains, contains, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsResource, createAlt, createAlt, createBag, createBag, createList, createList, createList, createLiteral, createLiteral, createLiteral, createLiteral, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createProperty, createProperty, createReifiedStatement, createReifiedStatement, createResource, createResource, createResource, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, enterCriticalSection, executeInTransaction, expandPrefix, findTriplesFrom, getAlt, getAlt, getAnyReifiedStatement, getBag, getBag, getDefaultModelPrefixes, getGraph, getHiddenStatements, getLock, getModelLock, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, getProperty, getProperty, getProperty, getRDFNode, getReader, getReader, getReificationStyle, getRequiredProperty, getResource, getResource, getSeq, getSeq, getWriter, getWriter, independent, intersect, intersection, isClosed, isEmpty, isIsomorphicWith, isReified, leaveCriticalSection, listBySubject, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listReifiedStatements, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, lock, notifyEvent, qnameFor, query, queryHandler, read, read, read, read, read, read, read, register, reifiedToString, remove, remove, remove, remove, remove, remove, remove, removeAll, removeAll, removeAllReifications, removeNsPrefix, removeReification, samePrefixMappingAs, setDefaultModelPrefixes, setNsPrefix, setNsPrefixes, setNsPrefixes, setReaderClassName, setWriterClassName, shortForm, size, supportsSetOperations, supportsTransactions, toString, union, unregister, withDefaultMappings, wrapAsResource, write, write, write, write, write, write |
Methods inherited from class com.hp.hpl.jena.enhanced.EnhGraph |
---|
asGraph, equals, getNodeAs, getNodeCacheControl, hashCode, isIsomorphicWith, setNodeCache |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelGraphInterface |
---|
asRDFNode, asStatement, getGraph, queryHandler, wrapAsResource |
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, qnameFor, removeNsPrefix, samePrefixMappingAs, setNsPrefix, setNsPrefixes, setNsPrefixes, shortForm, withDefaultMappings |
Methods inherited from interface com.hp.hpl.jena.shared.Lock |
---|
enterCriticalSection, leaveCriticalSection |
Constructor Detail |
---|
public ModelRDB(Personality<RDFNode> p, GraphRDB graph) throws RDFRDBException
p
- the GraphPersonality of the resulting Modelgraph
- a GraphRDB to be exposed through the model interface
RDFRDBException
public ModelRDB(GraphRDB graph)
Method 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 DBConnection specifying the database connection
RDFRDBException
public static ModelRDB createModel(IDBConnection dbcon, Model modelProperties) throws RDFRDBException
Use the properties to optionally customize the model - this won't change the results you see when using the model interface, but it may alter the speed with which you get them or the space required by the underlying database.
The properties must form a complete and consistent set. The easist way to get a complete and consistent set is to call getDefaultModelProperties, modify it, and then use that as an argument in the call.
dbcon
- a DBConnection 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.
The name "DEFAULT" is reserved and may not be used for user models.
RDFRDBException
public static ModelRDB createModel(IDBConnection dbcon, java.lang.String name, Model modelProperties) throws RDFRDBException
Use the properties to optionally customize the model - this won't change the results you see when using the model interface, but it may alter the speed with which you get them or the space required by the underlying database.
The properties must form a complete and consistent set. The easist way to get a complete and consistent set is to call getDefaultModelProperties, modify it, and then use that as an argument in the call.
dbcon
- a DBConnection specifying the database connectionname
- the name to give the newly created model.
The name "DEFAULT" is reserved and may not be used for user models.modelProperties
- a Model containing customization properties
RDFRDBException
public Model getModelProperties()
public static Model getDefaultModelProperties(IDBConnection dbcon)
dbcon
- a DBConnectionI specifying the database connection
public static com.hp.hpl.jena.util.iterator.ExtendedIterator<java.lang.String> 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
close
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public void remove() throws RDFRDBException
RDFRDBException
public IDBConnection getConnection()
public boolean getDoDuplicateCheck()
public void setDoDuplicateCheck(boolean bool)
bool
- booleanpublic void setDoFastpath(boolean val)
val
- booleanpublic boolean getDoFastpath()
public void setQueryOnlyAsserted(boolean opt)
opt
- booleanpublic boolean getQueryOnlyAsserted()
public void setQueryOnlyReified(boolean opt)
opt
- booleanpublic boolean getQueryOnlyReified()
public void setQueryFullReified(boolean opt)
opt
- booleanpublic boolean getQueryFullReified()
public void setDoImplicitJoin(boolean val)
val
- boolean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |