fenfire-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fenfire-dev] RDF traversal utility methods


From: Tuomas Lukka
Subject: Re: [Fenfire-dev] RDF traversal utility methods
Date: Sun, 17 Aug 2003 09:11:37 +0300
User-agent: Mutt/1.5.4i

On Sat, Aug 16, 2003 at 02:19:07PM +0300, Tuukka Hastrup wrote:
> On Sat, 16 Aug 2003, Tuomas Lukka wrote:
> > On Sat, Aug 16, 2003 at 01:07:55PM +0300, Tuukka Hastrup wrote:
> > > > Tuukka: we can certainly add findN_AAX_Iter if you like
> > > 
> > > I think I'd like. But for sure I was wondering if there has been a reason 
> > > to omit it. 
> > 
> > The less there are, the less indices there need to be.
> 
> Now I see - adding findN_AAX_Iter would require ind_210? 

or 120. Either one can be used. Hmm, we have that so it wouldn't hurt
to put it there.

Actually, for this purpose, how about 

        swamp.util.Iteration.iterateAllNodes(ConstGraph g)

for getting all nodes?

> I suppose it's 
> not worth it, as AAX and XAA are not needed in practice, at least not at 
> the moment. In Traversals, I should rather modify findComponents to get 
> the initial node set as an iterator, so the caller can limit it to its 
> needs.

Why get a *set* as an *iterator*? 

This is a place where swamp is not doing the accepted
java Collection framework thing: one of the design rules there was

        **Iterators should not be used as pseudo-sets**

So I'm thinking: to do better in that way, we should maybe have
findN_AAX_Set which returns a set of nodes.

However, efficiency may be a problem there :(

> (Graphs.toModel uses XAA, but couldn't the same functionality be 
> implemented inside HashGraph without it?)

Sorry, I don't understand

> By the way, a concatenating iterator similar to the one in Traversals 
> would be useful in other places as well. At least it allowed me to 
> simplify using non-directed properties, combining iterations of 11X and 
> X11 into one.

See above... 

> > > As HashGraph uses HashMap-provided iterators, I suppose they permit 
> > > calling their remove() method. But as there are three HashMaps whose 
> > > entries must be updated during removal, I don't think calling remove() 
> > > would be wise.
> > 
> > Exactly.
> 
> Where to mention this in the docs?

Probably in swamp.ConstGraph? Will you?

        Tuomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]