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

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

0 votes


Accepted answer

Permanent link

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.




Oana Capatana selected this answer as the correct answer

0 votes

Comments

Thank you for clarifying 


4 other answers

Permanent link

 Try setting header OSLC-Core-Version=2.0 and use OSLC 2.0 query: https://archive.open-services.net/bin/view/Main/OSLCCoreSpecQuery.html 

0 votes

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. 


Permanent link

You need to escape the # in the prefix definition URI with %23.

0 votes

Comments


Permanent link

 https://<server>:<port>/ccm/oslc/contexts/_tQ4kMOZdEeiSKJbK_kaFqA/workitems?oslc.select=dcterms:type,dcterms:title,dcterms:identifier&oslc.where=dcterms:type="Defect"


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.

0 votes


Permanent link

 I found the answer to this issue.

The oslc.where value should be rtc_cm:type="task" instead of dcterms:type="task"

This I think is non-intuitive since in the response the attribute show up as:
dcterms:type="Task"

0 votes

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
× 516
× 201

Question asked: Dec 04 '18, 9:18 a.m.

Question was seen: 3,943 times

Last updated: Dec 11 '18, 12:18 a.m.

Confirmation Cancel Confirm