Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

DNG 6.0 : List of requiremnts in a folder

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.

0 votes



One answer

Permanent link
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".

0 votes

Comments

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 ?

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

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Sep 15 '15, 12:49 a.m.

Question was seen: 3,163 times

Last updated: Sep 23 '15, 4:09 a.m.

Confirmation Cancel Confirm