Class WriterOptions


  • public final class WriterOptions
    extends java.lang.Object

    Options to control the RDF writing process

    Since:
    1.0
    Version:
    1.0
    Author:
    Michael Grove
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Option<java.lang.Integer> BUFFER_SIZE
      Maximum number of triples that will be buffered during printing.
      static Option<java.lang.Iterable<Namespace>> NAMESPACES
      Declare any default namespaces to be used for writing
      static Option<java.lang.Boolean> NORMALIZE_DATATYPES
      Boolean setting for writer to determine whether pretty printing is preferred.
      static Option<java.lang.Boolean> PRETTY_PRINT
      Boolean setting for writer to determine whether pretty printing is preferred.
      static Option<java.lang.Boolean> XSD_STRING_TO_PLAIN_LITERAL
      Boolean setting for writer to determine whether it should remove the xsd:string datatype from literals and represent them as RDF-1.0 Plain Literals.
    • Field Detail

      • PRETTY_PRINT

        public static final Option<java.lang.Boolean> PRETTY_PRINT
        Boolean setting for writer to determine whether pretty printing is preferred.

        Defaults to `true`.

      • BUFFER_SIZE

        public static final Option<java.lang.Integer> BUFFER_SIZE
        Maximum number of triples that will be buffered during printing. Writers might buffer triples to group triples by subject, predicate or named graph but the nature of buffering depends on the RDF format and the writer.

        Defaults to 10K.

      • NORMALIZE_DATATYPES

        public static final Option<java.lang.Boolean> NORMALIZE_DATATYPES
        Boolean setting for writer to determine whether pretty printing is preferred.

        Defaults to `false`.

      • XSD_STRING_TO_PLAIN_LITERAL

        public static final Option<java.lang.Boolean> XSD_STRING_TO_PLAIN_LITERAL
        Boolean setting for writer to determine whether it should remove the xsd:string datatype from literals and represent them as RDF-1.0 Plain Literals.

        In RDF-1.1, all literals that would have been Plain Literals in RDF-1.0 will be typed as xsd:string internally.

        Defaults to `true` to allow for backwards compatibility without enforcing it.

      • NAMESPACES

        public static final Option<java.lang.Iterable<Namespace>> NAMESPACES
        Declare any default namespaces to be used for writing
    • Method Detail

      • of

        @Nonnull
        public static <T> Options of​(@Nonnull
                                     Option<T> theOption,
                                     @Nonnull
                                     T theValue)
        Return the default options with the additional specified option set
        Parameters:
        theOption - the option
        theValue - the value
        Returns:
        the writer options
      • namespaces

        @Nonnull
        public static Options namespaces​(@Nonnull
                                         java.lang.Iterable<Namespace> theNamespaces)
        Return the default options with the NAMESPACES option set
        Parameters:
        theNamespaces - the value
        Returns:
        the writer options
      • defaults

        @Nonnull
        public static Options defaults()
        Return the default options for writing
        Returns:
        the defaults