public class N3Writer extends Object implements RDFWriter, CharSink
TurtleWriter and writes documents in Turtle format, which is a subset of N3.| Constructor and Description |
|---|
N3Writer(OutputStream out)
Creates a new N3Writer that will write to the supplied OutputStream.
|
N3Writer(OutputStream out,
ParsedIRI baseIRI)
Creates a new N3Writer that will write to the supplied OutputStream.
|
N3Writer(Writer writer)
Creates a new N3Writer that will write to the supplied Writer.
|
N3Writer(Writer writer,
ParsedIRI baseIRI)
Creates a new N3Writer that will write to the supplied Writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
endRDF()
Signals the end of the RDF data.
|
FileFormat |
getFileFormat()
Get the
FileFormat this sink uses. |
RDFFormat |
getRDFFormat()
Gets the RDF format that this RDFWriter uses.
|
Collection<RioSetting<?>> |
getSupportedSettings() |
Writer |
getWriter()
|
WriterConfig |
getWriterConfig()
Retrieves the current writer configuration as a single object.
|
void |
handleComment(String comment)
Handles a comment.
|
void |
handleNamespace(String prefix,
String name)
Handles a namespace declaration/definition.
|
void |
handleStatement(Statement st)
Handles a statement.
|
<T> RDFWriter |
set(RioSetting<T> setting,
T value)
Set a setting on the writer, and return this writer object to allow chaining.
|
RDFWriter |
setWriterConfig(WriterConfig config)
Sets all supplied writer configuration options.
|
void |
startRDF()
Signals the start of the RDF data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitacceptsFileFormatpublic N3Writer(OutputStream out)
out - The OutputStream to write the N3 document to.public N3Writer(OutputStream out, ParsedIRI baseIRI)
out - The OutputStream to write the N3 document to.baseIRI - used to relativize IRIs to relative IRIs.public N3Writer(Writer writer)
writer - The Writer to write the N3 document to.public RDFFormat getRDFFormat()
RDFWritergetRDFFormat in interface RDFWriterpublic RDFWriter setWriterConfig(WriterConfig config)
RDFWritersetWriterConfig in interface RDFWriterconfig - a writer configuration object.public WriterConfig getWriterConfig()
RDFWritergetWriterConfig in interface RDFWriterpublic Collection<RioSetting<?>> getSupportedSettings()
getSupportedSettings in interface RDFWriterRioSettings that are supported by this RDFWriter.public <T> RDFWriter set(RioSetting<T> setting, T value)
RDFWriterpublic void startRDF()
throws RDFHandlerException
RDFHandlerstartRDF in interface RDFHandlerRDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void endRDF()
throws RDFHandlerException
RDFHandlerendRDF in interface RDFHandlerRDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void handleNamespace(String prefix, String name) throws RDFHandlerException
RDFHandlerhandleNamespace in interface RDFHandlerprefix - The prefix for the namespace, or an empty string in case of a default namespace.name - The URI that the prefix maps to.RDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void handleStatement(Statement st) throws RDFHandlerException
RDFHandlerhandleStatement in interface RDFHandlerst - The statement.RDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void handleComment(String comment) throws RDFHandlerException
RDFHandlerhandleComment in interface RDFHandlercomment - The comment.RDFHandlerException - If the RDF handler has encountered an unrecoverable error.public FileFormat getFileFormat()
SinkFileFormat this sink uses.getFileFormat in interface SinkFileFormat. May not be null.Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.