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

Encoded query

Accepted answer

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


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 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:


Actual encoded URL used:


G C selected this answer as the correct answer

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.

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 version. and the encoded query I am using is below


Ian Barnard commented Jan 28, 5:24 a.m. | edited Jan 28, 5:25 a.m.
I tested this on 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.