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 statements
in 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 void
comment(java.lang.String theComment)
Write a comment to the output.void
end()
Signals the writing process is completed.RDFFormat
format()
Theformat
this writer will serialize output in.void
handle(Statement theStmt)
Write the givenStatement
void
namespace(java.lang.String thePrefix, java.lang.String theIRI)
Provide a namespace to the writer.void
start()
Signals that the RDF writing process is starting.
-
-
-
Method Detail
-
start
void start()
Signals that the RDF writing process is starting.- Specified by:
start
in interfaceRDFHandler
-
handle
void handle(@Nonnull Statement theStmt)
Write the givenStatement
- Specified by:
handle
in interfaceRDFHandler
- Parameters:
theStmt
- the statement to write- Implementation Notes:
- It is generally assumed that output has to be
started
prior 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:
namespace
in 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 bestarted
at 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 underlyingInputStream
is *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:
end
in interfaceRDFHandler
-
-