It's all about the answers!

Ask a question

Odd behavior of oslc.select=* in OSLC query


Daniel Garcia (4911013) | asked May 19 '14, 8:18 a.m.
 Hello everyone.

I'm trying to retrieve all the information from a single workitem using OSLC. I've tried the following query in RTC 4.0.1, 4.0.5 and 4.0.6:

https://<server>:<port>/jazz/oslc/contexts/_3B5Qbr6MEeGj86YFkos_nR/workitems?oslc.where=dcterms:identifier="18552"&oslc.select=*

The result is what I expected: a RDF response containing every property of the workitem which identifier is "18552" (identifier, type, plannedFor, ...), and a property "oslc:totalCount" set to "1". Working as expected.

Now, trying the same query (with different project area and different ID, of course) in another 4.0.1 server and I just get the following result:

 <rdf:RDF

      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

      xmlns:dcterms="http://purl.org/dc/terms/"

      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

      xmlns:oslc="http://open-services.net/ns/core#" >

      <rdf:Description rdf:about="https://<server>:<port>/jazz/oslc/contexts/_o9yuus5GSdGj867hJss_nR/workitems?oslc.where=dcterms:identifier=%2237993%22&amp;oslc.select=*">

            <dcterms:title>Workitems</dcterms:title>

            <oslc:totalCount>1</oslc:totalCount>

            <rdf:type rdf:resource="http://open-services.net/ns/core#ResponseInfo"/>

      </rdf:Description>

      <rdf:Description rdf:about="https://<server>:<port>/jazz/oslc/contexts/_o9yuus5GSdGj867hJss_nR/workitems">

            <rdfs:member rdf:resource="https://<server>:<port>/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/37993"/>

      </rdf:Description>

</rdf:RDF>

The server is providing a proper but incomplete response. It's like as the wildcard of the 'oslc.select=*' parameter is being ignored. When I change the wildcard for single parameters (i.e. 'oslc.select="dcterms:identifier"'), the response is including it as expected, but wildcard is not working at all.

Does anyone know the reason of this odd behavior? Some server configuration parameter maybe?

Thank you very much for your help.


Comments
1
Donald Nong commented May 20 '14, 3:28 a.m.

Although the RDF looks to be correctly formatted, the content does not look correct (apart from the incompleteness). It seems that the work item cannot be queried. What if you GET the work item directly using OSLC?
https://<server>:<port>/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/37993


Daniel Garcia commented May 20 '14, 3:53 a.m.

  Hello, Donald.


First of all, thank you for your answer. When I access the workitem directly through the URL, I get all the expected fields. Only when using the OSLC query, the odd behavior happens.
I've tried with different WorkItems and different filters, and alas, it's behaving in the same way I described above.

My intention is retrieving workitems using OSLC and mapping them into object once the RDF/XML file is obtained. I've borne in mind your suggestion to retrieve the information when I have the ID of the workitem, but the problem is that now I've no way to get the expected information when I need to filter by other attributes, such type or contributor.


Again, thank you very much for your help, Donald.

    Kind regards.


    Daniel G. Garcia.


1
Donald Nong commented May 20 '14, 11:17 p.m.

Hi Daniel,
It seems that the problem is related to something particular in the environment which we cannot identify yet. You can enable SQL query debugging in the log4j.properties file to see how the CCM server interprets the OSLC query in both the working and problematic environments. It can be quite time-consuming going through the log files though.
Another thing you may try, which may not be relevant at all, is to move "oslc.select=" to the middle of the URI so that the OSLC URI does not end with the "" sign. I once had some nasty problems with such URI, not OSLC-related though.


Daniel Garcia commented May 21 '14, 3:44 a.m.

Hello, Donald.


I agree with your theory. I've tried over RTC versions 4.0.1, 4.0.5 and 4.0.6 RTC versions which run over basic test configuration (Tomcat+Derby) and they are working properly. The problem showed itself on production and pre-production environments (CLM 4.0.1+WAS+DB2), so I guess that, if the platform is the same, the only possibilities may be related with configuration or environment issues.

I have already tried to change the order of the 'oslc.select=*' sentence inside the query, and no luck either. I'll take into consideration your suggestion about activating sql debugging in pre-production environment and taking a look to the logs.

Again, thank you very much for your help.

Kind regards,

    Daniel G. Garcia


1
Sudarshan Rao commented May 21 '14, 4:07 a.m.

You could probably try oslc.properties=*, which too should give you similar result. 

Since oslc.select isn't working, I don't know if this would work; but worth a try I think. 


Daniel Garcia commented May 21 '14, 4:36 a.m.

Hi, Sudarshan,


I tried, but the result is the same as using 'oslc.select=*'. It looks something related with the asterisk character, because specifying single fields (like dcterms:identifier) results in a proper response in conjunction with the 'oslc.select' parameter.

Thank you very much for the suggestion.

Kind regards,

    Daniel G. Garcia.

showing 5 of 6 show 1 more comments

Be the first one to answer this question!


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.