It's all about the answers!

Ask a question

How to retrieve CALM links associated with an RDF resource from CCM?


Sean G Wilbur (87222421) | asked Sep 13 '12, 12:21 p.m.
JAZZ DEVELOPER
edited Sep 13 '12, 12:30 p.m.
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

 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  

  -Sean

[edit] Removing code snippets as the forums just keeps eating them

Accepted answer


permanent link
Steve Speicher (31765) | answered Sep 14 '12, 8:49 a.m.
JAZZ DEVELOPER
edited Sep 14 '12, 8:50 a.m.
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:

 
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
Sean G Wilbur selected this answer as the correct answer

Comments
Sean G Wilbur commented Sep 14 '12, 9:18 a.m.
JAZZ DEVELOPER

Thanks Steve, as usual the simple answer prevails. Once I had a workitem with these properties it succeeds. I was expecting the behavior we see in the web OSLC 1.0 where we get a link endpoint to the resource collection regardless and it may be empty.

3 other answers



permanent link
Hao Wan (1.5k35) | answered Sep 13 '12, 11:22 p.m.
JAZZ DEVELOPER
edited Sep 13 '12, 11:27 p.m.
 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.

permanent link
Paul Slauenwhite (8.4k12) | answered Sep 14 '12, 6:18 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
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...

Comments
Sean G Wilbur commented Sep 14 '12, 9:12 a.m.
JAZZ DEVELOPER

The examples above are just a snippet, this is the RDF resource URI returned when you request application/rdf+xml content via a query or from another resources, so I am really just following the chain.


permanent link
Jorge Diaz (8664434) | answered Sep 14 '12, 6:42 a.m.
JAZZ DEVELOPER
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.

Comments
Sean G Wilbur commented Sep 14 '12, 9:15 a.m.
JAZZ DEVELOPER

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

Your answer


Register or to post 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.