It's all about the answers!

Ask a question

OSLC QUery in DNG


Reem Kadadihi (135) | asked Jul 27 '21, 5:22 a.m.
Hello,

is it possible to create a query in DNG which gets the Modules from a sepecific component.
My actuall problem is that I use the url
to get the infrmation. But I get only the info related to the first component in the project area.
I am not sure if I can use the component Id in the reporatble api or in the oslc api.
If anyone has faced a similar problem I am thankfull for every hint.
Thanks in advance.
Reem.

3 answers



permanent link
Reem Kadadihi (135) | answered Aug 03 '21, 6:36 a.m.

Thank you both David and Ian. Right now I query just one stream using the vvc coniguration. The global configuratin didnt work for me.


Comments
Ian Barnard commented Oct 21 '21, 9:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

That may be because you used header vvc.configuration - don't use that, instead, regardless of whether local or gc configuration URL, use either header Configuration.Context or parameter oslc_config.context - and I suggest you capaitalize exactly as shown here.


permanent link
David Honey (1.8k17) | answered Jul 27 '21, 11:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
@reem80 you could try using a global configuration as the configuration context. I don't know if DN supports that, but it if does, and the GC contains multiple RM streams, that might work across some of those streams. Often, OSLC query capabilities are specific to a service provider that is associated with a project area, and is likely to only return matching resources from that project area.

Comments
David Honey commented Jul 29 '21, 5:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I regard that as a DOORS Next defect. Is there a defect already submitted for this?


Ian Barnard commented Jul 29 '21, 12:53 p.m. | edited Jul 29 '21, 12:56 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Yes DN does support receiving a GC URI in Configuration-Context, but my first attempt code to test it was wrong :-(


So if you provide a GC URI in header Configuration-Context and/or parameter oslc_config.context then yes DN does query across components within a project which contribute to that GC, and this works for the type system as well as resources returned in Query.

@reem80 However if your question was "in one component we can define many streams or not?" and that means you somehow want to query all modules in all configurations in a component then nothing has changed from my answers above: an OSLC query will only return results which are in a specific single configuration in each component, either explicitly specified as the local config you provide or implicitly specified by being in a contribution local configuration URI to the Global Configuration you provide  from a component in the project.


permanent link
Ian Barnard (1.9k613) | answered Jul 27 '21, 6:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 27 '21, 11:36 a.m.

 Hi


You need to specify the configuration URI in header Configuration-Context alongside the query. The configuration is component-specific, so specifies the component.

For example here's a full OSLC Query URL and headers, querying for ArtifactFormat Module:


Accept: application/rdf+xml
OSLC-Core-Version: 2.0

Decoding the parameters and splitting onto separate lines, the URL looks like:

?oslc.pageSize=200
&oslc.paging=true
&oslc.query=true
&oslc.select=dcterms:identifier,rm_nav:parent
&oslc.where=rdm_types:ArtifactFormat=<http://jazz.net/ns/rm#Module>

The paging parameters aren't required, but I always put them in.


Comments
Reem Kadadihi commented Jul 27 '21, 6:06 a.m.
Hi,
thanks for the answer. I did a similar query and added in the vvc.configuration the stream url. This will geive me all Info from one stream. but in a one component we can define many streams or not? please correct me if I misunderstand.

David Honey commented Jul 27 '21, 7:26 a.m. | edited Jul 27 '21, 7:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The correct header for specifying a configuration context as defined by the OSLC Configuration Management specification is Configuration-Context.
@ianbarnard is this supported by DN?


Ian Barnard commented Jul 27 '21, 11:34 a.m. | edited Jul 27 '21, 11:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

@davidhoney yes it is supported at least in 7.0.2


@reem80 you can only query one configuration at once using OSLC Query.

Yes you can have many streams in one component, and many baselines in each of those streams. Versions of a module may be present in any number of those streams and would appear in baselines taken of the stream while it was present in the stream. But normally you'd only worry about modules in a specific configuration, e.g. the one you're working on at the moment.

OSLC Query can't do a query like 'give me all versions of a module'; a query is always targeted at a specific configuration. When you don't specify a configuration you're probably getting results from the default stream of the default component which is far to vague to be useful and anyway wouldn't work if the default stream or default component had been archived.

So if you want to query more than one configuration then you'll have to do an OSLC query for each of the configurations you're interested in.


David Honey commented Jul 27 '21, 11:39 a.m. | edited Jul 27 '21, 11:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Ok, thanks @ianbarnard. We should avoid inviting the user of vvc.configuration because that's deprecated and harks back to the days of a separate VVC server.

@reem You should also be able to use the oslc_config.context query parameter. See https://oslc-op.github.io/oslc-specs/specs/config/config-resources.html#configcontext.


Ian Barnard commented Jul 29 '21, 1:03 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Corrected my 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.