You are viewing the documentation for Blueriq 14. Documentation for other versions is available in our documentation directory.
INTERSECTION
Determines the intersection of two collections. It returns a collection containing the items that are present in both specified collections.
Syntax
INTERSECTION ( collection1 , collection2 )
Inputs
- collection1, collection2 - Collections to be intersected. These collections must be of the same base type.
Return type
- collection
Venn diagram
Examples
Suppose the following model. Entity Teacher
has a multivalued relation with entity Child
via the relation Teacher.teaches_Children
.
Teacher instance | Child instance | Child.name | Child.hobbies |
---|---|---|---|
Teacher_1 | Child_1 | “Kim” | “Reading”, “Dancing” |
Teacher_1 | Child_2 | “Rick” | “Tennis”, “Dancing” |
Teacher_1 | Child_3 | “Bob” | “Painting”, “Basketball”, “Reading” |
Teacher_2 | Child_1 | “Kim” | “Reading”, “Dancing” |
Teacher_2 | Child_3 | “Bob” | “Painting”, “Basketball”, “Reading” |
Teacher_2 | Child_4 | “Mary” | “Football” |
Expression | Result | Type |
---|---|---|
INTERSECTION ( Teacher[Teacher_1].teaches_Children , Teacher[Teacher_2].teaches_Children ) | [ Child_1 , Child_3 ] | Collection of Child instances |
INTERSECTION ( Teacher[Teacher_1].teaches_Children.name , Teacher[Teacher_2].teaches_Children.name ) | [ "Kim" , "Bob" ] | String (multivalued) |
INTERSECTION ( Child[Child_1].hobbies , Child[Child_3].hobbies ) | [ "Reading" ] | String (multivalued) |
INTERSECTION ( Child[Child_2].hobbies , Child[Child_3].hobbies ) | [ ] | String (multivalued) |
INTERSECTION( ?, [ 1, 2 ] ) | UNKNOWN | Integer (multivalued) |
Overview
Content Tools