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
A writer to serialize RDF statements in a particular RDF format.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidWrite a comment to the output.voidend()Signals the writing process is completed.format()Theformatthis writer will serialize output in.voidWrite the givenStatementvoidProvide a namespace to the writer.voidstart()Signals that the RDF writing process is starting.
-
Method Details
-
start
void start()Signals that the RDF writing process is starting.- Specified by:
startin interfaceRDFHandler
-
handle
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
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
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
-
format
Theformatthis writer will serialize output in.- Returns:
- the format
-