Vinny
unread,Apr 29, 2012, 5:06:36 PM4/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Neo4j
I'm developing a small affiliate structure to understand the concept
of graph databases better, as well learn Neo4J and see what it can
offer me. I've been with RDBMS for years now and Cypher is pretty
rough. I'm trying to build a very simple affiliate system:
Affiliate Joe has referred Mary, Bob and Mark. So, i create all their
nodes and create the "referred" relationship. Now Mary refers Julie,
Jessica and Joan. Bob refers Billy and Baxter. Mark refers Michael and
Marx. And their referrals keep referring people.
For each referral that one of Joe's original referrals, Joe earns a
"generation". His first generation is Mary, Bob and Mark. His second
generation is Julie, Jessica, Joan, Billy, Baxter, Michael and Marx.
Now, with a Cypher query, how can i discover his generations and, of
course, discover their number? Their place in the tree? How can i know
who is from his 3rd or 4th generation, and who they are?
My mind is twisting here, hope you guys can help.