How can I use OSLC to query for work Items whose title contains a particular string?
Accepted answer
The requested query is currently not defined/supported by OSLC V2 spec. Client code can not use wild cards on aftifacts fields.
Comments
Good to know.Thank you for that answer.
I also want to ask that again in the same line can I query by artifact type?
For example:
"&oslc.where=" + URLEncoder.encode("dcterms:type=" + "ABC", "UTF8")
here is ABC, my own type which created by me in Jazz Team Server.I want to get work items whose artifact type is ABC in Jazz team server. This type of usage is possible or not in OSLC V2?Because I did lots of researches about it but I couldn't find anything. Thanks.
6 other answers
To query for an specific type the URL of the desired type must be used. For instance, in my environment the FEAT type is represented by : "https://gradev.ibm.com:9444/rdm/types/_PDQfocSMEeGA8-GkKWmlAA", then to request all requirement of type FEAT following query must be used:
&oslc.prefix=rm=<http://www.ibm.com/xmlns/rdm/rdf/>&oslc:where=rm:ofType=<https://gradev.ibm.com:9444/rdm/types/_PDQfocSMEeGA8-GkKWmlAA>.
The service document of the Project Area exposes all the artifacts types ( Check the Creation factories )
Comments
Thank you for that answer.I want to ask that how can I know my environment? I mean ,how can I know the ABC type's link ,in between the other types? Because I check the creation factory and I saw lots of types but how can I resolve something like yours :PDQfocSMEeGA8-GkKWmlAA. How can I define my type's name?Thanks again.
The type URL must be enclosed by <> chars. like :
&oslc:where=rm:ofType=<Your type URL>
Where "Your Type URL" could be something like :
" https://gradev.ibm.com:9444/rdm/types/_PDQfocSMEeGA8-GkKWmlAA "
NOTE : Char " must NOT be included ( I just added here to try to avoid the automatic format ).
Regarding your above question: you can do a GET to the URL type as follows :
Headers :
accept=application/rdf+xmlAction : GET
OSLC-Core-Version=2.0
URL : " https://gradev.ibm.com:9444/rdm/types/_PDQfocSMEeGA8-GkKWmlAA "
Note: Do not include " charsIt will give information about the artifact type.
PLS let me know if more questions
1) rm:ofType should work, problem should be in other part of the query
2) rm is the default name in the URLs for RRC, but in can be changed, in my env it is named rdm. You should be using the one in your env,
If following is a valid resource type in your environment:
" https://abcdjazz.abcd.org.tr:9444/rm/types/_4dvf0LoNEeG8aNjNIIRtMQ "
Then you can test using following oslc.where line :
"&oslc.where=rm:ofType=<https://abcdjazz.abcd.org.tr:9444/rm/types/_4dvf0LoNEeG8aNjNIIRtMQ>"
Note: I removed the encoding because it seems to be needed in this specific case.
Are you using an HTTP requester or Poster to test ? It will be easier to test there and then move the query to the code.
Comments
I use Restful Client Api in Mozilla web browser.I checked my creation factory and the other things from there. I used your query in my code exactly same.But I again couldn't make the code work correctly. Can my prefix be wrong? Here: ","+ URLEncoder.encode("rm=<http: www.ibm.com="" xmlns="" rdm="" rdf=""/>", "UTF8") this prefix is true for rm:ofType ? Sorry I asked too much ,but It's really important for me to run this code and get my result correctly. Thanks again for your answers.
That means that the query works fine on the REstFull Client? If so, could you pls paste it here ?
It should looks like :
https://gradev.ibm.com:9444/rdm/views?oslc.query=true&projectURL=https://gradev.ibm.com:9443/jts/process/project-areas/_OcYF0sSMEeGA8-GkKWmlAA&oslc.prefix=dcterms=<http://purl.org/dc/terms/>,rm=<http://www.ibm.com/xmlns/rdm/rdf/>&oslc:where=rdf:type=<http://open-services.net/ns/rm%23Requirement>