Skip to main content
Version: latest

agrag.schema.canonical.build_schema

build_schema(data:dict[str, Any], origins:Mapping[str, list[str]], issues:Issues) -> GraphSchema | None

Validate a canonical dict and map model errors back to source paths.

Parameters:

  • data (dict[str, Any]) – A canonical dict.
  • origins (Mapping[str, list[str]]) – For entities and relations, the source path of each item in data, in the same order.
  • issues (Issues) – Receives one issue per model error.

Returns:

  • GraphSchema | None – The schema, or None when the model rejects data.