Skip to main content
Version: 0.0.5 (stable)

agrag.candidates.patch.endpoint_type

endpoint_type(labels:Sequence[str], schema:GraphSchema) -> str | None

Select the most specific declared type among an entity's labels.

If multiple leaf types remain, the alphabetically first label is returned.

Parameters:

  • labels (Sequence[str]) – Labels attached to an entity.
  • schema (GraphSchema) – Schema that declares entity types and their ancestry.

Returns:

  • str | None – Selected schema type, or None when no label is declared.