Entity functions are used to perform operations on entity-specific data to produce global results, such as counting the number of instances of an entity, obtaining the highest/most recent or lowest/least recent value of an entity-level variable, and adding up numerical values gathered from each instance of the entity.
Be sure to use the exact syntax for these functions including spacing and parentheses as specified below.
Function | Declarations | Example rule | Inputs | Outputs | Further information |
---|---|---|---|---|---|
For |
Source entity: the child Target entity: the school Relationship type: Many-to-one Relationship text: the child's school
|
|
the child's school: St Mary's; the school has a scholarship program: false
the child's school: St Joseph's; the school is closed for a pupil free day: true
the child's school: St Clare's Public School; the school name: St Clare's Public School |
the child may apply for a scholarship = false
the child does not have to go to school = true
the child's school name = St Clare's Public School |
Refer to entities connected by a to-one relationship |
ForScope |
Source entity: the person Target entity: the car Relationship type: One-to-one Relationship text: the person's car |
|
the car: NSW001; the number of times the car has broken down: 4 | the person has a reliable car = false | Extend the For, For All and Exists functions |
ForScope (Alias) |
Source entity: the person Target entity: the person Relationship type: One-to-one Relationship text: the person's spouse |
|
the person: Fran; the person’s income: 500 the person: Seb; the person’s income: 250 |
the person has the highest taxable income=true (Fran) the person has the highest taxable income=false (Seb) |
Remove ambiguity when reasoning about more than one instance of the same entity |
ForAll |
Source entity: Global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Sally; the child is at home: true; the child's location: home the child: Molly; the child is at home: true; the child's location: home the child: Elizabeth; the child is at home: false; the child's location: playground |
the playground is empty = false | Check that a condition returns true for every instance of an entity |
ForAllScope |
Source entity: the person Target entity: the cat Relationship type: One-to-many Relationship text: the person's cats |
|
the cat: Tiger; the cat is happy: false the cat: Kit; the cat is happy: true the cat: Patch; the cat is happy: true |
the person is happy = false | Extend the For, For All and Exists functions |
ForAllScope (Alias) |
Source entity: the person Target entity: the person Relationship type: One-to-many Relationship text: the person's dependents |
|
the person: Tobias; the person's birthday: 3 May the person: Alexandra; the person's birthday: 3 May the person: Victoria; the person's birthday: 5 May |
the person has one large party = false | Remove ambiguity when reasoning about more than one instance of the same entity |
Exists |
Source entity: Global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Isabelle ; the child is happy: false the child: Xavier; the child is happy: true the child: Phoebe; the child is happy: false the child: Rachel; the child is happy: false |
the playground has good equipment = true | Check that a condition returns true for at least one instance of an entity |
ExistsScope |
Source entity: the plan Target entity: the product Relationship type: Many-to-many Relationship text: the plan's products |
|
the plan: Plan 1; the plan's network: Vodafone the plan: Plan 2; the plan's network: Telstra the product: Product 1; the product's network: Optus the product: Product 2; the product's network: Vodafone |
the plan has incompatible products = true | Extend the For, For All and Exists functions |
ExistsScope (Alias) |
Source entity: Global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Kenneth; the child’s date of birth: 2007-10-15; the child's mother: Samantha Jane Smith the child: Benny; the child’s date of birth: 2007-10-15; the child's mother: Samantha Jane Smith the child: Jenny; the child’s date of birth: 2006-01-02; the child's mother: Samantha Jane Smith |
the child is a twin = true (Kenneth) the child is a twin = true (Benny) the child is a twin = false(Jenny) |
Remove ambiguity when reasoning about more than one instance of the same entity |
IsMemberOf |
Source entity: the person Target entity: the child Relationship type: Many-to-many Relationship text: the person's household |
|
the child: Sam; the child's address: 15 Melbourne Avenue Canberra the person: James; the person's address: 21 Sydney Avenue Canberra |
the child (Sam) is a member of the person's (James) household = false |
Use relationship membership as a rule input
|
IsNotMemberOf |
Source entity: the person Target entity: the bird Relationship type: One-to-many Relationship text: the person's hated birds Reverse relationship text: the bird's owner |
|
the bird: Chirpy; the bird is a member of the person's hated birds: true | the bird (Chirpy) is happy = false | Use relationship membership as a rule input |
InferInstance |
Source entity: the employee Target entity: the location Relationship type: Many-to-one Relationship text: the location in which the employee works Reverse relationship text: the employees at the location |
|
the employee: Gordon; the employee’s local office: "London" the employee: Britney; the employee’s local office: "London" the employee: Dominique; the employee’s local office: "Paris" |
new inferred location: London; the location = "London", the employee (Gordon) is a member of the employees at the location (London) = true, the employee (Britney) is a member of the employees at the location (London) = true, the employee (Dominique) is a member of the employees at the location (London) = false
new inferred location: Paris; the location = "Paris", the employee (Gordon) is a member of the employees at the location (Paris) = false, the employee (Britney) is a member of the employees at the location (Paris) = false, the employee (Dominique) is a member of the employees at the location (Paris) = true |
Infer existence of entities to satisfy the relationship |
InstanceCount |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the claimant's children |
|
the child: Anthony the child: Peter the child: Rebecca the child: Fiona |
the number of children that the claimant has = 4 | Count the number of instances of an entity |
InstanceCountIf |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the claimant's children |
|
the child: Anthony; the child is a school student: false the child: Peter; the child is a school student: false the child: Rebecca; the child is a school student: true |
the number of school students that the claimant has = 1 | Count the number of instances of an entity for which a particular attribute is true |
InstanceMaximum |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the claimant's children |
|
the child: Max; the child's bank balance: $50 the child: Sophie; the child's bank balance: $175 the child: Katie; the child's bank balance: $120 |
the highest bank balance for a child of the claimant = $175 | Get the highest/most recent value of an entity-level variable |
InstanceMaximumIf |
Source entity: the company Target entity: the employee Relationship type: One-to-many Relationship text: the company's employees |
|
the employee: David; the employee's date of employment: 01/01/2006; the employee is a permanent employee: true the employee: Shaun; the employee's date of employment: 24/08/2006; the employee is a permanent employee: false the employee: Anita; the employee's date of employment: 15/05/2006; the employee is a permanent employee: true |
the most recent date of employment of a permanent employee by the company = 2006-05-15 | Get the highest/most recent value of an entity-level variable for which a particular attribute is true |
InstanceMinimum |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the claimant's children |
|
the child: Harry; the child's weight in kilograms: 15 the child: Sharon; the child's weight in kilograms: 30 the child: Fran; the child's weight in kilograms: 45 |
the lightest weight for a child of the claimant = 15 | Get the lowest/least recent value of an entity-level variable |
InstanceMinimumIf |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the claimant's children |
|
the child: Sam; the child's age: 3; the child is female: false the child: Alex; the child's age: 4; the child is female: true the child: Sharon; the child's age: 6; the child is female: false the child: Paris; the child's age: 8; the child is female: true |
the youngest of the claimant's female children = 4 | Get the lowest/least recent value of an entity-level variable for which a particular attribute is true |
InstanceSum |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the claimant's children |
|
the child: Mary; the Child Care Benefit amount for the child: $500 the child: Sam; the Child Care Benefit amount for the child: $250 the child: Lizzie; the Child Care Benefit amount for the child: $150 |
the total Child Care Benefit payable to the claimant = $900 | Add up numerical values gathered from each instance of an entity |
InstanceSumIf |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the claimant's children |
|
the child: Sally; the annual school fees for the child: $18000; the child attends a boarding school: true the child: James; the annual school fees for the child: $15000; the child attends a boarding school: true the child: Bob; the annual school fees for the child: $10000; the child attends a boarding school: false |
the total cost of boarding school fees for the claimant = $33000 | Add up numerical values gathered from each instance of an entity for which a particular attribute is true |
InstanceValueIf | Source entity: Global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the age of the oldest child = 8 the child: Sam; the child's age: 3 the child: Alex; the child's age: 4 the child: Sharon; the child's age: 6 the child: Paris; the child's age: 8 |
the name of the oldest child = Paris | Get a value from a unique entity instance |
InstanceEquals |
Source entity: the product Target entity: the product Relationship type: Many-to-many Relationship text: the products |
|
the product: Product A; the product's code: TD2010 the product: Product B; the product's code: SM2031 the product: Product A; the product's code: TD2010 |
the product (Product A) is a duplicate = true the product (Product B) is a duplicate = false |
Compare instances of the same entity |
InstanceNotEquals |
Source entity: the employee Target entity: the employee Relationship type: Many-to-many Relationship text: the employees |
|
the employee: Harry; the employee's ID: RN6710 the employee: Will; the employee's ID: RN5812 the employee: Kate; the employee's ID: RN5812 |
the employee (Harry) has a conflicting ID = false the employee (Will) has a conflicting ID = true the employee (Kate) has a conflicting ID = true |
Compare instances of the same entity |
TIP: The localized syntax for these functions may be viewed: