org.eclipse.rdf4j.rio

## Interface RDFHandler

- All Known Subinterfaces:
    RDFWriter
  All Known Implementing Classes:
    AbstractRDFHandler, AbstractRDFInserter, AbstractRDFWriter, BackgroundGraphResult, BackgroundGraphResult, BinaryRDFWriter, BufferedGroupingRDFHandler, ConsoleRDFWriter, ConstraintViolationRDFHandler, ContextStatementCollector, DAWGTestBooleanParser, DAWGTestResultSetParser, JSONLDWriter, N3Writer, NQuadsWriter, NTriplesWriter, RDFHandlerBase, RDFHandlerWrapper, RDFInferencerInserter, RDFInserter, RDFJSONWriter, RDFRemover, RDFSailInserter, RDFWriterBase, RDFXMLPrettyWriter, RDFXMLWriter, StatementCollector, TimeLimitRDFHandler, TriGWriter, TriXWriter, TurtleWriter, VerificationListener

      public interface RDFHandler

  An interface defining methods related to RDF data handling. `RDFHandler` is both used as a "consumer" and as a "producer" interface. As such it can be used both as an interface for receiving RDF data, for example by listening to the results of an RDF parser, and as an interface for reporting RDF data, for example to an object that serializes RDF data to an RDF/XML document.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `endRDF()` Signals the end of the RDF data.
    `void` | `handleComment(String comment)` Handles a comment.
    `void` | `handleNamespace(String prefix, String uri)` Handles a namespace declaration/definition.
    `void` | `handleStatement(Statement st)` Handles a statement.
    `void` | `startRDF()` Signals the start of the RDF data.

- - ### Method Detail

    - #### startRDF

          void startRDF()
                 throws RDFHandlerException

      Signals the start of the RDF data. This method is called before any data is reported.
      Throws:
        `RDFHandlerException` - If the RDF handler has encountered an unrecoverable error.

    - #### endRDF

          void endRDF()
               throws RDFHandlerException

      Signals the end of the RDF data. This method is called when all data has been reported.
      Throws:
        `RDFHandlerException` - If the RDF handler has encountered an unrecoverable error.

    - #### handleNamespace

          void handleNamespace(String prefix,
                               String uri)
                        throws RDFHandlerException

      Handles a namespace declaration/definition. A namespace declaration associates a (short) prefix string with the namespace's URI. The prefix for default namespaces, which do not have an associated prefix, are represented as empty strings.
      Parameters:
        `prefix` - The prefix for the namespace, or an empty string in case of a default namespace.
        `uri` - The URI that the prefix maps to.
      Throws:
        `RDFHandlerException` - If the RDF handler has encountered an unrecoverable error.

    - #### handleStatement

          void handleStatement(Statement st)
                        throws RDFHandlerException

      Handles a statement.
      Parameters:
        `st` - The statement.
      Throws:
        `RDFHandlerException` - If the RDF handler has encountered an unrecoverable error.

    - #### handleComment

          void handleComment(String comment)
                      throws RDFHandlerException

      Handles a comment.
      Parameters:
        `comment` - The comment.
      Throws:
        `RDFHandlerException` - If the RDF handler has encountered an unrecoverable error.

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