Skip to main content
Version: latest

agrag.candidates.review.relabel_candidates

relabel_candidates(graph_store:GraphStore, *, kind:Literal['entity', 'relation'], from_label:str, to_label:str) -> ReviewOutcome

Rename pending candidate groups and matching unresolved entity endpoints.

Pending groups whose new key has already been reviewed remain unchanged. Groups at a pending destination merge by sharing the recomputed key.

Parameters:

  • graph_store (GraphStore) – Store containing the candidate groups.
  • kind (Literal['entity', 'relation']) – Candidate kind to rename.
  • from_label (str) – Current candidate label.
  • to_label (str) – Replacement label.

Returns:

  • ReviewOutcome – Source keys moved and source keys skipped with their reasons.

Raises:

  • ValueError – If to_label is malformed or reserved, or both labels are equal.