It's all about the answers!

Ask a question

How to get the list of module using an artifact (REST API)?

Pierre Bentkowski (51410) | asked Sep 17 '15, 1:02 p.m.

I want to get the list of all the module that make use a specific artifact.
I have access via the REST API to the artifact information in the context of the module and the core.

When looking at the results for the artifact in the context of a module, I can get the information about the current module (moduleContext), but not the other modules (was expected)
When looking at the core artifact I don't see any information relative to modules.

I do not want to query every module in the database to find the specified artifact.

Is there a flag to add in the query to get the information?


One answer

permanent link
Donald Nong (14.4k213) | answered Sep 29 '15, 1:45 a.m.
Sadly, if you use reportable REST API, you have to query every single module in order to find all the modules in which a particular artifact is used. Reportable REST API provides filtering capability, which is not the same as search/query capability. When using the filtering capability, you will potentially put a heavy load on the server.

You can use the OSLC query capability to do the following search.
1. Search by Id, and the result should contain one base/core artifact and zero to many module artifacts.
2. Use the oslc_rm:uses condition to search for modules based on the result returned at the previous step.


Your answer

Register or to post your answer.