Linking two artifacts using RRC API
3 answers

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

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.
I am pasting the portion of my XML. Could you please help me understand what needs to be corrected in the same.
<oslc_rm:implementedby rdf:ID="n0" rdf:resource="https://sowb-clm.dst.ibm.com:9443/rm/resources/_RfcrASTQEeKRXOX1D-rc1A" <a="" href="rdf:ID=" n0""="" target="_blank"> />
and after close of requirement tag
</rdf:description>
<rdf:description <a="" href="rdf:about=" #n0">"="" target="_blank">rdf:about="#n0">;
<dc:title <a="" href="rdf:parseType=" Literal"="">Associated</dc:title>">rdf:parseType="Literal">Associated</dc:title><>;
</rdf:description>

Check :
6. Adding and removing links
Comments

Does this link exists? I get : "The library item that you requested cannot be found. It might have been removed, or is temporarily unavailable."
Thanks,
Binoy

There is an extra space at the end of the link, Try :
https://jazz.net/library/article/1197

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.

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 )