Circular nested "tree"

I like to store and search a complex parent child structure using Kibana and Elasticsearch. I did find I few posts about parents and childs but they where relatively simple as where the parent has multiple childeren and each child is part of one or more parents but noting circular. I tried some of the suggestions but I didn't manage to get it to work.

For example, if group "Grade 1" is a member of group "Students", and group "Students" is a member of "School", and group "School" is a member of "Grade 1", the group nesting is circular

Questions I like to awnser:

  1. Show me all members of School recursively, expecting:
    Students, Grade1
  2. Show me all members of Students recursively, expecting:
    Grade 1
  3. Show me all members of Grade 1 recursively, expecting:
    School, Students, Grade 1
  4. All of the above but bottom-up. All parents above Grade 1, expecting:
    Students, School, Grade 1

So first question, how to store and search using Kibana.
Second, anyway to visualise this in a tree like view? Removing the circular relation is an option here.