Factory method, registers new edge.

def register_new_edge(edge_id, first_char_index, last_char_index, source_node_id, dest_node_id):
    """Factory method, registers new edge.
    """
    event = Edge.Created(
        originator_id=edge_id,
        first_char_index=first_char_index,
        last_char_index=last_char_index,
        source_node_id=source_node_id,
        dest_node_id=dest_node_id,
    )
    entity = Edge.mutate(event=event)
    publish(event)
    return entity