It's all about the answers!

Ask a question

[closed] OSLC API For Programmatically Linking RQM and DNG


jyoti mishra (45139) | asked Jul 30 '21, 2:25 a.m.
closed Mar 09 '23, 9:47 a.m. by David Honey (1.8k17)

 Hello Everyone,


I would like to know the  OSLC API to create automatic link from DNG's Artifacts to RQM, and other PLM Tool and vice versa. I also want to know OSLC API to fetch link type from RQM and DNG. Could someone please help me by providing the OSLC API format for fetching the same.
Kindly help at the earliest.

Thanks and Regards,
Jyoti

The question has been closed for the following reason: "The question is answered, right answer was accepted" by davidhoney Mar 09 '23, 9:47 a.m.

Accepted answer


permanent link
Ian Barnard (1.9k613) | answered Jul 30 '21, 4:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Hi Jyoti


>  other PLM Tool and vice versa

You'll have to discuss details with their vendor of how 'other PLM' tools work, but if they're OSLC configuration management aware then the principles should be similar to below.


> create automatic link

It's important to understand that (at least in the ELM world) with configuration management enabled links are always stored at the source, or 'from' end, and that end is where they must be created. Even though the user interface of DOORS Next allows creating a ETM->DN link from within DN, in reality the link is always created in EWM. All the OSLC links have a defined direction, basically all links involving DN are towards DN, and using OSLC APIs you will only be able to create them at the source/from end of that direction, i.e. not at the target/to end in DN.

(if you see mention of creating 'backlinks' when discussing links, this is referring to when not using configuration management)


To add or remove a link using OSLC APIs you will follow these steps, which are the same for creating links as for updating other properties:

  1. Obtain, or GET, the artifact that you want to create the link from
  2. Add or remove the link from the artifact body
  3. Update, or PUT, the modified artifact

Just to repeat: with configuration management enabled links are always stored at the source end, and for links between ETM and DN the source is always ETM, so you will only see ETM->DN links by GET on the ETM resource(s). You won't see ETM->DN links, or any other incoming links, when GETting DN resources.


To create a link ETM->DN you are going to GET the ETM resource, add the link to the RDF for the resource then PUT it back to ETM. If a link already exists you can remove it by GET then delete the link from the RDF, then PUT.

The simplest way to get the right format for the link you'll specify in the RDF to PUT is to manually create an example link of the type you want (in ETM), then GET the ETM resource.

You'll need the usual headers for Content-Type/Accept: application/rdf+xml, OSLC-Core-Version: 2.0, and configuration (which must be a GC URL) using header Configuration-Context or parameter oslc_config.context

And you'll have to copy the etag header from the GET result and put it in the if-match header of the PUT - if the thing you're PUTting to has been updated (e.g. by another user, by another application using API) since you did the GET then the PUT will fail and you'll have to handle this; this happening occasionally is to be expected in a multi-user server, i.e. it's not a product defect, and handling it robustly may not be simple, but it's your responsibility to do something sensible (or not).

By searching here I found some resources/forum q+a about link creation - you may be able to find more, I wasn't exhaustive:

HTH
Ian

Ian Barnard selected this answer as the correct answer

One other answer



permanent link
David Honey (1.8k17) | answered Jul 30 '21, 3:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Hi Jyoti,

Links between DNG and ETM are always stored in ETM and reference DNG artifacts for opt-in project areas. For a given ETM resource, its RDF should reference an instance resource shape, and that shape should describe the available properties of that ETM artifact, including links. That will tell you the RDF predicate of each link, its cardinality, range and so on. You can find more information about resource shapes in OSLC Core 3.0. Part 6: Resource Shape. You can then add RDF statements for any new links you want to create and use PUT to update the resource specifying an If-match header (as per standard HTTP usage).

David.