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

How to return linked resource properties with REST API or OSLC calls

Hi,

What am I doing wrong in either one of these calls:

 curl -X GET -k -H 'Content-Type: application/rdf+xml' -H 'OSLC-Core-Version: 2.0' -H 'Accept: application/xml' -i '.../qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_yG3bADHBEeWfYafF4ht9rQ/executionworkitem?fields=feed/entry/content/executionworkitem[title='\''X 602_1'\'']/(identifier|testplan/(webId/title)|testcase/state|testscript/(webId|state)|currentexecutionresult/verdict)&wildcard=X'

curl -X GET -k -H 'Content-Type: application/rdf+xml' -H 'OSLC-Core-Version: 2.0' -H 'Accept: application/xml' -i '.../qm/oslc_qm/contexts/_yG3bADHBEeWfYafF4ht9rQ/resource/com.ibm.rqm.execution.TestcaseExecutionRecord?oslc.properties=dcterms:identifier,oslc_qm:runsTestCase{oslc:shortId,dcterms:title,rqm_process:hasWorkflowState},oslc_qm:reportsOnTestPlan{oslc:shortId,dcterms:title},oslc_qm:executesTestScript{oslc:shortId,rqm_process:hasWorkflowState},rqm_qm:currentTestResult{rqm_qm:verdict}'

I'm expecting the response to contain the properties of the testplan, testcase and testcript. instead all i get is the uri of each resource.

I've been over the documentation in the wiki and still can't figure out what I'm doing wrong.

0 votes

Comments

I can see the same symptom, and will give you more details if I can figure it out.

If I read the document correctly, only two artifact types will give you the embedded referenced resource properties, with limitation.
https://jazz.net/wiki/bin/view/Main/RqmApi#Embedded_referenced_resource_pro
(but I can't get it to work for the two types mentioned in the document)

The OSLC API lacks behind in terms of implementation compared to the REST API, and I doubt that it provide such capability either.
https://jazz.net/wiki/bin/view/Main/RqmOslcQmV2Api

1 vote

Hi Donald,

My queries, either RTP or OSLC, are looking up testcase/testscript/testplan and execution results, of which only the last one is not listed as a primitive property.  Further still i'm initially only trying to get simple embedded info, like title/and shortId(webId).  I've followed the documentation examples and guidelines however it doesn't seem to be working as expected.

 

you must change header to:
accept: "application/atom+xml

this will return nested properties for testscript and testexecutionresult. however the testplan and testcase properties are not nested.

If you search for the execution result and requested nested properties for the testcase, tesplan, testscript,testexecution record, weirdly enough testcase and testplan nested properties are returned but testscript and testexecution record are not returned



2 answers

Permanent link

 You're using application/rdf+xml in the Content-Type for a GET. It should be Accept: application/rdf+xml and no Content-Type. GET does not have an entity request body.


0 votes

Comments

Hi Jim,

I removed the extra header, and only the testscript and the TestResult show their child properties. The test case and testplan only return the uri.

Any further suggestion?


Permanent link

 I think you're missing the prefix definitions.


0 votes

Comments

Does one still have to include prefix definitions for dcterms:title even if all the other resources have it and return it?

I also added the rqm prefix, and still the testplan and test case resource properties are not returned.

I appended : &oslc.prefix=rqm_qm="http://jazz.net/ns/qm/rqm#"

on further investigation "http://jazz.net/ns/qm/rqm#" returns a 404 page not found error. perhaps this is the source of the problem?

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,938
× 516
× 479

Question asked: Mar 25 '18, 4:32 a.m.

Question was seen: 3,443 times

Last updated: Mar 31 '18, 5:53 a.m.

Confirmation Cancel Confirm