How to add artifacts in collection using OSLC
2 answers
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>
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.?
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.?
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:
- Obtain, or get, the collection.
- Either add or remove the "oslc_rm:uses" entries in the RDF.
- 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