Package org.eclipse.rdf4j.rio.n3
Class N3Writer
- java.lang.Object
-
- org.eclipse.rdf4j.rio.n3.N3Writer
-
- All Implemented Interfaces:
org.eclipse.rdf4j.common.io.CharSink,org.eclipse.rdf4j.common.io.Sink,RDFHandler,RDFWriter
public class N3Writer extends Object implements RDFWriter, org.eclipse.rdf4j.common.io.CharSink
An implementation of the RDFWriter interface that writes RDF documents in N3 format. Note: the current implementation simply wraps aTurtleWriterand writes documents in Turtle format, which is a subset of N3.
-
-
Constructor Summary
Constructors Constructor Description N3Writer(OutputStream out)Creates a new N3Writer that will write to the supplied OutputStream.N3Writer(OutputStream out, org.eclipse.rdf4j.common.net.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, org.eclipse.rdf4j.common.net.ParsedIRI baseIRI)Creates a new N3Writer that will write to the supplied Writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendRDF()org.eclipse.rdf4j.common.lang.FileFormatgetFileFormat()RDFFormatgetRDFFormat()Collection<RioSetting<?>>getSupportedSettings()WritergetWriter()WriterConfiggetWriterConfig()voidhandleComment(String comment)voidhandleNamespace(String prefix, String name)voidhandleStatement(org.eclipse.rdf4j.model.Statement st)<T> RDFWriterset(RioSetting<T> setting, T value)RDFWritersetWriterConfig(WriterConfig config)voidstartRDF()
-
-
-
Constructor Detail
-
N3Writer
public N3Writer(OutputStream out)
Creates a new N3Writer that will write to the supplied OutputStream.- Parameters:
out- The OutputStream to write the N3 document to.
-
N3Writer
public N3Writer(OutputStream out, org.eclipse.rdf4j.common.net.ParsedIRI baseIRI)
Creates a new N3Writer that will write to the supplied OutputStream.- Parameters:
out- The OutputStream to write the N3 document to.baseIRI- used to relativize IRIs to relative IRIs.
-
N3Writer
public N3Writer(Writer writer)
Creates a new N3Writer that will write to the supplied Writer.- Parameters:
writer- The Writer to write the N3 document to.
-
N3Writer
public N3Writer(Writer writer, org.eclipse.rdf4j.common.net.ParsedIRI baseIRI)
Creates a new N3Writer that will write to the supplied Writer.- Parameters:
writer- The Writer to write the N3 document to.baseIRI- used to relativize IRIs to relative IRIs.
-
-
Method Detail
-
getWriter
public Writer getWriter()
- Specified by:
getWriterin interfaceorg.eclipse.rdf4j.common.io.CharSink
-
getRDFFormat
public RDFFormat getRDFFormat()
- Specified by:
getRDFFormatin interfaceRDFWriter
-
setWriterConfig
public RDFWriter setWriterConfig(WriterConfig config)
- Specified by:
setWriterConfigin interfaceRDFWriter
-
getWriterConfig
public WriterConfig getWriterConfig()
- Specified by:
getWriterConfigin interfaceRDFWriter
-
getSupportedSettings
public Collection<RioSetting<?>> getSupportedSettings()
- Specified by:
getSupportedSettingsin interfaceRDFWriter
-
set
public <T> RDFWriter set(RioSetting<T> setting, T value)
-
startRDF
public void startRDF() throws RDFHandlerException- Specified by:
startRDFin interfaceRDFHandler- Throws:
RDFHandlerException
-
endRDF
public void endRDF() throws RDFHandlerException- Specified by:
endRDFin interfaceRDFHandler- Throws:
RDFHandlerException
-
handleNamespace
public void handleNamespace(String prefix, String name) throws RDFHandlerException
- Specified by:
handleNamespacein interfaceRDFHandler- Throws:
RDFHandlerException
-
handleStatement
public void handleStatement(org.eclipse.rdf4j.model.Statement st) throws RDFHandlerException- Specified by:
handleStatementin interfaceRDFHandler- Throws:
RDFHandlerException
-
handleComment
public void handleComment(String comment) throws RDFHandlerException
- Specified by:
handleCommentin interfaceRDFHandler- Throws:
RDFHandlerException
-
getFileFormat
public org.eclipse.rdf4j.common.lang.FileFormat getFileFormat()
- Specified by:
getFileFormatin interfaceorg.eclipse.rdf4j.common.io.Sink
-
-