Nested conditions in where clause of OSLC
I wanted to query Clearquest records using OSLC.
Is nested conditions possible in where clause of oslc ?
Ex :
oslc.where=(name="James" and age>25 and (operatingStatus=null or operatingStatus="Active") )
If not, what is the way to extract using such nested where condition ?
Am new to OSLC. Any help will be extremely useful.
Any update on this ?? :(
|
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. Ragul S selected this answer as the correct answer
Comments @DonaldNong Thanks for the reply.. Any idea if clearquest support querying records using SPARQL ??
Donald Nong
commented Jan 16 '17, 12:44 a.m.
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
Donald Nong
commented Jan 16 '17, 7:17 p.m.
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?
Ragul S
commented Jan 17 '17, 1:48 a.m.
Thanks for explanation. No.. Actually my queries will have "Nested Where conditions", regex pattern matching and null checking, and these are not supported by OSLC. So, I was searching about other ways and i ended up in SPARQL.
If you know any other simpler and easier way to achieve these things, please let me know. It'll be extremely helpful.
Donald Nong
commented Jan 24 '17, 12:21 a.m.
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.
showing 5 of 6
show 1 more comments
|
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"]
See the description of this in the OSLC Query Spec.
Good luck,
Jim Ruehlin
Comments
Donald Nong
commented Jan 16 '17, 8:08 p.m.
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
|
The only other thing I can think of is to try and factor out the OR:
Status="Passed" or OverrideStatus="Override" is the same as NOT(Status != "passed" AND OverrideStatus != "Override)
The stuff inside the parens is doable in OSLC, but there's no NOT operator in OSLC and I'm not clear about nesting statements in OSLC queries. I spent 5 mins and can't think of a way, but maybe there's something out there that'll work.
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. :( |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.