Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to add artifacts in collection using OSLC

Need to add artifacts in a collection. Tried the following steps:-
1) Did a get on the artifact
2) Updated the RDF with the following line :-
<oslc_rm:uses rdf:resource="https://clm20124.accenture.com/rm/resources/_wtD10IYxEeKDfYJELFVegw"/>

But this didnt update the artifact.

0 votes



2 answers

Permanent link
 Make sure you have the following headers:
OSLC-Core-Version=2.0
Accept=application/rdf+xml
If-Match= "_C9-QgYZ2EeKEQsxslOt1-g"

If-Match header is the etag header you get by doing a GET on the artifact.
Also check the RDF like you add is inside the
  <rdf:Description rdf:about="https://server:port/rm/resources/_Ef2S1HbnEeK9wNdPpoPpMw">
...
  </rdf:Description>

0 votes

Comments

Hi,

Yes, I had used the above mentioned headers and added the tag inside the <rdf:description>  tag. But still i am unable to add the artifact in the collection.


Permanent link
Hi,

a couple of questions ?
Which is the HTTP rc returned from the PUT ?
When you do a GET to the Collection ( your step 1 ) Does the body returned contains other oslc_rm:uses ( assuming your Collection contains other artifacts.?

0 votes

Comments

Hi,

I am doing a GET on the artifact and not on the collection . I  updated the RDF content and added the  content :-<oslc_rm:uses rdf:resource="https://clm20124.accenture.com/rm/resources/_wtD10IYxEeKDfYJELFVegw"/>;
and did a PUT on the artifact.

These steps are given in the article :- https://jazz.net/library/article/1197/ 

Section 7 :-

7. Adding artifacts to and removing them from a collection

Requirements that belong to a collections are exposed as entries of the "oslc_rm:uses" type. A complete sample entry is as follows:

<oslc_rm:uses rdf:resource="https://grarrc.ibm.com:9443/rm/resources/_mLHpsbrhEeG3OKR6fZ1svQ"/>;

To add artifacts to or remove artifacts from a collection, follow these steps:

  1. Obtain, or get, the collection.
  2. Either add or remove the "oslc_rm:uses" entries in the RDF.
  3. Update (Put ) the resource back in with the modified RDF.

Hi,
The GET should be done to the Collection and add the oslc:uses to the Collection RDF.

1 vote

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,942

Question asked: Mar 06 '13, 4:31 a.m.

Question was seen: 5,888 times

Last updated: Mar 07 '13, 9:56 a.m.

Confirmation Cancel Confirm