Query Overview
Queries - overview
With the user defined queries, you can define any query
condition - this is the default query mode.
Depending on the active edit mode you get one of three different query
option panels as shown in the pictures below.

In the lower part you may adjust the Query conditions to
restrict the Query results shown in the upper part of
the panel. In search texts you may enter SQL wildcards
to specify ambigious conditions to match the data. By default only the
most importand query conditions are displayed. To modify the query
settings, refer to the Query options. Finally
section Save query describes how to save and restore
a certain query.
A Description query window is available from the menu
Query →
Description query …, where
you may select and accumulate descriptions in a list. The regular
description query is not capable to select descriptions with specific
descriptor data. Therefore the Extended query is
accessible from the menu Query →
Extended query ….
Subsections of Query Overview
Queries Saved
Save query
If you want to save a current query, click on the
button. A window as shown below will open
where you can specify the title and description of you query.

After you entered title and description of the query, click OK to
specify the query group. A window as shown below will open.

Choose a group from the tree or create a new one an click OK. The new
query will be included in the selected group.

Finally you can edit the titles and descriptions of the groups an
queries. Click the
button to store the changes. To
delete items from the tree, select it and click on the
button. Click OK to save the new query and close
the window.
Load query
If you want to load a query that has been stored previously, click on
the
button. A window as shown below will
open.

Choose a query from the tree and click OK to close the form and filter
the datasets according to the selected query.
Query
Query conditions
Depending on the activated edit mode you get one of the three query
options pannel below. The options for a fast search are displayed in the
main window beneath the list of the items. You can change this
arrangement using the
/
button to place the query options on
the left side of the item list.

To search for an item enter the restrictions in the fields for the
search conditions and click on the
button. The entities found in
the database will be shown in the result list. To add items with
differing search conditions click on the
button. To clear all
entries in the query fields use the
button. If the list of
items is longer than your maximal number of returned items you can
browse the next items with the
button. To move back to
the previous block of items click on the
button.
With button
you can
select all entries in the result list. If you want to remove entries
from the selected list, choose them and click on the
button. If you want to keep
the selected entries in the list and remove the rest, click on the
button. This will not delete
the data from the database, but remove them from your query result. With
the
resp.
buttons you can change the
order of the results between ascending and descending. To hide the area
containing the search fields click on
the
button. If the search
area is hidden and you want to start a new search, just click on
the
button.
To see the command generated by the program to retrieve the data
right-click on the
button to
open the context menu (see below).

A window will open containing the
command used to retrieve the data (see below).

With the button
you may control
auto-remember of the last submitted query parameter. If you re-start the
application and connect to the same database, the last used query will
automatically be submitted. If you prefer to switch off auto-remember,
click the button
and it will
change to
. In the main menu
Query → Preferred project … you may select a project that will
be used as a pre-selection for Description and Descriptor query, if no
other query parameter have been restored.
Within the query options you have several possibilities to specify your
search restriction. Use the drop down button to change between the
operator. The available operators are shown in the table below.
Operator |
Meaning |
Example |
Text |
|
|
∼ |
search for an entry like … |
Pinus s[iy]lvestris % (you can use wildcards) |
= |
search for an entry exactly equal to … |
Pinus silvestris L. |
≠ |
search for an entry not like … |
Pinus s[iy]lvestris % (you can use wildcards) |
∅ |
search for an entry where a value is missing … |
|
• |
search for an entry where a value is present … |
|
- |
search for an entry between … and … |
2000 - 2005 |
| |
search within a list of entries, separated by “|” |
2000 | 2003 | 2005 |
Numeric |
|
|
= |
search for an entry exactly equal to … |
2006 |
< |
search for an entry lower than … |
2006 |
> |
search for an entry bigger than … |
2006 |
- |
search for an entry between … and … |
2000 - 2005 |
| |
search within a list of entries, separated by “|” |
2000 | 2003 | 2005 |
∅ |
search for an entry where a value is missing … |
|
• |
search for an entry where a value is present … |
|
Date |
|
|
= |
search for an entry exactly equal to … |
20.3.2006 |
< |
search for an entry lower than … |
20.3.2006 |
> |
search for an entry bigger than … |
20.3.2006 |
∅ |
search for an entry where the date is missing … |
|
• |
search for an entry where the date is present and complete … |
|
Hierachy |
|
|
= |
search for an entry exactly equal to … |
M-Fungi |
≠ |
search for an entry that is not equal to … |
M-Fungi |
∅ |
search for missing entry … |
|
• |
search for present entry … |
|
Δ |
search including childs in a hierarchy … |
M-Fungi |
XML |
|
|
/ |
Search for entries containing a given XML node |
settings |
¬ |
Search for entries not containing a given XML node |
settings |
∅ |
search for missing entry … |
|
• |
search for present entry … |
|
For yes/no fields you will get an checkbox with 3 options:
= yes,
= no,
= undefined
Query in modules
In the query for scopes linked to another module 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).
Module related restriction |
 |
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. |
Query Options
Query options
The maximal number of items shown in a query result can be set in the
window for the query options. The default value is set to 100. If you
have a fast connection to your database or need to see more
or less results, you may change this value to any number you like.
To change the displayed search fields click on
the
button. This opens a form where you can
select and deselect the fields shown for searching specimens. You might
also change the maximum number of items that will be shown in the result
list.
The limit for the creation of drop down lists is by default set to
0, that means no dropdown lists will be created. If you set the
limit to e.g. 1000 and connect to a database, the programm will create
drop down list based on the entries in the database to ease the entry in
the query. For slow connections you may set this to lower value to speed
up the start of the program. If you set the value to 0 no drop down
lists will be created.
The minimal numbers of characters for a selection from the drop down
list is by default set to 3.

