Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is there a possibilty to query the https://alm.example.com/qm/oslc_config/resources/com.ibm.team.vvc.Configuration by projectArea?

I need a solution to query for the configurations from my projectArea, but an oslc.where using the projectArea does not seem to work. 


I tried building the URI like this but no success

0 votes


Accepted answer

Permanent link
Firstly, I hope you are not hard coding that URI. It looks like that endpoint URI is for an OSLC query capability. In which case, you should be using OSLC Discovery through an OSLC Service Provider Catalog to find the OLSC service providers and any OSLC Query Capabilities they support for specified types of resources.


When I use OSLC discovery, I see an OSLC service provider that defines a service that includes the following:

    oslc:queryCapability  [ a                   oslc:QueryCapability ;
                            oslc:queryBase      <https://localhost:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration> ;
                            oslc:resourceShape  <https://localhost:9443/qm/oslc_config/resourceShapes/com.ibm.team.vvc.Configuration> ;
                            oslc:resourceType   <http://open-services.net/ns/config#Configuration> ;
                            dcterms:title       "Default query capability for Configuration"^^rdf:XMLLiteral
                           ] ;
That service provider is not specific to a project area. The data says that the query base URI is https://localhost:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration

To query for specific properties, you use an oslc.where parameter.
See https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html#oslc.where

However, when I tried a query on process:projectArea is (after using a oslc.prefix parameter to define the process namespace), it reported the error:
AQXCM5004E The query, process:projectArea, is invalid.    
So it appears that the query capability does not support querying on that property.

I also noticed and submitted an ETM defect. The resource shape referenced in the declaration of the query capability should describe the shape of the Query Result Container (see https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html#query-result-containers), not the shape of its members. ETM is not doing that. That shape should then include a property for the member property that includes an oslc:valueShape that references the shape of the members. The resource shape ETM publishes does not describe the process:projectArea property, so this suggests that the property cannot be queried on, confirmed by the above error message.

So the short answer to your question is that it appears your use case is currently not supported. You will have to post-process the query results to exclude configurations that are from project areas that are not of interest. Feel free to submit an enhancement request through the IBM Ideas Portal: https://www.ibm.com/support/pages/welcome-ibm-ideas-portal

Catalin Morcan selected this answer as the correct answer

1 vote


One other answer

Permanent link

 Did you discover the URI as a "oslc:queryBase" ? If so, it likely will be. Just adding arbitrary parameters will likely not work. Here is the standard: https://docs.oasis-open-projects.org/oslc-op/query/v3.0/ps01/oslc-query.html 


If you look into the where syntax, you will note that the argument right to the equals always is enclosed with ". Also read up on and note that the Query part of the URI has to be URL encoded. I do not know at the moment if you can pass the UUID of a project area as parameter. 

0 votes

Comments

Thank you for the response

I understand that my syntax was not good. But I already tried using ".
I did discover the URI as a oslc:queryBase in the oslc-config/catalog.
It is a crucial step in my project to be able somehow to filter the configurations by projectArea

You can not just throw arbitrary data into the URI and hope it starts working. In my experience if you do something that is wrong, the query usually will not work or not return what you want.

I did https://rsjazz.wordpress.com/2022/02/22/ewm-oslc-query-api/ for EWM, maybe that gives you some ideas what to try. You need to work with the specification in any case. 

Yes. I understand that throwing random data is not the approach.

Just I cannot find if the project area can be passed as a parameter with this oslc api. Do you know how or where can I find this information?

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,132

Question asked: Mar 24 '23, 8:05 a.m.

Question was seen: 959 times

Last updated: Mar 24 '23, 10:05 a.m.

Confirmation Cancel Confirm