<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_sorted_relationships(self, goterm):
 """Traverse GO Terms above the current GO Term. Then add current GO Term to sorted."""

        if goterm.id in self.goids_seen:
            return
        self.goids_seen.add(goterm.id)
        for goterm_upper in goterm.get_goterms_upper():
            self._get_sorted_relationships(goterm_upper)
        self.goterms_sorted.append(goterm)