Query TestPlan by its visible ID
I use the OSLC interface to interact with RQM. I use the following code to query a test plan by its title:
OslcQueryParameters queryParams = new OslcQueryParameters();
queryParams.setWhere("dcterms:title=\"MyTestPlanTitle\"");
But it seems that there is no way to query a test plan by its visible id (in the GUI) because the RDF document does not contain such an information. Only the element dcterms:relation contains the substring 337 (the id I search for).
Do you know how OslcQueryParameters must look like in order to query for the id (337) ?
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rqm_auto="http://jazz.net/ns/auto/rqm#"
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:rqm_qm="http://jazz.net/ns/qm/rqm#"
xmlns:acp="http://jazz.net/ns/acp#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:oslc_auto="http://open-services.net/ns/auto#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_qm="http://open-services.net/ns/qm#"
xmlns:bp="http://open-services.net/ns/basicProfile#" >
<rdf:Description rdf:about="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestPlan/_GO25IWVeEeKR3t32SVbLKQ">
<dcterms:creator rdf:resource="https://jazz.net/sandbox02-jts/users/swqljh"/>
<oslc:instanceShape rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZ"
jjYw/shape/resource/com.ibm.rqm.planning.VersionedTestPlan"/>
<acp:accessControl rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/accessControl/_pv6fkFllEeKaV_p6uZjjYw"/>
<rdf:type rdf:resource="http://open-services.net/ns/qm#TestPlan"/>
<oslc_qm:usesTestCase rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestCase/_0eUxsXT-EeKiILFa-2lqaQ"/>
<dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string"></dcterms:description>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">MyTestPlanTitle</dcterms:title>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-03-05T14:38:00.247Z</dcterms:modified>
<oslc:serviceProvider rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/services.xml"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-01-23T13:09:19.41Z</dcterms:created>
<dcterms:identifier "
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestPlan/_GO25IWVeEeKR3t32SVbLKQ</dcterms:identifier>
<dcterms:relation rdf:resource="https://jazz.net/sandbox02-qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_pv6fkFllEeKaV_p6uZjjYw/testplan/urn:com.ibm.rqm:testplan:337"/>
<dcterms:contributor rdf:resource="https://jazz.net/sandbox02-jts/users/unassigned"/>
<oslc_qm:usesTestCase rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestCase/_EySIMWY0EeKR3t32SVbLKQ"/>
<oslc_qm:usesTestCase rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestCase/_BZ53ImY0EeKR3t32SVbLKQ"/>
</rdf:Description>
</rdf:RDF>
OslcQueryParameters queryParams = new OslcQueryParameters();
queryParams.setWhere("dcterms:title=\"MyTestPlanTitle\"");
But it seems that there is no way to query a test plan by its visible id (in the GUI) because the RDF document does not contain such an information. Only the element dcterms:relation contains the substring 337 (the id I search for).
Do you know how OslcQueryParameters must look like in order to query for the id (337) ?
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rqm_auto="http://jazz.net/ns/auto/rqm#"
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:rqm_qm="http://jazz.net/ns/qm/rqm#"
xmlns:acp="http://jazz.net/ns/acp#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:oslc_auto="http://open-services.net/ns/auto#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_qm="http://open-services.net/ns/qm#"
xmlns:bp="http://open-services.net/ns/basicProfile#" >
<rdf:Description rdf:about="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestPlan/_GO25IWVeEeKR3t32SVbLKQ">
<dcterms:creator rdf:resource="https://jazz.net/sandbox02-jts/users/swqljh"/>
<oslc:instanceShape rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZ"
jjYw/shape/resource/com.ibm.rqm.planning.VersionedTestPlan"/>
<acp:accessControl rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/accessControl/_pv6fkFllEeKaV_p6uZjjYw"/>
<rdf:type rdf:resource="http://open-services.net/ns/qm#TestPlan"/>
<oslc_qm:usesTestCase rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestCase/_0eUxsXT-EeKiILFa-2lqaQ"/>
<dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string"></dcterms:description>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">MyTestPlanTitle</dcterms:title>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-03-05T14:38:00.247Z</dcterms:modified>
<oslc:serviceProvider rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/services.xml"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-01-23T13:09:19.41Z</dcterms:created>
<dcterms:identifier "
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestPlan/_GO25IWVeEeKR3t32SVbLKQ</dcterms:identifier>
<dcterms:relation rdf:resource="https://jazz.net/sandbox02-qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_pv6fkFllEeKaV_p6uZjjYw/testplan/urn:com.ibm.rqm:testplan:337"/>
<dcterms:contributor rdf:resource="https://jazz.net/sandbox02-jts/users/unassigned"/>
<oslc_qm:usesTestCase rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestCase/_EySIMWY0EeKR3t32SVbLKQ"/>
<oslc_qm:usesTestCase rdf:resource="https://jazz.net/sandbox02-qm/oslc_qm/contexts/_pv6fkFllEeKaV_p6uZjjYw/resources/com.ibm.rqm.planning.VersionedTestCase/_BZ53ImY0EeKR3t32SVbLKQ"/>
</rdf:Description>
</rdf:RDF>
2 answers
I think you can use the relation attribute
as before you get query capability url
you need to get service.xml from catalog https://onehaodesktop.cn.ibm.com:9444/qm/oslc_qm/catalog
it also contains the project info like
<oslc:serviceProvider> <oslc:ServiceProvider ns12:type="oslc:ServiceProvider" rdf:about="https://onehaodesktop.cn.ibm.com:9444/qm/oslc_qm/contexts/_xBcMu_ceEeGT2PXPIk2Pog/services.xml"> <dcterms:title>qmpa2</dcterms:title> <dcterms:description> </dcterms:description> <oslc:details rdf:resource="https://onehaodesktop.cn.ibm.com:9444/qm/process/project-areas/_xBcMu_ceEeGT2PXPIk2Pog"/> <jproc:consumerRegistry rdf:resource="https://onehaodesktop.cn.ibm.com:9444/qm/process/project-areas/_xBcMu_ceEeGT2PXPIk2Pog/links"/> </oslc:ServiceProvider> </oslc:serviceProvider>
queryParams.setWhere("dcterms:relation=\"https://onehaodesktop.cn.ibm.com:9444/qm/process/project-areas/_xBcMu_ceEeGT2PXPIk2Pog/testplan/urn:com.ibm.rqm:testplan:337\"");
I think you can have a try with this approach.
as before you get query capability url
you need to get service.xml from catalog https://onehaodesktop.cn.ibm.com:9444/qm/oslc_qm/catalog
it also contains the project info like
details is the project area url
https://onehaodesktop.cn.ibm.com:9444/qm/process/project-areas/_xBcMu_ceEeGT2PXPIk2Pog
you can construct the query string like
https://onehaodesktop.cn.ibm.com:9444/qm/process/project-areas/_xBcMu_ceEeGT2PXPIk2Pog/testplan/urn:com.ibm.rqm:testplan:337
queryParams.setWhere("dcterms:relation=\"https://onehaodesktop.cn.ibm.com:9444/qm/process/project-areas/_xBcMu_ceEeGT2PXPIk2Pog/testplan/urn:com.ibm.rqm:testplan:337\"");
I think you can have a try with this approach.
As you and Hao Wan mentioned, you can use the dcterms:relation property but constructing RQM Reportable REST API resource URI (https://jazz.net/wiki/bin/view/Main/RqmApi#resourceUrl_for_interaction_with) with an internal ID (https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID) for the oslc.where predicate.
The OSLC QM query shape contains all of the queryable properties.
The OSLC QM query shape contains all of the queryable properties.