close
previous The Query Builder Interface     (2/9) next
Tutorial 2: Using the QueryBuilder and building a template query. Altering the results output of a template

The QueryBuilder interface enables you to browse through classes and fields of the data model, selecting those that you wish to constrain and those that you wish to include in your results. We will begin the tutorial with an overview of the QueryBuilder interface:

Building a query involves three main steps:

  • Browsing the model browser to find the classes of data you wish to query.

  • Applying constraints to this data to define the subset of that type of data required

  • Defining your results table by selecting the fields you want to include.

  • The main FlyMine QueryBuilder page is composed of several sections:

    [querybuilder_overview.png]
    • The model browser (top left) allows you to browse through the FlyMine data model. This displays an initial starting class and its fields with classes containing related information listed below. Each class can be expanded to show the fields for that class and in turn, any classes related to that class. For example, if the starting class is 'Gene', the fields shown will include 'name', 'identifier' and 'symbol' and the classes of related information include 'Proteins', 'Transcripts' and 'Microarray results'. The model browser thus allows you to browse through the types of data that are available and select those that you wish to query. For each field within the model browser there is a 'SHOW' and a 'CONSTRAIN' option. These are used to either select a field to show in the results output or to constrain in the constraints list (see below).

    • [querybuilder_modelbrowser.png ]
    • The constraint editor (right) allows you to specify the constraints you wish to apply to particular classes and fields. A constraint is like a filter - you filter out a subset of the objects in a class which have certain characteristics (defined by the constraint). To apply a constraint to a field, navigate to the field in the model browser and click on the 'constrain' button next to it. This will bring up a box in the constraint editor allowing you to specify your constraint. You can change the relationship (and, or, grouping) between the different constraints using the 'constraint logic'. A summary of the constraints that have been added is shown in the query summary (top right).

    • [querybuilder_constrain.png]
    • The output fields list (bottom) displays the fields you have selected to show in your results. (Each field is represented by a box which will become a column in the results table. Initially, the output fields list will say 'No fields selected for output'. To select a field to show in the results output you press 'SHOW' next to the field. (Alternatively selecting 'SUMMARY' next to the class name will add the main fields for that class to your results output). The order of fields in the output fields list can be changed by dragging and dropping them. Fields can be deleted from the output fields list using the 'x'. Fields that have been selected for output will appear in a blue box in the model browser and constraint list. By default results will be sorted alphabetically, in ascending order, based on the first column. The column to sort on can be changed by clicking on the 'sort' box under the column name - note this changes the name of the column displayed under 'Sort Results By Column' . The direction of sorting (ascending/descending) can be changed by clicking on the box under the field name in this section.

    [querybuilder_resultsoutput.png]
previous 2/9 next
Tutorial 2: Using the QueryBuilder and building a template query. Altering the results output of a template