Creating Complex Queries

Creating a complex query is a multi-step process, though isn't difficult once the general concept is understood. Basically, there are four stages that one can go through in creating a complex query: Formulating the idea, entering it in, viewing the results, and revising the query (if necessary).

Formulate an idea

More accurately, this step should probably be called "Translating an idea into terminology that maps onto the Biozon data representation." This is the step where an idea is formulated into concrete terms that can be entered in a search form. There are essentially two dimensions to this task. The first is deciding which objects are to be part of the query. This includes deciding what object is the focus of the query (i.e. the object that you are searching for) and deciding how objects in the query will relate to other objects. A representation of the various objects in Biozon can be found here. A line in the graph means that the objects are related somehow.

The second dimension is deciding what values certain attributes of the relevant objects should be, which serve as constraints when doing a search. For example, one may want a Structure to have a resolution less than two angstroms, or maybe a protein that is defined as being kinase-like, or an enzyme family that has an EC number of 1.2.3.4. Descriptions of searchable attributes are listed in each object's search form .

Further discussion on query formulation can be found in our section on Formulating a query in detail.

Enter in the query

There are two distinct "modes of operation" when entering a query, which translate directly to the two dimensions of formulating a query: selecting objects to be part of the query and imposing values on these objects' attributes. Indeed, the first step of entering in a query is selecting an object to search for, since complex searches are oriented towards a single return type. Selecting that object will immediately bring forth a form showing all of its searchable attributes, into which one is expected to enter any constraints on that particular object.

From that point, one is presented with a choice to continue the query, run it, save it (currently saving is turned off), or reset the form. Selecting the Continue option gives the ability to add new objects to the search.

Adding objects to search

Adding an object to a search involves selecting an object already existing in a search and selecting a new object that is to be related to it. selecting an object
to be related to another At the top of the page will be a short summary of the query as it exists so far. There is a radio button listed next to each object that is part of the current query. Selecting its radio button will indicate that this object is to be related to whatever object is added to the query next. The color of the selected row should change to a salmon color indicating that it has been selected. Sometimes, especially in older browsers, the color might not automatically change. That should not affect the success of the operation.

selecting an object On the lower part of the page will be a grid showing all existing objects. Selecting from this grid adds the object to the query, and that object is to be related to the one selected above. Here, the number of objects you may chose is limited. You may only select objects that are directly related to the above selected object. The edges of the graph indicate how the objects are connected, and the object selected above should appear to have a salmon color in the graph (assuming that javascript is working properly). Selecting a non-related object will result in an error page. In the future we will allow selection of indirectly related objects

Finishing the query

The process of building a query continues in this fashion until the query is run. It can be run by hitting the "run query" button at the bottom of a search form or by selecting the "run query" link in the query summary. Selecting the link in the query summary will run only query steps that have been previously completed. Underneath the link it displays which steps will be run to alleviate any ambiguity. Whenever an object's search form is displayed on screen, use the controls at the bottom of the screen, otherwise the current object and form values will be omitted. The controls present in the query summary only apply to its contents.

View the results

After running the query, a result set will show the results of the query and allow navigation to their profile pages. At this stage, poring through the results should hopefully yield the information desired from the query. If not, we provide a way to revise the query.

Revising the query

At any point in creating a query or viewing its results, elements of the query may be revised or deleted. On the left side of the query status indicator there are links labeled "revise" and "delete". revising
a query These controls are located on each row of the query status indicator, and apply to that object only. "revise" will cause that object's search form to be displayed, with all previously-entered values displayed. Once that form has been revised, those changes must be registered either by selecting "run query" or "continue". Selecting the "delete"option will cause that object, and everything that depended on it, to be removed from the query. Imagining the query as a tree, removing an object that is not a leaf node will cause all leaves underneath it do be deleted.

Notice that "add object" is not a revision option displayed on the query status indicator. Adding objects happens in the query building process. If a query has already run and adding new objects to the query is desired, then the way to do so is by entering query building mode. In order to do that, select 'revise' for some object to bring up a query form, then immediately select 'continue', which will keep that object unchanged and will present the menu for adding objects to the query. The process from that point is unchanged

Also see