Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This function determines whether an instance of a specified entity exists, optionally meeting certain criteria.

Syntax

Code Block
EXISTS instances [WHERE condition]
  • instances - 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”“f”23
“Rick”“m”35
“Bob”“m”42
“John”“m”19
“Mary”“f”33

 

  • EXISTS Person = TRUE
  • EXISTS Person WHERE (Person.age < 18) = FALSE
  • EXISTS Person WHERE (Person.gender = “m” AND Person.age > 35) = TRUE
UI Text Box
typenote

The return value of a boolean can be TRUE, FALSE or UNKNOWN.

Section
Column
width90%

 

Column
Back to top

EACH

This function determines whether all instances of a specified entity meet a certain criteria

Syntax

Code Block
EACH instances WHERE condition
  • 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”“f”23
“Rick”“m”35
“Bob”“m”42
“John”“m”19
“Mary”“f”33

 

  • EACH Person WHERE (Person.age < 18) = FALSE
  • EACH Person WHERE (Person.age > 18) = TRUE
  • EACH Person WHERE (Person.age < 20) = FALSE
  • EACH Person WHERE (Person.gender = “m” OR Person.age > 35) = FALSE
  • EACH Person WHERE (Person.gender = “m” OR Person.age > 20) = TRUE

...