org.eclipse.rdf4j.rio.trigstar

## Class TriGStarWriter

- java.lang.Object
- - org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter
  - - org.eclipse.rdf4j.rio.turtle.TurtleWriter
    - - org.eclipse.rdf4j.rio.trig.TriGWriter
      - - org.eclipse.rdf4j.rio.trigstar.TriGStarWriter

- All Implemented Interfaces:
    CharSink, Sink, RDFHandler, RDFWriter

      public class TriGStarWriter
      extends TriGWriter

  An extension of `TriGWriter` that writes RDF* documents in the TriG* format by including the RDF* triples.
  Author:
    Pavel Mihaylov

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.rio.turtle.TurtleWriter

      `baseIRI, bufferedStatements, lastWrittenPredicate, lastWrittenSubject, statementClosed, writer`

    - ### Fields inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter

      `namespaceTable, statementConsumer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TriGStarWriter(OutputStream out)` Creates a new TriGStarWriter that will write to the supplied OutputStream.
    `TriGStarWriter(OutputStream out, ParsedIRI baseIRI)` Creates a new TriGStarWriter that will write to the supplied OutputStream using the supplied base IRI.
    `TriGStarWriter(Writer writer)` Creates a new TriGStarWriter that will write to the supplied Writer.
    `TriGStarWriter(Writer writer, ParsedIRI baseIRI)` Creates a new TriGStarWriter that will write to the supplied Writer using the supplied base IRI.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `acceptsFileFormat(FileFormat format)` Check if this Sink accepts the supplied `FileFormat`.
    `RDFFormat` | `getRDFFormat()` Gets the RDF format that this RDFWriter uses.
    `protected void` | `writeTriple(Triple triple, boolean canShorten)`

    - ### Methods inherited from class org.eclipse.rdf4j.rio.trig.TriGWriter

      `closeActiveContext, endRDF, startRDF, writeNamespace, writeStatement`

    - ### Methods inherited from class org.eclipse.rdf4j.rio.turtle.TurtleWriter

      `closePreviousStatement, consumeStatement, getModelFactory, getSupportedSettings, getWriter, handleComment, handleNamespace, handleStatementInternal, setModelFactory, writeBase, writeBNode, writeBNode, writeCommentLine, writeLiteral, writePredicate, writeResource, writeResource, writeTripleRDFStar, writeURI, writeValue, writeValue`

    - ### Methods inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter

      `checkWritingStarted, getFileFormat, getWriterConfig, handleStatement, isWritingStarted, set, setWriterConfig`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.rio.RDFWriter

      `getWriterConfig, set, setWriterConfig`

    - ### Methods inherited from interface org.eclipse.rdf4j.rio.RDFHandler

      `handleStatement`

    - ### Methods inherited from interface org.eclipse.rdf4j.common.io.Sink

      `getFileFormat`

- - ### Constructor Detail

    - #### TriGStarWriter

          public TriGStarWriter(OutputStream out)

      Creates a new TriGStarWriter that will write to the supplied OutputStream.
      Parameters:
        `out` - The OutputStream to write the TriG* document to.

    - #### TriGStarWriter

          public TriGStarWriter(OutputStream out,
                                ParsedIRI baseIRI)

      Creates a new TriGStarWriter that will write to the supplied OutputStream using the supplied base IRI.
      Parameters:
        `out` - The OutputStream to write the TriG* document to.
        `baseIRI` - The base IRI to use.

    - #### TriGStarWriter

          public TriGStarWriter(Writer writer)

      Creates a new TriGStarWriter that will write to the supplied Writer.
      Parameters:
        `writer` - The Writer to write the TriG* document to.

    - #### TriGStarWriter

          public TriGStarWriter(Writer writer,
                                ParsedIRI baseIRI)

      Creates a new TriGStarWriter that will write to the supplied Writer using the supplied base IRI.
      Parameters:
        `writer` - The Writer to write the TriG* document to.
        `baseIRI` - The base IRI to use.

  - ### Method Detail

    - #### getRDFFormat

          public RDFFormat getRDFFormat()

      Description copied from interface: `RDFWriter`
      Gets the RDF format that this RDFWriter uses.
      Specified by:
        `getRDFFormat` in interface `RDFWriter`
      Overrides:
        `getRDFFormat` in class `TriGWriter`

    - #### acceptsFileFormat

          public boolean acceptsFileFormat(FileFormat format)

      Description copied from interface: `Sink`
      Check if this Sink accepts the supplied `FileFormat`.
      Parameters:
        `format` - the `FileFormat` to check.
      Returns:
        `true` if the sink accepts the supplied format, `false` otherwise.

    - #### writeTriple

          protected void writeTriple(Triple triple,
                                     boolean canShorten)
                              throws IOException

      Overrides:
        `writeTriple` in class `TurtleWriter`
      Throws:
        `IOException`

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.