How to write OSLC RM query for artifacts where Status is in a set?
I have a working OSLC query against JKE Banking in DNG 6.0.2 which returns all modules of type "Use Case Specification" and Status of "Approved". However, I would like to match on a set of potential Status values. I've tried the " in " notation described in the OSLC standard, and I've also tried doing an " or", but no luck either way. Is this supported in DNG 6.0.2?
I've included section of my query that tests for a single Status value:
|
Accepted answer
You will need to use the attribute rdf:type to specify RequirementCollection (collections and modules), and oslc:instanceShape to specify the artifact type (you need to first identify the resource URI of the type). So the extra OSLC filters look like this (I add extra spaces in between to avoid the messed-up format):
& oslc.prefix=rdf=< http://www.w3.org/1999/02/22-rdf-syntax-ns % 23 >& oslc.where=rdf:type=< http://open-services.net/ns/rm % 23RequirementCollection >& oslc.prefix=oslc=< http://open-services.net/ns/core % 23>& oslc.where=oslc:instanceShape=< https://clm602.example.com:9443/rm/types/_s40G4X57EeagE4RXfi8TMg > More information can be found in this article. https://jazz.net/library/article/1197 Robert Huet selected this answer as the correct answer
Comments
Robert Huet
commented Feb 14 '17, 5:58 p.m.
Thanks, Donald, I have added the rdf:type and oslc:instanceShape as shown above, and I can query successfully on "Status" of "Approved". The problem is how to query on "Status" of "Approved" OR "Draft". It appears that the "oslc.where" clauses act as implicit "AND" operators. How do you do an "Or" or an "In"? I'm not finding any examples of this in the link that you reference above.
Donald Nong
commented Feb 14 '17, 7:18 p.m.
It been discussed many time on this forum - OSLC does not support OR operator. The best you can get when testing the same filter for the OR condition is the IN operator (you're out of luck if testing different filters). It should not be difficult to construct such query URLs but it's tricky to escape or not escape certain characters in the URL. The filter for Status that I use in my own environment is shown below (this time as an image)
Donald Nong
commented Feb 14 '17, 7:23 p.m.
I re-read your comment and realized that you may have missed something. The article does include the sample for IN with this description:
Robert Huet
commented Feb 15 '17, 10:32 a.m.
That was it! Once I escaped the comma, it worked perfectly! Thanks, Donald! |
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.