It's all about the answers!

Ask a question

Fetch an artifact with a specific section from DNG

Reem Kadadihi (133) | asked Dec 15 '21, 4:57 a.m.
retagged Jan 19, 8:13 a.m. by Ian Barnard (1.2k613)
I m trying to fetch an artifact fron DNG with a specific section. My module has more than 4000 artifacts and to fetch the whole module and serach for the section I nedd to get is very complex and the paging option is alos not clear for me.
Is it possible to add the section as a query pamaeter in any API for DNG?
What is the right way to read the complete module using the paging possibilty?

The URl I use to fecth the module right now is:

Thanks in advance.

Accepted answer

permanent link
Ian Barnard (1.2k613) | answered Dec 16 '21, 7:05 a.m.
edited Dec 16 '21, 8:30 a.m.


That's a big module - you might want to consider splitting it into smaller modules just to make it easier/quicker to view, to manage changes and reduce changeset dependency, etc. And with a smaller module then you won't have so many pages of results so easier to process using whatever API.

Your URL is a call to the DOORS Next Reportable REST API

This returns the entire module structure, which can't be filtered by the API. If the result is paged then each page has a link to the URL for next page in the opening tag as attributes rel="next" and href= url for next page, for example in bold:


To get more granularity you could use the OSLC APIs. You would find the project/component/configuration, then perhaps search for the module using OSLC Query. Once you've got the module you can get its structure and then selectively retrieve the artifacts you want.

There's a summary/example of how to find project/component/configuration(at the OSLC API level, not code) in my answer here

The Module structure API is documented here:

Note the module API doesn't give you section/heading numbers, AFAIK these are calculated not permanently stored, likely because they have to change as you change the structure.

I've found the Module Structure API to be a bit fussy about which headers/query parameters it works with, so ensure that you:
  • Don't construct the structure URL, get it from the module definition by doing a GET on the module URL using the following settings, and also use these settings to retrieve the module structure itself:
  • Provide header (capitalised exactly like this)
    • DoorsRP-Request-Type: public 2.0
  • Do NOT provide header OSLC-Core-Version
  • Provide the configuration using header vvc.configuration and NOT using header Configuration-Context or query ?oslc_config.context - so it must be a local configuration URL not a global configuration

There's an example written in Python of using the module structure API to retrieve the structure in either JSON or RDF and then print a heading-indented view of the module, in my OSS elmclient on github. NOTE the section number calculation hasn't been fully checked/verified in this demo, you'll have to confirm it works for you and fix if necessary. See

Reem Kadadihi selected this answer as the correct answer

Reem Kadadihi commented Dec 16 '21, 10:12 a.m.

thanks for the asnwer. I got it now with the paging and I am able to read the whole module. I will check you python suggestion.

Your answer

Register or to post your answer.