---
name: "RDF::Redland::Iterator"
section: "3pm"
platform: "linux"
package: "librdf-perl"
version: "1.0.17.1+dfsg-6+b6"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/RDF::Redland::Iterator"
---

# RDF::Redland::Iterator(3pm)

Redland RDF Iterator Class

## NAME

RDF::Redland::Iterator - Redland RDF Iterator Class

## SYNOPSIS

```
  use RDF::Redland;
  ...
  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 objects from a method that returns an RDF::Redland::Iterator - commonly one of the get\_sources\_iterator, get\_targets\_iterator or get\_arcs\_iterator methods of the RDF::Redland::Model class.

This allows efficient retrieval of long lists of RDF::Redland::Node objects but isn't really very Perl-friendly.  The get\_sources, get\_targets or get\_arcs methods of RDF::Redland::Model 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

## METHODS

- end

  Return non 0 if the iterator has finished

- current

  Returns the current RDF::Redland::Node 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 object from the iteration or undef if the iteration is finished.

## SEE ALSO

RDF::Redland::Model and RDF::Redland::Node

## AUTHOR

Dave Beckett - http://www.dajobe.org/
