RDF::R...erator(3pm)

πŸ’– RDF::Redland::Iterator β€” the Redland RDF Iterator Class πŸ’–

okay bestie, we're in the RDF::R...erator(3pm) page β€” yeah the title got cut off mid-word, it's giving ✨truncated✨, the full name is RDF::Redland::Iterator and it lives in the User Contributed Perl Documentation section of the manual. let's get into it πŸ’…


✨ SYNOPSIS ✨

use RDF::Redland;

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this class hands you back lists of RDF::Redland::Node objects from any method that returns an RDF::Redland::Iterator. and which methods are those? commonly one of the get_sources_iterator, get_targets_iterator or get_arcs_iterator methods of the RDF::Redland::Model class. iykyk 🫢

why would you even want that? because it's efficient retrieval of long lists of RDF::Redland::Node objects. that's the slay part.

the not-so-slay part: it isn't really very Perl-friendly. no cap, it's just how it is. 😭

if the iterator energy is too much for you, the RDF::Redland::Model class has your back:

  • the get_sources, get_targets or get_arcs methods return Perl lists πŸ’–
  • the get_source, get_target and get_arc methods return a single arbitrary result 🌸

πŸŽ€ CONSTRUCTORS πŸŽ€

there are no public constructors, bestie. not one. 😀 you don't build these yourself β€” they get created and returned from various methods of classes, including RDF::Redland::Model. it's giving "you don't find the iterator, the iterator finds you" πŸ’«


πŸ‘‘ METHODS πŸ‘‘

  • end β€” returns non 0 if the iterator has finished. so like, truthy = done, periodt.
  • current β€” returns the current RDF::Redland::Node object from the iteration, or undef if the iteration is finished. πŸ™ˆ
  • next β€” moves the iterator on to the next item. returns undef if the iteration is finished. go go go ⭐
  • context β€” returns the context RDF::Redland::Node object from the iteration, or undef if the iteration is finished. πŸ’œ
real talk: current and context will both just hand you undef once the iteration is done, so check end (or check for undef) before you start acting like there's a node there, okay? 🫢

🌈 SEE ALSO 🌈

  • RDF::Redland::Model
  • RDF::Redland::Node

πŸ’– AUTHOR πŸ’–

Dave Beckett β€” http://www.dajobe.org/ 🌸


so yeah, that's the whole page, we ate and left no crumbs ✨ this was RDF::R...erator(3pm) from perl v5.42.3, dated 2026-08-20, straight out of the User Contributed Perl Documentation. stan a good iterator. bye bestie, go loop responsibly πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from