It's all about the answers!

Ask a question

Using the Requirement Creation Factory on OSLC RM API


Kangkan Goswami (1571621) | asked May 23 '12, 8:24 a.m.
edited Jun 06 '12, 10:50 a.m.
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??


Comments
Kangkan Goswami commented 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

Accepted answer


permanent link
Gabriel Ruelas (1.1k13) | answered May 23 '12, 5:51 p.m.
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
&lt;rdf:RDF
xmlns:calm=&quot;http://jazz.net/xmlns/prod/jazz/calm/1.0/&quot;
xmlns:dc=&quot;http://purl.org/dc/terms/&quot;
xmlns:oslc=&quot;http://open-services.net/ns/core#&quot;
xmlns:oslc_rm=&quot;http://open-services.net/ns/rm#&quot;
xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
xmlns:rm=&quot;http://www.ibm.com/xmlns/rdm/rdf/&quot;
xmlns:rm_property=&quot;https://localhost:9444/rdm/types/&quot;&gt;
&lt;oslc_rm:Requirement rdf:about=&quot;&quot;&gt;
&lt;rdf:type rdf:resource=&quot;http://open-services.net/ns/rm#Requirement&quot;/&gt;
&lt;oslc:instanceShape rdf:resource=&quot;https://gradev.ibm.com:9444/rdm/types/_gNKXkaRmEeGHx_XeiXK5Dw&quot;/&gt;
&lt;dc:description rdf:parseType=&quot;Literal&quot;&gt;Requirement Description&lt;/dc:description&gt;
&lt;dc:title rdf:parseType=&quot;Literal&quot;&gt;OSLC_V2_TEST&lt;/dc:title&gt;
&lt;/oslc_rm:Requirement&gt;
&lt;/rdf:RDF&gt;


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
Kangkan Goswami selected this answer as the correct answer

One other answer



permanent link
Joseph Reedick (10847) | answered May 23 '12, 12:32 p.m.
Try this: https://jazz.net/library/article/635 -&gt; OSLC Workshop Download (https://jazz.net/wiki/bin/view/Main/OSLCWorkshopDownload)

Look at example 6.4. It's in java, but you should be able to glean the REST syntax needed to create a requirement.

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.