CMIS Standard 1.1 defines a cmis:item object type as:
A new top level data model type that is an extension point for repositories that need to expose any other object types via CMIS that do not ﬁt the model’s deﬁnition for document, folder, relationship or policy.
But it also stays that:
Please note that the following text and the BNF grammar are inconsistent. The text allows the use of secondary object types in FROM clauses and the BNF grammar does not. Because the BNF grammar is the formal description of the query language, it takes precedence over the text. That is, secondary object types MUST NOT be used in FROM clauses.
The next version of the CMIS speciﬁcation will correct the BNF grammar and allow the use of secondary object types in FROM clauses.
As there will be no next version of the CMIS specification, according to specifications SQL Queries using secondary types (called aspects in Alfresco) should not be supported by CMIS implementations.
However in Alfresco this feature is implemented, so you can use aspects as cmis:item in your queries in the same way you use an object type.
For instance, to select every node having cm:titled aspect you can write:
SELECT * FROM cm:titled
I’ve been using this syntax for years (unknowing that it was outside the standard) and it works without issues. I guess that is safe to use this also in the future, so I’ll keep on using it.
Thanks to Axel Faust for letting me know about this.