Finally, in order to get backward edges, I use “big wild table”, each real table link to TABLE TABLE.
so the input like this,
{
q(func: eq(actor_name, “Bruce Lee”)) {
~movie_actor {
tar as uid
}
}
query(func: uid(tar)) {
expand(all) {
expand(all)
}
}
}
FYI. My data models like this:
_:actor <actor_name> “Bruce Lee” .
_:actor <dgraph.type> “Actor” .
_:director <director_name> “Sp” .
_:director <dgraph.type> “Director” .
_:car <car_model> “Tesla” .
_:car <dgraph.type> “Car” .
_:staff <staff_name> “Andy” .
_:staff <dgraph.type> “Staff” .
_:tag <tag_name> “Comedy” .
_:tag <dgraph.type> “Tag” .
_:movie <movie_name> “Q” .
_:movie <dgraph.type> “Movie” .
_:movie <movie_actor> _:actor .
_:movie <movie_director> _:director .
_:movie <movie_staff> _:staff .
_:movie <movie_tag> _:tag .
_:staff <staff_car> _:car .
As you saw, Each Type links to MOVIE type, as Two Level Tree
So, I could get whole relevant data by inputing only three conditions which are “actor_name,” “Bruce Lee” and “movie_type” in my java/go code.
BTW, why “forward” is deprecated?
Thanks.