It's all about the answers!

Ask a question

Fetching Resultset for RM query using OSLC4J


Sudipto Sarkar (631443) | asked Sep 28 '16, 9:42 a.m.
I am using OSLC4J to fetch artifacts in DNG  with some query parameters.
String folderUri=https://server.com/folders/_45dhdjnakqqabncmkk7652js
OslcQueryParameters queryParams = new OslcQueryParameters(); 
       //  queryParams.setWhere("nav:parent=<"+ folderUri +">");
        //queryParams.setPrefix("oslc_rm=<http://open-services.net/ns/rm#>"); 
        queryParams.setPrefix("nav=<http://com.ibm.rdm/navigation#>,rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"); 
       queryParams.setWhere("nav:parent=<"+ folderUri +">, rdf:type=<http://open-services.net/ns/rm#Requirement>;");
        OslcQuery query = new OslcQuery(client,queryCapability, 50, queryParams);
        System.out.println(query.getPageSize());
        OslcQueryResult result = query.submit();
        String[] s=result.getMembersUrls()

The result doesnt show any records. I checked using oslc2.0 and the same query url shows 41 results.
Am I missing something.
I am following article: https://jazz.net/library/article/1382


 

Comments
Donald Nong commented Sep 29 '16, 10:06 p.m.

Have you checked the log file (rm.log) for any errors?


Sudipto Sarkar commented Sep 30 '16, 1:28 a.m.

There are no errors in the log file.
When I am trying to parse the response using xml, the response is fine.
Ex: ClientResponse res=result.getRawResponse();
            if(res.getStatusCode()==200){
                return res.getEntity(InputStream.class);}
But When I try to get the result using:
result
.getMembersUrls(), its null.
and getMembersUrls().length is zero.


Donald Nong commented Sep 30 '16, 1:32 a.m.

You'd better dump the response and see what you've got with HTTP 200 code.

Be the first one to answer this question!


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.