Schemas¶
Bundled FtM model snapshot and lookup helpers. Use these when you need
to introspect the model at runtime — yente-cli ref is the CLI front-end
for the same data.
schemas ¶
Bundled FtM model snapshot and lookup helpers.
The model is loaded from model.json at import time and re-exported as a
plain dict. Use the helpers for the common membership / inheritance /
deprecation checks; navigate model directly for anything richer.
describe_schema ¶
Full projected schema view: summary + settable properties + relations.
properties are the attributes you set in a match query; relations are
the entity-typed edges you traverse with fetch_entity_relations (omitted
when the schema has none).
describe_type ¶
Project an FtM value type, trimmed like schemata/properties.
Keeps name, label, description, matchable (true-only), and
values (enum types only); drops structural cruft
(maxLength/group/plural/pivot) and omits empties.
Raises:
| Type | Description |
|---|---|
KeyError
|
if |
has_schema ¶
Return True if name is a valid schema in the bundled model.
is_a ¶
Return True if schema extends ancestor transitively.
Reflexive on schema itself. O(1) lookup against the pre-flattened
schemata list — no MRO walk needed.
is_deprecated ¶
Return True if prop is marked deprecated on schema or any ancestor.
is_matchable_schema ¶
Return True if schema can be used as a /match query target.
Non-matchable schemata (e.g. Document, Article, abstract
parents like Thing) cause yente to raise TypeError at query
construction; the SDK refuses such queries client-side rather than
let the server reject them. See yente/data/entity.py:42.
iter_properties ¶
Yield every property name available on schema, including inherited ones.
model.json stores own-properties only on each schema definition; this
walks the pre-flattened schemata ancestor list and yields each property
name at most once, even if multiple ancestors define a property of the same
name.
matchable_schemata ¶
Return every schema name with matchable: true in the model.
Sorted alphabetically for stable error messages.
property_matchable ¶
Resolve a property's matchable flag, falling back to its type's default.
A property may not set matchable itself; when it doesn't, the value comes
from its FtM type (e.g. the country type is matchable, so citizenship
inherits it). This is the FtM model's own resolution rule.
schema_index ¶
Project every schema (or only matchable ones) as summaries, name-sorted.
schema_properties ¶
Project a schema's settable attributes (non-entity-typed), sorted by name.
These are the fields you fill in a match_entity query (names, dates,
countries, identifiers, …). Relationship edges (entity-typed properties)
live in :func:schema_relations, not here.
schema_relations ¶
Project a schema's relationship edges (entity-typed properties).
These are the edges fetch_entity_relations traverses (ownershipOwner,
sanctions, familyPerson, …): pass the name as its prop,
range is the schema the edge points at, and reverse names the role
the source plays on the far entity — which disambiguates same-range edges
(familyPerson/person vs familyRelative/relative, both →
Family). Kept compact — no full property projection.
schema_summary ¶
Project a schema header (no properties): name, description, matchable, lineage.
type_values ¶
Return an enum type's value → label map (topic, country, …).
Empty for non-enum types (date, name, …). The single source for the
controlled vocabularies the CLI and MCP expose.
Raises:
| Type | Description |
|---|---|
KeyError
|
if |