Package com.stardog.stark.io
Interface RDFWriter
-
- All Superinterfaces:
RDFHandler
- All Known Implementing Classes:
BinaryRDFWriter,ForwardingRDFWriter,JSONLDWriter,NQuadsWriter,NTWriter,PrettyTurtleWriter,RDFJSONWriter,RDFXMLPrettyWriter,RDFXMLWriter,StreamingJSONLDWriter,TrigWriter,TurtleWriter
public interface RDFWriter extends RDFHandler
A writer to serialize
RDF statementsin a particular RDF format.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
- See Also:
RDFWriterFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcomment(java.lang.String theComment)Write a comment to the output.voidend()Signals the writing process is completed.RDFFormatformat()Theformatthis writer will serialize output in.voidhandle(Statement theStmt)Write the givenStatementvoidnamespace(java.lang.String thePrefix, java.lang.String theIRI)Provide a namespace to the writer.voidstart()Signals that the RDF writing process is starting.
-
-
-
Method Detail
-
start
void start()
Signals that the RDF writing process is starting.- Specified by:
startin interfaceRDFHandler
-
handle
void handle(@Nonnull Statement theStmt)Write the givenStatement- Specified by:
handlein interfaceRDFHandler- Parameters:
theStmt- the statement to write- Implementation Notes:
- It is generally assumed that output has to be
startedprior to writing Statements, but it is not required as not all syntaxes will have a preamble requirement, such as the opening `rdf:RDF` tag in RDF/XML. It should not be possible to continue writing statements after the writing processes hasended
-
namespace
void namespace(@Nonnull java.lang.String thePrefix, @Nonnull java.lang.String theIRI)Provide a namespace to the writer. This method can be called before writing hasstarted, in which case, the namespace bindings are buffered and written when appropriate after writing has begun.- Specified by:
namespacein interfaceRDFHandler- Parameters:
thePrefix- the namespace prefixtheIRI- the associated IRI- Implementation Notes:
- It is assumed that the namespaces will be used to shorten output via QNames for syntaxes which support them.
-
comment
void comment(@Nonnull java.lang.String theComment)Write a comment to the output. Writing need not bestartedat this point; comments can be written prior to any actual serialized RDF- Parameters:
theComment- the comment to write
-
end
void end()
Signals the writing process is completed. The underlyingInputStreamis *not* closed, but the caller should not call additional methods on this writer as that will normally yield syntax errors in the output.- Specified by:
endin interfaceRDFHandler
-
-