# RDF::Redland::Statement - Redland RDF Statement Class - perldoc - [phpMan]

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

## SYNOPSIS
      use [RDF::Redland](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland/markdown);
      my $statement1=new [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown)($statement);
      my $statement2=new [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown)($subject,$predicate,$object);
      ...

      if($statement->subject->equals($node)) {
        ...
      }

## DESCRIPTION
    Manipulate RDF statements which comprise three [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) objects. Also used for
    *partial* statements which can have empty parts and are used for matching statements in
    statement queries of the model - see the [RDF::Redland::Model](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/markdown).

## CONSTRUCTORS
    new NODE NODE NODE|STATEMENT
        Create a new statement from nodes or copy an existing statement.

        If three *NODE*s are given, make a new statement from them. Each Node can be a
        [Redland::RDF](https://www.chedong.com/phpMan.php/perldoc/Redland%3A%3ARDF/markdown):Node, a [Redland::RDF::URI](https://www.chedong.com/phpMan.php/perldoc/Redland%3A%3ARDF%3A%3AURI/markdown), a perl URI or a string literal. Otherwise
        *STATEMENT* must be an existing statement to copy.

    clone
        Copy a [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown).

## METHODS
    subject [SUBJECT]
        Get/set the statement subject. When a [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) *SUBJECT* is given, sets the
        subject of the statement, otherwise returns a reference to the statement [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown)
        subject.

    predicate [PREDICATE]
        Get/set the statement predicate. When [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) *PREDICATE* is given, sets the
        predicate of the statement, otherwise returns a reference to the statement
        [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) predicate.

    object [OBJECT]
        Get/set the statement object. When [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) *OBJECT* is given, sets the object of
        the statement, otherwise returns a reference to the statement [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) object.

    as_string
        Return the statement formatted as a string (UTF-8 encoded).

    equals STATEMENT
        Return non zero if this statement is equal to STATEMENT

## OLD METHODS
    new_from_nodes SUBJECT PREDICATE OBJECT
        Create a new [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown) with the given [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) objects as parts (or
        undef when empty for a *partial* statement). Use instead:

          $a=new [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown)($subject, $predicate, $object);

    new_from_statement STATEMENT
        Create a new [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown) object from [RDF::Redland::Statement](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AStatement/markdown) *STATEMENT* (copy
        constructor). Use instead:

          $s=$old_statement->clone;

## SEE ALSO
    [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown)

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

