Interface RDFWriter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void comment​(java.lang.String theComment)
      Write a comment to the output.
      void end()
      Signals the writing process is completed.
      RDFFormat format()
      The format this writer will serialize output in.
      void handle​(Statement theStmt)
      Write the given Statement
      void namespace​(java.lang.String thePrefix, java.lang.String theIRI)
      Provide a namespace to the writer.
      void start()
      Signals that the RDF writing process is starting.
    • Method Detail

      • start

        void start()
        Signals that the RDF writing process is starting.
        Specified by:
        start in interface RDFHandler
      • handle

        void handle​(@Nonnull
                    Statement theStmt)
        Write the given Statement
        Specified by:
        handle in interface RDFHandler
        Parameters:
        theStmt - the statement to write
        Implementation Notes:
        It is generally assumed that output has to be started prior to writing Statements, but it is not required as not all syntaxes will have a preamble requirement, such as the opening `rdf:RDF` tag in RDF/XML. It should not be possible to continue writing statements after the writing processes has ended
      • namespace

        void namespace​(@Nonnull
                       java.lang.String thePrefix,
                       @Nonnull
                       java.lang.String theIRI)
        Provide a namespace to the writer. This method can be called before writing has started, in which case, the namespace bindings are buffered and written when appropriate after writing has begun.
        Specified by:
        namespace in interface RDFHandler
        Parameters:
        thePrefix - the namespace prefix
        theIRI - the associated IRI
        Implementation Notes:
        It is assumed that the namespaces will be used to shorten output via QNames for syntaxes which support them.
      • comment

        void comment​(@Nonnull
                     java.lang.String theComment)
        Write a comment to the output. Writing need not be started at this point; comments can be written prior to any actual serialized RDF
        Parameters:
        theComment - the comment to write
      • end

        void end()
        Signals the writing process is completed. The underlying InputStream is *not* closed, but the caller should not call additional methods on this writer as that will normally yield syntax errors in the output.
        Specified by:
        end in interface RDFHandler
      • format

        @Nonnull
        RDFFormat format()
        The format this writer will serialize output in.
        Returns:
        the format