public final class StardogRepositoryConnection
extends org.openrdf.repository.base.AbstractRepositoryConnection
Stardog-based implementation of a Sesame RepositoryConnection. Leaving autoCommit
turned ON
will yield sub-optimal performance with Stardog because of the overhead of pushing many single statement transactions.
It is therefore highly recommended to use the begin()
and commit()
/rollback()
methods to
group operations into transactions unless absolutely required by your application
These connections keep a local cache of changes which are not pushed until they exceed a threshold, or an action, such as a query or a commit, requires them to be pushed to the server. This minimizes the overhead of calling add or remove in a tight loop with small payloads and then committing the entire thing, those updates would then be pushed in as few chunks as possible.
All queries created via this connection will implement the accessors for a query's maxQueryTime
as no ops.
The methods will work in that they will not throw an UnsupportedOperationException
, however, they are not
supported by Stardog. Timeouts cannot be controlled on a per-query basis, they are global server options.
Each of the specific prepare*Query
methods, such as
AbstractRepositoryConnection.prepareGraphQuery(org.openrdf.query.QueryLanguage, String)
will parse the query during invocation, but it
will not be type checked until execution time. For example, you can provide a valid ASK query to
prepareGraphQuery
and it will not fail that you're using a boolean query as a graph query until its executed.
This is similar to how HTTPRepository handles this situation.
Modifier and Type | Method and Description |
---|---|
protected void |
addWithoutCommit(org.openrdf.model.Resource theSubj,
org.openrdf.model.IRI thePred,
org.openrdf.model.Value theObj,
org.openrdf.model.Resource... theContexts)
Deprecated.
|
void |
begin()
Deprecated.
|
void |
clearNamespaces()
Deprecated.
|
void |
close()
Deprecated.
|
void |
commit()
Deprecated.
|
void |
exportStatements(org.openrdf.model.Resource theSubj,
org.openrdf.model.IRI thePred,
org.openrdf.model.Value theObj,
boolean theIncludeInferred,
org.openrdf.rio.RDFHandler theRDFHandler,
org.openrdf.model.Resource... theContexts)
Deprecated.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Resource> |
getContextIDs()
Deprecated.
|
String |
getNamespace(String s)
Deprecated.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Namespace> |
getNamespaces()
Deprecated.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getStatements(org.openrdf.model.Resource theSubj,
org.openrdf.model.IRI thePred,
org.openrdf.model.Value theObj,
boolean theIncludeInferred,
org.openrdf.model.Resource... theContexts)
Deprecated.
|
boolean |
isActive()
Deprecated.
|
org.openrdf.query.BooleanQuery |
prepareBooleanQuery(org.openrdf.query.QueryLanguage theQueryLanguage,
String theQuery,
String theBase)
Deprecated.
|
org.openrdf.query.GraphQuery |
prepareGraphQuery(org.openrdf.query.QueryLanguage theQueryLanguage,
String theQuery,
String theBase)
Deprecated.
|
org.openrdf.query.Query |
prepareQuery(org.openrdf.query.QueryLanguage theQueryLanguage,
String theQuery,
String theBase)
Deprecated.
|
org.openrdf.query.TupleQuery |
prepareTupleQuery(org.openrdf.query.QueryLanguage theQueryLanguage,
String theQuery,
String theBase)
Deprecated.
|
org.openrdf.query.Update |
prepareUpdate(org.openrdf.query.QueryLanguage theQueryLanguage,
String theQuery,
String theBase)
Deprecated.
Will always throw an
UnsupportedOperationException as Stardog does not yet support SPARQL update syntax
|
void |
removeNamespace(String thePrefix)
Deprecated.
|
protected void |
removeWithoutCommit(org.openrdf.model.Resource theSubj,
org.openrdf.model.IRI thePred,
org.openrdf.model.Value theObj,
org.openrdf.model.Resource... theContexts)
Deprecated.
|
void |
rollback()
Deprecated.
|
void |
setIsolationLevel(org.openrdf.IsolationLevel level)
Deprecated.
|
void |
setNamespace(String thePrefix,
String theNS)
Deprecated.
|
long |
size(org.openrdf.model.Resource... theContexts)
Deprecated.
|
add, add, add, add, add, add, add, add, addWithoutCommit, begin, clear, conditionalCommit, conditionalRollback, export, getIsolationLevel, getParserConfig, getRepository, getValueFactory, hasStatement, hasStatement, isAutoCommit, isEmpty, isOpen, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, prepareUpdate, remove, remove, remove, remove, removeWithoutCommit, setAutoCommit, setParserConfig, startLocalTransaction
public void begin() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public boolean isActive() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void close() throws org.openrdf.repository.RepositoryException
close
in interface AutoCloseable
close
in interface org.openrdf.repository.RepositoryConnection
close
in class org.openrdf.repository.base.AbstractRepositoryConnection
org.openrdf.repository.RepositoryException
public void setIsolationLevel(org.openrdf.IsolationLevel level) throws IllegalStateException
setIsolationLevel
in interface org.openrdf.repository.RepositoryConnection
setIsolationLevel
in class org.openrdf.repository.base.AbstractRepositoryConnection
IllegalStateException
protected void addWithoutCommit(org.openrdf.model.Resource theSubj, org.openrdf.model.IRI thePred, org.openrdf.model.Value theObj, org.openrdf.model.Resource... theContexts) throws org.openrdf.repository.RepositoryException
addWithoutCommit
in class org.openrdf.repository.base.AbstractRepositoryConnection
org.openrdf.repository.RepositoryException
protected void removeWithoutCommit(org.openrdf.model.Resource theSubj, org.openrdf.model.IRI thePred, org.openrdf.model.Value theObj, org.openrdf.model.Resource... theContexts) throws org.openrdf.repository.RepositoryException
removeWithoutCommit
in class org.openrdf.repository.base.AbstractRepositoryConnection
org.openrdf.repository.RepositoryException
public org.openrdf.query.Query prepareQuery(org.openrdf.query.QueryLanguage theQueryLanguage, String theQuery, String theBase) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
public org.openrdf.query.TupleQuery prepareTupleQuery(org.openrdf.query.QueryLanguage theQueryLanguage, String theQuery, String theBase) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
public org.openrdf.query.GraphQuery prepareGraphQuery(org.openrdf.query.QueryLanguage theQueryLanguage, String theQuery, String theBase) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
public org.openrdf.query.BooleanQuery prepareBooleanQuery(org.openrdf.query.QueryLanguage theQueryLanguage, String theQuery, String theBase) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
public org.openrdf.query.Update prepareUpdate(org.openrdf.query.QueryLanguage theQueryLanguage, String theQuery, String theBase) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException
UnsupportedOperationException
as Stardog does not yet support SPARQL update syntax
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Resource> getContextIDs() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getStatements(org.openrdf.model.Resource theSubj, org.openrdf.model.IRI thePred, org.openrdf.model.Value theObj, boolean theIncludeInferred, org.openrdf.model.Resource... theContexts) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void exportStatements(org.openrdf.model.Resource theSubj, org.openrdf.model.IRI thePred, org.openrdf.model.Value theObj, boolean theIncludeInferred, org.openrdf.rio.RDFHandler theRDFHandler, org.openrdf.model.Resource... theContexts) throws org.openrdf.repository.RepositoryException, org.openrdf.rio.RDFHandlerException
org.openrdf.repository.RepositoryException
org.openrdf.rio.RDFHandlerException
public long size(org.openrdf.model.Resource... theContexts) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void commit() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void rollback() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Namespace> getNamespaces() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public String getNamespace(String s) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void setNamespace(String thePrefix, String theNS) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void removeNamespace(String thePrefix) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void clearNamespaces() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
Copyright © 2010-2016 Stardog Union. All Rights Reserved.