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.
0 votes
Comments
Rich Kulp
FORUM MODERATOR / JAZZ DEVELOPER Apr 08 '13, 3:20 p.m.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
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
FORUM MODERATOR / JAZZ DEVELOPER Apr 09 '13, 10:05 a.m.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
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
Apr 09 '13, 10:16 a.m.And without trailing semicolons.