Pegasus Enhancement Proposal (PEP)

PEP #: 138

Title: CQL Stage 1

Version: 1.11

Created: 20 February 2004

Authors: Oliver Benke, Chuck Carmack

Status:  Approved, Ballot 75, Nov 2004

 

Version History:

Version

Date

Author

Change Description

1.0

20 February 2004

Oliver Benke 

Initial Submission

1.1 

30 March 2004

 Oliver Benke

Removed execQuery support

Restricted to CMPI providers

Restricted to feature level 1 with more precise definition in DMTF

Different behavior for virtual properties

Changed from OBJECTNAME to OBJECTPATH

some minor changes

Incorporated comments from Pegasus developers

1.2

5 April 2004

Oliver Benke

Refer to POSIX REGEX

Include Pegasus C++ API

Added some comments

Added TODO section

1.3

14 April 2004

Oliver Benke

Removed virtual properties/ path functions

(A)BNF now in the appendix

Added details on CIM_QueryCapabilities

Removed restriction on CMPI providers

Added section on handling of not supported CQL query strings

1.4

18 April 2004

Oliver Benke

- Updated discussion section

- Removed error in ABNF from CQL query spec 0.11 which prevents arithmetic on datetime values; fixes in ABNF are suggested by George Ericsson and they are marked with OB>

- CIM_ERR_INVALID_QUERY as possible error code, instead of CIM_ERR_NOT_SUPPORTED

- don't refer to GNU software, like OpenLDAP did, for legal reasons

1.5

20 April 2004

Chuck Carmack

- Updated the section on IndicationService and QueryExpression class
- More detail on utf-8 support in the query.

1.6

25 May 2004

Oliver Benke

