It's all about the answers!

Ask a question

Why is OSLC Query in Rational Team Concert not returning the expected result when I pass in specific parameters?

W Diu (58026) | asked Jan 04 '13, 3:16 p.m.
I have this query which works as expected: https://oslcqueryurl/?oslc.prefix=oslc_cm=<>&oslc.where=oslc_cm:tracksChangeSet=<https://myserver/changesetId>

However, when I pass in additional parameters, it does not work as expected.

1) If I append &* or & to it, I do not get back any additional properties.  From what I understood, &* is supposed to give back all the properties and & is supposed to give back the title of the work item.  What did I do wrong with

2) Suppose I don't know the type of link, so I replaced oslc_cm:tracksChangeSet with *.  It doesn't work and gives the error: Unknown attribute id [*].  What is the correct syntax?

3) In the OSLC query spec at, I am supposed to be able to add or oslc_cm:tracksChangeSet=<https://myserver/changesetId2> to the above.  But that gives an error.  What is the correct way to use or?

Accepted answer

permanent link
Jan Wloka (4161) | answered Jan 14 '13, 11:48 a.m.
 You're almost there, just a couple of syntax problems. In general, for some good examples you could go to In particular the section Query Capabilities should help you in this case.

1) Querying for all or selected properties
Use no for complete resources 
Append &, the property AND the prefix URL for selecting individual properties
2) Discover what's supported
For some examples on how to discover the provider's capabilities go to Discovery Mechanism

3) OR operator in queries
The OR works with brackets, e.g., &oslc.where=cm:severity in ["high","medium"].

https://oslcqueryurl/workitems?oslc.where=cm:severity in ["high","medium"]&
A common mistake im most query attempts is to forget to escape all URL components. The actual URL would look like https://localhost:9443/jazz/oslc/contexts/_f_vywF5XEeK9rd6rj1tVjA/workitems?oslc.where%3Dcm%3Aseverity%20in%20%5B%22high%22%2C%22medium%22%5D&


W Diu selected this answer as the correct answer

Buzz Moschetti commented Jan 14 '13, 12:42 p.m.

If operating in the OSLC v2 space, shouldn't we be asked for the query base resource and using that, e.g. (example taken from RM but same idea):


Buzz Moschetti commented Jan 14 '13, 3:06 p.m.

Whoops.   If you oslcqueryurl means the URL at the queryBase then I get it.   CCM and QM and RM have some web service inconsistencies and I incorrectly assumed oslcqueryurl was yet another means to get at the data (like the Requirements Reporting API)

W Diu commented Jan 14 '13, 3:36 p.m.

Thanks for your reply, Jan, and especially for that link to the examples.  It gives me a much better understanding of the expected syntax!

A question about the discovery mechanism: I tried
https://servername:port/ccm/oslc/contexts/_projectId/workitems/services.xml and it gives me back an XML document -- how do I tell if * operator is supported?

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.