Skip to main content
Version: 0.0.6 (stable)

agrag.schema.canonical.dump_schema

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

Return the canonical dict form of a schema.

The canonical form holds every field, with no shorthand. Entity and relation order is kept, and each relation pattern is a [source, target] list. load_schema(dump_schema(schema)) == schema for every valid schema, and the dump is plain JSON data.

Parameters:

Returns:

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