Updates based on DMTF CIM Query Spec version 0.12 (April 30, 2004); discussion needed on what should be the content of this PEP (like query features Time, Array Elements, etc.

1.7

27 May 2004

Oliver Benke

Updates based on DMTF CIM Query Spec version 0.13 (May 26, 2004):

-          Basic Like Regular Expressions are now easy to implement

-          Basic array support (in specific-property-name clause) is part of basic query feature, so should be part of this PEP as well

1.8

7 June 2004

Oliver Benke

added CR1386

various fixes

1.9

28 September 2004

Oliver Benke

Various updates

1.10

19 October 2004

Oliver Benke

Changed to concept PEP

Worked on LIKE

1.11

19 October 2004

Oliver Benke

Updates based on input by Carol Ann Krug Graves and Chuck Carmack (see discussion archive)

 


Abstract: This PEP proposes the implementation of a subset of CQL for indication filter strings (event based monitoring).

 

This PEP is based on DMTF CIM Query Language Specification (DSP0202, aka CQL spec). The latest version of the CQL spec available at the time this was written was Version 1.0.0a from October 15, 2004, currently in company review. It is expected that the CQL spec will be finalized before Pegasus 2.5 release.

 

Please note that ExecQuery or ExecuteQuery support is not part of this PEP.

 

For now, the CQL implementation needs to be experimental, with PEGASUS_USE_EXPERIMENTAL applied.

 

This PEP is not focused on the implementation details but on the requirements to be fulfilled. More implementation details can be found in PEP #193.

Definition of the Problem

This PEP is meant to get Pegasus CQL implementation started (together with subsequent PEP #193) and to outline the requirements and what’s the content of CQL Stage 1 implementation in Pegasus.

 

CQL as implemented in stage 1 in Pegasus (PEP #193) can be used by indication providers in order to parse the CQL indication filter queries much the same way they can use WQL today. However, in the long term, the CQL parser implementation should be useable to also support executeQuery interface and other applications, like filtered associations.

 

The assumption is that CQL and WQL will co-exist for some while. However, WQL was never really standardized, and existing implementations are not interoperable.

There is a certain risk in that the CQL spec is not finalized right now.

 

The following query features have to be implemented with this PEP:

    1. Basic Query (Query Feature 2) as defined in version 0.18.002 of DSP0202 (CIM Query Language Specification, 09/28/2004)
    2. Embedded Properties (Query Feature 8) without support for nested embedded objects

 

For embedded properties, please refer to PEP 158 and subsequent PEPs, as embedded object support is currently missing in Pegasus.

 

In the ABNF in DSP0202, everything which belongs to Basic Query is in bold font.

 

Please note that query feature “Arithmetic Expression” used to be part of “Basic Query”, but this is no longer the case. PEP #193 won’t implement support for arithmetic expressions.

 

Reason for choosing query features Basic Query and Embedded Properties: as a first useful and most easy to support use case for CQL, we have chosen to support indication filtering support. Basic Query is considered to be the minimum needed for most CQL applications, and it has actually been defined with indication filtering support in mind. In order to support life-cycle indications, embedded properties are needed as well.

 

Related PEPs

PEP #193  - CQL stage 1 functional design
PEP #158 - the stage 1 embedded objects support in the Lifecycle Indications concept PEP; the related function PEP is #194.

PEP #172 – base embedded object encoding/ decoding support

PEP #194 - functional PEP for stage 1 embedded objects support for the Lifecycle Indications, based on PEP #158.

PEP #192 – CIMDateTime functional enhancements 

Proposed Solution

Implementation notes

Implementation details are now described in PEP #193.

Provider interface

Both the CMPI provider interface as well as the Pegasus C++ interface have to be supported. Details on the SDK level can be found in the PEP #193 on CQL stage 1 functional design.

IndicationService and QueryExpressionFactory changes

Although PEP #119 is focused on ExecQuery operations and this PEP (#138) does not include CQL support for ExecuteQuery (because of the current state of discussion with regard to CIM_QueryResult), the query language independent framework described in PEP #119 should be extended for CQL.

UTF8 Support

The CQL parser MUST be able to accept input in utf-8 format.  

Not supported CQL query strings

If the query contains any statement which cannot be parsed, which is not part of the implemented subset of CQL, a parse error must be generated according to DSP0202 (CIM Query Language Specification).

CIM_QueryCapabilities

With DMTF Interop-00206, a CIM_QueryCapabilities class is added to the CIM Schema 2.9 preliminary in order to enable applications to find out which features of the CQL language are implemented.

 

The change request looks like this:

// ==================================================================

// QueryCapabilities

// ==================================================================

   [Experimental, Version ("2.8.1000"), Description (

       "This class defines the query capabilities of a CIM_ObjectManager "
       "and/or CIM_Provider, as associated via ElementCapabilities.") ]

class CIM_QueryCapabilities : CIM_Capabilities {

 

     [Description (
          "Enumeration of CQL features supported by an Object "
          "Manager or Provider associated via ElementCapabilities. "),
       ValueMap {"2", "3", "4", "5", "6", "7", "8", "9", "10", "11",
                 "12", "13", “14”, "..", "0x8000.."},
       Values {"Basic Query", "Simple Join", "Complex Join",
          "Subquery", "Result Set Operations", "Extended Select List",
          "Embedded Properties", "Aggregations", "Regular Expression Like",
          "Array Range", "Satisfies Array", "Foreign Namespace Support",
          “Arithmetic Expression”, "DMTF Reserved", "Vendor Reserved"}
       ]
   uint16 CQLFeatures[];

 

};

 

A provider to create a CIM_QueryCapabilities instance like this has to be implemented:

 

instance of CIM_QueryCapabilities  {

            Caption = "CQL Parser Capabilities";
            Description = "This instance contains information on which CQL features are implemented by the CQL implementation in this version of OpenPegasus.";
            InstanceID = "OpenPegasus:CQLParser_QueryCapabilities";
            ElementName = "Implemented CQL Features: Basic Query (2), Embedded Properties (8), ";
            CQLFeatures = { "2",”8" };

 

};

Rationale

CQL query support is essential for CIM indications, and it will be the base for filtered associations in future, which are needed if dealing with a large number of CIM objects as the case for management of enterprise-class server environments. In contrast to WQL, CQL is formally specified, giving it long-term advantages with regard to interoperability.

Schedule

Pegasus 2.5

Discussion
 

 

Discussion Archive

  • Chuck Carmack: there a target date for the standard to finalize? We need to take account of the risk of implementing an unfinished spec.
    OB> I agree this is a problem, but unfortunately there is no DMTF target date afaik. I tried to restrict myself to parts which hopefully stay stable.
  • Carolann Graves: I would be interested in seeing a discussion of proposed public classes and interfaces for CQL level 1.
  • Chuck Carmack: I'm assuming that the new CQL parser would need to available for both C++ and CMPI providers.
    OB> See above, and let's discuss. I only see we are required to do it for CMPI providers, but let's talk.
  • Chuck Carmack: CQL going to replace WQL support in Pegasus? Will it co-exist with WQL and maybe deprecate WQL?
    OB> See above.
  • David Dillard: It would be nice to have the ability to conditionally support both WQL and CQL. So, if I want to support only
    CQL I don't have to take along the baggage of WQL. This might be accomplished by defining server extensions.
  • Dong Xiang:  To support the following query in the SNIA CTP test:


SELECT * FROM CIM_InstModification WHERE SourceInsance ISA
CIM_ConcreteJob AND SourceInstance.OperationalStatus = 17
AND SourceInstance.OperationalStatus = 2.


The corresponding query in CQL (using Basic Query feature) would be:



SELECT * FROM CIM_InstModification WHERE
CIM_InstModification.SourceInstance._CLASSPATH
= 'CIM_ConreteJob' AND NOT
CIM_InstModification.SourceInstance.OperationalStatus[*] = 17 AND NOT
CIM_InstModification.SourceInstance.OperationalStatus[*] = 2

If this PEP will support 'Individual Array Elements' feature, the above query can be improved as:


SELECT * FROM CIM_InstModification WHERE
CIM_InstModification.SourceInstance._CLASSPATH
= 'CIM_ConreteJob' AND
CIM_InstModification.SourceInstance.OperationalStatus[0] =
17 AND CIM_InstModification.SourceInstance.OperationalStatus
[1] = 2


The logic is simpler, so the time to process the second query could be faster.

However, there is still no obvious way to verify the array length. Therefore the
OperationalStatus[*] could be {17,2} or {17,2,6}.

OB> Unfortunately, such a query is beyond the scope of this PEP. We are missing array support and support for embedded objects.


BTW, the 'symbolic constants' sounds like a handy feature. I am wondering if this PEP will support it or not.
OB> I have added it as optional.

  • Chuck Carmack: select-criteria link doesn't work
    OB> I hope I've fixed it.
     
  • Chuck Carmack: I would like some discussion of the internationalization impacts. The WQL parser wasn't updated to support utf-8 in 2.3. This was because the flex/bison code doesn't support utf-8. Is supporting utf-8 in the CQL parser a priority in 2.4, and if so, would this PEP cover that? I see from the BNF that a character is utf-8, so it looks like it must be supported.
  • David Dillard: A nit: Instead of using 'transfer' how about using 'translate?'
    OB> I've removed the sentence in question.
  • David Dillard: POSIX is fine for UNIXs, but what about Windows?
    OB> see update in PEP: implement POSIX subset as specified in DSP0202 Query Specification.

 

  • Chuck Carmack:  If it is to be experimental, then the new APIs will need to be inside of PEGASUS_USE_EXPERIMENTAL. We also need to set a cut-off date for when we will implement the spec in its current state.

 

  • Carolann Graves: Please clarify - does this mean no array property may appear anywhere in the query, or no array property may appear in the WHERE clause, or an array property may appear only in the SELECT clause but must refer to the entire array rather than a subset, or something else?

 

  • Carolann Graves: Please clarify - does this mean no embedded object property may appear anywhere in the query, or an embedded object property may appear only in the SELECT clause, or something else?

 

  • Chuck Carmack: Fortunately, PEP119 has set up a framework for coexistence with WQL. Since this PEP is focusing on  indication filters, we will need to extend that framework into the IndicationService to make it language-agnostic. Also, since indication providers may want to do their own filtering (as mentioned above), we might want help them be language-agnostic. For example, we could make the QueryExpressionFactory from PEP119 more of a public interface that could be used to build a QueryExpression from a CIM_IndicationFilter instance.

 

  • Carolann Graves: Please also describe in this PEP the proposed changes to the Indication Service.

 

  • Chuck Carmack: Line 637 of the CQL spec (0.10) talks about the CIM server declaring its level of CQL support through a
    CQLCapabilities class. Should a provider be written for that, and if so, how does the server declare support for multiple levels (1, 4, and 5 in our case)? Actually, how can any level be declared by the server when the BNF in this PEP does not exactly match any level of the CQL spec.

 

  • Carolann Graves: Just to clarify, when you say only CMPI providers will be supported, do you mean that if an indication provider wants to use the CQL implementation to perform its own filter evaluation, that would only be supported for CMPI providers in stage 1? If the IndicationService is using the CQL implementation to evaluate an indication being processed, it wouldn't matter whether the indication had been generated by a CMPI or a standard provider.

 

  • Diane Olson: The Pegasus standard C++ interfaces will need to support CQL also.

 

  • Chuck Carmack: This appears doable based on our preliminary research into flex. We need to prototype this. PEP 146 really doesn't add any more information (it actually refers to this PEP)

 

  • Chuck Carmack: There should be the same support for C++ providers as for CMPI providers. I don't see this as a big problem, because CMPI typically wrappers the Pegasus C++ classes. In order to support CMPI we would need to implement the C++ classes anyway.

 

  • Diane Olson: I looked through the DMTF DSP0202 Query Specification and couldn't find a reference to using the POSIX APIs - did I miss it? I was looking at version 0.10 dated February 26, 2004 - perhaps there is a newer version somewhere?

(andreas_maier)(1) I suggest to rebase this PEP whenever the next CQL Spec after V0.11 comes out (probably V0.12). Reason is that the ABNF should be error free by then, and the Basic Query support should be precisely identifiable then. (2) This sentence states that this PEP also provides ExecuteQuery support. Further down in this PEP, this is contradicted. Resolve.

OB>So should we postpone this until CQL spec v0.12 comes out? (My vote: no.)

[ (dong_xiang) It seems not all features in the 'Basic Query' are supported in this PEP. Please specify in details what is supported and what is not.
(andreas_maier) (1) Once V0.12 of the CQL Spec is out, I expect that the Basic Query functionality is precisely defined there, so we do not need to repeat it in this PEP. (2) In V0.11, there are two features with LIKE: 'Basic Like' and 'Full Like'. Specify which of these we plan to support.

OB> see above. I would prefer to get implementation started.

[ (dong_xiang) We definitely need to address embedded objects and specific array elements in the WHERE clause as a minimum. Would you please tell us how hard to have a support for these features and what is your concern if we include these features in the PEP?

  • With this PEP, there is no support for

[ ¤75] Join operations

[ (andreas_maier) This point refers to the CQL feature 'Satisfies Array', in addition to 'Array Elements'. I suggest to list the excluded features by the feature names as per the CQL Spec.
¤76] Array operations, so array properties may not appear anywhere in the query, regardless whether used with constant or with *

[ (andreas_maier) I have to correct my initial comment. There is still some ambiguity in the CQL Spec V0.11 regarding the behaviour of Basic Query on Embedded Objects. I tend to believe that the embedded capabilities of Basic Query are not sufficient for purposes of indications and event based monitoring, so that we would need to support the feature Embedded Objects. I'll clarify that.
¤77] Embedded objects in whatever form in the query

[ (andreas_maier) Support for URI-REFERENCE (i.e. [class-path] in the [class-identifier]) is part of Basic Query, as per the CQL Spec V0.11. I suggest to implement the complete Basic Query.
¤78] WBEM URI specification (DSP0207)

[ (andreas_maier) Also no support for path functions
¤79] Aggregation function

[ ¤80] Subqueries

[ (andreas_maier) Support for Qualifiers is part of Basic Query, as per the CQL Spec V0.11. I suggest to implement the complete Basic Query.
¤81] Qualifiers
[ (andreas_maier) In addition to this exclusion list, the following CQL features are also meant to be excluded, I guess: 'Order By', 'Distinct', 'First' and 'Full Like'. Please confirm.
OB> Yes, but "Full Like" is automatically implemented for non-Windows platform, together with "Basic Like".

OB> I have listed above that first stage of query feature "Basic Query", plus, "Time", "Basic Like" and (for non-Windows) "Full Like" are to be implemented. This list is just to make it more precise.

[ (andreas_maier)DMTF did not 'remove support for WQL'. This statement is inrorrect and should be removed.
(chuck_carmack) This is an important discussion point. The proposal is to only do bug fixes on WQL.

[ (andreas_maier)I suggest to implement the complete 'Basic Query'. By V0.12 of trhe CQL Spec, it should be sufficiently stable. We are already now only iterating on how to present it in the ABNF, the contents already now (V0.11) seems to be stable.

 

[ (andreas_maier) Don't repeat the regexp definition, you are already referring to the respective section of the CQL Spec.
OB> ok, done

 

[ (andreas_maier) The CQL Spec prescribes CIM_ERR_INVALID_QUERY to be returned in this case.
OB> ok, changed

 

[ (andreas_maier) Do we suggest to implement it as part of this PEP ?
(chuck_carmack) That was my question too. Do we need a provider for this? If we do, then what do we declare as the supported level of CQL?
OB> yes, see above

 

[ (chuck_carmack) A static instance is obviously easier, but having any static instances in the repository is a discussion point.

OB> ok, so let's discuss. Such a static provider probably wouldn't be too hard to implement anyhow.


carolann_gravesThis PEP should also specify what Filter QueryLanguage
string value will be supported, e.g. 'CQL'? For
interoperability, the Filter QueryLanguage value should be
consistent with that used by other CIM Server
implementations.

OB> done


carolann_gravesJust to clarify, if an array property is specified without
brackets in the query (e.g. SELECT CorrelatedIndications
FROM CIM_ProcessIndication; or SELECT * FROM
CIM_ProcessIndication), the error would not be caught by
the parser, but would be caught later on, right?

OB> Yes.

 

carolann_gravesmissing '7'

OB> done

 

 

[ (carolann_graves) Instead of specifying a particular version (which becomes superseded), it would be great to include a generic statement that the expectation is that the CQL spec will be final before the pegasus release, and that the intention is for the functionality to be consistent with the final CQL spec. (See also tag 145.)
¤128] Abstract: This PEP proposes the implementation of a subset of CQL for indication filter strings (event based monitoring). It is based on "CIM Query Specification" (DSP0202) Version 0.18.002 (September 2004).

OB> agreed, changed

 

[ ¤140] The assumption is that CQL and WQL will co-exist for some while. However, WQL was never really standardized, and existing implementations are not interoperable. In order to use CQL, the queryLanguage string has to be "CQL".

[ (carolann_graves) This statement is out of sync with the statement in PEP 193 ('CIM:CQL'). Perhaps it doesn't need to be stated here, and can just appear in PEP 193.

OB> agreed, changed

 

 

Comments submitted by: chuck_carmack.

Document Title: .

File: pep138_cqlstage1_10.htm. Tag: 148. Action = insert

 

Comment:

PEP 194 is the subsequent PEP to 158

 

OB> ok, added this detail


Copyright (c) 2004 EMC Corporation; Hewlett-Packard Development Company, L.P.; IBM Corp.; The Open Group; VERITAS Software Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy  of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Template last modified: January 20th 2004 by Martin Kirk
Template version: 1.6