Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Query module meta information from component

Hello,


I want to query all my modules with a particular view from my components, but I only want to have the module URI, not the content in order to count them and to establish a module list. Is this possible with an oslc query?

Thanks

0 votes



5 answers

Permanent link

I tried the following query, but the result is NULL.


https://{0}/rm/publish/resources
?projectURL={1}
&viewURI={2}
&oslc.select=dcterms:title
&oslc.where=rdf:type=%3Chttp://jazz.net/ns/rm#Module%3E"

0 votes


Permanent link

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.

0 votes


Permanent link

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.

0 votes

Comments

You can't use OSLC Query to query for a specific view.


Permanent link

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

0 votes


Permanent link

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.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,132

Question asked: Apr 09 '25, 2:49 a.m.

Question was seen: 1,296 times

Last updated: Apr 09 '25, 7:02 a.m.

Confirmation Cancel Confirm