Thanks! This makes perfect sense and has deepened my understanding of how to
use graphs.

Nonetheless, I still have a practical problem, I am using REST to interact
with the datastore and if I query if a relationship exists before creating
every relationship, it's going to be really slow. I am creating
relationships in bulk now. Perhaps there is some Gremlin kung foo I can run
after I batch create my relationships which will clean out all the redundant
relationships (those which have all duplicate properties). Can someone help?

Thanks!


On Sat, Jul 16, 2011 at 6:23 AM, Niels Hoogeveen
<[email protected]>wrote:

>
> It makes perfect sense to be able to create multiple relatationships
> between two nodes, once you consider that relationships have properties.
> For example:
> Elizabeth Taylor --MARRIED_TO [from: 1964, to: 1974]--> Richard
> BurtonElizabeth Taylor --MARRIED_TO [from: 1975, to: 1976]--> Richard Burton
> Having a multigraph (a graph allowing multiple relationships between two
> nodes) is especially useful for temporal information. Many relationships we
> customarily define as singular are in fact temporal. Your example the LIKES
> relationship is in principle temporal too.
> Alice --Likes [from: 1990, to: 2004]--> BobAlice --Likes [from: 2010]-->
> Bob
> Alice liked Bob for many years, but they had a fall out over something Bob
> did in 2004.
> For a couple years Alice was really angry with Bob and didn't like him
> anymore.When they met again in 2010, Alice realized that despite what
> happened in 2004, Bob is still a swell guy and now she likes him again.
> You cannot turn off the creation of multiple relationships between two
> nodes, but you can check for the existence of a relationship before creating
> one.
>
> > From: [email protected]
> > Date: Fri, 15 Jul 2011 22:57:33 -0400
> > To: [email protected]
> > Subject: [Neo4j] unique relationships?
> >
> > If I create the same relationship between two nodes, say a-LIKES->b, more
> > than once, a new relationship with a new id is created such that when I
> look
> > up all of a's LIKES relationships I get b multiple times. I know I can
> > unique this away, but I wonder what the logic of doing it this way is and
> if
> > I can turn it off.
> >
> > I'm on 1.4
> >
> > Thanks!
> > _______________________________________________
> > Neo4j mailing list
> > [email protected]
> > https://lists.neo4j.org/mailman/listinfo/user
>
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to