chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Hübel <>
Subject RE: OpenCMIS Query Parsing Failure with Repeating Attribute and Not Equal Operator
Date Mon, 18 Apr 2011 20:07:10 GMT
Hi Randy,

you are right. This restriction has been added in one of the later revisions of the spec.

If you need more operators than just "=" with "ANY" you can use the extended grammar which
is provided as an example how to enhance the CMIS grammar. The extended grammar should support
your example and is even part of the distribution. So it is even simpler than Florent has
pointed out. The code is there you would just have to enable it (just by chance your case
matches the extension example).

The two unit tests and should give you an idea how
to do this (don't be confused by the reflection magic, this is only needed for simplifying
the test code). Basically you need to replace the Lexer and Parser class names.


-----Original Message-----
From: Speakman, Randy [] 
Sent: Montag, 18. April 2011 14:52
To: Florent Guillaume;
Subject: RE: OpenCMIS Query Parsing Failure with Repeating Attribute and Not Equal Operator

Hi Florent, thank you for responding. I think the problem was that I had been basing the query
on an older document from EMC, when I should have
been referring to the 1.0 specs from OASIS directly.

Inside of this document it has the following description which differs from the OASIS spec.

<quantified comparison predicate> ::= <literal> <comp op> ANY <multi-valued-column

<comp op> ::= "=" | "<>" | "<" | ">" | "<=" | ">="

So this led me to believe that the query I had written was a valid query. This query was just
part of a Junit test suite that I had written to test my custom repository connector. It was
one of many queries that I wrote to test my code. The query always failed and I was never
able to determine why.

Many thanks,


-----Original Message-----
From: Florent Guillaume [] 
Sent: Sunday, April 17, 2011 11:33 AM
Cc: Speakman, Randy
Subject: Re: OpenCMIS Query Parsing Failure with Repeating Attribute and Not Equal Operator

The BNF grammar of the CMIS 1.0 specification (§ at has:

<quantified comparison predicate> ::= <literal> "=" ANY
<multi-valued-column reference>

So only the "=" operator is allowed by the strict spec, not "<>".

Your query would be a straightforward extension that OpenCMIS could
very reasonably allow in non-strict mode (if the server chooses to
support it), but it's not in it at the moment.


PS: are you sure that you don't want to write ... WHERE NOT('keyword1'
= ANY keywords), which is legal? This is the semantics people usually

On Fri, Apr 15, 2011 at 8:29 PM, Speakman, Randy <> wrote:
> Hi,
> I am having an issue with a specific type of CMISQL query that fails to be parsed in
OpenCMIS 0.3.0 by the CmisQlStrictParser class. I have checked the CMIS 1.0 specs and believe
the query I have written is valid, however I would like someone else to look at the query
and double check it. The query criteria filters on a repeating attribute that is not equal
to a specific value. In the query below, the keywords attribute is a repeating string. The
exception is thrown when QueryUtil.getWalker(...) is called and hits line 57, where it checks
the parser for errors. The error message in the parser says "line 1:114 mismatched input '&lt;&gt;'
expecting EQ".
> /*
> Lines 56 to 59 from QueryWalker class
> */
>        query_return parsedStatement = parser.query();
>        if (parser.hasErrors()) {
>            throw new CmisInvalidArgumentException(parser.getErrorMessages());
>        }
> /*
> My query
> */
> select cmis:objectId, cmis:name, cmis:contentStreamLength, keywords from my_doc_type
where 'keyword1' <> any keywords
> Thanks,
> Randy

Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)   +33 1 40 33 79 87

View raw message