Class TurtleWriter

java.lang.Object
org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter
org.eclipse.rdf4j.rio.turtle.TurtleWriter
All Implemented Interfaces:
CharSink, Sink, RDFHandler, RDFWriter
Direct Known Subclasses:
TriGWriter, TurtleStarWriter

public class TurtleWriter extends AbstractRDFWriter implements CharSink
An implementation of the RDFWriter interface that writes RDF documents in Turtle format. The Turtle format is defined in in this document.
  • Field Details

    • bufferedStatements

      protected Model bufferedStatements
    • baseIRI

      protected ParsedIRI baseIRI
    • writer

      protected IndentingWriter writer
    • statementClosed

      protected boolean statementClosed
      Flag indicating whether the last written statement has been closed.
    • lastWrittenSubject

      protected Resource lastWrittenSubject
    • lastWrittenPredicate

      protected IRI lastWrittenPredicate
  • Constructor Details

    • TurtleWriter

      public TurtleWriter(OutputStream out)
      Creates a new TurtleWriter that will write to the supplied OutputStream.
      Parameters:
      out - The OutputStream to write the Turtle document to.
    • TurtleWriter

      public TurtleWriter(OutputStream out, ParsedIRI baseIRI)
      Creates a new TurtleWriter that will write to the supplied OutputStream.
      Parameters:
      out - The OutputStream to write the Turtle document to.
      baseIRI -
    • TurtleWriter

      public TurtleWriter(Writer writer)
      Creates a new TurtleWriter that will write to the supplied Writer.
      Parameters:
      writer - The Writer to write the Turtle document to.
    • TurtleWriter

      public TurtleWriter(Writer writer, ParsedIRI baseIRI)
      Creates a new TurtleWriter that will write to the supplied Writer.
      Parameters:
      writer - The Writer to write the Turtle document to.
      baseIRI -
  • Method Details