Skip to main content
Version: latest

agrag.schema.canonical.dump_schema

dump_schema(schema:GraphSchema) -> dict[str, Any]

Return the canonical dict form of a schema.

The canonical form keeps entity and relation order and uses a [source, target] list for each relation pattern. Retained ancestry appears when present. The dump is plain JSON data and load_schema(dump_schema(schema)) == schema for every valid schema.

Parameters:

Returns:

  • dict[str, Any] – A new dict that the caller may change freely.