It's all about the answers!

Ask a question

[OSLC-RM] Querying requirement module not possible


Benjamin Röhl (1671324) | asked Mar 02 '16, 10:26 a.m.
Hello,
I'm trying to query all requirement modules from the Doors NG server with the following query:

OslcQueryParameters params = new OslcQueryParameters();
params.setPrefix("nav=<" + RmConstants.JAZZ_RM_NAV_NAMESPACE + ">,rdf=<" + OSLCConstants.RDF + ">");
params.setWhere("nav:parent=<" + folder.getUniqueID() + "> and rdf:type=<http://jazz.net/ns/rm#Module>");

OslcQuery query = new OslcQuery(client, url, params);
OslcQueryResult result = query.submit();
result.getMembersUrls();

Executing the query returns no member urls, despite having at least one resource defined!

Seems like an issue with query engine?

Kind regards.

Accepted answer


permanent link
Donald Nong (14.5k414) | answered Mar 07 '16, 11:03 p.m.
edited Mar 07 '16, 11:04 p.m.
In Gabriel's jazz.net article, a working sample is shown for "rdf:type", of which the value is < http://open-services.net/ns/rm% 23RequirementCollection >. Apparently a different value of < http://jazz.net/ns/rm% 23Module > will not work, because collections and modules are of same "rdf:type" (as in RequirementCollection). To query for modules only, you will need to use the "rmTypes:ArtifactFormat" attribute. The parameters will look like:
    & oslc.prefix=rmTypes=< http://www.ibm.com/xmlns/rdm/types/ >& oslc.where=rmTypes:ArtifactFormat=< https://clm:9443/rm/types/_4zgcEcSTEeWUhvpDd3TRcA%23Module >
Benjamin Röhl selected this answer as the correct answer

Comments
Benjamin Röhl commented Mar 08 '16, 4:15 a.m.

Hey,

I'm currently using the Doors NG 6.0.1. It attracted my attention that the 'Artifact Format' is missing for the requirement and requirement collection resources delivered by Doors NG's OSLC services.
Querying the rdf:type for Modules seemed to me as an alternative way getting these.

This seems to be an issue, that the Artifact Format misses for OSLC resources.


Donald Nong commented Mar 08 '16, 6:37 p.m.

I verified this with RGND 6.0.1 before posting. Try adding oslc.select=* in the query to see if it exposes all the attributes.

2 other answers



permanent link
Gabriel Ruelas (1.1k13) | answered Mar 02 '16, 10:47 a.m.
Hi,
  Does it work if you remove the nav:parent param of the oslc.where param?

Comments
Benjamin Röhl commented Mar 07 '16, 6:02 a.m.

I removed the nav:parent in the where-clause.
This makes no difference. I still get 0 matches in my result.

Besides that, I saw the 'Artifact Format' property is no more included in the Instance Shape resource when querying it for a requirement/ requirement collection resource.


Benjamin Röhl commented Mar 07 '16, 6:07 a.m.

I removed the nav:parent in the where-clause.
This makes no difference. I still get 0 matches in my result.

Besides that, I saw the 'Artifact Format' property is no more included in the Instance Shape resource when querying it for a requirement/ requirement collection resource.


permanent link
Adella Miller (111) | answered Aug 28 '21, 5:38 a.m.
edited Aug 30 '21, 1:49 a.m.

 If used in a module/object context returns all of the attributes for the current object. If not used in this context, returns all of the objects in the source.


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.