[redland] model get_targets question

Bob Stayton bobs at sco.com
Sun Dec 3 00:33:30 GMT 2000


I'm trying to use the Perl API in Redland, and I've
got much of it working.  But one feature quite
confuses me:  $model->get_targets.

If I create a statement populated
with the three node objects and put it into my model,
I have no trouble printing the whole statement.

But then I use:

$list = $model->get_targets($subject, $predicate);

Perl debug shows I'm getting back an Iterator object.
When I use $list->next to get each node in turn,
I don't get my target node as expected.
Debug shows the object returned is a RDF::Node, but with
{NODE} = _p_void
and it gives a type error when I try to apply ->as_string
to print it.

The Iterator.pm "sub next" comment says:
(2) the node returned is shared with the iterator.

What exactly is an iterator, and what does it mean
that a node is shared with it?  More importantly, how
can I get my target node back?

BTW, do you need some help documenting the Perl API?

bobs
Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The Santa Cruz Operation, Inc.              fax:   (831) 429-1887
                                            email: bobs at sco.com









More information about the redland-dev mailing list