It's all about the answers!

Ask a question

Obtaining List of RDF Resources for RTC Rest API


Gregory Hatt (1213) | asked Oct 06 '15, 8:11 a.m.
So I've just started toying with the RTC Rest API. I was able to do everything I needed to do through the Plain Java API (Thanks Ralph, Donald) but now that I've moved over to the REST API I'm having an issue figuring out where do to get the URLs for different fields.

For example, in the creation example here it has JSON listed as:
"dc:type":
    {
        "rdf:resource":"https:\/\/publicuri.test.org:9443\/jazz\/oslc\/types\/_9BHm0EqVEd6HXO10niqZpg\/defect"
    },
I'm able to get the rdf:resource by looking at already existing work items in JSON but I was wondering how I would go about getting a list of all available resources (for type, filedAgainst, enumerations, etc). Sorry to ask such a basic question but if anyone could provide some guidance I would, as always, be grateful.


Comments
Gregory Hatt commented Oct 06 '15, 8:35 a.m. | edited Oct 06 '15, 8:38 a.m.

I've tried following a few different posts but can't seem to locate the shape resources. The steps I've taken are:
1. ..com:9445/rtc/rootservices
2. <oslc_cm:cmServiceProviders rdf:resource="https://sma-unleash.ratl.swg.usma.ibm.com:9445/rtc/oslc/workitems/catalog"/>;
3. <oslc_disc:services rdf:resource="https://sma-unleash.ratl.swg.usma.ibm.com:9445/rtc/oslc/contexts/_b805UJ2mEeSt084cL1Gjgg/workitems/services.xml"/>;

I would expect to see a URL for the shape resource by the creation URL for the particular type of work item I'm looking for and am not seeing it (something like this). I must be missing something.

One answer



permanent link
Gregory Hatt (1213) | answered Oct 06 '15, 9:17 a.m.
The issue was with changing contexts to context, adding the shape path and adding the correct version to the header; all is well. The solution was found in this post: https://jazz.net/forum/questions/164028/rest-oslc-how-to-get-workitem-types-its-workflow-and-then-the-actions-possible-in-that-workflow

Comments
Gregory Hatt commented Oct 06 '15, 9:59 a.m.

One issue with this though is that the list of allowed values I get is just a list of URLs; I could use these URLs in my JSON but I'm wondering how I can discover what actual values map against the URL. For example:

<oslc:allowedValue rdf:resource="https://sma-unleash.ratl.swg.usma.ibm.com:9445/rtc/resource/itemOid/com.ibm.team.workitem.Category/_h8nCMBnAEeWJgMdw4ZgbNQ"/>;

I don't know how to determine what Category that actually maps to.


Donald Nong commented Oct 06 '15, 8:31 p.m.

You're just one step away. Just follow the <oslc:allowedValue> link. What you're interested in are "dcterms:title" and "rtc_cm:hierarchicalName".

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.