Page History
Anchor | ||||
---|---|---|---|---|
|
Table of Contents | ||
---|---|---|
|
Panel | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||
EXISTSThis function determines whether an instance of a specified entity exists, optionally meeting certain criteria. Syntax
Return type
Examples Suppose the following data model.
|
Panel | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
EACHThis function determines whether all instances of a specified entity meet a certain criteria Syntax
Return type
Examples Suppose the following data model.
|
Panel | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
ALLUse this function to create a collection of all instances of a specified entity. Syntax
Return type
Examples Suppose the following data model. The
|
Panel | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||
COLLECT FROM [WHERE]Use this function to create a collection of entity or attribute instances (meeting certain criteria). Syntax
Return type
Examples Suppose the following model. Entity
|
Panel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
COLLECT FROM NAMED [WHERE]Use this version of the COLLECT FROM [WHERE] function for complex nested selections in which it is necessary to use an alias. Syntax
Return type
Examples Suppose the following model with only instances of entity
To retrieve all the parent names, we use this expression:
This expression results in “Rick”, “Julia” and “Joan”. To retrieve all children names, we use this expression:
This expression results in a collection of three instances of To retrieve all children younger than 15, we use this expression:
This expression results in a collection of two instances of To retrieve the children’s names with a parent older than 40 years:
This expression results in a collection with only the name “Kim”. You can make it as complex as you like, for example:
This expression results also in a collection with only the name “Kim”.
|
Panel | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
UNPACKUse this function to extract the value from a single valued collection or list. Syntax
Return type
Examples Suppose the following data model.
|
Panel | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||
SIZEThis function determines the size of a collection. Syntax
Return type
Example Suppose you have a
Then:
|
Panel | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
UNIQUEThe Syntax
Examples Suppose the following model.
|
Panel | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||
SUBSET OFThis function returns Syntax
Return type
Examples
|
Panel | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||
UNIONAdds two collections of the same base type to a new collection. Syntax
Return type
Examples Suppose you have a
|
Panel | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||
INTERSECTIONThis function determines the intersection of two collections. It returns a collection containing the items that are present in both specified collections. Syntax
Return type
Examples Suppose the following model. Entity
|
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
DIFFERENCEThis function returns a collection containing all the items from collection1 that are not present in collection 2. Syntax
Return type
Examples
|
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
SYMMETRIC DIFFERENCEThis function determines the symmetric difference between two collections. It returns a collection with the elements of the provided collections which are in either one of the collections, but not in both. Syntax
Return type
Examples
|
Panel | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
A note on collections and duplicatesAn expression resulting in a collection does not contain duplicates. Please be aware however, that intermediary results of a This is best illustrated with the following examples.
Now an example with the UNPACK function. We leave out the first instance from the previous example.
|