def nanopub_to_edges(nanopub: dict = {}, rules: List[str] = [], orthologize_targets: list = []):
<EOL>nanopub_url = nanopub.get("<STR_LIT>", "<STR_LIT>")<EOL>edge_dt = utils.dt_utc_formatted()  <EOL>if nanopub["<STR_LIT>"]["<STR_LIT:type>"]["<STR_LIT:name>"].upper() == "<STR_LIT>":<EOL><INDENT>bel_version = nanopub["<STR_LIT>"]["<STR_LIT:type>"]["<STR_LIT:version>"]<EOL>versions = bel.lang.bel_specification.get_bel_versions()<EOL>if bel_version not in versions:<EOL><INDENT>log.error(<EOL>f"<STR_LIT>"<EOL>)<EOL>return []<EOL><DEDENT><DEDENT>else:<EOL><INDENT>log.error(<EOL>f"<STR_LIT>"<EOL>)<EOL>return []<EOL><DEDENT>api_url = config["<STR_LIT>"]["<STR_LIT>"]["<STR_LIT>"]<EOL>try:<EOL><INDENT>citation_string = normalize_nanopub_citation(nanopub)<EOL><DEDENT>except Exception as e:<EOL><INDENT>log.error(f"<STR_LIT>")<EOL>citation_string = "<STR_LIT>"<EOL><DEDENT>if orthologize_targets == []:<EOL><INDENT>if config["<STR_LIT>"].get("<STR_LIT>", None):<EOL><INDENT>orthologize_targets = config["<STR_LIT>"]["<STR_LIT>"].get("<STR_LIT>", [])<EOL><DEDENT><DEDENT>master_annotations = copy.deepcopy(nanopub["<STR_LIT>"]["<STR_LIT>"])<EOL>master_metadata = copy.deepcopy(nanopub["<STR_LIT>"]["<STR_LIT>"])<EOL>master_metadata.pop("<STR_LIT>", None)<EOL>nanopub_type = nanopub["<STR_LIT>"]["<STR_LIT>"].get("<STR_LIT>")<EOL>r = generate_assertion_edge_info(<EOL>nanopub["<STR_LIT>"]["<STR_LIT>"], orthologize_targets, bel_version, api_url, nanopub_type<EOL>)<EOL>edge_info_list = r["<STR_LIT>"]<EOL>edges = []<EOL>errors = []<EOL>for edge_info in edge_info_list:<EOL><INDENT>annotations = copy.deepcopy(master_annotations)<EOL>metadata = copy.deepcopy(master_metadata)<EOL>errors.extend(edge_info["<STR_LIT>"])<EOL>if not edge_info.get("<STR_LIT>"):<EOL><INDENT>continue<EOL><DEDENT>edge_hash = utils._create_hash(<EOL>f'<STR_LIT>'<EOL>)<EOL>edge = {<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": {<EOL>"<STR_LIT:name>": edge_info["<STR_LIT>"]["<STR_LIT>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT>"].lower(),<EOL>"<STR_LIT:label>": edge_info["<STR_LIT>"]["<STR_LIT>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT>"].lower(),<EOL>"<STR_LIT>": edge_info["<STR_LIT>"],<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT>"],<EOL>"<STR_LIT>": edge_hash,<EOL>"<STR_LIT>": edge_dt,<EOL>"<STR_LIT>": nanopub_url,<EOL>"<STR_LIT>": nanopub["<STR_LIT>"]["<STR_LIT:id>"],<EOL>"<STR_LIT>": citation_string,<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT:object>"],<EOL>"<STR_LIT:object>": edge_info["<STR_LIT>"]["<STR_LIT:object>"],<EOL>"<STR_LIT>": copy.deepcopy(annotations),<EOL>"<STR_LIT>": copy.deepcopy(metadata),<EOL>"<STR_LIT>": True,<EOL>"<STR_LIT>": edge_info["<STR_LIT>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"],<EOL>},<EOL>"<STR_LIT:object>": {<EOL>"<STR_LIT:name>": edge_info["<STR_LIT>"]["<STR_LIT:object>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT:object>"].lower(),<EOL>"<STR_LIT:label>": edge_info["<STR_LIT>"]["<STR_LIT:object>"],<EOL>"<STR_LIT>": edge_info["<STR_LIT>"]["<STR_LIT:object>"].lower(),<EOL>"<STR_LIT>": edge_info["<STR_LIT>"],<EOL>},<EOL>}<EOL>}<EOL>edges.append(copy.deepcopy(edge))<EOL><DEDENT>return {<EOL>"<STR_LIT>": edges,<EOL>"<STR_LIT>": nanopub["<STR_LIT>"]["<STR_LIT:id>"],<EOL>"<STR_LIT>": nanopub_url,<EOL>"<STR_LIT:success>": True,<EOL>"<STR_LIT>": errors,<EOL>}<EOL>
Process nanopub into edges and load into EdgeStore

    Args:
        nanopub: BEL Nanopub
        rules: list of compute rules to process
        orthologize_targets: list of species in TAX:<int> format

    Returns:
        list: of edges

    Edge object:
        {
            "edge": {
                "subject": {
                    "name": subj_canon,
                    "name_lc": subj_canon.lower(),
                    "label": subj_lbl,
                    "label_lc": subj_lbl.lower(),
                    "components": subj_components,
                },
                "relation": {  # relation _key is based on a hash
                    "relation": edge_ast.bel_relation,
                    "edge_hash": edge_hash,
                    "edge_dt": edge_dt,
                    "nanopub_url": nanopub_url,
                    "nanopub_id": nanopub_id,
                    "citation": citation,
                    "subject_canon": subj_canon,
                    "subject": subj_lbl,
                    "object_canon": obj_canon,
                    "object": obj_lbl,
                    "annotations": nanopub['annotations'],
                    "metadata": nanopub['metadata'],
                    "public_flag": True,  # will be added when groups/permissions feature is finished,
                    "edge_types": edge_types,
                },
                'object': {
                    "name": obj_canon,
                    "name_lc": obj_canon.lower(),
                    "label": obj_lbl,
                    "label_lc": obj_lbl.lower(),
                    "components": obj_components,
                }
            }
        }