Query builder
To build your own query, ECCAIRS 2 integrates a visual tool that helps you create the restrictions and combinations you need:
This tool is composed by various buttons and options.
+ GROUP
If you want different sets of rules to be evaulated in groups, you can do it with the 'Add group' button. You can also add groups inside other groups.
All the rules inside a group will be linked with the AND / OR options at the top of each group.
There is a particular limit of the Group creation. Because of the way a query is evaluated, no more groups can be added inside a group selected as 'Entity'. This is further explained in the section below, 'Evaluation of groups'.
Evaluation of groups
One very important thing to understand about ECCAIRS 2 Taxonomies is how Entities and Attributes relate to each other. Each Entity has Attributes that describe it. For example: Occurrence is an Entity and has Attributes like “Headline” and “Local Date”. For some Attributes it is possible to have more than one value, i.e. more than one instance. For example: Occurrence can involve several values (instances) of type “Aviation sector” (Aerodrome, ATM Operational etc.).
An Entity can also have other Entities involved with it. For example: Aircraft is an Entity that is related to certain Occurrence and an Occurrence can involve more than one instances of Aircrafts. In this case, Occurrence is called the “parent” of the Aircraft-entity. These relations naturally exist on several levels so that for example an aircraft can have several instances of Entity type “Engine”. This possibility of multiple instances effects the way queries need to be constructed to provide the desired outcome.
When specifying restrictions in a query, the restrictions can be evaluated across all the entities of a record at once OR can be evaluated to each entity of a record one by one. By default, the restrictions of a query will be evaluated across all the entities of a record at once, with the 'Occurrence' option selected by default.
With the selector 'Occurrence | Entity' you can change that, and the restrictions will be evaluated entity by entity.
There is a limitation in the creation of groups based on the restriction selected here. If a group is restricted to Entity, no more groups can be added inside that "Entity" group.
+ RULE
The most important one is the option that lets you select the attribute, layout, operator and value to be used for each condition. In this case, the condition is called Rule.
Click on the 'Select attribute' button to choose the attribute or metadata you want. A new window will appear. Check the desired option and click on the 'Confirm' button
Then, select the layout, operator and value to do the comparison, if applicable.
The layout you can select will vary based on the attribute data type in the released taxonomy.
The operators that are shown depend on the previously selected layout.
The operators that can be used based on the data type of the attribute and the layout can be found in the table below:
Attribute Datatype | Layout | Operator | |
Alphanumeric | Value (Word) | equal | |
not equal | |||
in | |||
not in | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null | |||
Text | Value | equal | |
not equal | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null | |||
Code | Value | equal | |
not equal | |||
in | |||
not in | |||
is null | |||
is not null | |||
Code and Additional text | Value | equal | |
not equal | |||
in | |||
not in | |||
is null | |||
is not null | |||
Text | equal | ||
not equal | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null | |||
Code or Alternative Text | Value | equal | |
not equal | |||
in | |||
not in | |||
is null | |||
is not null | |||
Text | equal | ||
not equal | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null | |||
Date | Value | equal | |
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
is null | |||
is not null | |||
Day of the month (1-31) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Day of the week (1-7) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Month (1-12) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Year (YYYY) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Time | Value | equal | |
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
is null | |||
is not null | |||
DateTime | Value | equal | |
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
is null | |||
is not null | |||
Day of the month (1-31) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Day of the week (1-7) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Month (1-12) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Year (YYYY) | equal | ||
not equal | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
Decimal | Value | equal | |
not equal | |||
in | |||
not in | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
is null | |||
is not null | |||
Number | Value | equal | |
not equal | |||
in | |||
not in | |||
less | |||
less or equal | |||
greater | |||
greater or equal | |||
between | |||
not between | |||
is null | |||
is not null | |||
Eccairs Resource Locator | Description | equal | |
not equal | |||
in | |||
not in | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null | |||
File Name | equal | ||
not equal | |||
in | |||
not in | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null | |||
Eccairs Embedded Data | Eccairs Number | equal | |
not equal | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null | |||
Eccairs Data Link | Eccairs Number | equal | |
not equal | |||
begins with | |||
not begins with | |||
contains | |||
not contains | |||
ends_with | |||
not ends with | |||
is null | |||
is not null |
This is a description of the available operators in the QueryBuilder and upper or lower limits applied to them:
Operator |
Restrictions |
Explanation |
---|---|---|
Equal |
Only one value can be selected or written |
The value being searched has to be exactly the same as the value written or selected when creating the query |
Not equal |
Only one value can be selected or written |
The opposite of Equal. When searching, all the values that are not exactly the same as the one written or selected when creating the query are retrieved |
In |
One or more values can be written or selected |
The value being searched has to be exactly the same as one of the values written or selected when creating the query. When writing the values, they must be separated with a “;” |
Not in |
One or more values can be written or selected |
The opposite of In. When searching, all the values that are not exactly the same as the ones written or selected when creating the query are retrieved When writing the values, they must be separated with a “;” |
Less |
|
The value being searched has to be less (and not equal) than the value written or selected when creating the query. |
Less or equal |
|
The value being searched has to be less and also can be equal than the value written or selected when creating the query. |
Greater |
|
The opposite of Less. The value being searched has to be bigger (and not equal) than the value written or selected when creating the query. |
Greater or equal |
|
The opposite of Less or equal. The value being searched has to be bigger and also can be equal than the value written or selected when creating the query. |
Between |
Two values have to be selected |
The value being searched has to be in the range established by the selection of the two values selected when creating the query. The two values that form the ‘between’ will also be included in the search results. |
Not between |
Two values have to be selected |
The opposite of Between. The value being searched can’t be in the range established by the selection of the two values selected when creating the query. The two values that form the ‘between’ will be excluded from the search results. |
Begins with |
Only for Text, Code and additional text and Code or alternative text. For Code and additional text and Code or alternative text, it will only be available on the Text layout |
The text field being searched must begin with the string being written when creating the query. It is case sensitive. |
Not begins with |
Only for Text, Code and additional text and Code or alternative text. For Code and additional text and Code or alternative text, it will only be available on the Text layout |
The opposite of Begins with. The text field being searched must not begin with the string being written when creating the query. It is case sensitive. |
Contains |
Only for Text, Code and additional text and Code or alternative text. For Code and additional text and Code or alternative text, it will only be available on the Text layout |
The text being written when creating the query has to be within the text the search is being conducted on. This text can also be at the beginning or at the end. It is case sensitive. |
Not contains |
Only for Text, Code and additional text and Code or alternative text. For Code and additional text and Code or alternative text, it will only be available on the Text layout |
The opposite of Contains. The text field of the attribute can’t have any text that matches what is written when creating the query It is case sensitive. |
Ends with |
Only for Text, Code and additional text and Code or alternative text. For Code and additional text and Code or alternative text, it will only be available on the Text layout |
The text field being searched must end with the string being written when creating the query. It is case sensitive. |
Not ends with |
Only for Text, Code and additional text and Code or alternative text. For Code and additional text and Code or alternative text, it will only be available on the Text layout |
The opposite of Ends with. The text field being searched must not end with the string being written when creating the query. It is case sensitive. |
Is null |
Available for all attributes Not necessary to write anything when selecting this operator |
The attribute is not present in the occurrence |
Is not null |
Available for all attributes Not necessary to write anything when selecting this operator |
The attribute exists in the occurrence |
You can add as many rules as you need. Each rule will be inside the group you selected by clicking on the 'Add rule' button.
Ask later
There is no need to write a value for a given attribute when creating a query. There is an option to leave the value field blank and this value will be asked again when trying to execute the query or when using this query in a Batch operation.
If you write a value when creating a query and at the same time select the 'Ask later' option, the value written will not be saved. When executing the query, this value will also be asked and the value you wrote when creating the query will not be taken into account.
Find more information about how to execute a query with 'Ask later' in Data management > Queries > Query execution and in Data management > Batch operations > Batch creation
Metadata
Apart from attributes fron the taxonomy, there is an option to create queries based on the Reports and Safety Recommendations metadata.
As these fields are not defined in the taxonomy and can be a bit more abstract, here are the data types
