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

Can we fetch only artifacts of system requirement type using OSLC?

 Can we fetch only artifacts of system requirement type using OSLC?

0 votes


Accepted answer

Permanent link

Hi


Yes - using OSLC Query you can retrieve resources of a particular artifact type, or do more complex queries. 


This article https://jazz.net/library/article/1197 gives a useful overview of how to use the OSLC APIs of DOORS Next, and has some search examples under the heading Using the query capabilities 

So you'd specify (appropriately encoded):

  • oslc.where=oslc:instanceShape=<URI of Stakeholder Requirement shape>

For example:


Which is encoded in the URL (along with other OSLC query parameters like oslc.select, oslc.prefix) as:

  • &oslc.where=oslc%3AinstanceShape%3D%3Chttps%3A%2F%2Fjazz.ibm.com%3A9443%2Frm%2Ftypes%2F_k4KCi9cKEeqXpuBdEolY7w%3E
You can discover the shape URI from the component+configuration services.xml, which is part of the discovery sequence where you also find the query capability for oslc_rm:Requirement.

If you want a working example of using OSLC Query, which you can also modify/adapt/extend if you want to, and you're able to use Python then there is an open source example of command-line OSLC Query (among other things) here https://github.com/IBM/ELM-Python-Client also installable using pip install elmclient - full disclosure, I'm the author :-) Using the oslcquery command from this package means you don't have to worry about assembling the complex URL of the query, and you can specify your query on the command line using the name of the type like -q "oslc:instanceShape='Stakeholder Requirement'"

HTH
Ian

Ian Barnard selected this answer as the correct answer

1 vote

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,498
× 1,328

Question asked: Nov 25 '21, 1:47 a.m.

Question was seen: 807 times

Last updated: Nov 25 '21, 5:32 a.m.

Confirmation Cancel Confirm