def to_triple(self, ast_obj=None, fmt="<STR_LIT>"):
if not ast_obj:<EOL><INDENT>ast_obj = self<EOL><DEDENT>if self.bel_subject and self.bel_relation and self.bel_object:<EOL><INDENT>if self.bel_relation.startswith("<STR_LIT>"):<EOL><INDENT>bel_relation = self.bel_relation<EOL><DEDENT>elif fmt == "<STR_LIT>":<EOL><INDENT>bel_relation = self.spec["<STR_LIT>"]["<STR_LIT>"].get(<EOL>self.bel_relation, None<EOL>)<EOL><DEDENT>else:<EOL><INDENT>bel_relation = self.spec["<STR_LIT>"]["<STR_LIT>"].get(<EOL>self.bel_relation, None<EOL>)<EOL><DEDENT>bel_subject = self.bel_subject.to_string(fmt=fmt)<EOL>if isinstance(self.bel_object, (BELAst)):<EOL><INDENT>bel_object = f"<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>bel_object = self.bel_object.to_string(fmt=fmt)<EOL><DEDENT>return {<EOL>"<STR_LIT>": bel_subject,<EOL>"<STR_LIT>": bel_relation,<EOL>"<STR_LIT:object>": bel_object,<EOL>}<EOL><DEDENT>elif self.bel_subject:<EOL><INDENT>return {"<STR_LIT>": self.bel_subject.to_string(fmt=fmt)}<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>
Convert AST object to BEL triple

        Args:
            fmt (str): short, medium, long formatted BEL statements
                short = short function and short relation format
                medium = short function and long relation format
                long = long function and long relation format

        Returns:
            dict: {'subject': <subject>, 'relation': <relations>, 'object': <object>}