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?
&oslc.prefix=rm_property=<https://clm.testqa.foo.com/rm/types/
>&oslc.where=rm_property:_PoZEwl06EeOQb4Ms4S7jTQ=<https://clm.testqa.foo.com/rm/types/_PRVPol06EeOQb4Ms4S7jTQ%23dd84ed1c-9786-469b-85a2-517388d6a09b>
Thanks,Robert
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
Comments
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.
The OSLC Spec shows a syntax for "IN", but I could not get that to work.
Thanks,
Robert
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)
Note that I escape the two pound signs and comma in the URL, and you can tell them by the leading percentage sign (%). I'm using RESTClient within Firefox if that matters.
I re-read your comment and realized that you may have missed something. The article does include the sample for IN with this description:
'For queries that are based on a link type that uses the “in” modifier, select everything by using the wildcard character (*). This example uses the implementedBy link type'
That was it! Once I escaped the comma, it worked perfectly! Thanks, Donald!