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

how can we fetch all modules of a project area by using module type as filter using oslc query

 how can we fetch all modules of a project area by using module type as filter using oslc query

0 votes

Comments
Have you read about OSLC Discovery (https://docs.oasis-open-projects.org/oslc-op/core/v3.0/os/discovery.html) and OSLC Query (https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html) ? Those two specifications tell you how to discover an OSLC query capability for querying resources of some RDF type, and then having found one, how to consume it. A module will have an RDF type of http://open-services.net/ns/rm#RequirementCollection.

 Hello David, Thanks for the quick response. i wanted to know if we can fetch modules based on module type i.e, customer requirement, software requirement 


Accepted answer

Permanent link

 Yes you can query for modules by artifact type like

oslc.where=oslc.instanceShape=<urioftype>

e.g.
oslc.where=oslc:instanceShape=<https://SERVER:PORT/rm/types/OTx7TIEB6Eeuh3Iiax2L3Ow>

This must be URL-encoded in the query URL to e.g.
oslc.where=oslc%3AinstanceShape%3D%3Chttps%3A//SERVER%3APORT/rm/types/OTx7TIEB6Eeuh3Iiax2L3Ow%3E

You'll need to provide prefix definitions for e.g. oslc in the oslc.prefix, of course

You can find the type definitions to find the type url using the configuration-specific services.xml  - which is where you find the query capability base URLs - the types are referenced in the query capability and factory definitions.


G C selected this answer as the correct answer

0 votes

Comments
 Hello Ian I tried using the below two queries one suggested by you and from the reference document you have asked to refer, but I am getting bad request error. Can you please let me know where I am doing the mistake Note : I will replace the serverUrl with my server url Query 1: https://serverurl/rm/views?oslc.query=true&projectURL=https%3A%2F%2Fserverurl%2Frm%2Fprocess%2Fproject-areas%2F_lHiK8KCkEeqZEuOY_z6S2AA&oslc.prefix=rm%3D%3Chttp%3A%2F%2Fwww.ibm.com%2Fxmlns%2Frdm%2Frdf%2F%3E&oslc.select=*&oslc.where=rm:ofType%3D%3C%22https%3A%2F%2Fserverurl%2Frm%2Ftypes%2FOT_Ek6nE-U1EeWet5TBEvruVA%22%3E Query 2 : https://serverurl/rm/views?oslc.query=true&projectURL=https%3A%2F%2Fserverurl%2Frm%2Fprocess%2Fproject-areas%2F_lHiK8KCkEeqZEuOY_z6S2AA&oslc.where=oslc%3AinstanceShape%3D%3C%22https%3A%2F%2Fserverurl%2Frm%2Ftypes%2FOT_Ek6nE-U1EeWet5TBEvruVA%22%3E&oslc.prefix=oslc%3D%3Chttp%3A%2F%2Fopen-services.net%2Fns%2Fcore%23%3E

You shouldn't have " around the URL in e.g.:  oslc.where=oslc:instanceShape=<"https://serverurl/rm/types/OT_Ek6nE-U1EeWet5TBEvruVA"> If that doesn't fix the bad request problem then also show all the headers you're providing?  Also what version+ifix are you using? There have been defects in the APIs which are resolved in latest ifix so always a good policy to keep using the most recent ifix.

 Hello, Even after removing " I am facing same error Version we are using -  7.0.2 SR1 iFix017 Headers I am using Configuration - context - stream URL OSLC-Core-Version=2.0 Accept=application/rdf+xml

 working fine after removing ". Thanks for the help

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
× 7,625
× 1,455

Question asked: Jan 09 '23, 3:03 a.m.

Question was seen: 2,991 times

Last updated: Jan 11 '23, 6:50 a.m.

Related questions
Confirmation Cancel Confirm