It's all about the answers!

Ask a question

How get link types from RDNG


Dmitry A. Lesin (24826296) | asked Aug 21 '19, 10:50 a.m.
edited Aug 21 '19, 10:54 a.m.

Hello!

I need to get information about available link types in a project area. Using next link:


I can find that next REST API request is legal:


But server response to this link is:
Error 400: Bad Request

If I try use something like next:

Then returned empty XML document:
<ds:dataSource xmlns:ds="http://jazz.net/xmlns/alm/rm/datasource/v0.1" xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/" xmlns:rrm="http://www.ibm.com/xmlns/rrm/1.0/" appId="RRC" vMajor="60" vMinor="06"/>

So the question is, how can be loaded information about available link types for a project area with either REST or OSLC API?
Thank you!





2 answers



permanent link
Ivan Bravo (1762) | answered Aug 21 '19, 11:58 a.m.
JAZZ DEVELOPER
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; min-height: 14.0px} p.p3 {margin: 0.0px 0.0px 2.0px 0.0px; font: 14.0px 'Helvetica Neue'} span.s1 {color: #dca10d} span.s2 {text-decoration: underline ; color: #dca10d} </style>

 Hi Dmitry


As mentioned in Reportable API Wiki https://jazz.net/wiki/bin/view/Main/DNGReportableRestAPI, REST API request https://serverName:Port/rm/publish/linktypes is used by ETL, that means that it will provide link types only for "opt out" (configuration management disabled) project areas.


If there is no "opt out" project areas in the server, then it is expected an empty XML document, same is expected when using parameter "projectURI" and the project area provided has configuration management enabled.


Unfortunately I don't know any other way to get project link types.




Comments
Dmitry A. Lesin commented Aug 21 '19, 12:20 p.m.

Hi Ivan,

Thank you for the information. I appreciate it so much.
You are right at all. My project area is under configuration management. and we need to create links in a change set. This is a customer's prerequisite for an extension being developed.
It seems that I found some another way how to get this data. I have found that in OSLC project area services (services.xml), in " <oslc:creationFactory>" group, there's some record like next:


This URI being GET returns a response that contains all descriptions of link types. But the problem is that there's a lot of such records there. And now the problem is how define a correct record with link types in advance. I think it's not a good way to request all similar records and try to define the correct one.
Don't you know how we can do it? I believe that it can solve the current problem, at least in a theory. 
Thank you!


permanent link
Brian Lahaie (1081514) | answered Mar 15 '23, 11:05 p.m.
edited Mar 15 '23, 11:08 p.m.
In a CM enabled environment I was able to do the following:
GET the services.xml file using this URL:
https://<hostname>:<port>/rm/oslc_rm/<PROJECT_AREA_UUID>/services.xml?oslc_config.context=https://<hostname>:<port>/rm/cm/stream/<STREAM_UUID>
    Headers:
    Accept = application/rdf+xml
    OSLC-Core-Version = 2.0

In the response from the GET request was the URLs for the types.
I then took this URL and did the following GET:
    Headers:
    Accept = application/rdf+xml
    OSLC-Core-Version = 2.0
    URL:   https://<hostname>:<port>/rm/types/OT_xvyTcYuLEe2Bk9tMZMvU5Q?oslc_config.context=https://<hostname>:<port>/rm/cm/stream/<STREAM_UUID>
   

Comments
David Honey commented Mar 16 '23, 5:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Clients should never hard code or make assumptions about URI patterns. If you want to know the URI of an OSLC service provider, use OSLC discovery.

Looking at the OSLC service provider of a CM enabled project area, I see OSLC query capabilities for RDF types http://jazz.net/ns/rm/dng/view#View, http://jazz.net/ns/rm/dng/reqif#ReqIFDefinition, http://jazz.net/ns/rm/navigation#folder,  [http://open-services.net/ns/rm#RequirementCollection,http://open-services.net/ns/rm#Requirement], but nothing for type definition artifacts such as link types.

The ELM API landing page is at https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding.I see nothing there that describes how to query for resources.  So, it looks like the API endpoint that Brian mentioned should be treated as private, undocumented, and unsupported. Use of private APIs is discouraged because such APIs are subject to change without notice, making for potentially fragile implementations, and are unsupported.


Ian Barnard commented Mar 16 '23, 7:39 a.m. | edited Mar 16 '23, 7:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In each shape the link types can be identified as the tags that contain a tag:


At least for DN all the link types appear to be repeated in all the shapes, so it's possible that just retrieving the first shape will get you all the link types. Not sure about this. Anyway these only change when a new link type is created, so maybe you could use e.g. http caching so re-retrieving doesn't require a GET to the server, or your app saves them and only refresh when user chooses or (perhaps) 7 days since last retrieved.

Before anyone asks about link constraints, AFAIK these aren't exposed in any public API https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding


Ian Barnard commented Mar 16 '23, 9:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

GCM has similar tags in properties its shapes to denote link types - although it also has the benefit of a (OSLC) QueryCapability for link types :-)


Ian Barnard commented Mar 16 '23, 9:38 a.m. | edited Mar 16 '23, 9:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I agree with David about it being not a good approach to hardcode URL patterns, instead to use discovery. In this case for DN the link types can be discovered from the shapes, all accessible using OSLC-Core-Version: 2.0 and with no indication that this is a private API.

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.