Extended Query

Extended query - introduction

With this form you can search description data from the database that match specific conditions of the description data, description scopes and descriptor values. Choose Query → Extended query … from the menu to open the extended query window (see image below). With the button  you can set the timeout for critical database queries, with button you can set the timeout for the web access to resource data. Feedbacks can be sent with the button .

 

First the Project must be selected from the combo box in the upper window area. If you want to include matches that are assigned to the selected project only in the additionalprojects field, check the Additional projects option. The Matches: field shows the number of available description datasets. If any matches are available, the Show matches button is active and by clicking it the datasets are listed in the Result list section (see image below).

 

If you want to view a single entry of the result list, you may select it by a single click on the entry and press the View in separate window button. You may check all entries by clicking the all button, uncheck all entries by clicking the none button or toggle the check marks by clicking the swap button. You may export the checked results to a tab-separated text file by clicking the button and view the exported list by clicking . When you close the window by a click on the OK button, the checked entries are passed to the parent form, e.g. the main window of Diversity Descriptions (see below). If you do not want to take over the query results to the parent form, close the extended query by pressing the Cancel button.

 

Continue with:

Jan 14, 2025

Subsections of Extended Query

Extended Query Parameter

Extended query parameter

As you have seen in the introduction the basic filter in the extended query are the selected Project and Additional projects. You may introduce additional query restrictions for description data, description scopes and descriptor conditions, which are shown in the Query parameter area. By clicking on button Add description, Add scope or Add descriptor in the Query parameter tool strip a query parameter control is inserted at the end of the query parameter list. When you enter query parameter, the field Matches: will be updated immediatly. To see the Result list, you will have to click on button Show matches (see picture below). 

If you have entered several parameter controls, you might wish to de-activate one of them temporarily, e.g. to check its effect on the result list. Remove the check mark in the beginning of the first line of the query parameter (see item 1 in image below) and the whole condition will be ignored. Below this check box you find by default the symbol (see item 2 in image below), which means “logical AND”. If you specify several query parameter controls, which are all adjusted to , a matching description must fulfill all entered query conditions simultaneously.

You may click on the symbol to change it to (see item 3 in image below), which means “logical OR”. In this case the result list will include all descriptions that fulfill the first descriptor condition and additionally all descriptions, which fulfill the second condition. I.e. each “AND” condition will reduce the list of matching descriptions and each “OR” condition will add its matching descriptions to the result list.  

By clicking on a parameter control it is selected as the active control (see above). The active parameter control is shown with light blue background. The resulting SQL query may be viewed with button . You can delete the current query control by clicking on button Remove or all query controls by clicking on button in the Query parameter tool strip.

 

Continue with:

Jan 14, 2025

Subsections of Extended Query Parameter

Extended Query Description

Extended query parameter - Description conditions

Press button Add description in the Query parameter tool strip to insert a new query parameter condition to search for specific values in the description data. A control representing a single description data filter will be added at the end of the query parameter list. You may enter filter criteria for the description ID, Title text, Details text and AID text (alternate id). To enable a certain item, select the check box before the parameter text (picture below). For the numeric parameter ID you may enter a number and select the comparer by clicking the  button . Available comparers are = (equal), (not equal), < (less), > (greater), (less or equal) and (greater or equal).   

 

For the text parameters (title, details and AID) you may enter a search text and select one the matching options Contains, Starts with, Ends with or Exact match. Capitalization is not taken into account. For option Contains the database text must contain the search text. The options Starts with and Ends with only check the database text begin rsp. end for a match. Finally option Exact match requires identical texts. For option Exact match you may enter an empty text, which will match if in the database an empty text or a NULL value (if a NULL value is allowed) is present. For the other matching options an empty search text does not make sense because it will allways match. By checking the Invert option you may invert the search criteria. E.g. the option Exact match with empty search text and Invert will search for “text present” (“not empty string”). You may use the wildcards _, [] and [^] in your search text, but not %. % is automatically inserted in the correct places by selecting the matching option.

If you entered more than one condition as shown in the image above (ID and Title text), the default adjustment is that all conditions must match. This is indicated by the symbol behind the text Description data in the header line, which means “logical AND”. If you want to get a match for any of the entered conditions, you may click on the symbol to change it to “logical OR” (see image below). 

