code: def gen_query(self):
          
          return (
              SQL.forwards_relation(self.src, self.rel) if self.dst is None else
              SQL.inverse_relation(self.dst, self.rel)
              )
docs: Generate an SQL query for the edge object.