It's all about the answers!

Ask a question

DNG OSLC.where query is not working


G C (452) | asked Jan 12, 1:12 a.m.

 I am trying to filter the modules from a  DNG project area by created date but I am not getting the filtered response.

I have tried encoding and not encoding the OSLC where query parameter  as well but all attempts were unsuccessful.

original query
https://<server:port>/rm/views?oslc.query=true&projectURL=https://<server:port>/rm/process/project-areas/<encodedValue>&oslc.where=dcterms:created<"2020-10-27T09:50:00-04:00"&oslc.prefix=dcterms=<http://purl.org/dc/terms/>

Encoded query
https://<server:port>/rm/views?oslc.query=true&projectURL=https://<server:port>/rm/process/project-areas/<encodedValue>&oslc.where=dcterms%3Acreated%3C%222020-10-27T09%3A50%3A00-04%3A00%22&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E

Accepted answer


permanent link
Ian Barnard (950612) | answered Jan 12, 5:05 a.m.
JAZZ DEVELOPER
edited Jan 28, 5:26 a.m.

Hi


You must always encode all parameters, that's just a HTTP thing.

With 7.0.1 I had to include the type of the literal like: oslc.where=dcterms:created<"2020-10-27T09:50:00-04:00"^^xsd:datetime

What version(+ifix) are you using?

UPDATE: also for 6.0.6.1 to do date comparison you must specify that the string for the date is a date time by appending ^^xsd:datetime to it.

I tested this on my environment like this:

1. With your query oslc.where=dcterms:created<"2020-10-27T09:50:00-04:00"
I get no (zero) results

2. With ^^xsd:datetime appended to the datetime string: oslc.where=dcterms:created<"2020-10-27T09:50:00-04:00"^^xsd:datetime
I get 737 results

3. with the < changed to >: oslc.where=dcterms:created>"2020-10-27T09:50:00-04:00"^^xsd:datetime
I get 0 results- not surprising since my environment was created before that date and I've not created any new artifacts since it was created

4. I created a new artifact in the project and used same query as #3: oslc.where=dcterms:created>"2020-10-27T09:50:00-04:00"^^xsd:datetime
I get 1 result (i.e. the new artifact)

A query that worked on my test env (return >0 results), split into unencoded parameters:

https://server:9443/rm/views
?oslc.pageSize=200
&oslc.paging=true
&oslc.prefix=dcterms=<http://purl.org/dc/terms/>,rm_nav=<http://jazz.net/ns/rm/navigation#>
&oslc.query=true
&oslc.select=rm_nav:parent,rm_nav:parent{dcterms:title},dcterms:identifier
&oslc.where=dcterms:created>"2020-10-27T09:50:00-04:00"^^xsd:datetime
&projectURL=https://server:9443/rm/process/project-areas/_NDNJ0NcLEeqXpuBdEolY7w

Actual encoded URL used:


HTH
Ian

G C selected this answer as the correct answer

Comments
G C commented Jan 18, 2:32 a.m.

I tried this but didnt work

 


Ian Barnard commented Jan 18, 3:21 a.m. | edited Jan 18, 3:23 a.m.
JAZZ DEVELOPER

Which version/ifix are you using?  And please show the full encoded oslc query URL, with parameters, that you're using now.


G C commented Jan 28, 1:44 a.m.

I am working on 6.0.6.1 version. and the encoded query I am using is below

https://<server:port>/rm/views?oslc.query=true&projectURL=https://<server:port>/rm/process/project-areas/<encodedValue>&oslc.where=dcterms%3Acreated%3C%222020-10-27T09%3A50%3A00-04%3A00%22&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E 


Ian Barnard commented Jan 28, 5:24 a.m. | edited Jan 28, 5:25 a.m.
JAZZ DEVELOPER
I tested this on 6.0.6.1 GA, and you must add ^^xsd:datetime to the date/time string, then it works for me. I updated my answer with this detail and an example of a query that works using this addition, like this oslc.where=dcterms:created<"2020-10-27T09:50:00-04:00"^^xsd:datetime

Of course if you have no artifacts which meet this condition then you'll still get 0 results - that's why I tested with the condition reversed at steps 3 and then 4 as I put in my answer.

Your answer


Register or to post your answer.