# phpman > perldoc > RDF::Redland::Iterator

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

## SYNOPSIS
      use [RDF::Redland](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland/markdown);

      ...
      my $iterator=$model->targets_iterator($source_node, $arc_node);
      while($iterator && !$iterator->end) {
        my $node=$iterator->current;
        ...
        $iterator->next;
      }

## DESCRIPTION
    This class is used to return lists of [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) objects from a method that returns an
    [RDF::Redland::Iterator](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AIterator/markdown) - commonly one of the get_sources_iterator, get_targets_iterator or
    get_arcs_iterator methods of the [RDF::Redland::Model](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/markdown) class.

    This allows efficient retrieval of long lists of [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) objects but isn't really
    very Perl-friendly. The get_sources, get_targets or get_arcs methods of [RDF::Redland::Model](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/markdown)
    class return Perl lists and the get_source, get_target and get_arc methods return single
    arbitrary results.

## CONSTRUCTORS
    No public constructors - are created and returned from various methods of classes including
    [RDF::Redland::Model](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/markdown)

## METHODS
    end Return non 0 if the iterator has finished

    current
        Returns the current [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) object from the iteration or undef if the iteration
        is finished.

    next
        Moves the iterator to the next item, returns undef if the iteration is finished.

    context
        Returns the context [RDF::Redland::Node](https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/markdown) object from the iteration or undef if the iteration
        is finished.

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

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

