def generate_assertion_edge_info(<EOL>assertions: List[dict],<EOL>orthologize_targets: List[str],<EOL>bel_version: str,<EOL>api_url: str,<EOL>nanopub_type: str = "<STR_LIT>",<EOL>) -> dict:
bo = bel.lang.belobj.BEL(bel_version, api_url)<EOL>bo_computed = bel.lang.belobj.BEL(bel_version, api_url)<EOL>edge_info_list = []<EOL>with utils.Timer() as t:<EOL><INDENT>for assertion in assertions:<EOL><INDENT>start_time = t.elapsed<EOL>bo.parse(assertion)<EOL>if not bo.ast:<EOL><INDENT>errors = [<EOL>f"<STR_LIT>"<EOL>for error in bo.validation_messages<EOL>if error[<NUM_LIT:0>] == "<STR_LIT>"<EOL>]<EOL>edge_info = {"<STR_LIT>": copy.deepcopy(errors)}<EOL>edge_info_list.append(copy.deepcopy(edge_info))<EOL>continue<EOL><DEDENT>bo.collect_nsarg_norms()<EOL>bo.collect_orthologs(orthologize_targets)<EOL>log.info(<EOL>"<STR_LIT>", delta_ms=(t.elapsed - start_time)<EOL>)<EOL>(edge_species_id, edge_species_label) = extract_ast_species(bo.ast)<EOL>orig_species_id = edge_species_id<EOL>canon = bo.canonicalize().to_triple()<EOL>components = get_node_subcomponents(bo.ast)  <EOL>computed_asts = bo.compute_edges(<EOL>ast_result=True<EOL>)  <EOL>decanon = bo.decanonicalize().to_triple()<EOL>if nanopub_type == "<STR_LIT>":<EOL><INDENT>edge_types = ["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>edge_types = ["<STR_LIT>", "<STR_LIT>"]<EOL><DEDENT>if assertion.get("<STR_LIT>", False):<EOL><INDENT>causal_edge_type = []<EOL>if "<STR_LIT>" in bo.spec["<STR_LIT>"]["<STR_LIT:info>"][assertion["<STR_LIT>"]]["<STR_LIT>"]:<EOL><INDENT>edge_types.append("<STR_LIT>")<EOL><DEDENT>edge_info = {<EOL>"<STR_LIT>": edge_types,<EOL>"<STR_LIT>": edge_species_id,<EOL>"<STR_LIT>": edge_species_label,<EOL>"<STR_LIT>": canon,<EOL>"<STR_LIT>": decanon,<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": [],<EOL>}<EOL>edge_info_list.append(copy.deepcopy(edge_info))<EOL><DEDENT>for computed_ast in computed_asts:<EOL><INDENT>bo_computed.ast = computed_ast<EOL>bo_computed.collect_nsarg_norms()<EOL>canon = bo_computed.canonicalize().to_triple()<EOL>components = get_node_subcomponents(<EOL>bo_computed.ast<EOL>)  <EOL>decanon = bo_computed.decanonicalize().to_triple()<EOL>(edge_species_id, edge_species_label) = extract_ast_species(bo_computed.ast)<EOL>edge_info = {<EOL>"<STR_LIT>": ["<STR_LIT>"],<EOL>"<STR_LIT>": edge_species_id,<EOL>"<STR_LIT>": edge_species_label,<EOL>"<STR_LIT>": canon,<EOL>"<STR_LIT>": decanon,<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": [],<EOL>}<EOL>if [edge for edge in edge_info_list if edge.get("<STR_LIT>", {}) == canon]:<EOL><INDENT>continue  <EOL><DEDENT>edge_info_list.append(copy.deepcopy(edge_info))<EOL><DEDENT>if nanopub_type == "<STR_LIT>":<EOL><INDENT>continue<EOL><DEDENT>if len(bo.ast.species) > <NUM_LIT:0>:<EOL><INDENT>for species_id in orthologize_targets:<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>if species_id == orig_species_id:<EOL><INDENT>continue<EOL><DEDENT>bo.orthologize(species_id)<EOL>(edge_species_id, edge_species_label) = extract_ast_species(bo.ast)<EOL>if edge_species_id == "<STR_LIT:None>" or edge_species_id == orig_species_id:<EOL><INDENT>log.debug(<EOL>f'<STR_LIT>'<EOL>)<EOL>continue<EOL><DEDENT>ortho_decanon = bo.orthologize(<EOL>species_id<EOL>).to_triple()  <EOL>ortho_canon = bo.canonicalize().to_triple()<EOL>computed_asts = bo.compute_edges(<EOL>ast_result=True<EOL>)  <EOL>components = get_node_subcomponents(<EOL>bo.ast<EOL>)  <EOL>if assertion.get("<STR_LIT>", False):<EOL><INDENT>edge_info = {<EOL>"<STR_LIT>": ["<STR_LIT>", "<STR_LIT>"] + causal_edge_type,<EOL>"<STR_LIT>": edge_species_id,<EOL>"<STR_LIT>": edge_species_label,<EOL>"<STR_LIT>": ortho_canon,<EOL>"<STR_LIT>": ortho_decanon,<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": [],<EOL>}<EOL>edge_info_list.append(copy.deepcopy(edge_info))<EOL><DEDENT>for computed_ast in computed_asts:<EOL><INDENT>bo_computed.ast = computed_ast<EOL>bo_computed.collect_nsarg_norms()<EOL>canon = bo_computed.canonicalize().to_triple()<EOL>components = get_node_subcomponents(<EOL>bo_computed.ast<EOL>)  <EOL>decanon = bo_computed.decanonicalize().to_triple()<EOL>(edge_species_id, edge_species_label) = extract_ast_species(bo_computed.ast)<EOL>edge_info = {<EOL>"<STR_LIT>": ["<STR_LIT>", "<STR_LIT>"],<EOL>"<STR_LIT>": edge_species_id,<EOL>"<STR_LIT>": edge_species_label,<EOL>"<STR_LIT>": canon,<EOL>"<STR_LIT>": decanon,<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": components["<STR_LIT>"],<EOL>"<STR_LIT>": [],<EOL>}<EOL>if [edge for edge in edge_info_list if edge.get("<STR_LIT>", {}) == canon]:<EOL><INDENT>continue  <EOL><DEDENT>edge_info_list.append(copy.deepcopy(edge_info))<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>log.info("<STR_LIT>", delta_ms=t.elapsed)<EOL>return {"<STR_LIT>": edge_info_list}<EOL>
Create edges (SRO) for assertions given orthologization targets

    Args:
        assertions: list of BEL statements (SRO object)
        orthologize_targets: list of species in TAX:<int> format
        bel_version: to be used for processing assertions
        api_url: BEL API url endpoint to use for terminologies and orthologies