code: def handle_triple(self, lhs, relation, rhs):
          
          relation = relation.replace(':', '', 1)  # remove leading :
  
          if self.is_relation_inverted(relation):  # deinvert
              source, target, inverted = rhs, lhs, True
              relation = self.invert_relation(relation)
          else:
              source, target, inverted = lhs, rhs, False
  
          source = _default_cast(source)
          target = _default_cast(target)
  
          if relation == '':  # set empty relations to None
              relation = None
  
          return Triple(source, relation, target, inverted)
docs: Process triples before they are added to the graph.
  
          Note that *lhs* and *rhs* are as they originally appeared, and
          may be inverted. Inversions are detected by
          is_relation_inverted() and de-inverted by invert_relation().
  
          By default, this function:
           * removes initial colons on relations
           * de-inverts all inverted relations
           * sets empty relations to `None`
           * casts numeric string sources and targets to their numeric
             types (e.g. float, int)
  
          Args:
              lhs: the left hand side of an observed triple
              relation: the triple relation (possibly inverted)
              rhs: the right hand side of an observed triple
          Returns:
              The processed (source, relation, target) triple. By default,
              it is returned as a Triple object.