Is there any way to suppress moduleContext information in the DNG REST API?
Accepted answer
Not sure why you think a module should return resources for base artifacts only. A module always refers to module artifacts, while the module artifacts recognize their corresponding base artifact.
If you just want to find out the resource URIs for all the base artifacts in a module, here is what I have found out. When using REST API only, it appears no effective field selection is available for a module. XPath doesn't work (not implemented), and attribute filtering does not work (not available for hierarchical data) either. If you are building an application to process this, the below method should reduce the memory requirement significantly.
1. Use OSLC API (not REST API) to get the module information first. The returned XML should be quite simple and should be easy to process.
2. For each module artifact returned within the module, use the "resources" REST API to find out the corresponding base artifact - its UUID appears in the <rrm:core> attribute.
It can be slow if there are lots of artifacts in the module though.
Comments
Sorry, my initial question was not stated very clearly. I would expect a "resources" query that includes a set of module artifacts to provide a lightweight response with only module-level information for these modules (not the artifacts they contain). The "modules" query is the one that could be more heavyweight and return the moduleContext for all the artifacts it contains. I believe that is how "resources" and "collections" queries worked in the early RRC versions.
I'm with you on this one. The "resources" format returns that exact same information as the "modules" format, which does not make sense to me. But that's the current implementation anyway.
The OSLC API returns a lighter version of the content (which I suspect is what you want), but it seems that you're doing something in RPE, so I'm not sure how practical it can be.
As for the flags, "fields" and "attributeURI" are the only ones that I can find in the document, for this particular purpose. Other than those, I am not aware any other flags/parameters.