DOORS navigation folder query does not work

Hi,

I’m trying to query the navigation folder structure in DOORS Next:

String folderQueryCapability = client.lookupQueryCapability(serviceProviderURI, OSLCConstants.OSLC_RM_V2, "http://jazz.net/ns/rm/navigation#folder");
    // --> https://192.168.99.3:9443/rm/folders?oslc.where=public_rm:parent=https%3A%2F%2F192.168.99.3%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_NunPgHbfEeyVS6HRXK_XDw
    
OslcQueryParameters parameters = new OslcQueryParameters();
parameters.setPrefix("dcterms=<http://purl.org/dc/terms/>,nav=<http://jazz.net/ns/rm/navigation#>");
parameters.setSelect("*");

OslcQuery query = new OslcQuery(client, queryCapability, parameters);
OslcQueryResult result = query.submit();

ClientResponse response = result.getRawResponse();
if (response.getStatusCode() != HttpStatus.SC_OK) {
	response.consumeContent();
	throw new RuntimeException(response.getMessage());
}

if (false) {
	printResponseBody(response);
	// --> prints the rdf+xml shown below the code
	return;
}

String[] membersUrls = result.getMembersUrls();
    // --> empty array
    
boolean hasNext = result.getMembers(Folder.class).hasNext();
// --> false

I’ve added comments for you to see the actual return values that I get with the debugger.

If I enable the printResponseBody() section I get the following console output:

  <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
    xmlns:nav="http://jazz.net/ns/rm/navigation#"
    xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/">
    <oslc:ResponseInfo rdf:about="https://192.168.99.3:9443/rm/folders?oslc.where=public_rm%3Aparent%3Dhttps%3A%2F%2F192.168.99.3%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_NunPgHbfEeyVS6HRXK_XDw&amp;oslc.select=*&amp;oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%2Cnav%3D%3Chttp%3A%2F%2Fjazz.net%2Fns%2Frm%2Fnavigation%23%3E" >
      <dcterms:title>Folder Query Results: 1</dcterms:title>
    </oslc:ResponseInfo>
    <nav:Description rdf:about="https://192.168.99.3:9443/rm/folders">
      <rdfs:member>
        <nav:folder rdf:about="https://192.168.99.3:9443/rm/folders/FR_OEq_EHbfEeyVS6HRXK_XDw">
          <dcterms:title>root</dcterms:title>
          <nav:subfolders rdf:resource="https://192.168.99.3:9443/rm/folders?oslc.where=public_rm:parent=https://192.168.99.3:9443/rm/folders/FR_OEq_EHbfEeyVS6HRXK_XDw"/>
        </nav:folder>
      </rdfs:member>
    </nav:Description>
  </rdf:RDF>

To me it seems as if there is a single rdfs:member element available, the root navigation folder.

Why isn’t that returned by my code?

I tried debugging it but it quickly descends into RDF handling (Jena), which I can’t make much sense of ;-(

Please note that th requirement queries work well for me.

Also note that I started with the 2017-04-26-oslc-workshop.zip that I found on jazz.net because I couldn’t get the Lyo-provided samples to work with Jazz. The code in this workshop came with the following (old) libraries:

oauth-20090617.jar
oauth-httpclient4-20090617.jar
oslc4j-core-2.1.0-SNAPSHOT.jar
oslc4j-jena-provider-2.1.0-SNAPSHOT.jar
oslc4j-json4j-provider-2.1.0-SNAPSHOT.jar
oslc-java-client-2.1.0.jar
slf4j-api-1.6.4.jar
slf4j-log4j12-1.6.4.jar
wink-client-1.1.3-incubating.jar
wink-client-apache-httpclient-1.2.1-incubating.jar
wink-common-1.1.3-incubating.jar
xercesImpl-2.11.0.jar
xml-apis-1.4.01.jar
commons-logging-1.1.1.jar
httpclient-4.2.2.jar
httpcore-4.2.2.jar
javax.servlet-3.1-b33.jar
jena-core-2.7.1.jar
jena-iri-0.9.2.jar
jsr311-api-1.1.1.jar
log4j-1.2.15.jar

Hello Eike,

Sorry for a late reply. I added a test case for your request and it passes (1 member URI is found):

Please make sure:

  1. The queryCapability is exactly https://192.168.99.3:9443/rm/folders
  2. You are calling result.getMembersUrls() to get the member URIs.

/Andrew