It's all about the answers!

Ask a question

REST API: Fast or Scalable way to get list of collections in a project?

Joseph Reedick (10847) | asked Jun 07 '12, 10:32 a.m.
edited Jun 07 '12, 10:33 a.m.
Currently, I'm getting the list of collections in a project via  https://server:port/rm/publish/collections?projectName="MyProject".  The problem is that the query returns too much information (i.e. the collections plus all the linked items in the collections, plus basic information about the linked items.)  With just 13 collections, it's taking 30 seconds for the query to return.  Needless to say, when the number of collections (and the number of requirements in collections) grows, performance is going to suffer.

Using the REST API, does anyone know of a way to list just the collection URIs in a project? 

I've been fiddling with the reporting API,, but nothing has worked.

Accepted answer

permanent link
Gabriel Ruelas (1.1k13) | answered Jun 13 '12, 11:56 a.m.
Using OSLC can help you to get the information, use following example ( adapt to your RRC environment ):<>&*&oslc.where=rdf:type=<>&projectURL=

Note: the %23 is the encoding of "#".

If you need specific fields modify the entry so you specify the fields needed in the response.

Joseph Reedick selected this answer as the correct answer

Joseph Reedick commented Jun 14 '12, 1:24 p.m. | edited Jun 14 '12, 1:24 p.m.

That was it. Many thanks!

For posterity's sake: Get the Query Base: <oslc:querybase rdf:resource="https://myserver:1234/rm/views?oslc.query=true&amp;"/>;

Final query to return just the requirement collection links: Base query + &oslc.prefix=rdf=,oslc_rm=

One other answer

permanent link
Bas Bekker (1.4k4) | answered Jun 12 '12, 5:06 p.m.
Have you tried the RRC OSLC Query Capability Service Provider to obtain project requirements and collections?
You can find samples how to interact with the OSLC interface in the workshop document you find here:

Joseph Reedick commented Jun 12 '12, 5:23 p.m.

Yup, I've tried the query service, read the workshop, read the publishing/report api, etc.. Either I'm missing something obvious, or there simply isn't a lightweight means of getting the list of collections in a project via the REST api.

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.