How to retrieve CALM links associated with an RDF resource from CCM?
Assuming we are using a uniform request type once authenticated with accept: application/rdf+xml and OSLC-Core-Version: 2.0 for ALL requests.
From the CCM perspective, if I request:
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12
It returns a valid RDF Description of the resource, but this does not include all the properties defined in the resource shape ? The ones I am interested in specifically are the CALM links which I can see in the resource shape definition, anything special I need to do to get them to return with the workitem?
I have tried directly selecting them as properties without any luck so far, the query returns but without the attributes I am interested in...
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12?oslc.select=dcterms:identifier,oslc_cm:implementsRequirement ,oslc_cm:testedByTestCase
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12?oslc.select=dcterms:identifier,oslc_cm:implementsRequirement ,oslc_cm:testedByTestCase
-Sean
[edit] Removing code snippets as the forums just keeps eating them
Accepted answer
I did the "follow your nose" method to get to the work item URL that was listed as part of the query response, which taking an example is:
I did as Sean did to fetch, though didn't notice the oslc_cm:testedByTestCase property in this work item. I noticed there wasn't a link, therefore it doesn't exist. I added a link and fetched it again, there was the oslc_cm:testedByTestCase property then. To minimize the amount of properties, I used ?oslc.properties such as:
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/9?oslc.properties=oslc_cm:testedByTestCase
I haven't looked at the shape support in detail but the shape associated with this work item (instance shape) should show most of these properties as optional (you may not find them). If there are true conflicts with the shape and the work item in hand, ie it doesn't validate right, then it may be a bug. Hope that helps
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/9
I did as Sean did to fetch, though didn't notice the oslc_cm:testedByTestCase property in this work item. I noticed there wasn't a link, therefore it doesn't exist. I added a link and fetched it again, there was the oslc_cm:testedByTestCase property then. To minimize the amount of properties, I used ?oslc.properties such as:
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/9?oslc.properties=oslc_cm:testedByTestCase
I haven't looked at the shape support in detail but the shape associated with this work item (instance shape) should show most of these properties as optional (you may not find them). If there are true conflicts with the shape and the work item in hand, ie it doesn't validate right, then it may be a bug. Hope that helps
3 other answers
Hi Sean,
what about trying to add prefix and using oslc.properties instead of oslc.select such as
https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12?oslc.prefix=dcterms=<http://purl.org/dc/terms/>&oslc.properties=dcterms:identifier,dcterms:title,dcterms:created
add screenshot as the forum display is not correct.
Sean, the resource URL (https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12) does not look like an OSLC-style URL. An OSLC-syle URL in RTC has the following format:
https://server/ccm/oslc...
https://server/ccm/oslc...
Hi Sean,
as Paul pointed out, try modifying your call to:
https://server/ccm/oslc/workitems/12
Then you can add the query parameters, for example:
https://server/ccm/oslc/workitems/12?oslc.select=calm:relatedTestPlan
Regards,
Jorge.
as Paul pointed out, try modifying your call to:
https://server/ccm/oslc/workitems/12
Then you can add the query parameters, for example:
https://server/ccm/oslc/workitems/12?oslc.select=calm:relatedTestPlan
Regards,
Jorge.
Comments
Either URLs actually return the same thing, only the RDF Resource URL changes to match the query intereface, but as noted above to Paul, when you query via the simple Query interface the return is URLs with the format: https://server/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/ID