def edge_iterator(edges=[], edges_fn=None):
for edge in itertools.chain(edges, files.read_edges(edges_fn)):<EOL><INDENT>subj = copy.deepcopy(edge["<STR_LIT>"]["<STR_LIT>"])<EOL>subj_id = str(utils._create_hash_from_doc(subj))<EOL>subj["<STR_LIT>"] = subj_id<EOL>obj = copy.deepcopy(edge["<STR_LIT>"]["<STR_LIT:object>"])<EOL>obj_id = str(utils._create_hash_from_doc(obj))<EOL>obj["<STR_LIT>"] = obj_id<EOL>relation = copy.deepcopy(edge["<STR_LIT>"]["<STR_LIT>"])<EOL>relation["<STR_LIT>"] = f"<STR_LIT>"<EOL>relation["<STR_LIT>"] = f"<STR_LIT>"<EOL>relation_hash = copy.deepcopy(relation)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_hash.pop("<STR_LIT>", None)<EOL>relation_id = str(utils._create_hash_from_doc(relation_hash))<EOL>relation["<STR_LIT>"] = relation_id<EOL>if edge.get("<STR_LIT>", None):<EOL><INDENT>if "<STR_LIT>" not in relation:<EOL><INDENT>relation["<STR_LIT>"] = {}<EOL><DEDENT>relation["<STR_LIT>"]["<STR_LIT>"] = edge["<STR_LIT>"]<EOL><DEDENT>yield ("<STR_LIT>", subj)<EOL>yield ("<STR_LIT>", obj)<EOL>yield ("<STR_LIT>", relation)<EOL><DEDENT>
Yield documents from edge for loading into ArangoDB