RTC OSLC query not working
Hello,
I have RTC 6.0.6 installed.
I am trying to filter the workitems from a project area by type but I keep ending up with a list of all workitems from the project.
I have tried encoding and not encoding the oslc_cm.query parameter as follows but all attempts were unsuccessful.
https://<server:port>/ccm/oslc/contexts/_tQ4kMOZdEeiSKJbK_kaFqA/workitems?oslc.select=dcterms:type,dcterms:title,dcterms:identifier&oslc_cm.query=dcterms%3Atype%3Dtask
https://<server:port>/ccm/oslc/contexts/_tQ4kMOZdEeiSKJbK_kaFqA/workitems?oslc.select=dcterms:type,dcterms:title,dcterms:identifier&oslc_cm.query=dcterms%3Atype%3DTask
https://<server:port>/ccm/oslc/contexts/_tQ4kMOZdEeiSKJbK_kaFqA/workitems?oslc.select=dcterms:type,dcterms:title,dcterms:identifier&oslc_cm.query=dcterms:type=task
https://<server:port>/ccm/oslc/contexts/_tQ4kMOZdEeiSKJbK_kaFqA/workitems?oslc.select=dcterms:type,dcterms:title,dcterms:identifier&oslc_cm.query=dcterms:type=Task
The selection part works. Query I couldnt get any of the examples here https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2 to work.
Any suggestions?
Thanks,
Oana
Accepted answer
dcterms:type with a string value is not considered a reliable mechanism for typing. I believe this usage is left over from OSLC 1.0.
For OSLC Core 2.0, dcterms:type is deprecated and attempting to access it in a oslc.where query parameter fails indicating the property is an unknown attribute id. However, a GET on the work item does show that property.
RTC uses its own typing mechanism that is extensible and has proper namespaces.
Use rtc_cm:type="com.ibm.team.workitem.workItemType.defect" in the oslc.where clause to find RTC defects.
OSLC Core 3.0 and OSLC Change Management 3.0 use rdf:type with standard OSLC namespaces to define specific subclasses of oslc_cm:ChangeRequest.
See this jazz forum entry for further details.
4 other answers
Try setting header OSLC-Core-Version=2.0 and use OSLC 2.0 query: https://archive.open-services.net/bin/view/Main/OSLCCoreSpecQuery.html
Comments
Thanks for your answer Jim!
If I use oslc.where from oslc 2.0 specification I can filter by common attributes like identifier or title but it still doesn;t work to filter by type.
I tried this (with OSLC-Core-Version header set to 2.0):
and i get this response:
{
"oslc:statusCode": 400,
"prefixes": {
"oslc": "http:\/\/open-services.net\/ns\/core#"
},
"oslc:message": "Unexpected symbol: null"
}
if I set "defect" instead of defect in the above url, I still get a 400 status and the error message is Unknown attribute id: [http:\/\/purl.org\/dc\/terms\/type], which is strange because it allows me to select it with oslc.select.
should work. Here's the dcterms:type property of a defect work item I created:
<dcterms:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Defect</dcterms:type>
But I see it doesn't. I'll look into it.