Skip to content

alias

relationalai.semantics
alias(value: object, name: str) -> Alias

Wrap a value in an output alias.

This is a convenience function for attaching an output alias to any value, including Python literals that cannot call .alias() directly (e.g., alias(1, "col") instead of 1.alias("col")).

  • value

    (Variable or Python literal (int, str, float, bool, etc.)) - The value to label.
  • name

    (str) - The output column name.
  • Alias

Alias a literal integer:

from relationalai.semantics import Model, select, alias
m = Model()
select(alias(1, "one")).to_df()

Alias a concept property (equivalent to Person.name.alias("n")):

Person = m.Concept("Person")
select(alias(Person.name, "n")).to_df()