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

EWM OSLC Query Search for link(chengesets(remote)) exist on workitems, what kind of parameters should I set?

We are investigating how to search for work items with Changeset (Remote).
I'm trying to search for OSLC Query, but I don't know how to set the same conditions as "exist" in the "EWM query".
what kind of parameters should I set?

As a guess, when I executed it under the following conditions, I was angry that "the conditions cannot be NULL."
Curl: -H "Accept: application/rdf+xml" -H "OSLC-Core-Version: 2.0"
https://jazzewm.com/ccm/oslc/contexts/_BABCgO8-EeuR4JcRG1xq9Q/workitems?oslc.where=oslc_cm:tracksChangeSet!=""
                                                                             ~~~~ 

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#" >
  <rdf:Description rdf:nodeID="A0">
    <oslc:message>Expected symbol: ", actual: null</oslc:message>
    <oslc:statusCode>400</oslc:statusCode>
    <rdf:type rdf:resource="http://open-services.net/ns/core#Error"/>
  </rdf:Description>
</rdf:RDF>



It worked in Firefox RestClient.

0 votes


Accepted answer

Permanent link
Hi Hiroaki san,

OSLC Query does not support queries for the existence or non-existence of properties.
You can query for work items and then post-process the returned RDF to find any members of interest that do [not] have a specified property.

There was a recent question on this topic that you might find helpful: https://jazz.net/forum/questions/281661/how-to-query-for-artifacts-with-specific-attributes-that-exists

Best regards,
David
HIROAKI JOSAKO selected this answer as the correct answer

0 votes

Comments

Thank you
Is that so
It is a way to change the verification of verification whether the result when you write '! = "" Is as expected.

I don't understand your question. EWM is complaining about the syntax of the query expression you specified in the oslc.where parameter. One thing I notice is that you have not URL encoded that parameter value - you should do so. An unencoded query expression of oslc_cm:tracksChangeSet!="" is dubious for several reasons. The sematics of comparing against an empty string may not be well defined. That property would normally have a URI value, and URI values should be enclosed in <> angle brackets. See section 7.2.2 oslc.where syntax in https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html#oslc.where.

I think the only safe way is to omit that condition from the query expression, or omit oslc.where and then post process the results.

I also note that you are not specifying olsc.select and this means that the set of properties of work item members of the returned LDPC is undefined, and might even be an empty set. It might also change from release to release, so any client that is dependent on the default set of properties is potentially fragile.If you require specific properties of work items to be included in the response, you should specify them with oslc.select.

Thank you for the detailed explanation.
And I'm sorry, there was no explanation in the previous comment.
I'm sorry,my English is not good.

Write the results of the trial.

I also thought that it would not work after reading the "oslc.where" reference.
In the CURL, I got a 400 error as I asked.
However, using Firefox's Addon "RestClient" returned the query results.

So I decided to create script by VBA.
I thought it would be a 400 error.

sample: using MSXML2
header accept:application/rdf+xml,oslc-core-version 2.0
GET https://jazzewm.com/ccm/oslc/contexts/_BABCgO8-EeuR4JcRG1xq9Q/workitems?oslc.where=oslc_cm:tracksChangeSet!=""""&oslc.select=dcterms:identifier,oslc_cm:tracksChangeSet

*don't URL encode

As a result, I confirmed that there was a response as expected.
    <dcterms:title>ワークアイテム</dcterms:title>
    <oslc:totalCount>487</oslc:totalCount>
    <rdf:type rdf:resource="http://open-services.net/ns/core#ResponseInfo" />

Of course I don't know why.
It has been confirmed that all the IDs of the target work items match in another way.
I don't believe in this result,
I would like to use this method to achieve this purpose by using this.

 I didn't know the importance of oslc.select, and I happened to add it according to my purpose.

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
× 11,089
× 114

Question asked: Sep 27 '22, 10:27 p.m.

Question was seen: 1,886 times

Last updated: Oct 04 '22, 1:33 a.m.

Confirmation Cancel Confirm