Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[lyo-dev] Querying requirements in a DOORS module using Lyo?

Hi,

 

Last question for today…I promise J

 

Kind of related to my previous thread on finding requirements in a DOORS baseline using OSLC, I thought I would try a different approach.

I decided to query all the requirements in the module that has been baselined and see if there is some property of the requirements that might indicate which baselines they are contained in.

 

But my OslcQuery is returning no results for my query, even tho when I sniff the network traffic I can see lots of requirements data coming back.

 

I have my URL for the OSLC Service Provider for my module:

 

http://mydwaserver:mydwaport/dwa/rm/discovery/service/urn:rational:ers-390465871f686086:1-390465871f686086-M-00000cc0

 

I get the query URL using the code:

 

String queryCapability = client.lookupQueryCapability(serviceProviderUrl,

  OSLCConstants.OSLC_RM_V2,

  OSLCConstants.RM_REQUIREMENT_TYPE);

 

Then I try to query all requirements that were created today or earlier (all of them).

I do that using the following Lyo code:

 

OslcQueryParameters queryParams = new OslcQueryParameters();

queryParams.setPrefix("dcterms=<http://purl.org/dc/terms/>");

queryParams.setWhere("dcterms:created<=2013-07-03");

OslcQuery query = new OslcQuery(client, queryCapability, 10, queryParams);

OslcQueryResult result = query.submit();

 

String requirementURL = null;

// Get the returned requirements

if ( result != null ) {

    int resultsSize = result.getMembersUrls().length;

 

    if (resultsSize>0) {                       

       String [] returnedURLS = result.getMembersUrls();

       // Do some stuff with the requirements :)

                   

But resultsSize is always zero.

 

Any ideas why the API is returning no objects when the HTTP response seems to have some good data in it?

Is there something else I need to specify when creating my OslcQuery object (perhaps some special attribute I must select for inclusion in the query results)?

 

If I enable a network sniffer I see the following network traffic. Which all looks good, there are lots of requirements coming back.

 

GET /dwa/rm/oslc/query/urn:rational:ers-390465871f686086:1-390465871f686086-M-00000cc0/view:0000000e?oslc.paging=true&oslc.pageSize=10&oslc.where=dcterms%3Acreated%3C%3D2013-07-03&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E HTTP/1.1

 

HTTP/1.1 200 OK

<?xml version="1.0"?>

<rdf:RDF

    xmlns:dcterms="http://purl.org/dc/terms/"

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

    xmlns:rm_property="http://st3958vm:9090/dwa/rm/urn:rational::1-390465871f686086-M-00000cc0/types/"

    xmlns:oslc="http://open-services.net/ns/core#"

    xmlns:foaf="http://xmlns.com/foaf/0.1/"

    xmlns:oslc_rm="http://open-services.net/ns/rm#">

  <rdf:Description rdf:about="http://st3958vm:9090/dwa/rm/oslc/query">

    <rdfs:member>

      <oslc_rm:Requirement rdf:about="http://st3958vm:9090/dwa/rm/urn:rational::1-390465871f686086-O-76-00000cc0">

        <dcterms:title>UR76: Users shall be able to have cassette tape output within the vehicle.</dcterms:title>

      </oslc_rm:Requirement>

    </rdfs:member>

    <rdfs:member>

      <oslc_rm:Requirement rdf:about="http://st3958vm:9090/dwa/rm/urn:rational::1-390465871f686086-O-66-00000cc0">

        <dcterms:title>UR66: Users shall be able to operate gears, if fitted,  with minimal effort.</dcterms:title>

      </oslc_rm:Requirement>

    </rdfs:member>

    <rdfs:member>

      <oslc_rm:Requirement rdf:about="http://st3958vm:9090/dwa/rm/urn:rational::1-390465871f686086-O-40-00000cc0">

        <dcterms:title>UR40: Safety</dcterms:title>

      </oslc_rm:Requirement>

    </rdfs:member>

 

    … lots more requirements here….

 

</rdf:Description>

  <oslc_rm:ResponseInfo rdf:about="http://st3958vm:9090/dwa/rm/oslc/query?urn=urn:rational:ers-390465871f686086:1-390465871f686086-M-00000cc0&amp;view=0000000e&amp;oslc.pageSize=10&amp;oslc.where=dcterms:created&lt;=2013-07-03&amp;oslc.prefix=dcterms=&lt;http://purl.org/dc/terms/&gt;&amp;oslc.paging=true">

    <dcterms:title>User Requirements</dcterms:title>

  </oslc_rm:ResponseInfo>

</rdf:RDF>

 

 

Regards,

--

Peter Raymond

Principal Software Architect

Serena Software

mailto: praymond@xxxxxxxxxx

WWW: http://www.serena.com

 


Back to the top