It's all about the answers!

Ask a question

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


G C (496) | asked Jan 09, 3:03 a.m.

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


Comments
David Honey commented Jan 09, 5:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


G C commented Jan 10, 12:36 a.m.

 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
Ian Barnard (1.7k613) | answered Jan 10, 6:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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

Comments

Ian Barnard commented Jan 11, 4:14 a.m. | edited Jan 11, 4:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You shouldn't have " around the URL in e.g.:

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.


G C commented Jan 11, 4:22 a.m.

 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


G C commented Jan 11, 6:50 a.m.

 working fine after removing ".


Thanks for the help

Your answer


Register or to post your answer.