Query module meta information from component
5 answers
I tried the following query, but the result is NULL.
https://{0}/rm/publish/resources
?projectURL={1}
&viewURI={2}
&oslc.prefix=dcterms=%3Chttp://purl.org/dc/terms/%3E&oslc.prefix=nav=%3Chttp://com.ibm.rdm/navigation#%3E
&oslc.prefix=rdf=%3Chttp://www.w3.org/1999/02/22-rdf-syntax-ns#%3E
&oslc.select=dcterms:title
&oslc.where=rdf:type=%3Chttp://jazz.net/ns/rm#Module%3E"
I don't believe you can search for modules with a view using OSLC Query - but your example which doesn't work isn't OSLC Query, that's an attempt to use the Reportable REST API on /rm/publish.
FYI if you were actually using OSLC Query you mustn't put < > around the jazz_rm:Module in the oslc.where, and you must fully url encode the query parameter values everywhere: for example in oslc.prefix the = in the value (like dcterms=) aren't URL encoded - they should be.
Hi,
thanks for your answer.
I use already the correct headers (I did not mention this), but I have no Idea, how to create the correct REST API query for this. Could you please support me in this matter with an example query?
I dont want to have all Modules from a component, but the Modules in a specific view and only their URI and e.g. title and specifier.
Or is there any other solution for what I want to do, I reformulate it here:
I want the following informations from each of my components:
1. Count of Modules with a specifiy Format, e.g. only modules with artifact format ABC.Documents
2. I need the URIs from this modules and their titles and IDs, but not more, because of reduction of web traffic
Using OSLC Query you can use oslc.where=instanceShape=<urlofshape> (where the value must be URL encoded) note the < > are part of the syntax needed to surround a literal URL.
Also provide a configuration using query parameter oslc_config.context or header Configuration-Context, and headers OSLC-Core-Version: 2.0 and Accept: application/rdf+xml
Use oslc.select to specify the properties you want to retrieve in the query results - otherwise you'll just get the module URLs.