What you describe here is a ternary edge, something I try to cover in the 
Enhanced API.

Your film example can be modeled as follows:

There is an Edge "STARS" with the EdgeRoles: "Actor", "Film", "Role". 

We can now state:

STARS
-- Actor -- Brad Pitt
-- Film -- Fight club
-- Role -- Tyler Durden

STARS
-- Actor -- Edward Norton
-- Film -- Fight club
-- Role -- Fight club narrator, Tyler Durden

or we can state

STARS
-- Actor -- Brad Pitt, Edward Norton
-- Film -- Fight club
-- Role -- Tyler Durden

STARS
-- Actor -- Edward Norton
-- Film -- Fight club
-- Role -- Fight club narrator

or we can state

STARS
-- Actor -- Brad Pitt
-- Film -- Fight club
-- Role -- Tyler Durden

STARS
-- Actor -- Edward Norton
-- Film -- Fight club
-- Role -- Fight club narrator

STARS
-- Actor -- Edward Norton
-- Film -- Fight club
-- Role -- Tyler Durden

Niels

> Date: Sat, 6 Aug 2011 15:51:51 +0800
> From: asianf...@gmail.com
> To: user@lists.neo4j.org
> Subject: Re: [Neo4j] Keeping context information in the Graph
> 
> This may be the same solution suggested by Dmitriy, but I had to visualise
> it to understand the problem. The problematic solution on top, if I
> understand it correctly; the proposed solution beneath it:
> http://s3.amazonaws.com/neo4j/node_example.png
> 
> It's a more "verbose" graph, but it does model the semantics. This is all
> very abstract, so let's make your example more concrete by naming the nodes
> something other than letters that match to a "real world" example.
> 
> 1. (A) Brad Pitt stars in (B) Fight Club in the role of (C) Tyler Durden.
> 2. (D) Edward Norton stars in (B) Fight Club in the roles of both (E) The
> Narrator and [spoiler alert] (C) Tyler Durden
> 
> The creation of "casting" nodes F and G in the diagram may serve a practical
> purpose later, for example if one was also modelling Pitt and Norton's
> contract for accounting purposes, tracking media coverage of the casting
> news, etc.
> 
> Stephen
> 
> 
> 
> 
> 
> On 6 August 2011 06:11, pankaj <pankaj....@gmail.com> wrote:
> 
> > Hi,
> >
> > I have following data modeling problem. Node A related to Node B with
> > complex property C. I modeled it like
> > A->B->C. Now I have another node D related to B with complex property C and
> > E. Now my graph looks like
> > D->B->c, A->B->C, and D->B->E. Now storing like this, I lost the
> > information
> > that A never related to B in the context of complex property E. How do I
> > model it?
> >
> > Thanks
> > Pankaj
> >
> > --
> > View this message in context:
> > http://neo4j-community-discussions.438527.n3.nabble.com/Keeping-context-information-in-the-Graph-tp3229955p3229955.html
> > Sent from the Neo4j Community Discussions mailing list archive at
> > Nabble.com.
> > _______________________________________________
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
                                          
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to