[closed] How to get all modules in a project in DNG
Currently I am using the below query to fetch all the modules in a project.
But this returns both modules and core artifacts.
How to get only the modules list?
The question has been closed for the following reason: "The question is answered, right answer was accepted" by ianbarnard Apr 20 '23, 10:05 a.m.
Accepted answer
Module artifacts are core artifacts really, so not sure what's wrong with your overall OSLC Query but something is. Perhaps it's related to the configuration that David mentioned. I've seen badly-written queries return everything, i.e. don't always give an explicit error.
Also the query you show doesn't have URL encoding for the query parameter values - it needs this, example below.
Also you don't specify version+ifix - below works with 7.0.2SR1 and I would expect to work with 7.x.
For modules the query (before url encoding of the parameter value) should be:
- oslc.where=rdf:type=jazz_rm:Module
or the exact equivalent without using a prefix:
- oslc.where=rdf:type=<http://jazz.net/ns/rm#Module>
A fully url-encoded query using this is:
In addition the following headers:
- OSLC-Core-Version: 2.0
- Accept: application/rdf+xml
- Configuration-Context: config url
HTH
Ian
Comments
David Honey
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 19 '23, 6:32 a.m.You should also specify a configuration context using an
oslc_config.context
parameter. If you omit it, the query will run against a default configuration and this may not be what you want,rdf:type
that applies to modules and not core artifacts.