|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectvirtuoso.sesame2.driver.VirtuosoRepository
public class VirtuosoRepository
A Sesame repository that contains RDF data that can be queried and updated. Access to the repository can be acquired by openening a connection to it. This connection can then be used to query and/or update the contents of the repository. Depending on the implementation of the repository, it may or may not support multiple concurrent connections.
Please note that a repository needs to be initialized before it can be used and that it should be shut down before it is discarded/garbage collected. Forgetting the latter can result in loss of data (depending on the Repository implementation)!
| Constructor Summary | |
|---|---|
VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password)
Construct a VirtuosoRepository with a specified parameters. |
|
VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password,
boolean useLazyAdd)
Construct a VirtuosoRepository with a specified parameters defGraph will be set to "sesame:nil". |
|
VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password,
java.lang.String defGraph)
Construct a VirtuosoRepository with a specified parameters. |
|
VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password,
java.lang.String defGraph,
boolean useLazyAdd)
Construct a VirtuosoRepository with a specified parameters |
|
| Method Summary | |
|---|---|
void |
createRuleSet(java.lang.String ruleSetName,
java.lang.String uriGraphRuleSet)
|
org.openrdf.repository.RepositoryConnection |
getConnection()
Opens a connection to this repository that can be used for querying and updating the contents of the repository. |
java.io.File |
getDataDir()
Get the directory where data and logging for this repository is stored. |
int |
getFetchSize()
Get the buffer fetch size |
int |
getResultsHandlerType()
|
boolean |
getRoundrobin()
Get the RoundRobin state for connection |
java.lang.String |
getRuleSet()
Get the RoundRobin state for connection |
org.openrdf.model.ValueFactory |
getValueFactory()
Gets a ValueFactory for this Repository. |
void |
initialize()
Initializes this repository. |
boolean |
isWritable()
Checks whether this repository is writable, i.e. |
void |
setDataDir(java.io.File dataDir)
Set the directory where data and logging for this repository is stored. |
void |
setFetchSize(int sz)
Set the buffer fetch size(default 200) |
void |
setResultsHandlerType(int handlerType)
|
void |
setRoundrobin(boolean v)
Set the RoundRobin state for connection(default false) |
void |
setRuleSet(java.lang.String name)
Set inference RuleSet name |
void |
shutDown()
Shuts the repository down, releasing any resources that it keeps hold of. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password,
java.lang.String defGraph,
boolean useLazyAdd)
url_hostlist - the Virtuoso JDBC URL connection string or hostlist for poolled connection.
Virtuoso database hostlist
"hostone:1112,hosttwo:1113"
or "hostone,hosttwo" if default port=1111 is used on hosts
user - the database user on whose behalf the connection is being madepassword - the user's passworddefGraph - a default Graph name, used for Sesame calls, when contexts list
is empty, exclude exportStatements, hasStatement, getStatements methodsuseLazyAdd - set true to enable using batch optimization for sequence of
add(Resource subject, URI predicate, Value object, Resource... contexts);
add(Statement statement, Resource... contexts);
methods, when autoCommit mode is off. The triples will be sent to DBMS on commit call
or when batch size become more than predefined batch max_size.
public VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password,
boolean useLazyAdd)
url_hostlist - the Virtuoso JDBC URL connection string or hostlist for poolled connection.
Virtuoso database hostlist
"hostone:1112,hosttwo:1113"
or "hostone,hosttwo" if default port=1111 is used on hosts
user - the database user on whose behalf the connection is being madepassword - the user's passworduseLazyAdd - set true to enable using batch optimization for sequence of
add(Resource subject, URI predicate, Value object, Resource... contexts);
add(Statement statement, Resource... contexts);
methods, when autoCommit mode is off. The triples will be sent to DBMS on commit call
or when batch size become more than predefined batch max_size.
public VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password,
java.lang.String defGraph)
url_hostlist - the Virtuoso JDBC URL connection string or hostlist for poolled connection.
Virtuoso database hostlist
"hostone:1112,hosttwo:1113"
or "hostone,hosttwo" if the default port=1111 is used for hosts
user - the database user on whose behalf the connection is being madepassword - the user's passworddefGraph - a default Graph name, used for Sesame calls, when contexts list
is empty, exclude exportStatements, hasStatement, getStatements methods
public VirtuosoRepository(java.lang.String url_hostlist,
java.lang.String user,
java.lang.String password)
url_hostlist - the Virtuoso JDBC URL connection string or hostlist for poolled connection.
Virtuoso database hostlist
"hostone:1112,hosttwo:1113"
or "hostone,hosttwo" if the default port=1111 is used for hosts
user - the database user on whose behalf the connection is being madepassword - the user's passworddefGraph - a default Graph name, used for Sesame calls, when contexts list
is empty, exclude exportStatements, hasStatement, getStatements methods| Method Detail |
|---|
public org.openrdf.repository.RepositoryConnection getConnection()
throws org.openrdf.repository.RepositoryException
Connection con = repository.getConnection();
try {
// perform operations on the connection
}
finally {
con.close();
}
getConnection in interface org.openrdf.repository.Repositoryorg.openrdf.repository.RepositoryException - If something went wrong during the creation of the Connection.public void setFetchSize(int sz)
sz - buffer fetch size.public int getFetchSize()
public void setRoundrobin(boolean v)
sz - buffer fetch size.public boolean getRoundrobin()
public void setRuleSet(java.lang.String name)
name - RuleSet name.public java.lang.String getRuleSet()
public java.io.File getDataDir()
getDataDir in interface org.openrdf.repository.Repositorypublic org.openrdf.model.ValueFactory getValueFactory()
getValueFactory in interface org.openrdf.repository.Repository
public void initialize()
throws org.openrdf.repository.RepositoryException
initialize in interface org.openrdf.repository.Repositoryorg.openrdf.repository.RepositoryException - If the initialization failed.
public boolean isWritable()
throws org.openrdf.repository.RepositoryException
isWritable in interface org.openrdf.repository.Repositoryorg.openrdf.repository.RepositoryExceptionpublic void setDataDir(java.io.File dataDir)
setDataDir in interface org.openrdf.repository.RepositorydataDir - the directory where data for this repository is stored
public void shutDown()
throws org.openrdf.repository.RepositoryException
shutDown in interface org.openrdf.repository.Repositoryorg.openrdf.repository.RepositoryExceptionpublic int getResultsHandlerType()
public void setResultsHandlerType(int handlerType)
public void createRuleSet(java.lang.String ruleSetName,
java.lang.String uriGraphRuleSet)
throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||