code: def register_new_edge(edge_id, first_char_index, last_char_index, source_node_id, dest_node_id):
      
      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
docs: Factory method, registers new edge.