Skip to content

Alias

relationalai.semantics.frontend.base
Alias(source: Variable, alias: str)

Represents a DSL value labeled with an output alias.

Alias objects are typically created via Variable.alias and are used to name selected outputs (and enable indexing a fragment by that name, for example query["AGE"]).

  • source

    (Variable) - The underlying value being labeled.
  • alias

    (str) - The name to attach to the value in query outputs.

Most users should not instantiate this class directly. Prefer Variable.alias.

Alias.__format__(format_spec: str) -> str

Return the placeholder used when formatting this alias in readings.

This is mainly used when interpolating values into relationship/property reading strings (see Concept.__format__). When the aliased value is a Concept, formatting the alias is equivalent to formatting the concept with the alias name as the field name.

Parameters:

  • format_spec

    (str) - Additional format spec. This is only allowed when the aliased value is not a concept.

Returns:

  • str - A placeholder string for use in a reading.

Raises:

  • relationalai.util.error.RAIException - If the aliased value is a concept and an additional format_spec is provided.
AliasVariableDSLBase
 semantics > frontend > base
└──  Variable
    └──  alias