schemacast.schema_io¶
Load the governed schema a cast runs against.
Functions:¶
load_contract(path)
¶
The schema of path and its connector-owned vertex types.
A manifest names which types its connectors ingest; text links to those and never creates them. A schema file owns nothing.
Source code in schemacast/schema_io.py
load_schema(path)
¶
Read a GraFlo Schema, or the schema block of a GraphManifest.
YAML or JSON; see :func:schema_from_mapping.
Raises:
| Type | Description |
|---|---|
TypeError
|
when the file does not hold a mapping. |
ValueError
|
when the mapping is neither a schema nor a manifest. |
Source code in schemacast/schema_io.py
schema_from_mapping(data, source='schema')
¶
A GraFlo Schema from a mapping: a schema itself (core_schema at the
top) or a GraphManifest (schema or graph_schema).
Raises:
| Type | Description |
|---|---|
TypeError
|
when data is not a mapping. |
ValueError
|
when the mapping is neither a schema nor a manifest. |