chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Guillaume>
Subject Re: OpenCMIS Query Parsing Failure with Repeating Attribute and Not Equal Operator
Date Sun, 17 Apr 2011 15:32:55 GMT
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