It's all about the answers!

Ask a question

DNG 6.0 : List of requiremnts in a folder


Naveen Tyagi (19768152) | asked Sep 15 '15, 12:49 a.m.
i am able to get the folder list and URI from a DNG project. Now, i want to get the list of requirements in a folder.
After going trough few thread i got to know that the url would be for this:

&oslc.prefix=oslc=<http://open-services.net/ns/core%23>,dcterms=<http://purl.org/dc/terms/>,
nav=<http://com.ibm.rdm/navigation%23>&oslc.select=dcterms:title,dcterms:description,
oslc:instanceShape&oslc.where=nav:parent=<https://grarrc.ibm.com:9443/rm/folders
/_RHCJYN5jEeGb6IIbvOh9Dw>

but not able to understand whether to use "query capability" for this url or need to do a get on this url.
I am using OSLC,Eclipse and Java.Thanking in advance.

One answer



permanent link
Donald Nong (14.5k414) | answered Sep 15 '15, 10:51 p.m.
You need to do both. You should append the search parameters to the "queryBase" URL within "Query Capability" and do  a GET against the complete URL. Remember to add HTTP request headers "OSLC-Core-Version: 2.0" and "Accept: application/rdf+xml".

Comments
Naveen Tyagi commented Sep 23 '15, 12:11 a.m.

Thanks Donald,
I managed to this without GET.

 i am able to get the requirements from a folder. I was using wrong prefix that only reason i was not getting value.
Here is the correct syntex to retrieve the URI of the artifacts inside a  folder :

OslcQueryParameters queryParams = new OslcQueryParameters();
queryParams = new OslcQueryParameters();
queryParams.setPrefix("nav=<http://com.ibm.rdm/navigation#>");
queryParams.setWhere("nav:parent=<"+ folderUri +">");
OslcQuery query =new OslcQuery(client, queryCapability, 100, queryParams);
OslcQueryResult result = query.submit();
System.out.println("Result value : " + result.getMembersUrls().length);

Now, one more challenge i am facing, if i have all the requiremnts inside folder then it is working fine but if there one or more than collection in folder then i am getting exception and it is obvious since i am treating every artifact as requirement. so Collection object assignment in Requirements will be incompatible. now, i am wondering how do retrieve requirements but not other artifacts ?


Donald Nong commented Sep 23 '15, 4:09 a.m.

Use an extra filter in the query. The candidates are oslc:instanceShape and rmTypes:ArtifactFormat.

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.