def _include_term(self, term):
        """Add a single term to the current ontology.

        It is needed to dereference any term in the term's relationship
        and then to build the reference again to make sure the other
        terms referenced in the term's relations are the one contained
        in the ontology (to make sure changes to one term in the ontology
        will be applied to every other term related to that term).
        """
        ref_needed = False

        if term.relations:

            for k,v in six.iteritems(term.relations):
                for i,t in enumerate(v):

                    #if isinstance(t, Term):
                    try:

                        if t.id not in self:
                            self._include_term(t)

                        v[i] = t.id

                    except AttributeError:
                        pass

                    ref_needed = True

        self.terms[term.id] = term
        return ref_needed
def _include_term ( self , term ) : ref_needed = False if term . relations : for k , v in six . iteritems ( term . relations ) : for i , t in enumerate ( v ) : try : if t . id not in self : self . _include_term ( t ) v [ i ] = t . id except AttributeError : pass ref_needed = True self . terms [ term . id ] = term return ref_needed
Add a single term to the current ontology.

        It is needed to dereference any term in the term's relationship
        and then to build the reference again to make sure the other
        terms referenced in the term's relations are the one contained
        in the ontology (to make sure changes to one term in the ontology
        will be applied to every other term related to that term).