It's all about the answers!

Ask a question

How to create an empty Module artifact in RDNG using OSLC?


Mahitorn Kanjanapart (113) | asked Jul 09 '20, 4:38 a.m.
I am using RDNG 6.0.6 and OSLC creation factory same as this article -> https://jazz.net/library/article/1197
I searched the forum and found this issue https://jazz.net/forum/questions/205757/dng-60-create-module-through-oslc. It seem RDNG should be able to create Module in 6.0.6. 

I am not sure which is the correct rdf:type for creating module, so I try using "http://jazz.net/ns/rm#Module" as the value like this.

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:dc="http://purl.org/dc/terms/" 
xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/" 
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" 
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/" 
xmlns:acp="http://jazz.net/ns/acp#" 
xmlns:rm_property="https://grarrc.ibm.com:9443/rm/types/" 
xmlns:oslc="http://open-services.net/ns/core#" 
xmlns:nav="http://jazz.net/ns/rm/navigation#" 
xmlns:oslc_rm="http://open-services.net/ns/rm#"
>
<rdf:Description rdf:about="">
<oslc:instanceShape rdf:resource="https://XXXX/rm/types/_XXXXXXXXXXXXXXXXXXXXXX"></oslc:instanceShape>
<nav:parent rdf:resource="https://XXXX/rm/folders/_XXXXXXXXXXXXXXXXXXXXXX"></nav:parent>
<dc:description rdf:parseType="Literal">OSLC Creation Example</dc:description>
    <dc:title rdf:parseType="Literal">OSLC Created Requirement</dc:title>        
<rdf:type rdf:resource="http://jazz.net/ns/rm#Module"></rdf:type>
<rdf:type rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>

</rdf:Description>
</rdf:RDF>

The server responses '201 created' and it end up creating an empty 'Collection' not an empty 'Module' artifact.


Then, I try this request body and still not successful. (RDNG will create a text artifact instead)

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:dc="http://purl.org/dc/terms/" 
xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/" 
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" 
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/" 
xmlns:acp="http://jazz.net/ns/acp#" 
xmlns:rm_property="https://grarrc.ibm.com:9443/rm/types/" 
xmlns:oslc="http://open-services.net/ns/core#" 
xmlns:nav="http://jazz.net/ns/rm/navigation#" 
xmlns:oslc_rm="http://open-services.net/ns/rm#"
>
<rdf:Description rdf:about="">
<oslc:instanceShape rdf:resource="https://XXXX/rm/types/_XXXXXXXXXXXXXXXXXXXXXX"></oslc:instanceShape>
<nav:parent rdf:resource="https://XXXX/rm/folders/_XXXXXXXXXXXXXXXXXXXXXX"></nav:parent>
<dc:description rdf:parseType="Literal">OSLC Creation Example</dc:description>
    <dc:title rdf:parseType="Literal">OSLC Created Requirement</dc:title>        
<rdf:type rdf:resource="http://jazz.net/ns/rm#Module"></rdf:type>
<rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>

</rdf:Description>
</rdf:RDF>

If I use only <rdf:type rdf:resource="http://jazz.net/ns/rm#Module"></rdf:type>, RDNG will return 403: Forbidden. CRRRS6401E Error parsing content. Content must be valid rdf+xml.


<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:dc="http://purl.org/dc/terms/" 
xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/" 
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" 
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/" 
xmlns:acp="http://jazz.net/ns/acp#" 
xmlns:rm_property="https://grarrc.ibm.com:9443/rm/types/" 
xmlns:oslc="http://open-services.net/ns/core#" 
xmlns:nav="http://jazz.net/ns/rm/navigation#" 
xmlns:oslc_rm="http://open-services.net/ns/rm#"
>
<rdf:Description rdf:about="">
<oslc:instanceShape rdf:resource="https://XXXX/rm/types/_XXXXXXXXXXXXXXXXXXXXXX"></oslc:instanceShape>
<nav:parent rdf:resource="https://XXXX/rm/folders/_XXXXXXXXXXXXXXXXXXXXXX"></nav:parent>
<dc:description rdf:parseType="Literal">OSLC Creation Example</dc:description>
    <dc:title rdf:parseType="Literal">OSLC Created Requirement</dc:title>        
<rdf:type rdf:resource="http://jazz.net/ns/rm#Module"></rdf:type>
</rdf:Description>
</rdf:RDF>

I suspect that I am using incorrect rdf:type value.
If this is not the correct API for creating an empty Module artifact, please correct me.

2 answers



permanent link
Mahitorn Kanjanapart (113) | answered Jul 16 '20, 5:45 a.m.
Hi, 

I look forward to hearing from you.

If the rdf:type cannot be used, is it possible to change artifact format using API after creating artifact?

permanent link
Christian Gallant (11) | answered May 16 '23, 9:33 a.m.

Hi,


If you change the type to  <rdf:type rdf:resource="http://jazz.net/ns/rm#Artifact"/> it should work.
This way it works for us.

A RequirementCollection will always  be a Module.

Your answer


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.