Sun WBEM SDK Developer's Guide

The WBEM Query Language Expression

The following figure shows the WBEM classes that represent the clauses in a WQL expression.

Figure 5–1 WBEM Classes that Represent the WBEM Query Language Expression

Graphic

WBEM Query Lanuage 

WBEM Query Class 

SELECT attribute_expression

SelectList

FROM table_attribute

FromExp

WHERE conditional_expression

QueryExp

WQL has been adapted to query data that is stored using the CIM data model. In the CIM model, information about objects is stored in CIM classes and CIM instances. CIM instances can contain properties, which have a name, data type, and value. WQL maps the CIM object model to SQL tables, as shown in the following table:

SQL 

WQL 

Table 

CIM class 

Row 

CIM instance 

Column 

CIM property 

In CIM, a WQL expression could be expressed in the following form:


SELECT FROM WHERE CIM property CIM class propertyA = 40

A more realistic example of a WQL expression follows:



SELECT * FROM Solaris_FileSystem WHERE (Name="home" OR Name="files") AND AvailableSpace > 2000000