Queries

A query is a path in the data source schema that is attached to a template element. A template specifies the data to be extracted using queries.

The query path starts with the root element (module), continues with its child element (Object), with the object's child attribute, and so on (for example, Module.Object.Attribute.Name).

Although you typically drag and drop schema elements instead of manually writing queries, it is useful to understand the concepts of schema and queries, and how they are constructed.

The following table shows some commonly used queries:
Query Description
module Returns a single result, the source module.
module.object Returns all the objects in the source module, as filtered or sorted by a data source view.
module.object.attribute If used in a module.object context returns all the attributes for the current object. If not used in this context, returns all objects in the source module.
A query is attached to a template element. The template element and its children can use the attributes of the entities returned by the current query as well as the attributes of the queries from parent elements. In the following example, after the query module.object is applied, any of the object's schema element attributes can be used: Absolute Number, Has inlink, Object Text and so on.
Template elements can be nested. Setting queries on elements and their children elements creates nested contexts. The query in the child element is performed on the results of the parent query.
	Element 1: module.object
	Element 1.1 (child of Element 1): module.object.attribute

In Element 1, only the attributes of IBM® Rational® DOORS® objects can be used. In Element 1.1, the attributes of Rational DOORS object attributes can be used (that is, the names of those object attributes). The second query yields a list of attributes for the current object returned by the query of Element 1.


Feedback