It's all about the answers!

Ask a question

Query for specific tagged workitem by OSLC dcterms:subject

Adrian ZHU (111) | asked Apr 22 '22, 10:57 a.m.


I'm using the OSLC to fetch the expected tagged workitems with 
dcterms:subject in ["tvt","mustfix"]
like format, which is one example in example6. 
My URL is like in ["stability"]&oslc.prefix=dcterms=<>
and I do encode the URL by utf-8.But the response is still all the bugs without tag filter.
Does someone know how to fix this by OSLC or REST API of RTC?

2 answers

permanent link
David Honey (1.8k17) | answered Apr 22 '22, 11:59 a.m.

I assume you are using an OSLC query capability - see

You should URL encode all the values for parameters including oslc.where and oslc.prefix . See the specification for details with examples.

Adrian ZHU commented Apr 24 '22, 2:19 a.m.

Hi David,

Thanks for your answer. But i did encode all the parameter in the URL like the following:, which uses UTf-8.
It still gives back all the items without tags filtered.

David Honey commented Apr 25 '22, 4:58 a.m. | edited Apr 25 '22, 5:01 a.m.

That's not correct - you are encoding more than each parameter value Assuming you're trying to use the following parameters:

Parameter Value
oslc.where dcterms:subject in ["sop5_bug"]
oslc.prefix dcterms=<> *
oslc.paging true
oslc.pageSize 200

the correct encoding in a request would be: oslc.where=dcterms%3Asubject%20in%20%5B%22sop5_bug%22%5D&*&oslc.paging=true&oslc.pageSize=200

permanent link
Ian Barnard (2.0k613) | answered Apr 22 '22, 12:46 p.m.
edited Apr 25 '22, 5:16 a.m.
I don't know where/how you got your query base URL but my 7.0.2 iFix009 test env doesn't have any query capability with bugv2.0 in it. YMMV.

For my test environment the project-specific work items query URL base for my project is

This is discovered starting from rootservices, details after the Discovery heading below.  

Then the full OSLC Query URL in this case for tags"asd" and "mobile":

With headers:
  OSLC-Core-Version: 2.0
  Accept: application/rdf+xml

With the encoding removed and with the query parameters broken out this looks like:

  • oslc.prefix=dcterms=<>
  • oslc.where=dcterms:subject in ["asd","mobile"]
  • oslc.paging=true
  • oslc.pageSize=200
The paging and pagesize are optional - but your code needs to be prepared for paging of results even if you don't specify these :-)

NOTE using* increases the load on the server so avoid if at all possible, to minimize the impact of your queries on users.
Discovery of OSLC Query base URL

I'm using 7.0.2 iFix009 - although AFAIK the steps below would work back to at least 6.0.2.

For all requests below you MUST provide headers:
* OSLC-Core-Version: 2.0
* Accept: application/rdf+xml

If you don't provide these headers then the sequence below won't work because you'll get different (non-OSLC 2.0) responses.

The querybases (there are two in my test environment) are in the project's services.xml., in my case this is at

You discover this starting from rootservices:

(this request doesn't require you to be authenticated)

Look for the entry:

          rdf:resource="" />


(your client code will have to be authenticated to get the catalog and any other requests from now on, if your user doesn't have permission to access then you won't get the data)

This is the catalog of projects on your server. Find the project by looking for the dcterms:title tag with title of your project, then the services catalog for that project is in the rdf:about of the containing oslc:ServiceProvider tag:

<dcterms:title rdf:parseType="Literal">My Project</dcterms:title>
<jfs_proc:supportLinkDiscoveryViaLinkIndexProvider rdf:parseType="Literal">false</jfs_proc:supportLinkDiscoveryViaLinkIndexProvider>
<jfs_proc:supportContributionsToLinkIndexProvider rdf:parseType="Literal">true</jfs_proc:supportContributionsToLinkIndexProvider>
<jfs_proc:globalConfigurationAware rdf:parseType="Literal">compatible</jfs_proc:globalConfigurationAware>

Then to find the correct query base URL search for an oslc:QueryCapability tag containing a tag oslc:resourceType for, and the query base is the oslc:queryBase tag alongside it.

<dcterms:title rdf:parseType="Literal">Change request queries</dcterms:title>
<oslc:resourceType rdf:resource=""/>


Adrian ZHU commented Apr 24 '22, 2:25 a.m.

Hi Ian,

Thanks for your answer!
What I discovered from the  'Discovery Mechanism' is like below
<dc:title>Location for creation of Bug change requests </dc:title>
This is from, and I didn't see a tag named oslc:queryBase you described.
I use the select and page setup as yours but the result is still the same where no filter on tags.

Ian Barnard commented Apr 25 '22, 4:49 a.m. | edited Apr 25 '22, 5:12 a.m.

That URL definitely won't work as query because, as it shows in your XML, it's the "Location for creation of Bug change requests", and it's in a oslc_cm:factory tag, i.e. it isn't a OSLC Query base URL.

You're probably not providing the header OSLC-Core-Version: 2.0 - this is required.

I added to my answer details of how to find the correct query base URL for work items.

Ralph Schoon commented Apr 25 '22, 6:37 a.m.

I would suggest to have a look here: this also covers the discovery process. I agree with the statements with respect to the URL as well as the headers.  

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.