You can define queries using the constraint language on the Full tab. The constraint language is a robust language geared towards the definition of constraints and queries and, as such, should be powerful enough to handle the most complex desired queries. For example, if a query is to traverse one or more relationships as part of the criteria, the only way (with a few exceptions) to define that query is using the Full query.
Query for Existence Using the Constraint Language
The following examples explains how to query for the existence of a relationship to a specific object is covered.
The ANY operator along with the specified equivalent comparator and value should be used to query for the existence of a particular related object across a to-many relationship edge. For example, to query for class definitions that realize both IPipingComponent and IInlineComponent, the criteria in the image below should be specified.
Query for Non-Existence Using the Constraint Language
Querying for non-existent objects or relationships between objects is done using either the Count() function or the ALL operator in conjunction with a negative test depending on whether the query is for the non-existence of a relationship or the non-existence of a relationship to a specific object.
If the query is to locate objects that are missing a specific relationship, then do the following:
-
Select the Count function from the Functions list in the Constraints and Functions tree.
-
Select the specific relationship edge from the Edge/Property tree and provide a value of zero (0). For example, to find all property types for which there are no property definitions that are scoped by that property type, do the following:
-
Select IPropertyType from the Interface query list.
-
Select Count from the Constraints and Functions tree.
-
Select the Scoped Property Definitions from the Edge/Property tree.
-
Click = in the Comparator group and provide a value of zero (0).
-
If the query is to locate objects that are missing a relationship to a specific objec, use the ALL operator in conjunction with a negative comparator. For example, to locate all class definitions that don’t realize IObject, do the following:
-
Select IClassDef from the Interface query list.
-
Select the Name property across the Realized Interface Definitions in the Edge/Property tree, and then click All(?).
-
Click <> in the Comparator group to indicate that all realized relationship definitions should not be IObject.
-
Select IObject as the realized interface definition in the Property Value box.