After having edited the query options click OK to store your selection.
The new selection will become active for the next query. To ease the
selection and deselection of query options you may use the buttons
Check all,
Check none,
Expand and
Collapse.
To search for a field within the database, use the search function that
will check the names and descriptions of the fields and mark them as
shown below.

After having edited the query options click OK to store you selection.
The new selection will become active for the next query.
Query Window
Collect descriptions
With menu item Query →
Collect
descriptions … you can open a query window for descriptions as shown
below. This window will also open when you click a description selection
button in several other forms.

Start a query and select the entries you want to take over into the
result list. By clicking the button
Add you
insert the selected entries. With button
Delete all you can clear the result list. By clicking on button
you may open an extended
query window and take over the results in the query
result window.
You may select all entries by clicking the
all button, deselect all entries by clicking the
none button or toggle your selection by
clicking the
swap button. To export the
checked results to a tab-separated text file, click the
button and view the exported list by clicking
. If you want to view a single entry of the result
list, you may select it in the result list and press the
button. When you close the window by a click on
the OK button, the checked entries are passed to the main window of
Diversity Descriptions.
Result list
Result list
The result list displays the descriptions, descriptors or projects found
in a query.



With combobox order by: you may adjust the sorting and presentation
of the query results. For example the descriptors may be displayed with
their sequence number, name or ID on as shown in the images above.
You can restrict the maximal number of results together with the queryoptions (click on the
button), for example if
you have a slow connection to the database. As a default the maximal
number is set to 100. If the number of datasets according to your query
is higher than the maximal value set in the query options this will be
indicated in the header of the list.
To search for items, enter the restrictions in the fields for the search
conditions and click on the
button. The items found in the database will be shown in the result
list. To add items that match differing search conditions click on the
button. If the list of
items is longer than your maximal number of returned items you can
browse the next items with the
button. With button
you can select all
entries in the result list. If you want to remove entries from the
selected list, choose them in the list and click on the
button. If you want to keep
the selected entries in the list and remove the rest, click on the
button. This will not delete
the data from the database, but remove them from your query result.
Wildcards
Wildcards in SQL
There are 4 different possibilities for wildcards in SQL:
% any string consisting of no, one or many characters, e.g.
Pinus % will find anything like Pinus, Pinus sylvestris, Pinus
strobus etc.
* any string consisting of no, one or many characters, e.g.
Pinus * will find anything like Pinus, Pinus sylvestris, Pinus
strobus etc.
_ a single character, e.g. Pinus s**_lvestris will find
Pinus sylvestris and Pinus si**lvestris etc.
[] ** any character out of a given range like [abcde] or
[a-e], e.g. Pinus s[iy]**lvestris will find Pinus sylvestris
and Pinus silvestris.
[^] any character not in a given range like [^abcde] or
[^a-e], e.g. Pinus s**[^i]**lvestris will find Pinus sylvestris
but not Pinus silvestris.