It's all about the answers!

Ask a question

GC REST API Usage


vinitha dsouza (147223136) | asked Jan 11 '23, 7:26 a.m.
Hello Team,

i am referring the GC Scenarios given based on

i have fired the below query for a given project area and getting all the GC releted data (staging,personal streams..,)

my usecase: Get the GC configurations only not personal streams, Staged baselines..of given project area

i have come across parameter like rdf:type which can be added where condition. unfortunately cannot succeed there.
Can you provide same sample for the same?
below is the url i have fired

and do you have documentation on the content retrieved?

Accepted answer


permanent link
David Honey (1.8k17) | answered Jan 11 '23, 8:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jan 11 '23, 8:53 a.m.

If you are using https://jazz.net/gc/doc/scenario?id=QueryConfigurations then that page describes the values you can use for rdf:type in an olsc.where expression. If you want to only return shared streams and baseline staging streams, then the query expression should include rdf:type in [oslc_config_ext:SharedStream, oslc_config_ext:BaselineStagingStream] . Remember that parameter values should be encoded, so the request URI would include ?oslc.where=rdf%3Atype%20in%20%5Boslc_config_ext%3ASharedStream%2C%20oslc_config_ext%3ABaselineStagingStream%5D . I hope you are using standard OSLC discovery to find the query base URI of a query capability and not constructing the URI yourself.

vinitha dsouza selected this answer as the correct answer

Comments
Ian Barnard commented Jan 11 '23, 8:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

OP wants everything except staging baselines and personal streams :-( 


David Honey commented Jan 11 '23, 8:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I'm sure they can figure this out for themselves based on the above examples and the API doc page. :-)


David Honey commented Jan 11 '23, 8:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

vinitha dsouza commented Jan 12 '23, 9:38 a.m.
thanks for the input.in the response what shall be used to differentiate that this is staging baseline/stream.., i see one item has so many rdf types how to figure out
<rdf:Description rdf:gnout="https://alm-q.de.x.com/gc/configuration/153">
..    <oslc_config:component rdf:resource="https://alm-q.de.x.com/gc/component/23" /><oslc_config:accepts rdf:resource="http://open-services.net/ns/config#Configuration" /><oslc_config:baselines rdf:resource="https://alm-q.de.x.com/gc/configuration/153/baselines" /> ..   <oslc_config:contribution rdf:resource="https://alm-q.de.x.com/gc/part/1082" /> <oslc_config:contribution rdf:resource="https://alm-q.de.x.com/gc/part/1083" />..<oslc_config:contribution rdf:resource="https://alm-q.de.x.com/gc/part/1081" />..<rdf:type rdf:resource="http://jazz.net/ns/config_ext#SharedStream" /><rdf:type rdf:resource="http://open-services.net/ns/config#Stream" /> <dcterms:subject>platform/gen15</dcterms:subject></rdf:Description>

vinitha dsouza commented Jan 12 '23, 9:40 a.m.
By the way, i do not understand difference between Shared streams and Streams?
the terminology used to what i see in the UI.
in addition what exactly is accepted by , accepts in the xml definition
I would be glad if you shown some help that mapping to What is see in GC UI and to response.



David Honey commented Jan 12 '23, 9:45 a.m. | edited Jan 12 '23, 9:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

That specific GC only has two RDF types:

  1. http://jazz.net/ns/config_ext#SharedStream
  2. http://open-services.net/ns/config#Stream
#1 is a GC specific type.
#2 is a general OSLC Configuration Management type.


David Honey commented Jan 12 '23, 9:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The concepts of streams and baseliens are defined by OSLC Configuration Management. More information can be found at https://docs.oasis-open-projects.org/oslc-op/config/v1.0/ps01/oslc-config-mgt.html.

In GCM, there are several sub-types of streams:
  1. A shared stream is stream that can be used by multiple users for ongoing development work.
  2. A baseline staging stream is a stream that is used to prepare a baseline and typically becomes a baseline at some point.
  3. A personal sream is specific to a particular user and is used when working on change sets, especially in DOORS Next.
All 3 will have an RDF type of oslc_config:Stream . They typically also have additional GCM-specific types to distinguish them.

vinitha dsouza commented Jan 20 '23, 6:14 a.m.
It is rather confusion to me now.
Can you help me with an example,
1. how can i query all the GC configurations of given project area.
2. From the response, what is fool proof way to identify the GC configurations only not Staging baseline streams,personal streams (i.e an element to distinguish this).
3. Docu that help me to understand that overall the Response (I see lot of content cannot actually understand the relation ship), would be glad some high level information

David Honey commented Jan 20 '23, 7:02 a.m. | edited Jan 20 '23, 7:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Use the OSLC query capability for the project area of interest and for configurations. This is all described in https://jazz.net/gc/doc/scenario?id=QueryConfigurations.That page includes 3 examples that show the response.

You can distinguish types of configurations by looking at the rdf:type values for each. Or if you only want to query for certain types, you can include that in your oslc.where query expression. I already gave an example of that in an earlier post.

For general information about OSLC query, see https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html.

showing 5 of 9 show 4 more comments

One other answer



permanent link
Ian Barnard (2.3k714) | answered Jan 11 '23, 8:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jan 11 '23, 8:39 a.m.

If you're using this scenario Jazz API Usage Scenario: Query for global configurations using LDPCs then note the page says very clearly "... any  oslc.where  parameter in the request is ignored" - so you'll have to filter the results to find the ones you are interested in.


Or if using this scenario Jazz API Usage Scenario: Query for global configurations then you may be able (I haven't tested htis) to be more selective by using:

 oslc.where=rdf:type in [oslc_config:Stream,oslc_config:Baseline]
Ah yes I see that a staging baseline is also (quite reasonably) a stream and a configuration - this is what is returned for rdf:type: 
* oslc_config_ext:BaselineStagingStream
* oslc_config:Configuration
* oslc_config:Stream

This means it's returned when you query for rdf:type=oslc_config:Stream, and also when you query for rdf:type=oslc_config:Configuration

OSLC Query (the spec itself, i.e. this isn't a limitation or restriction of GCM) doesn't have a 'not in' or 'is not' so you'll have to filter the results to remove the configurations you're not interested in.

I believe this topic of 'not' is being actively discussed, perhaps @davidhoney can add something about that?

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.