It's all about the answers!

Ask a question

To query for all collections/Modules that contain one or several requirements

vijayakumar ramesh (1173660) | asked Aug 24 '15, 4:06 a.m.
My requirement is to fetch the Module details from requirement artifact.

I wrote the below query but I am getting the error 400 or 500... Please do comment where I am going wrong in the query format.

Query which I wrote is
&oslc.prefix=oslc_rm=<>,dcterms=<>& in [<>,<>]s to

Reference article used

Accepted answer

permanent link
Donald Nong (14.5k414) | answered Aug 25 '15, 2:59 a.m.
The RM OSLC API appears to have some difficulties in handling the comma(,) sign, so you need to use some tricks.
1. For multiple namespaces, use multiple "oslc.prefix" (one for one).
2. For multiple values in an "in" operator, use "%2C" to replace ",".
The query should look like the below image, which works for me in RDNG 5.0.2.

vijayakumar ramesh selected this answer as the correct answer

vijayakumar ramesh commented Aug 25 '15, 9:28 a.m. | edited Aug 25 '15, 8:43 p.m.
@Donald Nong

https://lcm.*****.de:9443/rm/views?oslc.query=true&projectURL=https%3A%2F%2Flcm.*****.de%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_hYm_Qh9QEeWFK7vjMUdUyg &oslc.prefix=oslc_rm=<>&oslc.prefix=dcterms=<>&*&oslc.where= oslc_rm:uses in [<https://lcm.****.de:9443/rm/resources/_WIJUAx_GEeWFK7vjMUdUyg>%2C<https://lcm.*****.de:9443/rm/resources/_Ztnl4x_GEeWFK7vjMUdUyg>]

Response Body :
    >Error when converting:
oslc.where= oslc_rm:uses in[&lt;https://lcm.*****.de:9443/rm/resources/_WIJUAx_GEeWFK7vjMUdUyg&gt;,&lt;https://lcm.*****.de:9443/rm/resources/_Ztnl4x_GEeWFK7vjMUdUyg&gt;] Encountered "" at line 1, column 1.&#xD;
Was expecting one of:&#xD;
     (More info found at entry [c149bb93357b69af] in the RM application server log)</err:detailedMessage>
    >Interner Fehler</err:errorMessage>

I guess it is still saying the where condition is wrong , request you to please post the Query you used fully.

One more query since artifacts are having two resources names for same artifact , which one should i use here 

<dcterms:title>Query Results: 2</dcterms:title>

<oslc_rm:Requirement rdf:about="https://lcm.*****.de:9443/rm/resources/_kwtnQx_DEeWFK7vjMUdUyg">

<oslc_rm:Requirement rdf:about="https://lcm.*****.de:9443/rm/resources/_96df629add844f3283f171750d9f9cae">

<rm:boundArtifact rdf:resource="https://lcm.*****.de:9443/rm/resources/_kwtnQx_DEeWFK7vjMUdUyg"/>

Donald Nong commented Aug 26 '15, 1:00 a.m.

The first half of my query should not matter as it's the "query base".

For the "error in converting" message that you got, it usually means invalid characters in the URL. If the one that you posted is to be trusted (this forum quite often messes up the encoding of a URL), there are a couple of extra spaces and you have to remove them - the only spaces allowed in your URL should be the couple surrounding the "in" operator.

For your second question, you first need to understand the concept of "base artifact" and "module artifact" - see Mike's answer in this post for a brief explanation. In the response that you posted, the first one is the "base artifact", while the second one is a "module artifact" (with the <rm:boundArtifact> tag being the distinction). If you add the same base artifact into more modules, the same query will return more members (more module artifacts and only one base artifact).

Your answer

Register or to post your answer.