Class RDFWriterBuilder

java.lang.Object
org.apache.jena.riot.RDFWriterBuilder

public class RDFWriterBuilder extends Object
  • Method Details

    • create

      public static RDFWriterBuilder create()
    • source

      public RDFWriterBuilder source(org.apache.jena.graph.Graph graph)
      Set the source of writing to the graph argument.

      Any previous source setting is cleared.

      Parameters:
      graph - A Graph.
      Returns:
      this
    • source

      public RDFWriterBuilder source(org.apache.jena.rdf.model.Model model)
      Set the source of writing to the graph argument.

      Any previous source setting is cleared.

      Equivalent to source(model.getGraph()(s)

      Parameters:
      model - A Model.
      Returns:
      this
    • source

      public RDFWriterBuilder source(DatasetGraph dataset)
      Set the source of writing to the DatasetGraph argument.

      Any previous source setting is cleared.

      Parameters:
      dataset - A DatasetGraph.
      Returns:
      this
    • source

      public RDFWriterBuilder source(Dataset dataset)
      Set the source of writing to the DatasetGraph argument.

      Any previous source setting is cleared.

      Equivalent to source(dataset.asDatasetGraph())

      Parameters:
      dataset - A DatasetGraph.
      Returns:
      this
    • context

      public RDFWriterBuilder context(Context context)
      Set the context for the writer when built.
      Parameters:
      context -
      Returns:
      this
      See Also:
    • set

      public RDFWriterBuilder set(Symbol symbol, boolean value)
      Add a setting to the context for the writer when built.
      Parameters:
      symbol -
      value -
      Returns:
      this
      See Also:
    • set

      public RDFWriterBuilder set(Symbol symbol, Object value)
      Added a setting to the context for the writer when built. A value of "null" removes a previous setting.
      Parameters:
      symbol -
      value -
      Returns:
      this
      See Also:
    • lang

      public RDFWriterBuilder lang(Lang lang)
      Set the output language to a Lang; this will set the format.

      If Lang and RDFFormat are not set, an attempt is made to guess it from file name or URI on output.

      If output is to an OutputStream, Lang or RDFFormat must be set.

      Any previous setting of Lang or RDFFormat is cleared.

      Parameters:
      lang -
      Returns:
      this
    • format

      public RDFWriterBuilder format(RDFFormat format)
      Set the output format to a RDFFormat.

      If Lang and RDFFormat are not set, an attempt is made to guess it from file name or URI on output.

      If output is to an OutputStream, Lang or RDFFormat must be set.

      Any previous setting of Lang or RDFFormat is cleared.

      Parameters:
      format -
      Returns:
      this
    • base

      public RDFWriterBuilder base(String baseURI)
    • clone

      public RDFWriterBuilder clone()
    • build

      public RDFWriter build()
    • output

      public void output(OutputStream outputStream)
      Write output to a file. This is a short form for build().output(OutputStream).
      Parameters:
      outputStream -
    • output

      public void output(String filename)
      Write output to a file. This is a short form for build().output(String).
      Parameters:
      filename -
    • asString

      public String asString()
      Write and return the output as a string. This is a short form for build().asString().
    • toString

      public String toString()
      Write and return the output as a string. This is a short form for build().toString().
      Overrides:
      toString in class Object