It's all about the answers!

Ask a question

How to use queryCapability to search in range with RDNG?


Dinyo Dinev (311235) | asked Aug 25 '15, 7:30 a.m.
edited Aug 25 '15, 10:21 a.m.
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.

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Aug 27 '15, 1:06 a.m.
edited Aug 27 '15, 1:06 a.m.
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

One other answer



permanent link
Ian Barnard (2.1k613) | answered Jun 10 '22, 10:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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

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.