Nested conditions in where clause of OSLC
Is nested conditions possible in where clause of oslc ?
Accepted answer
The main problem with this, with ClearQuest or not, is that OSLC does not allow the "OR" operator. Take a look at the "boolean_op" section, and it clearly states that
The only boolean operation allowed is "In other words, what you want to achieve is impossible with the current implementation.and
" which represents conjunction. The boolean operator "or
" for disjunction is not allowed in the interests of keeping the syntax simple.
Comments
@DonaldNong Thanks for the reply.. Any idea if clearquest support querying records using SPARQL ??
I'm not in development so I cannot give you the answer. Since ClearQuest supports OSLC now, not SPARQL, I would say it will never happen.
@Donald Nong
Could you please tell me Why is it so ? are OSLC & SPARQL mutually exclusive ?
No, they're not mutually exclusive. RDNG provides both functionalities. Adding support for a particular technology, in this case SPARQL, may require an architect change of the product, which is costly and risky. Is there a compelling reason you have to use SPARQL in ClearQuest?
If you know any other simpler and easier way to achieve these things, please let me know. It'll be extremely helpful.
In ClearQuest, you can customize the SQL query, but that's another can of worms. What I would suggest is to learn how the product works and work with what is available. You just can't think of a great idea and expect the product to implement it straightaway.
3 other answers
The OSLC query where clause does include support for nested property queries. See http://open-services.net/bin/view/Main/OSLCCoreSpecQuery#oslc_where.
Comments
@Jim , Thanks for the reply.. I want to apply where condition like "A=1 & B=2 & (C=3 || D=4)" where A,B,C,D are properties of a record in Clearquest.. Am able to do "X.Y.Z>19".. All I need to know is nested conditions in where clause, not nested property in where clause..
The in_op query operator was made to address this sitation. It returns TRUE for any value that matches what's in a list. So something like:
http://example.com/bugs?oslc.where=cm:severity in ["high","medium"]
Comments
There is something in the original request that cannot be handled by OSLC - testing for null. It's a big ask without knowing the limitation of OSLC.
@Jim Ruehlin Thanks for the reply. But my question is not about
Ex:1
Status="Passed" or Status="Ok",
it is about
Ex:2
Status="Passed" or OverrideStatus="Override".
I don't want OR for different values of same field, I want to use it to check two different fields.. The in_op won't help in this case right ??
The only other thing I can think of is to try and factor out the OR:
Comments
@Jim Ruehlin Thanks for spending time :) . Exactly, the same problem I also faced.. As they said OSLC is meant to be used for very very simple queries only it seems. :(