How to create an empty Module artifact in RDNG using OSLC?
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><dc:description rdf:parseType="Literal">OSLC Creation Example</dc:description>
<nav:parent rdf:resource="https://XXXX/rm/folders/_XXXXXXXXXXXXXXXXXXXXXX"></nav:parent>
<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
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.