Package org.eclipse.rdf4j.sail.memory
Class MemorySailStore.MemorySailDataset
java.lang.Object
org.eclipse.rdf4j.sail.memory.MemorySailStore.MemorySailDataset
- All Implemented Interfaces:
AutoCloseable
,SailClosable
,SailDataset
- Enclosing class:
MemorySailStore
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final boolean
private final MemorySailStore.SnapshotMonitor.ReservedSnapshot
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionMemorySailDataset
(boolean explicit) MemorySailDataset
(boolean explicit, int snapshot) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Called when thisSailDataset
is no longer is used, such as when a read operation is complete.CloseableIteration
<? extends Resource, SailException> Returns the set of all unique context identifiers that are used to store statements.private int
getNamespace
(String prefix) Gets the namespace that is associated with the specified prefix, if any.CloseableIteration
<? extends Namespace, SailException> Gets the namespaces relevant to the data contained in this object.getStatements
(Resource subj, IRI pred, Value obj, Resource... contexts) Gets all statements that have a specific subject, predicate and/or object.getTriples
(Resource subj, IRI pred, Value obj) Gets all RDF-star triples that have a specific subject, predicate and/or object.private boolean
isContextResource
(MemResource memResource, int snapshot) toString()
-
Field Details
-
explicit
private final boolean explicit -
snapshot
private final int snapshot -
reservedSnapshot
-
closed
private volatile boolean closed
-
-
Constructor Details
-
MemorySailDataset
- Throws:
SailException
-
MemorySailDataset
- Throws:
SailException
-
-
Method Details
-
toString
-
close
public void close()Description copied from interface:SailDataset
Called when thisSailDataset
is no longer is used, such as when a read operation is complete. An isolation level compatible withIsolationLevels.SNAPSHOT
will ensure the state of thisSailDataset
dose not change between the first call to this object untilinvalid reference
SailClosable#release()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSailClosable
- Specified by:
close
in interfaceSailDataset
-
getNamespace
Description copied from interface:SailDataset
Gets the namespace that is associated with the specified prefix, if any.- Specified by:
getNamespace
in interfaceSailDataset
- Parameters:
prefix
- A namespace prefix, or an empty string in case of the default namespace.- Returns:
- The namespace name that is associated with the specified prefix, or null if there is no such namespace.
- Throws:
SailException
- If this object encountered an error or unexpected situation internally.
-
getNamespaces
Description copied from interface:SailDataset
Gets the namespaces relevant to the data contained in this object.- Specified by:
getNamespaces
in interfaceSailDataset
- Returns:
- An iterator over the relevant namespaces, should not contain any duplicates.
-
getContextIDs
Description copied from interface:SailDataset
Returns the set of all unique context identifiers that are used to store statements.- Specified by:
getContextIDs
in interfaceSailDataset
- Returns:
- An iterator over the context identifiers, should not contain any duplicates.
- Throws:
SailException
-
getStatements
public CloseableIteration<MemStatement,SailException> getStatements(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException Description copied from interface:SailDataset
Gets 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:
getStatements
in interfaceSailDataset
- 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.
-
getTriples
public CloseableIteration<MemTriple,SailException> getTriples(Resource subj, IRI pred, Value obj) throws SailException Description copied from interface:SailDataset
Gets all RDF-star triples that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards.- Specified by:
getTriples
in interfaceSailDataset
- 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.- Returns:
- An iterator over the relevant triples.
- Throws:
SailException
- If the triple source failed to get the RDF-star triples.
-
getCurrentSnapshot
private int getCurrentSnapshot() -
isContextResource
private boolean isContextResource(MemResource memResource, int snapshot) throws SailException, InterruptedException - Throws:
SailException
InterruptedException
-