The next example shows how two description conditions are used to exclude a certain number range of the ID from the result list. The first condition restricts the result list to all IDs smaller than 343. The second condition adds all results with IDs larger than 426, which is achieved by a logical OR of the condition operator (). In this example it does not matter which one of the two conditions is marked as “AND” rsp. “OR”. If both conditions would be marked as “OR”, there would not be any restriction left except the project.  

 

Continue with:

Jan 14, 2025

Extended Query Descriptor

Extended query parameter - Descriptor conditions

Press button Add descriptor in the Query parameter tool strip to insert a new query condition for the search of specific values in the description summary data. A control representing a single descriptor filter will be added at the end of the query parameter list. Now you have to select the descriptor that shall be included in the search filter. This can be done by selecting the descriptor’s sequence number with combo box No.:, from an alphabetical descriptor list with combo box Descriptor: or by selecting from the descriptor tree with button (see picture below). 

 

After selecting the descriptor the query control shows query parameters depending on the descriptor type (see below). You may search for descriptions that do not have any data for the selected descriptor by checking option absent. The currently marked parameter control is shown with light blue background. You can delete the current query control by clicking on button Remove or all query controls by clicking on button in the Query parameter tool strip.

In the parameter control the descriptor type is indicated by symbols in the beginning of the first line ( categorical, quantitive, text or sequence). If additional information for the descriptor are available in the database, you can show them as bubble help by moving the mouse cursor over the symbol. If resource data are available for a descriptor, the symbol is displayed with coloured background and you can view them by double-clicking it (see image below).

   

Each parameter control has two main sections:

  • At the left you find the section for the descriptor parameter, depending on its type (Categorical states, Statistical measures, Descriptive text or Molecular sequence). If this section is checked and no other data have been entered, the query filters for all descriptions that include any value for that descriptor, e.g. any descriptive text or any categorical state. You may search for descriptions without descriptor data by checking option no value. By entering additional query data, the filter becomes more restrictive.  
  • At the right you find the section for the descriptor Status data. If this section is checked and no status value has been selected, the query filters for all descriptions that include any status data value for that descriptor. At the end of the Status data check box by default the symbol indicates that all selected data status values must be present in the matching descriptions. By checking dedicated status data values, the filter becomes more restrictive (logical AND). If you click on the symbol you can change it to (logical OR) to find matches for any of the selected status data values.  

If both sections are selected, matching descriptors must fulfill both conditions, i.e. the value must be present and the status data value must be set.

 

Notes

In the descriptive data you may enter free text notes to all text and sequence data. Furthermore individual notes may be entered for every selected categorical state and statistical measure. You may include additional query contitions for each of those notes, therefore the symbol is included at the appropriate places. To enter a query condition, click the button and a window as shown below will be opened.

You may enter a Search text that shall be part of the notes text. Capitalization is not taken into account. For option Contains the notes text must contain the search text. The options Starts with and Ends with only check the descriptor text begin rsp. end for a match. Finally option Exact match requires identical texts. Check the option Invert to invert the search criteria. You may use the wildcards _, [] and [^] in your search text, but not %. % is automatically inserted in the correct places by selecting the matching option.When you click OK the additional query condition will be active and the icon background changes to red (). If you want to remove the query condition, open the notes form, uncheck the Enable notes filter option and click OK.

For text and molecular sequence data exactly one note is possible for each descriptor value, therefore you find exactly one symbol for entering a query condition. For categorical and quantitative data you may enter a note for each single state rsp. statistical measure. Here you may search for notes of the specific state rsp. measure by clicking on the symbol located at the element. Additionally you may search for notes entered at any state or measure of the descriptor. Therefore an additional symbol is located in the header section besides the no value check box (see image above). 

 

Modifier and frequency

In categorical and quantitative descriptive data you may select modifier values for every selected categorical state and statistical measure. For categorical data additionally a frequency value may be selected. You may include additional query contitions for each of those modifier and frequency values, therefore the symbols (modifier) and (frequency) are included at the appropriate places. To enter a query condition, click the button and a window as shown below will be opened.

You may select the modifier rsp. frequency values for filtering from the recommended values of the current descriptor. Check the option Invert to invert the search criteria. A hint text explaining the resulting filter will be displayed in the lower area of the window. When you click OK the additional query condition will be active and the icon background changes to red (, ). If you want to remove the query condition, open the form, uncheck the Enable filter option and click OK.

 

