It's all about the answers!

Ask a question

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


G C (498) | asked Nov 25 '21, 1:47 a.m.

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

Accepted answer


permanent link
Ian Barnard (1.9k613) | answered Nov 25 '21, 4:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Nov 25 '21, 5:32 a.m.

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

Your answer


Register or 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.