OSLC pagination in IBM RQM is not working as expected
Hello Everyone,
I wanted to fetch all test cases available in particular project. I am able to get most of test cases, but it is not returning all test cases.
Total Test Cases available in Project:-2744
Return Test Case list size through OSLC :-512(It is default size)
Please find the below OSLC query:-
https://{QM_Domain}:9443/qm/oslc_qm/contexts/{ProjectUUID}/resources/com.ibm.rqm.planning.VersionedTestCase?oslc_config.context={configUUID}&oslc.paging=true&oslc.page=0&oslc.pageSize=100&oslc.orderby=+oslc%3AshortId&oslc.select=dcterms%3Atitle,oslc%3AshortId
Kindly guide, why pagination is not working in this. If there are another ways to achieve it ,kindly suggest.
Thanks and Regards,
Jyoti
2 answers
@Ian Barnard FYI
OSLC paging is, in general, problematic for a number of reasons.
The OSLC specification https://docs.oasis-open-projects.org/oslc-op/core/v3.0/os/oslc-core.html defines
oslc.pageSize
as having units of number of RDF statements, not number of resources:
When responding to a request that includesoslc.pageSizein the URI, a server MAY divide the response into a number of pages and use the value as a hint about the maximum number of RDF statements to be included in each page. Servers MAY return pages containing more or fewer RDF statements than specified. [CORE-29]
The OSLC specification also makes no guarantee about whether any page response is complete. So the only guaranteed way of looking at the returned data is to consume all pages and construct the union model across all those responses.
This makes it especially problematic for querying for resources in a paged manner.
It appears that some tools, like ETM, treat
These issues are discussed at https://github.com/oslc-op/oslc-specs/issues/169.
oslc.pageSize
as the number of resources and include the LDPC in each response for practical reasons of supporting paginated query results. However, in doing so, they are not in compliance with the OSLC Core specification. Which means that clients relying on this are dependent on non OSLC defined tool-dependent behaviours.
These issues are discussed at https://github.com/oslc-op/oslc-specs/issues/169.
Comments
Hi Jyoti
Each page provides the url the next page in the results using a <oslc:nextPage> tag with a resource URI for the next page - if the page doesn't contain the oslc:nextPage then there are no more pages.
I would remove the &oslc.page=0 - it's possible this is causing your problem by always returning just page 0 (the first page).
While you are asserting a page size 100 in your OSLC Query, the server can ignore that or assert its own page size, that's normal/expected behaviour.
You may be providing the configuration in the headers and you haven't shown what you're using. if the ETM project uses configuration management and you don't provide a configuration with the query then you will get results from the default configuration which could be a completely different number of test cases, i.e. like what you're saying..
HTH
Ian
Comments
1 vote