Continue with:

Jan 14, 2025

Subsections of Extended Query Descriptor

Extended Query Categorical

Extended query parameter - Categorical states

In this query control the categorical states are listed. If pictures or colours are assigned to the categorical states, they can be viewed by clicking on the state name (see picture below). You may switch off automatic loading of the resource view by clicking the button (“no web”), which will be indicated by a yellow symbol background. If this “no web” option is activated, only local resources, e.g. colours, will be shown. If during loading of remote resources an error occurs, e.g. due to a timeout, the “no web” option will automatically be activated. 

You may change the display order of the states between the standard numeric order , alphabetical order and reverse alphabetical order by clicking the appropriate button. If the state list exceeds the standard height of the control, a scroll bar will show at the right side of the state list. You can enlarge the control by clicking the button at the lower left side (see picture above). To return to the standard size, click on button  (see picture below).

Categorical states that are not checked are not relevant for the filter. If you want to search for a categorical state that is NOT present, check the option invert behind the categorical state name (see picture below). You may search for descriptions that do not have selected any of the categorical states by checking option no value.

By default all categorical states of a descriptor that are selected must be present in the matching descriptions. You may change this logical AND to a logical OR by clicking on the symbol behind the no value check box, which will change to symbol (see picture below). Now all descriptions will match, which include one of the selected states. 

 

Continue with:

Jan 14, 2025

Extended Query Quantitative

Extended query parameter - Statistical measures

In this query control the recommended statistical measures are listed. You may enter a single value for an exact match in the from: field or a value range in from: and to: (see picture below). If you enter no numeric values (or only a value in to:), a search for value presence will be performed. Remark: If you modify a value in a from: or to: field, you must leave the field to update the Matches: count. If you want to exclude the specified value range from the query, check the invert option. If you do not enter a value, the statistical measure is checked for presence.

If the statistical measure list exceeds the standard height of the control, a scroll bar will show at the right side of the statistical measure list. You can enlarge the control by clicking the button at the lower left side (see picture above). To return to the standard size, click on button  (see picture below).

Statistical measures that are not checked are not relevant for the filter. If you want to search for a statistical measure that is NOT present, check the option invert and do not enter any values (see picture below). You may search for descriptions that do not have specified any statsistical measure by checking option no value.

By default all statistical measure conditions of a descriptor that are selected must be fulfilled in the matching descriptions. You may change this logical AND to a logical OR by clicking on the symbol behind the no value check box, which will change to symbol (see picture below). Now all descriptions will match, which include one of the selected measure conditions. 

 

Continue with:

Jan 14, 2025

Extended Query Sequence

Extended query parameter - Molecular sequence

In this query control you may enter a Sequence that shall be part of the molecular sequence data. Capitalization is not taken into account. For option Contains the sequence text must contain the search string (see image below). The options Starts with and Ends with only check the descriptor text begin rsp. end for a match. Finally option Exact match requires identical texts. You may use the wildcards _, [] and [^] in your sequence text, but not %. % is automatically inserted in the correct places by selecting the matching option.

Check the option Invert to invert the search criteria (see picture below), i.e. there is a match if the molecular sequence does NOT contain, start or end with the specified Sequence. The query condition Invert with Exact match and empty Sequence is the query for molecular sequence present. A molecual sequence can only be absent if notes are present, because otherwise the descriptor had no value. You may search for descriptions that do not have specified any descriptor data by checking option no value

 

Continue with:

Jan 14, 2025

Extended Query Text

Extended query parameter - Descriptive text

In this query control you may enter a Search text that shall be part of the text descriptor data. Capitalization is not taken into account. For option Contains the descriptor text must contain the search string (see image below). The options Starts with and Ends with only check the descriptor text begin rsp. end for a match. Finally option Exact match requires identical texts. You may use the wildcards _, [] and [^] in your search text, but not %. % is automatically inserted in the correct places by selecting the matching option.

Check the option Invert to invert the search criteria (see picture below), i.e. there is a match if the descriptive text does NOT contain, start or end with the specified Search text. The query condition Invert with Exact match and empty Search text is the query for descriptive text present. A descriptive text can only be absent if notes are present, because otherwise the descriptor had no value. You may search for descriptions that do not have specified any descriptor data by checking option no value.   

 

