public class BigdataSailRepositoryConnection
extends org.openrdf.repository.sail.SailRepositoryConnection
Constructor and Description |
---|
BigdataSailRepositoryConnection(BigdataSailRepository repository,
org.openrdf.sail.SailConnection sailConnection) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeLog(IChangeLog log)
Set the change log on the SAIL connection.
|
void |
commit() |
long |
commit2()
Commit, returning the timestamp associated with the new commit point.
|
void |
computeClosure()
Computes the closure of the triple store for RDF(S)+ entailments.
|
void |
flush()
Flush the statement buffers.
|
BigdataSailRepository |
getRepository() |
BigdataSail.BigdataSailConnection |
getSailConnection() |
AbstractTripleStore |
getTripleStore()
Return the backing
AbstractTripleStore object. |
BigdataValueFactory |
getValueFactory() |
boolean |
hasStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
boolean includeInferred,
org.openrdf.model.Resource... contexts) |
boolean |
isReadOnly()
Return
true if the connection does not permit mutation. |
boolean |
isUnisolated()
Return
true if this is the ITx.UNISOLATED
connection. |
BigdataSailBooleanQuery |
prepareBooleanQuery(org.openrdf.query.QueryLanguage ql,
String qs,
String baseURI) |
BigdataSailGraphQuery |
prepareGraphQuery(org.openrdf.query.QueryLanguage ql,
String qs,
String baseURI) |
BigdataSailQuery |
prepareNativeSPARQLQuery(org.openrdf.query.QueryLanguage ql,
String queryStr,
String baseURI)
Parse a SPARQL query
|
BigdataSailUpdate |
prepareNativeSPARQLUpdate(org.openrdf.query.QueryLanguage ql,
String updateStr,
String baseURI)
Parse a SPARQL UPDATE request.
|
org.openrdf.repository.sail.SailQuery |
prepareQuery(org.openrdf.query.QueryLanguage ql,
String qs,
String baseURI) |
BigdataSailTupleQuery |
prepareTupleQuery(org.openrdf.query.QueryLanguage ql,
String qs,
String baseURI) |
org.openrdf.query.Update |
prepareUpdate(org.openrdf.query.QueryLanguage ql,
String update,
String baseURI) |
void |
removeAllEntailments()
Removes all "inferred" statements from the database (does NOT commit the
database).
|
void |
removeChangeLog(IChangeLog log)
Remove a change log from the SAIL connection.
|
String |
toString() |
addWithoutCommit, begin, clear, clearNamespaces, close, createRepositoryResult, exportStatements, getContextIDs, getNamespace, getNamespaces, getStatements, isActive, isEmpty, isOpen, removeNamespace, removeWithoutCommit, rollback, setNamespace, size
add, add, add, add, add, add, add, add, addWithoutCommit, conditionalCommit, conditionalRollback, export, getParserConfig, hasStatement, isAutoCommit, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, prepareUpdate, remove, remove, remove, remove, removeWithoutCommit, setAutoCommit, setParserConfig, startLocalTransaction
public BigdataSailRepositoryConnection(BigdataSailRepository repository, org.openrdf.sail.SailConnection sailConnection)
public BigdataSailRepository getRepository()
getRepository
in interface org.openrdf.repository.RepositoryConnection
getRepository
in class org.openrdf.repository.base.RepositoryConnectionBase
public BigdataSail.BigdataSailConnection getSailConnection()
getSailConnection
in class org.openrdf.repository.sail.SailRepositoryConnection
public BigdataValueFactory getValueFactory()
getValueFactory
in interface org.openrdf.repository.RepositoryConnection
getValueFactory
in class org.openrdf.repository.base.RepositoryConnectionBase
public boolean hasStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, boolean includeInferred, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
This code path is optimized for cases where isolatable indices are not in use and where inferences can not appear.
hasStatement
in interface org.openrdf.repository.RepositoryConnection
hasStatement
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
public BigdataSailGraphQuery prepareGraphQuery(org.openrdf.query.QueryLanguage ql, String qs, String baseURI) throws org.openrdf.query.MalformedQueryException
prepareGraphQuery
in interface org.openrdf.repository.RepositoryConnection
prepareGraphQuery
in class org.openrdf.repository.sail.SailRepositoryConnection
org.openrdf.query.MalformedQueryException
public BigdataSailTupleQuery prepareTupleQuery(org.openrdf.query.QueryLanguage ql, String qs, String baseURI) throws org.openrdf.query.MalformedQueryException
prepareTupleQuery
in interface org.openrdf.repository.RepositoryConnection
prepareTupleQuery
in class org.openrdf.repository.sail.SailRepositoryConnection
org.openrdf.query.MalformedQueryException
public BigdataSailBooleanQuery prepareBooleanQuery(org.openrdf.query.QueryLanguage ql, String qs, String baseURI) throws org.openrdf.query.MalformedQueryException
prepareBooleanQuery
in interface org.openrdf.repository.RepositoryConnection
prepareBooleanQuery
in class org.openrdf.repository.sail.SailRepositoryConnection
org.openrdf.query.MalformedQueryException
public org.openrdf.repository.sail.SailQuery prepareQuery(org.openrdf.query.QueryLanguage ql, String qs, String baseURI) throws org.openrdf.query.MalformedQueryException
prepareQuery
in interface org.openrdf.repository.RepositoryConnection
prepareQuery
in class org.openrdf.repository.sail.SailRepositoryConnection
org.openrdf.query.MalformedQueryException
public org.openrdf.query.Update prepareUpdate(org.openrdf.query.QueryLanguage ql, String update, String baseURI) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException
prepareUpdate
in interface org.openrdf.repository.RepositoryConnection
prepareUpdate
in class org.openrdf.repository.sail.SailRepositoryConnection
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
public BigdataSailQuery prepareNativeSPARQLQuery(org.openrdf.query.QueryLanguage ql, String queryStr, String baseURI) throws org.openrdf.query.MalformedQueryException
ql
- The QueryLanguage
.queryStr
- The query.baseURI
- The base URI.org.openrdf.query.MalformedQueryException
UnsupportedOperationException
- if the query language is not SPARQL.public BigdataSailUpdate prepareNativeSPARQLUpdate(org.openrdf.query.QueryLanguage ql, String updateStr, String baseURI) throws org.openrdf.query.MalformedQueryException
ql
- The QueryLanguage
.updateStr
- The update request.baseURI
- The base URI.org.openrdf.query.MalformedQueryException
UnsupportedOperationException
- if the QueryLanguage
is not SPARQL.public final boolean isReadOnly()
true
if the connection does not permit mutation.public final boolean isUnisolated()
true
if this is the ITx.UNISOLATED
connection.public long commit2() throws org.openrdf.repository.RepositoryException
Note: auto-commit is an EXTREMELY bad idea. Performance will be terrible. The database will swell to an outrageous size. TURN OFF AUTO COMMIT.
0L
if the write set was empty such that nothing was
committed.org.openrdf.repository.RepositoryException
BigdataSail.Options.ALLOW_AUTO_COMMIT
public void commit() throws org.openrdf.repository.RepositoryException
Note: auto-commit is an EXTREMELY bad idea. Performance will be terrible. The database will swell to an outrageous size. TURN OFF AUTO COMMIT.
commit
in interface org.openrdf.repository.RepositoryConnection
commit
in class org.openrdf.repository.sail.SailRepositoryConnection
org.openrdf.repository.RepositoryException
BigdataSail.Options.ALLOW_AUTO_COMMIT
public void flush() throws org.openrdf.repository.RepositoryException
BigdataSail.BigdataSailConnection
heavily
buffers assertions and retractions. Either a flush()
or a
commit()
is required before executing any operations directly
against the backing AbstractTripleStore
so that the buffered
assertions or retractions will be written onto the KB and become visible
to other methods. This is not a transaction issue -- just a buffer issue.
The public methods on the BigdataSail.BigdataSailConnection
all flush the
buffers before performing any queries against the underlying
AbstractTripleStore
.org.openrdf.repository.RepositoryException
public AbstractTripleStore getTripleStore()
AbstractTripleStore
object. Caution MUST be
used when accessing this object as the access goes around the SAIL API.public void computeClosure() throws org.openrdf.repository.RepositoryException
This computes the closure of the database. This can be used if you do NOT enable truth maintenance and choose instead to load up all of your data first and then compute the closure of the database. Note that some rules may be computed by eager closure while others are computed at query time.
Note: If there are already entailments in the database AND you have retracted statements since the last time the closure was computed then you MUST delete all entailments from the database before re-computing the closure.
Note: This method does NOT commit the database. See
AbstractTripleStore.commit()
and getTripleStore()
.
org.openrdf.repository.RepositoryException
removeAllEntailments()
public void removeAllEntailments() throws org.openrdf.sail.SailException, org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
org.openrdf.sail.SailException
public void addChangeLog(IChangeLog log)
IChangeLog
and
IChangeRecord
.log
- the change logpublic void removeChangeLog(IChangeLog log)
IChangeLog
and
IChangeRecord
.log
- the change logCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.