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.namePerson.genderPerson.age
“Kim”?23
“Rick”“m”35
“Bob”“m”42
“John”“m”19
ExpressionResultType
EACH Person WHERE ( Person.age < 18 ) FALSEBoolean
EACH Person WHERE ( Person.age > 18 )TRUEBoolean
EACH Person WHERE ( Person.age < 20 )FALSEBoolean
EACH Person WHERE ( Person.gender = "m" OR Person.age > 35 )UNKNOWNBoolean
EACH Person WHERE ( Person.gender = "m" OR Person.age > 20 )TRUEBoolean



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.


Back to Top