Issue Details (XML | Word | Printable)

Key: CMIS-177
Type: Bug Bug
Status: Closed Closed
Resolution: Applied
Priority: Critical Critical
Assignee: Ethan Gur-esh
Reporter: Ryan McVeigh
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OASIS Content Management Interoperability Services (CMIS) TC

How do the various comparison operators work with the various property types?

Created: 08/May/09 03:44 PM   Updated: 11/Jan/10 07:31 PM
Component/s: Domain Model
Affects Version/s: Draft 0.61
Fix Version/s: Draft 0.62

Proposal:
Property Type
 Operator(s)
 Literal
 Notes
 
String
 =, <>
 string
  
 
String
 [NOT] IN
 list of strings
  
 
String
 [NOT] LIKE
 string
  
 
Decimal, Integer
 =, <>
 number
  
 
Decimal, Integer
 [NOT] IN
 list of numbers
  
 
Decimal, Integer
 <, <=, >, >=
 number
  
 
Boolean
 =
 boolean
  
 
DateTime
 =, <>
 datetime
  
 
DateTime
 [NOT] IN
 datetime
  
 
DateTime
 <, <=, >, >=
 datetime
 compare as before/after
 
ID
 =, <>
 string
  
 
ID
 [NOT] IN
 string
 should be allowed (currently disallowed by section 2.9.2.3.1)
 
URI
 =, <>
 string
  
 
URI
 [NOT] IN
 string
  
 
URI
 [NOT] LIKE
 string
 compare as string
 

Operations on the SCORE() output MUST be treated the same as decimal operations. Any additional operators not specified are repository-specific.

When using properties in a join statement, comparison MUST be allowed on properties of the same types as defined by the table above. Repositories MAY extend this behavior.

The ANY operation argument MUST be one of the properties found in the table above which supports equality operations


 Description  « Hide
The spec needs to provide guidance about how the various comparison operators work with the various property types. Here's a list of the types, operators, literal type and possible result.

This is our interpretation and ?'s are areas we are looking for guidance on.

Possible values for ? might be: invalidArgumentException, always evaluate false, always evaluate true, do something else....

We should include this type of information in the spec.

String =, <>, IN, NOT IN string string equality test
String <, <=, >, >= string collation? what locale? ?
String LIKE, NOT LIKE string string wildcard match
String =, <>, IN, NOT IN numeric ?
String <, <=, >, >= numeric ?
Decimal, Integer =, <>, IN, NOT IN string ?
Decimal, Integer <, <=, >, >= string ?
Decimal, Integer =, <>, IN, NOT IN numeric numeric equality
Decimal, Integer <, <=, >, >= numeric numeric comparison
Boolean =, <>, IN, NOT IN string ? (what valid string values?)
Boolean <, <=, >, >= string ?
Boolean LIKE, NOT LIKE string ?
Boolean =, <>, IN, NOT IN numeric ?
Boolean <, <=, >, >= numeric ?
DateTime =, <>, IN, NOT IN string equality match if string matches xsd:dateTime? - if not: ?
DateTime <, <=, >, >= string before/after match if string matches xsd:dateTime? ?
DateTime LIKE, NOT LIKE string ?
DateTime =, <>, IN, NOT IN numeric ?
DateTime <, <=, >, >= numeric ?
ID =, <> string string match
ID IN, NOT IN string Not allowed (line 877) (? is this intended?)
ID <, <=, >, >= string Not allowed (line 877)
ID LIKE, NOT LIKE string Not allowed (line 877)
ID =, <> numeric ?
ID IN, NOT IN numeric Not allowed (line 877)
ID <, <=, >, >= numeric Not allowed (line 877)
URI, XML, HTML =, <>, IN, NOT IN string ? (string match?)
URI, XML, HTML <, <=, >, >= string ?
URI, XML, HTML LIKE, NOT LIKE string ?
URI, XML, HTML =, <>, IN, NOT IN numeric ?
URI, XML, HTML <, <=, >, >= numeric ?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Ryan McVeigh added a comment - 08/May/09 03:45 PM
Well that didn't translate well from the JIRA client to the actual issue in the browser... but imagine a table above.

Al Brown added a comment - 04/Jun/09 06:45 PM
We should include the table in p1 as long as we don't actually define how the comparisons happen. For URI, XML, HTML I would only support:

URI =, <>, IN, NOT IN
XML, HTML - LIKE, NOT LIKE

Chances are XML and HTML are too large/complex escaping is going to be a pain and not useful for =, <>, IN, NOT IN and <, <=, >, >= are probably not supported. We have not added xpath/xquery function and probably should not for 1.0

ID I would like to see support for IN and NOT IN.

Boolean should only support: =, <>, IN, NOT IN
DateTime only - =, <>, IN, NOT IN, >, >=, <, <=

I am not sure I get String equality comparison as numeric?

Anyway, this table should be filled out and included in the specification.

Florent Guillaume added a comment - 08/Jun/09 06:37 AM
I favor disallowing any kind of comparison operators between CLOB-like objects like XML and HTML. LIKE and NOT LIKE maybe but it's going to be costly to many backends.

Al Brown added a comment - 08/Jun/09 01:21 PM
deferred to query wg

Al Brown added a comment - 15/Jun/09 12:10 PM
proposal by wg

Al Brown added a comment - 15/Jun/09 01:26 PM
accepted by tc

Al Brown added a comment - 19/Jun/09 06:00 PM
added to 62b

Al Brown added a comment - 05/Jan/10 12:02 AM
JIRA Cleanup