You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
SIZE
Determines the size of a collection.
Syntax
SIZE ( collection )
Inputs
- collection - A collection of attribute or entity instances. This can be an expression or a relation attribute for instance.
Return type
- integer
Example
Suppose you have a Parent
and a Child
entity, where Parent
has a multivalued relation with Child
via the relation Parent.has_Children
. With this model the following instances are created:
Parent instance | Child instance | Child.name | Child.hobbies |
---|---|---|---|
Parent_1 | Child_1 | “Kim” | “Reading”, “Dancing” |
Parent_1 | Child_2 | “Rick” | “Tennis”, “Dancing” |
Parent_1 | Child_3 | “Bob” | “Painting”, “Basketball”, “Reading” |
Parent_2 | Child_4 | “Mary” | “Football” |
Then:
Active instance | Expression | Result | Type |
---|---|---|---|
Parent_1 | SIZE ( Parent.has_Children ) | 3 | Integer |
Parent_2 | SIZE ( Parent.has_Children ) | 1 | Integer |
none | SIZE ( Parent.has_Children ) | Error | |
Child_1 | SIZE ( Child.hobbies ) | 2 | Integer |
Child_3 | SIZE ( Child.hobbies ) | 3 | Integer |
Child_4 | SIZE ( Child.hobbies ) | 1 | Integer |
SIZE( ? ) | 0 | Integer |
Overview
Content Tools