Linking two artifacts using RRC API
Is it possible to link two artifacts in RRC using the rest service APIs?
|
3 answers
Hi, We have published an article with sample of using OSLC in RRC : https://jazz.net/library/article/1197
Check : 6. Adding and removing linksComments
Binoy D'costa
commented Apr 19 '13, 12:51 p.m.
Does this link exists? I get : "The library item that you requested cannot be found. It might have been removed, or is temporarily unavailable."
Gabriel Ruelas
commented Apr 19 '13, 1:51 p.m.
There is an extra space at the end of the link, Try :
Binoy D'costa
commented May 08 '13, 12:06 p.m.
Are any of the other link types like Extracter From, Link to etc supported? I can't seem to update them through the REST API.
Gabriel Ruelas
commented May 08 '13, 1:20 p.m.
Extracted From and Link To are internal RM links, Those can not be created/modified using OSLC API. The only link types allowed to create/modify are the ones defined in the OSLC spec ( like validatedBy, implementedBy etc )
|
Assuming that you already got the artifact URL of both artifacts to be linked:
Note: Following headers must be specified: Accept=application/rdf+xml OSLC-Core-Version=2.0 1) Do an OSLC GET to one artifact. 2) Add to the returned information : 2.1 : In the artifact body <oslc_rm:implementedBy rdf:ID="n0" rdf:resource="YOUR ARTIFACT URL"/> 2.1 Outside the artifact body ( but inside the RDF ): <rdf:Description rdf:about="#n0"> <dc:title rdf:parseType="Literal">LINKLNAME</dc:title> </rdf:Description> 3) Do an OSLC PUT to the artifact with this new body. The content-type must be set to application/rdf+xml and also add the header : If-Match using the vale of the etag header returned in the OSLC GET An example of the body will looks like : <rdf:RDF . . . <rdf:Description rdf:about=""> . . . <oslc_rm:implementedBy rdf:ID="n0" rdf:resource="YOUR ARTIFACT URL"/> . . . </rdf:Description> <rdf:Description rdf:about="#n0"> <dc:title rdf:parseType="Literal">LINKNAME</dc:title> </rdf:Description> </rdf:RDF> Comments
Samanwita Majumdar
commented Jan 02 '13, 3:56 a.m.
I tried the approach. But the XML is not well formed and hence the linking does not happen. I tried tweaking the XML but that does not help.
|
It is possible to link two artifact using an OSLC defined link type. Linking with an internal link type is not supported.
Comments
Brati Sankar Ghosh
commented Sep 13 '12, 7:18 a.m.
Hi Gabriel, can you please guide us to some examples/documents on the above topic. |
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.