Class SchemaCachingRDFSInferencerConnection
java.lang.Object
org.eclipse.rdf4j.sail.helpers.SailConnectionWrapper
org.eclipse.rdf4j.sail.helpers.NotifyingSailConnectionWrapper
org.eclipse.rdf4j.sail.inferencer.InferencerConnectionWrapper
org.eclipse.rdf4j.sail.inferencer.fc.SchemaCachingRDFSInferencerConnection
- All Implemented Interfaces:
AutoCloseable, FederatedServiceResolverClient, ThreadSafetyAware, InferencerConnection, NotifyingSailConnection, SailConnection, SailConnectionListener
public class SchemaCachingRDFSInferencerConnection
extends InferencerConnectionWrapper
implements SailConnectionListener
- Author:
- HÃ¥vard Mikkelsen Ottestad
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddInferredStatement(Resource subj, IRI pred, Value obj, Resource... contexts) Adds an inferred statement to a specific context.voidaddStatement(Resource subject, IRI predicate, Value object, Resource... contexts) Adds a statement to the store.voidaddStatement(UpdateContext modify, Resource subj, IRI pred, Value obj, Resource... contexts) Adds a statement to the store.voidbegin()Begins a transaction requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidbegin(IsolationLevel level) Begins a transaction with the specifiedIsolationLevellevel, requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidclearInferred(Resource... contexts) Removes all inferred statements from the specified/all contexts.voidcommit()CallsInferencerConnectionWrapper.flushUpdates()before forwarding the call to the wrapped connection.voidFlushes any pending updates to be processed and the resulting changes to be reported to registeredSailConnectionListeners.voidrollback()Rolls back the transaction, discarding any uncommitted changes that have been made in this SailConnection.voidNotifies the listener that a statement has been added in a transaction that it has registered itself with.voidNotifies the listener that a statement has been removed in a transaction that it has registered itself with.Methods inherited from class InferencerConnectionWrapper
evaluate, flush, getContextIDs, getStatements, getWrappedConnection, hasStatement, prepare, removeInferredStatement, sizeModifier and TypeMethodDescriptionCloseableIteration<? extends BindingSet> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) CallsInferencerConnectionWrapper.flushUpdates()before forwarding the call to the wrapped connection.voidflush()Flushes any pending updates and notify changes to listeners as appropriate.CloseableIteration<? extends Resource> CallsInferencerConnectionWrapper.flushUpdates()before forwarding the call to the wrapped connection.CloseableIteration<? extends Statement> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) CallsInferencerConnectionWrapper.flushUpdates()before forwarding the call to the wrapped connection.Gets the connection that is wrapped by this object.booleanhasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Determines if the store contains any statements from the specified contexts that have a specific subject, predicate and/or object.voidprepare()CallsInferencerConnectionWrapper.flushUpdates()before forwarding the call to the wrapped connection.booleanremoveInferredStatement(Resource subj, IRI pred, Value obj, Resource... contexts) Removes an inferred statement from a specific context.longCallsInferencerConnectionWrapper.flushUpdates()before forwarding the call to the wrapped connection.Methods inherited from class NotifyingSailConnectionWrapper
addConnectionListener, removeConnectionListenerModifier and TypeMethodDescriptionvoidaddConnectionListener(SailConnectionListener listener) Adds the given listener to the wrapped connection.voidRemoves the given listener from the wrapped connection.Methods inherited from class SailConnectionWrapper
clear, clearNamespaces, close, endUpdate, explain, getComparator, getFederatedServiceResolver, getNamespace, getNamespaces, getStatements, getSupportedOrders, isActive, isOpen, prepareQuery, removeNamespace, removeStatement, removeStatements, setFederatedServiceResolver, setNamespace, setTransactionSettings, size, startUpdate, supportsConcurrentReadsModifier and TypeMethodDescriptionvoidRemoves all statements from the specified/all contexts.voidRemoves all namespace declarations from the repository.voidclose()Closes the connection.voidendUpdate(UpdateContext modify) Indicates that the givenopwill not be used in any call again.explain(Explanation.Level level, TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred, int timeoutSeconds) Explain how the TupleExpr will be (or has been) executed/evaluated by returning a TupleExpr (which may or may not be the provided TupleExpr) that has gone through zero or more of the stages prior to and also including execution as specified by the provided level.Different underlying datastructures may have different ways of ordering statements.Gets theFederatedServiceResolverused by this client.getNamespace(String prefix) Gets the namespace that is associated with the specified prefix, if any.CloseableIteration<? extends Namespace> Gets the namespaces relevant to the data contained in this Sail object.CloseableIteration<? extends Statement> getStatements(StatementOrder statementOrder, Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Gets all statements from the specified contexts that have a specific subject, predicate and/or object.getSupportedOrders(Resource subj, IRI pred, Value obj, Resource... contexts) The underlying store may support some, but not all, statement orders based on the statement pattern.booleanisActive()Indicates if a transaction is currently active on the connection.booleanisOpen()Checks whether this SailConnection is open.prepareQuery(QueryLanguage ql, Query.QueryType type, String query, String baseURI) Allows the SailConnection to bypass the standard query parser and provide its own internalTupleExprimplementation.voidremoveNamespace(String prefix) Removes a namespace declaration by removing the association between a prefix and a namespace name.voidremoveStatement(UpdateContext modify, Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidremoveStatements(Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidSets theFederatedServiceResolverto use for this client.voidsetNamespace(String prefix, String name) Sets the prefix for a namespace.voidsetTransactionSettings(TransactionSetting... settings) Pass any transaction-specific settings to the SailConnection.longvoidstartUpdate(UpdateContext modify) Signals the start of an update operation.booleanA class may support concurrent reads from multiple threads against the same object.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SailConnectionListener
statementAdded, statementRemovedModifier and TypeMethodDescriptiondefault voidstatementAdded(Statement st, boolean inferred) Notifies the listener that a statement has been added in a transaction that it has registered itself with.default voidstatementRemoved(Statement st, boolean inferred) Notifies the listener that a statement has been removed in a transaction that it has registered itself with.
-
Method Details
-
clearInferred
Description copied from interface:InferencerConnectionRemoves all inferred statements from the specified/all contexts. If no contexts are specified the method operates on the entire repository.- Specified by:
clearInferredin interfaceInferencerConnection- Overrides:
clearInferredin classInferencerConnectionWrapper- Parameters:
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.- Throws:
SailException- If the statements could not be removed.
-
commit
Description copied from class:InferencerConnectionWrapperCallsInferencerConnectionWrapper.flushUpdates()before forwarding the call to the wrapped connection.- Specified by:
commitin interfaceSailConnection- Overrides:
commitin classInferencerConnectionWrapper- Throws:
SailException- If the SailConnection could not be committed.
-
addInferredStatement
public boolean addInferredStatement(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException Description copied from interface:InferencerConnectionAdds an inferred statement to a specific context.- Specified by:
addInferredStatementin interfaceInferencerConnection- Overrides:
addInferredStatementin classInferencerConnectionWrapper- Parameters:
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.- Throws:
SailException- If the statement could not be added.
-
addStatement
public void addStatement(Resource subject, IRI predicate, Value object, Resource... contexts) throws SailException Description copied from interface:SailConnectionAdds a statement to the store.- Specified by:
addStatementin interfaceSailConnection- Overrides:
addStatementin classSailConnectionWrapper- Parameters:
subject- The subject of the statement to add.predicate- The predicate of the statement to add.object- 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 specified, a context-less statement will be added.- Throws:
SailException- If the statement could not be added, for example because no transaction is active.
-
rollback
Description copied from interface:SailConnectionRolls back the transaction, discarding any uncommitted changes that have been made in this SailConnection.- Specified by:
rollbackin interfaceSailConnection- Overrides:
rollbackin classSailConnectionWrapper- Throws:
SailException- If the SailConnection could not be rolled back.
-
begin
Description copied from interface:SailConnectionBegins a transaction requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction. The transaction will use the defaultIsolationLevellevel for the SAIL, as returned bySail.getDefaultIsolationLevel().- Specified by:
beginin interfaceSailConnection- Overrides:
beginin classSailConnectionWrapper- Throws:
SailException- If the connection could not start a transaction or if a transaction is already active on this connection.
-
begin
Description copied from interface:SailConnectionBegins a transaction with the specifiedIsolationLevellevel, requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.- Specified by:
beginin interfaceSailConnection- Overrides:
beginin classSailConnectionWrapper- Parameters:
level- the transaction isolation level on which this transaction operates.- Throws:
SailException- If the connection could not start a transaction, if the supplied transaction isolation level is not supported, or if a transaction is already active on this connection.
-
flushUpdates
Description copied from interface:InferencerConnectionFlushes any pending updates to be processed and the resulting changes to be reported to registeredSailConnectionListeners.- Specified by:
flushUpdatesin interfaceInferencerConnection- Overrides:
flushUpdatesin classInferencerConnectionWrapper- Throws:
SailException- If the updates could not be processed.
-
statementAdded
Description copied from interface:SailConnectionListenerNotifies the listener that a statement has been added in a transaction that it has registered itself with.- Specified by:
statementAddedin interfaceSailConnectionListener- Parameters:
st- The statement that was added.
-
statementRemoved
Description copied from interface:SailConnectionListenerNotifies the listener that a statement has been removed in a transaction that it has registered itself with.- Specified by:
statementRemovedin interfaceSailConnectionListener- Parameters:
st- The statement that was removed.
-
addStatement
public void addStatement(UpdateContext modify, Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException Description copied from interface:SailConnectionAdds a statement to the store. Called when adding statements through aUpdateExproperation.- Specified by:
addStatementin interfaceSailConnection- Overrides:
addStatementin classSailConnectionWrapper- Parameters:
modify- operation properties of theUpdateExproperation producing these statements.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 specified, a context-less statement will be added.- Throws:
SailException- If the statement could not be added, for example because no transaction is active.
-