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

DNG OSLC.where query is not working

 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

0 votes


Accepted answer

Permanent link

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

0 votes

Comments

I tried this but didnt work

 

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

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 

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 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,937
× 7,495
× 1,325

Question asked: Jan 12 '21, 1:12 a.m.

Question was seen: 1,248 times

Last updated: Feb 09 '21, 6:10 a.m.

Confirmation Cancel Confirm