Package com.complexible.common.rdf
Interface StatementSource
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Subinterfaces:
ContextCopyStatementSource
- All Known Implementing Classes:
ContextFallbackStatementSource
,ContextOverrideStatementSource
,DelegatingStatementSource
,StatementSources.RDFStreamStatementSource
public interface StatementSource extends java.io.Closeable
Interface which represents a source of a set of RDF
statements
. The actual source of the statements can be an in-memory graph, a file on disk, a socket or network connection, etc.Care should be taken to sure that all StatementSource objects are closed to free up any resources they are holding.
- Since:
- 0.3.1
- Version:
- 6.0
- Author:
- Michael Grove, Fernando Hernandez
-
-
Field Summary
Fields Modifier and Type Field Description static long
NO_ESTIMATE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
containsVirtual()
Returns true if the statement source represents, at least partially, the contents of a Virtual Graphdefault long
estimatedCount()
Returns the estimated count of statements in this source orNO_ESTIMATE
if the estimate is not known.Resource
getContext()
Return the context these statements belong to.default boolean
inMemory()
Returns true if all statements are held in memoryStatementIterator
statements()
Return an iterator over the statements contained by this source.java.util.List<RDFStream>
streams()
Converts the statement source into one or more streams.
-
-
-
Field Detail
-
NO_ESTIMATE
static final long NO_ESTIMATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
statements
StatementIterator statements()
Return an iterator over the statements contained by this source.- Returns:
- an iteration over the statements.
- Implementation Requirements:
- Implementations must ensure that this method can be called more than once and the resulting iterators can be used independently.
- Implementation Notes:
Closing the iterator
, when applicable, does not clean up the source, only the iterator. You must close the source separately.
-
getContext
Resource getContext()
Return the context these statements belong to. When non-null, this should override the context specified on the statements themselves.- Returns:
- the context of all the statements from this source, or `null` if there is no context (for all of them) or they each have their own context specified.
-
streams
java.util.List<RDFStream> streams()
Converts the statement source into one or more streams.
-
estimatedCount
default long estimatedCount()
Returns the estimated count of statements in this source orNO_ESTIMATE
if the estimate is not known.
-
containsVirtual
default boolean containsVirtual()
Returns true if the statement source represents, at least partially, the contents of a Virtual Graph
-
inMemory
default boolean inMemory()
Returns true if all statements are held in memory- Returns:
- true if all statements are held in memory
-
-