Skip to content

RelationshipInfo

relationalai.semantics.inspect
RelationshipInfo(
name: str,
type_name: str,
fields: tuple[FieldInfo, ...],
reading: str,
is_property: bool,
is_identity: bool,
is_list: bool,
is_input: bool,
alt_readings: tuple[str, ...] = (),
)

Read-only view of a Relationship.

In the DSL, Property is a subclass of Relationship — a property is a single-valued (functional) relationship. This dataclass represents both: use is_property to distinguish them.

The owning concept’s field is excluded from fields — only value and key fields are included.

RelationshipInfo.name: str

Relationship or property name (e.g. "age", "customer"). Empty string for unnamed relationships.

RelationshipInfo.type_name: str

Type of the last field — the value type for properties ("Integer"), or the target concept for relationships ("Order").

RelationshipInfo.fields: tuple[FieldInfo, ...]

Value/key fields, excluding the owning concept.

RelationshipInfo.reading: str

Natural-language description (e.g. "Person has Integer:age" or "Customer placed Order"). Empty string if none declared.

RelationshipInfo.is_property: bool

True if this is a single-valued property (DSL Property), False if multi-valued (DSL Relationship).

RelationshipInfo.is_identity: bool

True if this property is part of the concept’s unique key (from identify_by=). Always False for non-properties.

RelationshipInfo.is_list: bool

True if the value field accepts a list of values.

RelationshipInfo.is_input: bool

True if the value field is a solver input (prescriptive models).

RelationshipInfo.alt_readings: tuple[str, ...]

Alternative phrasings from .alt() declarations.

 semantics > inspect
├──  ConceptInfo
└──  ModelSchema