DNG-How to get all the artifacts of module using OSLC
Hi
In Requirement Management I have created the module (Module->create module, - name as SWC, artifact type as software component->ok) and In SWC module I have imported custom artifacts from excel, after that I moved theses artifacts to folder name SWCartifact.
When I am trying to get these artifacts using oslc I am not able to fetch it.
Any help will greatly appreciated!
|
2 answers
It works for me. The <oslc_rm:uses> attribute in the response is the resource URI of each artifact included in the module.
Comments
Jayshri Burde
commented May 02 '17, 3:38 a.m.
Hi Donald,
Thanks for reply!
Could you please help me with sample query?
Donald Nong
commented May 02 '17, 3:50 a.m.
Not sure what you really want. This is what I usually do.
Jayshri Burde
commented May 02 '17, 6:12 a.m.
HI Donald,
below is the query I am firing to get artifacts.This gives me artifact in the specific folder, but I want all the artifacts of a model weather it is in same folder or in different folders.
<o:p> </o:p> <o:p> </o:p> Is there any query to get artifacts of a model whether they are in same folder or in different folder? Thanks in advance! <o:p> </o:p>
String queryCapability = client.lookupQueryCapability(serviceProviderURL, OSLCConstants.OSLC_RM_V2, OSLCConstants.RM_REQUIREMENT_TYPE);
OslcQueryParameters queryParams = new OslcQueryParameters();
queryParams.setPrefix("nav=<http://com.ibm.rdm/navigation#>,rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>");
queryParams.setWhere("nav:parent=<"+ folderUri +">, rdf:type=<http://open-services.net/ns/rm#Requirement>");
OslcQuery query =new OslcQuery(client, queryCapability, 20, queryParams);
result = query.submit();
|
According to the Jazz.net article: https://jazz.net/library/article/1197
You should be able to query the items in a collection (perhaps Modules too?).
Note says:
To query for all artifacts in a collection based on collection’s identifier, use a query similar to:
&oslc.prefix=oslc_rm=<http://open-services.net/ns/rm%23>,dcterms=<http://purl.org/dc/terms/> &oslc.select=oslc_rm:uses&oslc.where=dcterms:identifier=1
Unfortunately, this query does not seem to work in 6.03. Adding a prefix for oslc_rm simply eliminated the filtering applied by the where clause. It returns the entire set. This may be a bug.
|
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.