Package org.eclipse.rdf4j.sail.base
Class ObservingSailDataset
- java.lang.Object
-
- org.eclipse.rdf4j.sail.base.DelegatingSailDataset
-
- org.eclipse.rdf4j.sail.base.ObservingSailDataset
-
- All Implemented Interfaces:
java.lang.AutoCloseable,SailClosable,SailDataset
class ObservingSailDataset extends DelegatingSailDataset
AIsolationLevels.SERIALIZABLESailDatasetthat tracks the observed statement patterns to anSailSink.observe(Resource, IRI, Value, Resource...)to check consistency.
-
-
Constructor Summary
Constructors Constructor Description ObservingSailDataset(SailDataset delegate, SailSink observer)Creates aIsolationLevels.SERIALIZABLESailDatasetthat tracks consistency.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Called when thisSailDatasetis no longer is used, such as when a read operation is complete.CloseableIteration<? extends Resource,SailException>getContextIDs()Returns the set of all unique context identifiers that are used to store statements.CloseableIteration<? extends Statement,SailException>getStatements(Resource subj, IRI pred, Value obj, Resource... contexts)Gets all statements that have a specific subject, predicate and/or object.-
Methods inherited from class org.eclipse.rdf4j.sail.base.DelegatingSailDataset
getNamespace, getNamespaces, getTriples, toString
-
-
-
-
Constructor Detail
-
ObservingSailDataset
public ObservingSailDataset(SailDataset delegate, SailSink observer)
Creates aIsolationLevels.SERIALIZABLESailDatasetthat tracks consistency.- Parameters:
delegate- to beSailDataset.close()when thisSailDatasetis closed.observer- to beSailSink.flush()andSailClosable.close()when thisSailDatasetis closed.
-
-
Method Detail
-
close
public void close() throws SailExceptionDescription copied from interface:SailDatasetCalled when thisSailDatasetis no longer is used, such as when a read operation is complete. An isolation level compatible withIsolationLevels.SNAPSHOTwill ensure the state of thisSailDatasetdose not change between the first call to this object untilSailClosable#release()is called.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceSailClosable- Specified by:
closein interfaceSailDataset- Overrides:
closein classDelegatingSailDataset- Throws:
SailException- if this resource cannot be closed
-
getContextIDs
public CloseableIteration<? extends Resource,SailException> getContextIDs() throws SailException
Description copied from interface:SailDatasetReturns the set of all unique context identifiers that are used to store statements.- Specified by:
getContextIDsin interfaceSailDataset- Overrides:
getContextIDsin classDelegatingSailDataset- Returns:
- An iterator over the context identifiers, should not contain any duplicates.
- Throws:
SailException
-
getStatements
public CloseableIteration<? extends Statement,SailException> getStatements(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException
Description copied from interface:SailDatasetGets all statements that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards. Optionally a (set of) context(s) may be specified in which case the result will be restricted to statements matching one or more of the specified contexts.- Specified by:
getStatementsin interfaceSailDataset- Overrides:
getStatementsin classDelegatingSailDataset- Parameters:
subj- A Resource specifying the subject, or null for a wildcard.pred- A IRI specifying the predicate, or null for a wildcard.obj- A Value specifying the object, or null for a wildcard.contexts- The context(s) to get the statements from. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on all contexts.- Returns:
- An iterator over the relevant statements.
- Throws:
SailException- If the triple source failed to get the statements.
-
-