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

[DNG API] Is there a way using OSLC capabilities that I can query my project areas for all requirements under all components?

Hi all, 

Thank you for reading. I have a use case to scrape our DNG for all requirements. I only need a little bit of information from each requirement, basically an identifier and the status. 

I'm following a discovery process where I pull the rootservices, then the oslc catalog, and then the service providers. 

When I pull each service provider from here, I use the QueryBase under Query Capability with only a date filter added to the endpoint provided to pull all of the relevant requirements. The issue that I ran into is that this query returns only the requirements from whatever the default component was. I went back and I can see the component that is defined in the services.xml that I pulled from the service providers. 

What I would like to do is "select" a component either when I GET the query capability or when I GET the services.xml. If I can do that, I can iterate through each component to gather all of the data that I need. 

The ideal situation would be that I could pull all of the requirements from all of the components, but I have a feeling that that isn't an option. 

I think my headers are fine, but for completeness:

'Content-Type'= 'application/rdf+xml'
'Authorization'= f'Bearer {authKey}'
'OSLC-Core-Version' = '2.0'
'Accept' = 'application/rdf+xml'

The endpoints that I pull, in order, are: 
https://mydoors.com/rm/rootservices

https://mydoors.com/rm/oslc_rm/catalog

https://mydoors.com/rm/oslc_rm/{PROJECT_AREA}/services.xml

https://mydoors.com/rm/views?oslc.query=true&projectURL=https://mydoors.com/rm/process/project-areas/{PROJECT_AREA}

I've tried adding both the component URI and the config URI within a component to both the queries for the services.xml and the query capability in a couple ways:
As a header: "Configuration-Context" = "{URI}"
As part of the query: "oslc_config.context={URI}"
https://mydoors.com/rm/views?oslc.query=true&projectURL=https://mydoors.com/rm/process/project-areas/{PROJECT_AREA}&oslc_config.context={URI} )

These resulted in the exact same responses, so they're either not a proper solution or I haven't figured out how to do it correctly.

If anyone can offer a solution of any kind, I'd really appreciate it!

0 votes



2 answers

Permanent link

Hi Dominic


For DOORS Next the OSLC Query capabilities are component-specific which means that using a local configuration will only return artifacts from that component-configuration. You could iterate the component-configurations to collect all the artifacts.

Provide the local config using either header Configuration-Context (with the configuration URL) or parameter oslc_config.context (this with a URL-encoded configuration url in the full query URL).

If you use a global configuration URL which has contributions from several local configurations in the same project then the query will return artifacts from the local configurations in that project.

HTH
Ian

0 votes


Permanent link

Hi Ian, 

Thank you for the feedback. I'm not sure if it's something specific about our server, but this solution doesn't quite work, as I explained in the original post. I did find a solution on my own, though.

Rather than supplying a projectURL, I supply a "project" as a query parameter, and that is the missing piece of the puzzle. I found the 'project' by finding an endpoint looking like: 'https://mydoors.com/rm/cm/component/ldpc?project={PROJECT_IDENTIFIER}' within the component list from the response I get from here: 'https://mydoors.com/rm/oslc_config/components'. 

With this specified, supplying the Configuration-Context header (pointed to a stream) gives me the responses that I was looking for.

Cheers,
Dominic



0 votes

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
× 11,089

Question asked: Mar 17 '25, 10:47 a.m.

Question was seen: 2,915 times

Last updated: Apr 01 '25, 7:41 a.m.

Confirmation Cancel Confirm