It's all about the answers!

Ask a question

Getting all the Global Configurations in which a stream is used in using OSLC

Ana-Maria Rosu (388) | asked Oct 27 '23, 6:46 a.m.
edited Oct 27 '23, 6:47 a.m.

Hello all,

I want to get the list of Global Configurations in which a stream (local config) is used in using OSLC API.

In the web UI this is possible using the option "Find Where Used":

Based on the GC OSLC query capabilities documentation from here I've tried to construct the URL.

This is what I have until now:

GET https://server:port/gc/oslc-query/configurations?oslc_config:contribution{oslc_config:configuration{dcterms:itentifier="local_config_identifier"}}

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

I also encoded the parameter, but it does not find any match for the specified identifier. I cannot figure out what is missing.

Any help would be much appreciated.

Thanks in advance,


Ian Barnard commented Oct 30 '23, 5:06 a.m.

Not sure how you got the syntax for the query parameter oslc_config:contribution{oslc_config:configuration{dcterms:itentifier="local_config_identifier"}} - can you point at an example where exactly that syntax is used? And maybe it's a typo but I'd expect dcterms:identifier not dcterms:itentifier.

Not sure if what you are trying to do is possible but from here I'd expect the syntax for the parameter to be something more like oslc.where=oslc_config:contribution{oslc_config:configuration{dcterms:identifier="local_config_identifier"}} (with the bold part URL encoded) and I expect you'll have to use oslc.prefix to define the oslc_config and probably the dcterms prefixes.

Ana-Maria Rosu commented Oct 30 '23, 9:20 a.m.

Yes, indeed. It was a typo from me, but even with the correction, this first version of the query was working. 

Accepted answer

permanent link
Ian Barnard (1.9k613) | answered Oct 30 '23, 9:04 a.m.

Hi Ana

I tried this on 7.0.2 iFix025 although I've no reason to suppose it won't work on 7.0.1 and probably 7.x

The GC OSLC Query API is documented here Jazz API Usage Scenario: Query for global configurations - you need to use the global query because you want to look for configurations in any project. NOTE this may consume server resources so ensure your usage isn't impacting on other users or the overall load on the server.

(with the bold part URL encoded) gives me two results for an RM stream that is contributing to two GC streams, i.e. as expected.

  • Accept: application/rdf+xml
  • OSLC-Core-Version: 2.0
NOTE there's no need to provide oslc.prefix for prefixes dcterms and oslc_config

My final query URL (with the query parameter value URL encoded) is:

Ana-Maria Rosu selected this answer as the correct answer

Ana-Maria Rosu commented Oct 30 '23, 9:18 a.m.

Hi Ian,

I just tried this now and it works. I also used the documentation you referred to (minus the typo which was a mistake from my side).

Thank you very much for your support.

Best regards,

Your answer

Register or to post your answer.