Using the Requirement Creation Factory on OSLC RM API
I am trying to create requirement using the OSLC API and trying to use Requirement Creation Factory.
I am basically a .NET guy and trying to understand how to do it using the REST client in Firefox.
Can somebody describe me the steps?
I have the following specific queries:
1. How do I define the requirement? Is there some specified structure?
2. Do I need to post to the Requirement Creation Factory URL the requirement as content?
I need specific answers. Please help me.
EDIT:
So far so good. I am able to create the requirements pretty well.
But I am wondering on the Links. I could create a link (Implemented By) using the REST Client using the following data in the POST:
<code>
<pre>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
xmlns:rm_property="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/types/">
<oslc_rm:Requirement rdf:about="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/resources/_KKgOcKpVEeGbmvlxhFnwcw">
<oslc:serviceProvider rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/discovery/_wDCq0IObEeG9_P9JMaZ68g/services.xml"/>
<dc:description rdf:parseType="Literal">This is a test document with Link: Kangkan</dc:description>
<oslc:instanceShape rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/types/_yauT4IObEeG9_P9JMaZ68g"/>
<dc:creator rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/jts/users/GoswamiK"/>
<dc:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">40</dc:identifier>
<dc:contributor rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/jts/users/GoswamiK"/>
<rm_property:_wo4i24ObEeG9_P9JMaZ68g rdf:parseType="Literal">
<div xmlns="http://www.w3.org/1999/xhtml" id="_Nf2cQJKNEd25PMUBGiN3Dw"><h1 id="_DwpWsMueEd28xKN9fhQheA">This is a test document with Link: Kangkan</h1></div>
</rm_property:_wo4i24ObEeG9_P9JMaZ68g>
<rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>
<dc:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-05-30T12:44:12.918Z</dc:modified>
<rm_property:_we6HcYObEeG9_P9JMaZ68g rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/types/_wsBWaYObEeG9_P9JMaZ68g#Text"/>
<dc:title rdf:parseType="Literal">This is a test document with implementedBy: https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/resources/_2-uHoIRYEeG9_P9JMaZ68g - Kangkan</dc:title>
<dc:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-05-30T12:44:12.918Z</dc:created>
<oslc_rm:implementedBy rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/resources/_2-uHoIRYEeG9_P9JMaZ68g"/></oslc_rm:Requirement>
</rdf:RDF>
</pre>
</code>
However, when I send a traceTo in place of implementedBy, the link is not created (the requirement gets created anyway).
I also added a new link type (traceability) with relations Trace To and Trace From. But could not create such a link when I specify traceTo in the RDF that I send.
Can somebody help me doing this?
<b>Another update and good news</b>
Just used the Reporting API https://server:port/rm/publish/resources/* and could see all the links that I created, though they are not visible when I try to see them in the links window in the dashboard. A bug or a feature??
I am basically a .NET guy and trying to understand how to do it using the REST client in Firefox.
Can somebody describe me the steps?
I have the following specific queries:
1. How do I define the requirement? Is there some specified structure?
2. Do I need to post to the Requirement Creation Factory URL the requirement as content?
I need specific answers. Please help me.
EDIT:
So far so good. I am able to create the requirements pretty well.
But I am wondering on the Links. I could create a link (Implemented By) using the REST Client using the following data in the POST:
<code>
<pre>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
xmlns:rm_property="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/types/">
<oslc_rm:Requirement rdf:about="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/resources/_KKgOcKpVEeGbmvlxhFnwcw">
<oslc:serviceProvider rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/discovery/_wDCq0IObEeG9_P9JMaZ68g/services.xml"/>
<dc:description rdf:parseType="Literal">This is a test document with Link: Kangkan</dc:description>
<oslc:instanceShape rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/types/_yauT4IObEeG9_P9JMaZ68g"/>
<dc:creator rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/jts/users/GoswamiK"/>
<dc:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">40</dc:identifier>
<dc:contributor rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/jts/users/GoswamiK"/>
<rm_property:_wo4i24ObEeG9_P9JMaZ68g rdf:parseType="Literal">
<div xmlns="http://www.w3.org/1999/xhtml" id="_Nf2cQJKNEd25PMUBGiN3Dw"><h1 id="_DwpWsMueEd28xKN9fhQheA">This is a test document with Link: Kangkan</h1></div>
</rm_property:_wo4i24ObEeG9_P9JMaZ68g>
<rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>
<dc:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-05-30T12:44:12.918Z</dc:modified>
<rm_property:_we6HcYObEeG9_P9JMaZ68g rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/types/_wsBWaYObEeG9_P9JMaZ68g#Text"/>
<dc:title rdf:parseType="Literal">This is a test document with implementedBy: https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/resources/_2-uHoIRYEeG9_P9JMaZ68g - Kangkan</dc:title>
<dc:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-05-30T12:44:12.918Z</dc:created>
<oslc_rm:implementedBy rdf:resource="https://inblr-3dvetfs.eu.uis.unisys.com:9443/rm/resources/_2-uHoIRYEeG9_P9JMaZ68g"/></oslc_rm:Requirement>
</rdf:RDF>
</pre>
</code>
However, when I send a traceTo in place of implementedBy, the link is not created (the requirement gets created anyway).
I also added a new link type (traceability) with relations Trace To and Trace From. But could not create such a link when I specify traceTo in the RDF that I send.
Can somebody help me doing this?
<b>Another update and good news</b>
Just used the Reporting API https://server:port/rm/publish/resources/* and could see all the links that I created, though they are not visible when I try to see them in the links window in the dashboard. A bug or a feature??
Accepted answer
1. How do I define the requirement? Is there some specified structure?
Yes, see below
2. Do I need to post to the Requirement Creation Factory URL the requirement as content?
Yes,
Use the Rest Client to do following ( you need to change the URL's based on your RM configuration ) :
Action : POST
URL : https://gradev.ibm.com:9444/rdm/requirementFactory?projectURL=https://gradev.ibm.com:9443/jts/process/project-areas/_fZXjIqRmEeGHx_XeiXK5Dw
Headers:
Accept=application/rdf+xml
OSLC-Core-Version=2.0
Body: Content Type must be set to application/rdf+xml
<rdf:RDF
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
xmlns:rm_property="https://localhost:9444/rdm/types/">
<oslc_rm:Requirement rdf:about="">
<rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>
<oslc:instanceShape rdf:resource="https://gradev.ibm.com:9444/rdm/types/_gNKXkaRmEeGHx_XeiXK5Dw"/>
<dc:description rdf:parseType="Literal">Requirement Description</dc:description>
<dc:title rdf:parseType="Literal">OSLC_V2_TEST</dc:title>
</oslc_rm:Requirement>
</rdf:RDF>
The Body of this example is simple, if need to add more fields pls check the OSLC specification at: http://open-services.net/bin/view/Main/RmSpecificationV2
Yes, see below
2. Do I need to post to the Requirement Creation Factory URL the requirement as content?
Yes,
Use the Rest Client to do following ( you need to change the URL's based on your RM configuration ) :
Action : POST
URL : https://gradev.ibm.com:9444/rdm/requirementFactory?projectURL=https://gradev.ibm.com:9443/jts/process/project-areas/_fZXjIqRmEeGHx_XeiXK5Dw
Headers:
Accept=application/rdf+xml
OSLC-Core-Version=2.0
Body: Content Type must be set to application/rdf+xml
<rdf:RDF
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
xmlns:rm_property="https://localhost:9444/rdm/types/">
<oslc_rm:Requirement rdf:about="">
<rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>
<oslc:instanceShape rdf:resource="https://gradev.ibm.com:9444/rdm/types/_gNKXkaRmEeGHx_XeiXK5Dw"/>
<dc:description rdf:parseType="Literal">Requirement Description</dc:description>
<dc:title rdf:parseType="Literal">OSLC_V2_TEST</dc:title>
</oslc_rm:Requirement>
</rdf:RDF>
The Body of this example is simple, if need to add more fields pls check the OSLC specification at: http://open-services.net/bin/view/Main/RmSpecificationV2
Comments
Kangkan Goswami
Jun 04 '12, 2:51 a.m.Sorry, I could not add the XML/rdf data in the post as I could not understand how to put XML/HTML in the post in this new system. I have posted a question on that here: https://jazz.net/forum/questions/77945/how-to-post-a-question-to-this-updated-forum