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

How to use queryCapability to search in range with RDNG?

Hi, I am using 6.0.1 M2 . RDNG is implementing OSLC V2 and I find difficulties in making queryCapability URL for searching in range:

When I try:
httрs://10.0.2.79:9443/rm/viеws?оslc.query=true&projectURL=https%3A%2F2F10.0.2.79%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_Agw1YEA_EeW98vRabXRPEQ
&oslc.paging=true &oslc.pageSize=10 &oslc.where=dcterms:modified>="2015-08-15T21:51:40.979Z"%5E%5Exsd%3AdateTime &oslc.prefix=dcterms=httр://purl.оrg/dс/tеrms/

10 results was returned.
But when I try to combine with and operator

httрs://10.0.2.79:9443/rm/viеws?оslc.query=true&projectURL=https%3A%2F2F10.0.2.79%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_Agw1YEA_EeW98vRabXRPEQ&oslc.paging=true
&oslc.pageSize=10
&oslc.where=dcterms:modified>="2015-08-15T21:51:40.979Z"%5E%5Exsd%3AdateTime
&oslc.prefix=dcterms=httр://purl.оrg/dс/tеrms/
+and+
dcterms:modified<="2015-08-25T21:51:40.979Z"%5E%5Exsd%3AdateTime
&oslc.prefix=dcterms=httр://purl.оrg/dс/tеrms/


Then I have 500 Internal Server Error
   
dcterms=httр://purl.оrg/dс/tеrms/
com.ibm.oslc.query.parser.where.ParseException: Encountered "" at line 1, column 17.&#xD;
Was expecting one of:&#xD;
(More info found at entry [b13b5076b3bc5dda] in the RM application server log) 

  
How I can make search in range? How to add and operator in the query URL? With Doors 9.5 this where query works fine.

0 votes


Accepted answer

Permanent link
It's very tricky when working with RM OSLC API. According to the jazz.net article, we should use the "and" operator when using more than one filters, but it appears that the API just does not like it. I have found that using multiple "oslc.where" works just fine, same as using multiple "oslc.prefix". So the couple of "oslc.where" gave me a nice range for "dcterms:modified" (verified with RDNG 5.0.2).
&oslc.where=dcterms:modified>="2015-07-20T21:51:40.979Z"%5E%5Exsd%3AdateTime&oslc.where=dcterms:modified<="2015-08-01T21:51:40.979Z"%5E%5Exsd%3AdateTime

Dinyo Dinev selected this answer as the correct answer

1 vote


One other answer

Permanent link

Your syntax isn't anywhere near correct - where you use:


httрs://10.0.2.79:9443/rm/viеws?оslc.query=true&projectURL=https%3A%2F2F10.0.2.79%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_Agw1YEA_EeW98vRabXRPEQ&oslc.paging=true
&oslc.pageSize=10
&oslc.where=dcterms:modified>="2015-08-15T21:51:40.979Z"%5E%5Exsd%3AdateTime&oslc.prefix=dcterms=httр://purl.оrg/dс/tеrms/
+and+
dcterms:modified<="2015-08-25T21:51:40.979Z"%5E%5Exsd%3AdateTime
&oslc.prefix=dcterms=httр://purl.оrg/dс/tеrms/

NOTE the "and" should be between terms in the oslc.where value. Also all query parameter values (e.g. the bit after oslc.where=) MUST be URL encoded. The URL encoding is a http thing, nothing to do with DOORS Next or OSLC Query, it's simply required to make a decodable URL.

Tidying your example up and moving the and into oslc.where the parts of your query URL should look like this:

httрs://10.0.2.79:9443/rm/viеws
?оslc.query=true
&projectURL=https%3A%2F2F10.0.2.79%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_Agw1YEA_EeW98vRabXRPEQ
&oslc.paging=true
&oslc.pageSize=10
&oslc.where=dcterms:modified>="2015-08-15T21:51:40.979Z"^^xsd:dateTime and dcterms:modified<="2015-08-25T21:51:40.979Z"^^xsd:dateTime
&oslc.prefix=dcterms=<httр://purl.оrg/dс/tеrms/>

And then url encoding the values (and only the values!) and combining into a single URL it looks like this (all one line): (untested!)

httрs://10.0.2.79:9443/rm/viеws?оslc.query=true&projectURL=https%253A%252F2F10.0.2.79%253A9443%252Frm%252Fprocess%252Fproject-areas%252F_Agw1YEA_EeW98vRabXRPEQ&oslc.paging=true&oslc.pageSize=10&oslc.where=dcterms%3Amodified%3E%3D%222015-08-15T21%3A51%3A40.979Z%22%5E%5Exsd%3AdateTime%20and%20dcterms%3Amodified%3C%3D%222015-08-25T21%3A51%3A40.979Z%22%5E%5Exsd%3AdateTime&oslc.prefix=dcterms%3D%3Chtt%D1%80%3A%2F%2Fpurl.%D0%BErg%2Fd%D1%81%2Ft%D0%B5rms%2F%3E


HTH

0 votes

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
× 10,938

Question asked: Aug 25 '15, 7:30 a.m.

Question was seen: 2,420 times

Last updated: Jun 11 '22, 2:53 a.m.

Confirmation Cancel Confirm