Entity Rules
If the entity does not exists, the rules below return:
- An empty value (
"") for rules that returnCategorical - A missing value for rules that return
Numerical
Exist
Checks is an entity exists. Returns 0 or 1.
Example
Root Dictionary Customer(customer_id)
{
Categorical customer_id;
Numerical age;
Categorical sex;
Entity(Address) customerAddress; // 1-1 relationship
Table(Sale) sales; // 1-n relationship
// Value is 1 if the address exists for the customer
Numerical ExistingAddress = Exist(customerAddress);
};
Dictionary Address(customer_id)
{
Categorical customer_id;
Categorical street;
Categorical city;
Categorical zipcode;
Categorical State;
};
Dictionary Sale(customer_id)
{
Categorical customer_id;
Categorical product;
Numerical cost;
Date purchaseDate;
};
GetValue
Access to a Numerical value of an entity. Returns a missing value if the entity does not exist.
Example
Root Dictionary Customer(customer_id)
{
Categorical customer_id;
Numerical age;
Categorical sex;
Entity(Address) customerAddress; // 1-1 relationship
Table(Sale) sales; // 1-n relationship
// Street name length
Numerical streetNameLength = GetValue(customerAddress, Length(street));
};
Dictionary Address(customer_id)
{
Categorical customer_id;
Categorical street;
Categorical city;
Categorical zipcode;
Categorical State;
};
Dictionary Sale(customer_id)
{
Categorical customer_id;
Categorical product;
Numerical cost;
Date purchaseDate;
};
GetValueC
Access to a Categorical value of an entity. Returns an empty Categorical value if the entity
does not exist.
Example
Root Dictionary Customer(customer_id)
{
Categorical customer_id;
Numerical age;
Categorical sex;
Entity(Address) customerAddress; // 1-1 relationship
Table(Sale) sales; // 1-n relationship
Categorical city = GetValueC(customerAddress, city); // City from address
};
Dictionary Address(customer_id)
{
Categorical customer_id;
Categorical street;
Categorical city;
Categorical zipcode;
Categorical State;
};
Dictionary Sale(customer_id)
{
Categorical customer_id;
Categorical product;
Numerical cost;
Date purchaseDate;
};
GetValueD
Access to a Date value of an entity. Returns empty Date value if the entity does not exist.
GetValueT
Access to a Time value of an entity. Returns an empty Time value if the entity does not exist.
GetValueTS
Access to a Timestamp value of an entity. Returns an empty Timestamp value if the entity does
not exist.
GetValueTSTZ
Access to a TimestampTZ value of an entity. Returns an empty TimestampTZ value if the entity
does not exist.
GetEntity
Access to an Entity value of an entity.
GetTable
Access to a Table value of an entity.