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

Problem adding artifacts to Rational Asset Manager asset using REST

Hi,

I am having problem adding an artifact to an existing asset in RAM. I want to do this using REST/posting data.

Sample request:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc_asset="http://open-services.net/ns/artifact#">
   <oslc_asset:Artifact>   
      <rdf:type rdf:resource="http://open-services.net/ns/asset#Artifact"/>
      <dcterms:title>Build help documentation</dcterms:title>
      <dcterms:label>documentation</dcterms:label>
      <oslc_asset:content rdf:resource="http://help.example.com"/>
      <dcterms:format>text/html</dcterms:format>
   </oslc_asset:Artifact>
</rdf:RDF>

This should add an url to an asset.

Contents is posted to

0 votes

Comments

What URL do you use for posting? And what Content-Type, OSLC-Core-Version, and Accept headers do you send in on the post?

Oh, they were added initiallly. Url: <server>/ram/oslc/assets/57C75409-0931-FA0C-64DC-0A717B313B6B/1.0/artifacts  The guid being the asset id. Content-Type: Application/rdf, OSLC-Core-Version: 2.0, and Accept headers: Application/xml 

Did you post exactly what you showed in the question? The reason I ask is because

<a href='http://help.example.com" '="">http://help.example.com

is not a valid rdf:resource. That would be an rdf:resource reference to an HTML Anchor statement, not a URL.

You should have just rdf:resource="http://help.example.com".  That would be a valid rdf:resource reference to a URL.

Sorry I missed the remove links, this is the actual post.

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc_asset="http://open-services.net/ns/artifact#">;
   <oslc_asset:Artifact>   
      <rdf:type rdf:resource="http://open-services.net/ns/asset#Artifact"/>;
      <dcterms:title>Build help documentation</dcterms:title>
      <dcterms:label>documentation</dcterms:label>
      <oslc_asset:content rdf:resource="http://help.example.com"/>;
      <dcterms:format>text/html</dcterms:format>
   </oslc_asset:Artifact>
</rdf:RDF>

And without trailing semicolons.


Be the first one to answer this question!

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,938
× 137

Question asked: Apr 08 '13, 12:48 p.m.

Question was seen: 4,755 times

Last updated: Apr 09 '13, 10:16 a.m.

Confirmation Cancel Confirm