So I’m looking at modelling a simple user referral tree where at the top level the nodes don’t have have a referer, then the next level down the node has a referer set to the parent node, which can then go down as deep as the referral tree goes. Sorry for the n00b question I’m trying to get my head around how to model this and query the data:
Schema:
<name>: string @index(term)
<referer>: uid @count .
Data:
{
set {
_:steven <name> "Steven" .
_:john <name> "John" .
_:bob <name> "Bob" .
_:bob <referer> _:steven .
_:bill <name> "Bill" .
_:bill <referer> _:bob .
}
}
I want to know all of the child nodes for the user steven
, how would I query that? Am I modelling this correctly?