Package com.complexible.common.rdf.rio
Interface RDFStream
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
DelegatingRDFStream
,RandomStream
,RDFStreamBase
public interface RDFStream extends java.io.Closeable
A simple interface for representing a stream for RDF input. An RDF stream is typically backed by an input stream and parsed with anRDFParser
but a specific stream implementation might use different means to generate statements.- Since:
- 1.1
- Version:
- 6.0
- Author:
- Evren Sirin
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
bytesRead()
long
estimatedCount()
Resource
getContext()
Returns the default context associated with this stream ornull
if there is no default context.java.lang.String
getName()
Returns the name of this stream.boolean
hasContext()
Returnstrue
either if this stream has a non-nullcontext
or the statements generated by this stream has contexts.long
length()
void
parse(RDFHandler theHandler)
Parses the stream and passes the statements to the given handler.
-
-
-
Method Detail
-
parse
void parse(RDFHandler theHandler) throws java.io.IOException, InvalidRDF, RDFHandlerException
Parses the stream and passes the statements to the given handler.- Throws:
java.io.IOException
InvalidRDF
RDFHandlerException
-
getContext
Resource getContext()
Returns the default context associated with this stream ornull
if there is no default context. Note that, the statements that will be sent to the handler may not be using this context and the user of this stream should make sure the context information is used correctly.
-
hasContext
boolean hasContext()
Returnstrue
either if this stream has a non-nullcontext
or the statements generated by this stream has contexts.
-
getName
java.lang.String getName()
Returns the name of this stream. If the stream is backed by a file this will return the file's name. Otherwise it might be an auto-generated name or some other (not necessarily unique) name.
-
bytesRead
long bytesRead()
-
length
long length()
-
estimatedCount
long estimatedCount()
-
-