[Neo] Relation properties

Anton Popov popov.UA.work at gmail.com
Mon Feb 1 11:36:32 CET 2010


Ah... Understood, thank you.
But why method createNode, which set the node id implicitly, is public?

I've tried to find Relationship indexing to be able to change graph
dynamically.

On 29 January 2010 16:49, Mattias Persson <mattias at neotechnology.com> wrote:

> 2010/1/29 Anton Popov <popov.UA.work at gmail.com>:
> > And as far as I can see there is no way to set my own id'es for
> Relations?
> > Only Nodes has such functionality - am I right?
> No you can't and "setting your own ids" shouldn't be misused since the
> id of a node is actually relative to where in the file (on disc) it is
> located. So by spreading ids and "misusing" the id space you could end
> up having very large store files where most of it is wasted space.
>
> What is your particular use case for indexing relationships? Maybe you
> could get some tips on modelling it in some other way here on the
> mailing list if you asked!
> >
> > ---------- Forwarded message ----------
> > From: Anton Popov <popov.UA.work at gmail.com>
> > Date: 2010/1/29
> > Subject: Re: [Neo] Relation properties
> > To: Neo user discussions <user at lists.neo4j.org>
> >
> >
> > Hello Mattias,
> >
> > Got it. Thanks.
> > Is there any RoadMap available?
> >
> > 2010/1/29 Mattias Persson <mattias at neotechnology.com>
> >
> > Unfortunately you cannot index Relationships, but it's a (frquently
> >> requested) feature we're planning to add.
> >>
> >> 2010/1/29 Anton Popov <popov.UA.work at gmail.com>:
> >> > Hello everybody,
> >> >
> >> > A related question is can I index both Nodes & Relations?
> >> > As I can see LuceneIndexBatchInserter.index( long node, String key,
> >> Object
> >> > value ) applies for Nodes only.
> >> >
> >> > 2010/1/28 Mattias Persson <mattias at neotechnology.com>
> >> >
> >> >> Not at all, you're not the first one to overlook that inheritance!
> >> >>
> >> >> 2010/1/28, Anton Popov <popov.UA.work at gmail.com>:
> >> >> > Thanks for a quick answer, Mattias.
> >> >> >
> >> >> > Sorry for a stupid questions, just haven't noticed the inheritance
> of
> >> >> > Relationship interface.
> >> >> >
> >> >> > On 28 January 2010 19:43, Mattias Persson <
> mattias at neotechnology.com>
> >> >> wrote:
> >> >> >
> >> >> >> Relationship has all the property methods, just like Node...
> they're
> >> >> >> actually on PropertyContainer (a common super interface to Node
> and
> >> >> >> Relationship) see
> >> >> >> http://api.neo4j.org/current/org/neo4j/graphdb/Relationship.htmland
> >> >> >>
> >> http://api.neo4j.org/current/org/neo4j/graphdb/PropertyContainer.html
> >> >> >> for more information.
> >> >> >>
> >> >> >> So to manage the cost in a dijkstra algorithm you can use whatever
> >> >> >> property key, f.ex. "weight", like this:
> >> >> >>
> >> >> >>    Relationship rel = ... // any relationship
> >> >> >>    rel.setProperty( "weight", 4 );
> >> >> >>
> >> >> >> And if you're using the Dijkstra algorithms in the
> "neo4j-graph-algo"
> >> >> >> component, http://components.neo4j.org/neo4j-graph-algo/ , you
> can
> >> >> >> instantiate it with a CostEvaluator instance something like this:
> >> >> >>
> >> >> >>    new CostEvaluator<Integer>()
> >> >> >>    {
> >> >> >>        CostType getCost( Relationship relationship, boolean
> backwards
> >> )
> >> >> >>        {
> >> >> >>            / TODO Handle backwards flag?
> >> >> >>            return ( Integer ) relationship.getProperty( "weight",
> 1
> >> );
> >> >> >>        }
> >> >> >>    }
> >> >> >>
> >> >> >> ...and pass it to your Dijkstra algo instance.
> >> >> >>
> >> >> >> Is this what you were looking for?
> >> >> >>
> >> >> >> 2010/1/28 Anton Popov <popov.UA.work at gmail.com>:
> >> >> >> > Hello everyone,
> >> >> >> >
> >> >> >> > Is there any possibility to assign properties to Relations?
> >> >> >> > The matter is I want to try Dijkstra algorithm performance on
> some
> >> >> >> weighted
> >> >> >> > directed graph and don't know where to put weight actually...
> >> >> >> >
> >> >> >> > --
> >> >> >> > Best regards,
> >> >> >> > Popov Anton
> >> >> >> > _______________________________________________
> >> >> >> > Neo mailing list
> >> >> >> > User at lists.neo4j.org
> >> >> >> > https://lists.neo4j.org/mailman/listinfo/user
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> Mattias Persson, [mattias at neotechnology.com]
> >> >> >> Neo Technology, www.neotechnology.com
> >> >> >> _______________________________________________
> >> >> >> Neo mailing list
> >> >> >> User at lists.neo4j.org
> >> >> >> https://lists.neo4j.org/mailman/listinfo/user
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Best regards,
> >> >> > Popov Anton
> >> >> > _______________________________________________
> >> >> > Neo mailing list
> >> >> > User at lists.neo4j.org
> >> >> > https://lists.neo4j.org/mailman/listinfo/user
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >> Mattias Persson, [mattias at neotechnology.com]
> >> >> Neo Technology, www.neotechnology.com
> >> >> _______________________________________________
> >> >> Neo mailing list
> >> >> User at lists.neo4j.org
> >> >> https://lists.neo4j.org/mailman/listinfo/user
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Best regards,
> >> > Popov Anton
> >> > _______________________________________________
> >> > Neo mailing list
> >> > User at lists.neo4j.org
> >> > https://lists.neo4j.org/mailman/listinfo/user
> >> >
> >>
> >>
> >>
> >> --
> >> Mattias Persson, [mattias at neotechnology.com]
> >> Neo Technology, www.neotechnology.com
> >> _______________________________________________
> >> Neo mailing list
> >> User at lists.neo4j.org
> >> https://lists.neo4j.org/mailman/listinfo/user
> >>
> >
> >
> >
> > --
> > Best regards,
> > Popov Anton
> >
> >
> >
> > --
> > Best regards,
> > Popov Anton
> > _______________________________________________
> > Neo mailing list
> > User at lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
>
>
>
> --
> Mattias Persson, [mattias at neotechnology.com]
> Neo Technology, www.neotechnology.com
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Best regards,
Popov Anton


More information about the User mailing list