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
Hi Donald,
Thanks for reply!
Could you please help me with sample query?
Not sure what you really want. This is what I usually do.
1. Open the module in web client.
2. Click on the three-bar menu and choose Share Link to Artifact ...
3. Copy the link in the dialog.
4. Put the link in the OSLC client and just fire away.
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.