Réserver une Démo

SVP notez : Cette page d’aide n’est pas pour la dernière version d’Enterprise Architect. La dernière aide peut être trouvée ici.

Pré. Proc.

Set Joining

and

and(left: set, right: set)

An 'and' join will return a set containing all nodes that exist in both the left and right set. This join is comparable to a bitwise AND operation. In set theory, this type of join is called an 'intersection'.

     {1, 2, 3} intersected with {2, 3, 4} results in {2, 3}

This example returns a set that contains all nodes that have a single attribute with the name of "TYPE" and the value of "int".

     and(

     find("int"),

     with("TYPE")

     )

union

union(left: set, right: set [, right: set])

'Union' joins return a set that includes all nodes found in either the left or the right set. This join is used to combine the results of two or more sub-queries into a single set. A 'union' join is similar to a logical OR operation. In set theory, the 'union' join is known as a union.

The 'union' join is able to operate on more than two sets. The result is a set that contains all nodes from all supplied sets. The 'union' join is the only join able to operate on more than two sets.

The result of a 'union' join is always a discrete set, unless one of the source sets contained duplicates. This means that duplicates in source sets will be preserved, but the 'union' join itself will not generate duplicates.

     {1, 2, 3} unioned with {2, 3, 4} results in {1, 2, 3, 4}

This sample creates a set containing all nodes with an attribute named “TYPE” or a single attribute with the value of “int”.

     union(

     find("int"),

     with("TYPE")

     )

except

except(left: set, right: set)

'except' joins return sets that contain any nodes from either set that do not appear in both sets. This join is similar to a bitwise XOR operation. In set theory, this type of join is referred to as a 'symmetric difference' join.

     {1, 2, 3} excepted with {2, 3, 4} results in {1, 4}

For more information on the 'symmetric difference' join in set theory, see https://en.wikipedia.org/wiki/Symmetric_difference

This sample returns a set of all nodes with an attribute named "TYPE" but no single attribute with the value of "int", plus all nodes with an attribute with the value of "int" that are not named "TYPE".

    except(

     find("int"),

     with("TYPE")

    )

exclude

exclude(left: set, right: set)

'exclude' joins return a set that contains all nodes from the left set that do not appear in the right set.  In set theory, this type of join is referred to as a relative complement join.

     {1, 2, 3} complemented with {2, 3, 4} results in {1}

This sample returns a set of all nodes with a value of “int” that are not “TYPE” nodes:

     Exclude(

     find(“int”),

     with(“TYPE”)

     )

andat

andat(count: number, left: set, right: set)

andat(value: string, left: set, right: set)

andat(count: number, value: string, left: set, right: set)

The andat function performs both a non-destructive tree traversal and an intersect join in one operation. Each node in the left set is traversed according to parameters provided, then the result of the traversal is intersected with the right set.  If the intersect passes, the original node is added to the result set.  If the intersect fails, the node is excluded from the result set.

The traversal parameters for andat are the same as for 'ancestor' and 'filter'.  For more information about the traversal parameters, see the 'ancestor' function described in the Set Traversal Help topic.

This sample takes all “NAME” nodes, traverses them up one parent, and intersects them with a set of all “CLASS” nodes.  If a “NAME” node passes both the traversal and intersect join, it is added to the result set. The result is a set of all “NAME” nodes whose immediate parent is a “CLASS” node.

andat(1,

type(“NAME”),

type(“CLASS”)

)

Learn More