You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.
EACH
Determines whether all instances of a specified entity meet a certain criteria.
Syntax
EACH instances WHERE ( condition )
Inputs
- instances - A collection of instances to search.
- condition - Boolean expression that represents the criterion the instance has to meet.
Return type
- Boolean
Examples
Suppose the following data model.
Person.name | Person.gender | Person.age |
---|---|---|
“Kim” | ? | 23 |
“Rick” | “m” | 35 |
“Bob” | “m” | 42 |
“John” | “m” | 19 |
Expression | Result | Type |
---|---|---|
EACH Person WHERE ( Person.age < 18 ) | FALSE | Boolean |
EACH Person WHERE ( Person.age > 18 ) | TRUE | Boolean |
EACH Person WHERE ( Person.age < 20 ) | FALSE | Boolean |
EACH Person WHERE ( Person.gender = "m" OR Person.age > 35 ) | UNKNOWN | Boolean |
EACH Person WHERE ( Person.gender = "m" OR Person.age > 20 ) | TRUE | Boolean |
Please note that you can use a COLLECT expression as well for collecting instances for which the EACH should hold. E.g., EACH (COLLECT Person FROM ALL Person WHERE (Person.gender = "f")) WHERE ( Person.age < 25 ).
In case that the list of instances for which the EACH should hold is an EMPTY list, then the EACH expression returns TRUE.
Overview
Content Tools