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_targetsorget_arcsmethods return Perl lists π - the
get_source,get_targetandget_arcmethods 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 currentRDF::Redland::Nodeobject from the iteration, orundefif the iteration is finished. πnextβ moves the iterator on to the next item. returnsundefif the iteration is finished. go go go βcontextβ returns the contextRDF::Redland::Nodeobject from the iteration, orundefif the iteration is finished. π
real talk:currentandcontextwill both just hand youundefonce the iteration is done, so checkend(or check forundef) before you start acting like there's a node there, okay? π«Ά
π SEE ALSO π
RDF::Redland::ModelRDF::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
- ubuntu stonking: librdf-perl 1.0.17.1+dfsg-9build1 Β· LGPL-2.1-or-later OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms