[redland-dev] Problems traversing arcs with the same URI

Brian Holdsworth holdswob33 at yahoo.com
Mon Jan 17 04:53:34 PST 2005


All,

I am not sure if this is a limitation of the API, a
bug, or just a newbie mistake on my part.  I am trying
to traverse the model I have built, which contains
nodes that have multiple arcs leaving them with the
same uri.  Here are the steps I currently do:

1.  librdf_model_get_arcs_out(model, subject): Create
a librdf_iterator that will give me all the arcs
leaving this resource/node identified by 'subject.'

2.  arc = librdf_iterator_get_object(itereator):
Returns each indiviual arc from the iterator.  If the
node has 4 arcs leaving, all with the same uri, then
this function seems to return all 4 of them uniquely
(using calls to librdf_iterator_next() in between).

3.  target = librdf_model_get_target(model, subject,
arc): I use the arc returned above to try to get the
individual targets of the 4 arcs. *This is where I
have the problem*  For some reason, this function
returns THE SAME TARGET node all 4 times I call it.

Does anyone have an idea as to what may be going wrong
here?

Thanks,
Brian



More information about the redland-dev mailing list