public class KiWiSailConnection
extends org.openrdf.sail.helpers.NotifyingSailConnectionBase
implements org.openrdf.sail.inferencer.InferencerConnection, org.apache.marmotta.commons.sesame.repository.ResourceConnection
Modifier and Type | Class and Description |
---|---|
protected static class |
KiWiSailConnection.KiWiEvaluationStatistics |
Modifier and Type | Field and Description |
---|---|
protected KiWiConnection |
databaseConnection
Internal JDBC connection to the database.
|
Constructor and Description |
---|
KiWiSailConnection(KiWiStore sailBase) |
Modifier and Type | Method and Description |
---|---|
KiWiTriple |
addInferredStatement(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj)
Used by the KiWi reasoner, returns the created inferred statement directly.
|
boolean |
addInferredStatement(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... contexts)
Adds an inferred statement to a specific context.
|
Set<KiWiTriple> |
addStatementInternal(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
boolean inferred,
org.openrdf.model.Resource... contexts) |
protected void |
addStatementInternal(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... contexts) |
void |
clearInferred(org.openrdf.model.Resource... contexts)
Removes all inferred statements from the specified/all contexts.
|
protected void |
clearInternal(org.openrdf.model.Resource... contexts) |
protected void |
clearNamespacesInternal() |
protected void |
closeInternal() |
protected void |
commitInternal() |
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.query.BindingSet,org.openrdf.query.QueryEvaluationException> |
evaluateInternal(org.openrdf.query.algebra.TupleExpr tupleExpr,
org.openrdf.query.Dataset dataset,
org.openrdf.query.BindingSet bindings,
boolean includeInferred)
Implementation of SPARQL/SeRQL querying using an abstract query expression.
|
void |
flushUpdates() |
org.openrdf.model.BNode |
getBNode(String id)
Return the Sesame BNode with the given anonymous ID if it exists, or null if it does not exist.
|
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Resource,org.openrdf.sail.SailException> |
getContextIDsInternal() |
KiWiConnection |
getDatabaseConnection() |
protected String |
getNamespaceInternal(String prefix) |
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Namespace,org.openrdf.sail.SailException> |
getNamespacesInternal() |
org.openrdf.repository.RepositoryResult<org.openrdf.model.Resource> |
getResources()
Return an iterator over the resources contained in this repository.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.URI> |
getResources(String prefix)
Return an iterator over the resources contained in this repository matching the given prefix.
|
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Statement,org.openrdf.sail.SailException> |
getStatementsInternal(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
boolean includeInferred,
org.openrdf.model.Resource... contexts) |
org.openrdf.model.URI |
getURI(String uri)
Return the Sesame URI with the given uri identifier if it exists, or null if it does not exist.
|
KiWiValueFactory |
getValueFactory() |
boolean |
removeInferredStatement(KiWiTriple triple)
Removes an inferred statement from a specific context.
|
boolean |
removeInferredStatement(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... contexts)
Removes an inferred statement from a specific context.
|
protected void |
removeNamespaceInternal(String prefix) |
void |
removeResource(org.openrdf.model.Resource resource)
Remove the resource given as argument from the triple store and the resource repository.
|
protected void |
removeStatementsInternal(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... contexts) |
protected KiWiResource |
resolveContextInternal(org.openrdf.model.Resource input) |
protected void |
rollbackInternal() |
protected void |
setNamespaceInternal(String prefix,
String name) |
protected long |
sizeInternal(org.openrdf.model.Resource... contexts) |
protected void |
startTransactionInternal() |
addConnectionListener, hasConnectionListeners, notifyStatementAdded, notifyStatementRemoved, removeConnectionListener
addStatement, addStatement, autoStartTransaction, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, finalize, getContextIDs, getExclusiveConnectionLock, getNamespace, getNamespaces, getSharedConnectionLock, getStatements, getTransactionLock, isActive, isOpen, iterationClosed, prepare, registerIteration, removeNamespace, removeStatement, removeStatements, rollback, setNamespace, size, startUpdate, transactionActive, verifyIsActive, verifyIsOpen
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addConnectionListener, removeConnectionListener
addStatement, addStatement, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, getContextIDs, getNamespace, getNamespaces, getStatements, isActive, isOpen, prepare, removeNamespace, removeStatement, removeStatements, rollback, setNamespace, size, startUpdate
protected KiWiConnection databaseConnection
public KiWiSailConnection(KiWiStore sailBase) throws org.openrdf.sail.SailException
org.openrdf.sail.SailException
public KiWiConnection getDatabaseConnection()
protected void addStatementInternal(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
addStatementInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
public boolean addInferredStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
addInferredStatement
in interface org.openrdf.sail.inferencer.InferencerConnection
subj
- The subject of the statement to add.pred
- The predicate of the statement to add.obj
- The object of the statement to add.contexts
- The context(s) to add the statement to. Note that this parameter is
a vararg and as such is optional. If no contexts are supplied the
method operates on the entire repository.org.openrdf.sail.SailException
- If the statement could not be added.IllegalStateException
- If the connection has been closed.public KiWiTriple addInferredStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj) throws org.openrdf.sail.SailException
org.openrdf.sail.SailException
public Set<KiWiTriple> addStatementInternal(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, boolean inferred, org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
org.openrdf.sail.SailException
protected void closeInternal() throws org.openrdf.sail.SailException
closeInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.query.BindingSet,org.openrdf.query.QueryEvaluationException> evaluateInternal(org.openrdf.query.algebra.TupleExpr tupleExpr, org.openrdf.query.Dataset dataset, org.openrdf.query.BindingSet bindings, boolean includeInferred) throws org.openrdf.sail.SailException
evaluateInternal
in class org.openrdf.sail.helpers.SailConnectionBase
tupleExpr
- dataset
- bindings
- includeInferred
- org.openrdf.sail.SailException
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Resource,org.openrdf.sail.SailException> getContextIDsInternal() throws org.openrdf.sail.SailException
getContextIDsInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Statement,org.openrdf.sail.SailException> getStatementsInternal(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, boolean includeInferred, org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
getStatementsInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected long sizeInternal(org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
sizeInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected void startTransactionInternal() throws org.openrdf.sail.SailException
startTransactionInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected void commitInternal() throws org.openrdf.sail.SailException
commitInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected void rollbackInternal() throws org.openrdf.sail.SailException
rollbackInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected void removeStatementsInternal(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
removeStatementsInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
public boolean removeInferredStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
removeInferredStatement
in interface org.openrdf.sail.inferencer.InferencerConnection
subj
- The subject of the statement that should be removed.pred
- The predicate of the statement that should be removed.obj
- The object of the statement that should be removed.contexts
- The context(s) from which to remove the statements. Note that this
parameter is a vararg and as such is optional. If no contexts are
supplied the method operates on the entire repository.org.openrdf.sail.SailException
- If the statement could not be removed.IllegalStateException
- If the connection has been closed.public boolean removeInferredStatement(KiWiTriple triple) throws org.openrdf.sail.SailException
org.openrdf.sail.SailException
- If the statement could not be removed.IllegalStateException
- If the connection has been closed.protected void clearInternal(org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
clearInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
public void clearInferred(org.openrdf.model.Resource... contexts) throws org.openrdf.sail.SailException
clearInferred
in interface org.openrdf.sail.inferencer.InferencerConnection
contexts
- The context(s) from which to remove the statements. Note that this
parameter is a vararg and as such is optional. If no contexts are
supplied the method operates on the entire repository.org.openrdf.sail.SailException
- If the statements could not be removed.IllegalStateException
- If the connection has been closed.public void flushUpdates()
flushUpdates
in interface org.openrdf.sail.inferencer.InferencerConnection
protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Namespace,org.openrdf.sail.SailException> getNamespacesInternal() throws org.openrdf.sail.SailException
getNamespacesInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected String getNamespaceInternal(String prefix) throws org.openrdf.sail.SailException
getNamespaceInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected void setNamespaceInternal(String prefix, String name) throws org.openrdf.sail.SailException
setNamespaceInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected void removeNamespaceInternal(String prefix) throws org.openrdf.sail.SailException
removeNamespaceInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected void clearNamespacesInternal() throws org.openrdf.sail.SailException
clearNamespacesInternal
in class org.openrdf.sail.helpers.SailConnectionBase
org.openrdf.sail.SailException
protected KiWiResource resolveContextInternal(org.openrdf.model.Resource input)
public KiWiValueFactory getValueFactory()
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Resource> getResources() throws org.openrdf.repository.RepositoryException
getResources
in interface org.apache.marmotta.commons.sesame.repository.ResourceConnection
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.URI> getResources(String prefix) throws org.openrdf.repository.RepositoryException
getResources
in interface org.apache.marmotta.commons.sesame.repository.ResourceConnection
org.openrdf.repository.RepositoryException
public org.openrdf.model.URI getURI(String uri)
getURI
in interface org.apache.marmotta.commons.sesame.repository.ResourceConnection
uri
- public org.openrdf.model.BNode getBNode(String id)
getBNode
in interface org.apache.marmotta.commons.sesame.repository.ResourceConnection
id
- public void removeResource(org.openrdf.model.Resource resource)
removeResource
in interface org.apache.marmotta.commons.sesame.repository.ResourceConnection
resource
- Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.