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, https://jazz.net/wiki/bin/view/Main/RRCReportableRestAPI, but nothing has worked.


Accepted answer


permanent link
Gabriel Ruelas (1.1k13) | answered Jun 13 '12, 11:56 a.m.
Hi,
Using OSLC can help you to get the information, use following example ( adapt to your RRC environment ):

https://gradev.ibm.com:9444/rdm/views?oslc.prefix=rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns%23>&oslc.select=*&oslc.where=rdf:type=<http://open-services.net/ns/rm%23RequirementCollection>&projectURL=https://gradev.ibm.com:9443/jts/process/project-areas/_TLBIUrGKEeGOR66SQRG0Cw

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

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


Joseph Reedick selected this answer as the correct answer

Comments
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;projectURL=https%3A%2F%2Frrc.it.att.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_8q0ioCzTEeG6U9u3DDmcLw"/>;

Final query to return just the requirement collection links: Base query + &oslc.prefix=rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns%23,oslc_rm=http://open-services.net/ns/rm%23&oslc.where=rdf:type=http://open-services.net/ns/rm%23RequirementCollection&oslc.select=oslc_rm:RequirementCollection

One other answer



permanent link
Bas Bekker (1.4k4) | answered Jun 12 '12, 5:06 p.m.
JAZZ DEVELOPER
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:

https://jazz.net/library/article/635



Comments
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.