Expression Aliases
This section describes the SDL declarations pertaining to expression aliases.
Example
Declare a “UserAlias” that provides additional information for a “User” via a computed link “friend_of”:
Copy
alias UserAlias := User {
# declare a computed link
friend_of := User.<friends[is User]
};
Syntax
Define a new alias corresponding to the more explicit DDL commands.
alias alias-name := alias-expr ;
alias alias-name "{"
using alias-expr;
[ annotation-declarations ]
"}" ;
Description
This declaration defines a new alias with the following options:
- alias-name
-
The name (optionally module-qualified) of an alias to be created.
- alias-expr
-
The aliased expression. Must be a Stable EdgeQL expression.
The valid SDL sub-declarations are listed below:
- annotation-declarations
-
Set alias annotation to a given value.
︙