Package com.complexible.common.rdf
Interface StatementSource
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Subinterfaces:
ContextCopyStatementSource,RDFFileSupplier,RDFStreamSupplier
- All Known Implementing Classes:
ContextFallbackStatementSource,ContextOverrideStatementSource,DelegatingStatementSource,StatementSources.RDFStreamStatementSource
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 -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturns true if the statement source represents, at least partially, the contents of a Virtual Graphdefault longReturns the estimated count of statements in this source orNO_ESTIMATEif the estimate is not known.Return the context these statements belong to.default booleaninMemory()Returns true if all statements are held in memoryReturn an iterator over the statements contained by this source.streams()Converts the statement source into one or more streams.
-
Field Details
-
NO_ESTIMATE
static final long NO_ESTIMATE- See Also:
-
-
Method Details
-
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
Converts the statement source into one or more streams. -
estimatedCount
default long estimatedCount()Returns the estimated count of statements in this source orNO_ESTIMATEif 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
-