Continue with:

Jan 14, 2025

Extended Query Scope

Extended query parameter - Scope conditions

Press button Add scope in the Query parameter tool strip to insert a new query parameter condition to search for specific description scope data. A control representing a single description scope filter will be added at the end of the query parameter list. Now you have to select the Scope type that shall be included in the search filter. You have the choice between the general scope types ( Geographic area, Sampling plot, Reference, Observation, Specimen and Taxon name) and the project specific scope types (Other scope, Sex, Stage and Part). The project specific scope types are only shown if values have been entered in the database (see Editing the project). 

 

General scopes

After selecting the scope type a query control as shown in the image below is available. You may search for descriptions that do not have any scope of the selected type by checking option no value. Otherwise the two text search fields Scope text and Scope URI are available, which can be activated by checking the box before the text. 

 

You may enter a search text and select one the matching options Contains, Starts with, Ends with or Exact match. Capitalization is not taken into account. For option Contains the database text must contain the search text. The options Starts with and Ends with only check the database text begin rsp. end for a match. Finally option Exact match requires identical texts. For option Exact match you may enter an empty text, which will match if in the database an empty text or a NULL value (if a NULL value is allowed) is present. For the other matching options an empty search text does not make sense because it will allways match. By checking the Invert option you may invert the search criteria. E.g. the option Exact match with empty search text and Invert will search for “text present” (“not empty string”). 

With the query option Module filter you may build a item list from a linked database using a remore query. You may search for scopes that match one of the entries (operator ) or do not link any of the entries (operator ). You may select the operator by clicking the drop down button . To build the list click on the button to open a window where you can search for values within the linked module. A click on the button will show a list of the selected items, button the related database (see image below).

 

A click on the button switches the filter mode between link search and text search. For some scope types, e.g. Taxon names, additional operations are available (see image below). While for the standard operations all elements of the query result are entered into the item list, they will take the selected value as starting value and add synonym/hierarchy values.

Operator Meaning Example
Search for entries with a list ... Rosa | Rosa caninia | ...
Search for entries not within a list Rosa | Rosa caninia | ...
+H search for entry including lower hierarchy Picea | Picea abies | ...
+S search for entry including synonyms Picea abies | Pinus abies | ...
+HS search for entry including lower hierarchy and synonyms Picea | Picea abies | Pinus abies | ...
Change filter mode between link and text http://tnt.diversityworkbench.de/TaxonNames_Plants/4269
Picea abies L.

If you entered more than one condition, the default adjustment is that all conditions must match. This is indicated by the symbol behind the text Description scopes and the no value check box, which means “logical AND”. If you want to get a match for any of the entered conditions, you may click on the symbol to change it to “logical OR”. 

 

Project scopes

After selecting a project specific scope all available values inserted in the database will be listed (see image below). You may select one ore more of the avalable values. Furthermore you may check the invert option to search for description entries that do not include the specified scope value. 

If you entered more than one condition, the default adjustment is that all conditions must match. This is indicated by the symbol behind the text Description scopes and the no value check box, which means “logical AND”. If you want to get a match for any of the entered conditions, you may click on the symbol to change it to “logical OR” (see image below). 

The project specific scope values must be marked as “recommended” for each project. In the query control you will be shown every value, but the not recommended ones will be listed with an appropriate text shown in the image below. 

 

Continue with:

Jan 14, 2025

Extended Query Save

Save and load extended query

The complete query schema may be saved into an XML file using the button , which opens a dialog window to enter the file name and location. By default the schema file name is generated as:

     <working directory>\ExtendedQuery\DescriptionQuery_<Database name>_<Project>.xml 

The XML schema file includes information concerning the database, the project and the query parameter. By pressing the button in the Query parameter section, a query schema file can be opened. If the schema does not meet the active database you will be informed by a message box. In the query file all relevant parameter are identified by the database internal numeric IDs. If no matching values are found, it is tried to get them by their names. Since the names might be ambigious, the corresponding element are displayed with a yellow background colour (see image below).

 

If the parameter could not even be assigned by their names, this is indicated by a red background color (see picture below).