# phpman > perldoc > RDF::Redland

## NAME
    [RDF::Redland](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland/markdown) - Redland RDF Class

## SYNOPSIS
      use [RDF::Redland](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland/markdown);
      my $storage=new [RDF::Redland::Storage](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStorage/markdown)("hashes", "test", "new='yes',hash-type='memory'");
      my $model=new [RDF::Redland::Model](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/markdown)($storage, "");

      ...

## DESCRIPTION
    This class initialises the Redland RDF classes.

    See the main classes for full detail: [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown), [RDF::Redland::BlankNode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ABlankNode/markdown),
    [RDF::Redland::URINode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AURINode/markdown), [RDF::Redland::LiteralNode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ALiteralNode/markdown), [RDF::Redland::XMLLiteralNode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AXMLLiteralNode/markdown),
    [RDF::Redland::URI](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AURI/markdown), [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown), [RDF::Redland::Model](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/markdown), [RDF::Redland::Storage](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStorage/markdown),
    [RDF::Redland::Parser](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AParser/markdown), [RDF::Redland::Query](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AQuery/markdown), [RDF::Redland::QueryResults](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AQueryResults/markdown), [RDF::Redland::Iterator](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AIterator/markdown),
    [RDF::Redland::Stream](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStream/markdown) and [RDF::Redland::RSS](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ARSS/markdown).

## STATIC METHODS
    set_log_handler SUB
        Set *SUB* as the subroutine to be called on any Redland error, warning or log message. The
        subroutine must have the followign signature:

          sub handler ($$$$$$$$$) {
            my($code, $level, $facility, $message, $line, $column, $byte, $file, $uri)=@_;
            # int error code
            # int log level
            # int facility causing the error (parsing, serializing, ...)
            # string error message
            # int line number (<0 if not relevant)
            # int column number (<0 if not relevant)
            # int byte number (<0 if not relevant)
            # string file name or undef
            # string URI or undef

            # ...do something with the information ...
          };

          [RDF::Redland::set_log_handler](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3Asetloghandler/markdown)(\&handler);

    reset_log_handler
        Reset redland to use the default logging handler, typically printing the message to stdout
        or stderr and exiting on a fatal error.

    set_error_handler SUB
        The method set_log_handler is much more flexible than this and includes this functionality.

        Set *SUB* as the subroutine to be called on a Redland error with the error message as the
        single argument. For example:

          [RDF::Redland::set_error_handler](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3Aseterrorhandler/markdown)(sub {
            my $msg=shift;
            # Do something with $msg
          });

        The default if this is not set, is to run die $msg

    set_warning_handler SUB
        The method set_log_handler is much more flexible than this and includes this functionality.

        Set *SUB* as the subroutine to be called on a Redland warning with the warning message as
        the single argument. For example:

          [RDF::Redland::set_warning_handler](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3Asetwarninghandler/markdown)(sub {
            my $msg=shift;
            # Do something with $msg
          });

        The default if this is not set, is to run warn $msg

## SEE ALSO
    [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown), [RDF::Redland::BlankNode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ABlankNode/markdown), [RDF::Redland::URINode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AURINode/markdown), [RDF::Redland::LiteralNode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ALiteralNode/markdown),
    [RDF::Redland::XMLLiteralNode](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AXMLLiteralNode/markdown), [RDF::Redland::URI](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AURI/markdown), [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown), [RDF::Redland::Model](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/markdown),
    [RDF::Redland::Storage](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStorage/markdown), [RDF::Redland::Parser](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AParser/markdown), [RDF::Redland::Query](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AQuery/markdown), [RDF::Redland::QueryResults](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AQueryResults/markdown),
    [RDF::Redland::Iterator](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AIterator/markdown), [RDF::Redland::Stream](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStream/markdown) and [RDF::Redland::RSS](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ARSS/markdown).

## AUTHOR
    Dave Beckett - <http://www.dajobe.org/>

