It's all about the answers!

Ask a question

Is there a possibilty to query the by projectArea?

Catalin Morcan (132) | asked Mar 24 '23, 8:05 a.m.

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

Accepted answer

permanent link
David Honey (1.8k17) | answered Mar 24 '23, 9:34 a.m.
edited Mar 24 '23, 10:05 a.m.
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/> ;
                            oslc:resourceShape  <https://localhost:9443/qm/oslc_config/resourceShapes/> ;
                            oslc:resourceType   <> ;
                            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/

To query for specific properties, you use an oslc.where parameter.

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, 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:

Catalin Morcan selected this answer as the correct answer

One other answer

permanent link
Ralph Schoon (63.3k33646) | answered Mar 24 '23, 8:31 a.m.

 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: 

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. 

Catalin Morcan commented Mar 24 '23, 8:38 a.m.

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

Ralph Schoon commented Mar 24 '23, 9:24 a.m.

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 for EWM, maybe that gives you some ideas what to try. You need to work with the specification in any case. 

Catalin Morcan commented Mar 24 '23, 9:41 a.m.

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