It's all about the answers!

Ask a question

DNG-How to get all the artifacts of module using OSLC


Jayshri Burde (2818) | asked Apr 27 '17, 6:28 a.m.
edited Apr 27 '17, 6:29 a.m.

 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



permanent link
Venkatesh Nadamuni (138) | answered Dec 02 '18, 11:12 p.m.

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.


permanent link
Donald Nong (14.5k414) | answered May 02 '17, 3:20 a.m.

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.
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.


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.setWhere("nav:parent=<"+ folderUri +">, rdf:type=<;http://open-services.net/ns/rm#Requirement>");
OslcQuery query =new OslcQuery(client, queryCapability, 20, queryParams);
result = query.submit();

Your answer


Register or 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.