It's all about the answers!

Ask a question

Problem adding artifacts to Rational Asset Manager asset using REST


Fredrik Sparre (1111) | asked Apr 08 '13, 12:48 p.m.

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


Comments
Rich Kulp commented Apr 08 '13, 3:20 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

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


Fredrik Sparre commented Apr 09 '13, 3:18 a.m.

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 


Rich Kulp commented Apr 09 '13, 10:05 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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.


Fredrik Sparre commented Apr 09 '13, 10:14 a.m.

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>


Fredrik Sparre commented Apr 09 '13, 10:16 a.m.

And without trailing semicolons.

Be the first one to answer this question!


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