TableSchema
relationalai.semantics.frontend.base
TableSchema(table: Table, exclude: list[str] = [])Represents a schema projection derived from a Table.
A TableSchema is typically created via Table.to_schema and
then passed to Concept.new (to create one entity per source row) or to
Model.select (to select all columns). Column names in exclude are
matched case-insensitively.
Parameters
(tableTable) - Source table whose columns make up the schema.
(excludelist[str], default:[]) - Column names to omit from the schema.
Notes
Most users should not instantiate this class directly. Prefer
Table.to_schema.
Attributes
.exclude
TableSchema.exclude: set[str]Set of excluded column names (stored in lowercase).
Methods
.get_columns()
TableSchema.get_columns() -> list[Relationship]Return the table columns included in this schema.
This filters the underlying Table columns using the exclude
list passed to Table.to_schema (matched case-insensitively).
Returns:
list[Relationship] - Column relationships in the same order as the source table.
Inheritance Hierarchy
Used By
semantics > frontend > base └── StatementAndSchema
Returned By
semantics > frontend > base └── Table └── to_schema
Referenced By
RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Build a semantic model └── Define base facts