To query for all collections/Modules that contain one or several requirements
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 https://lcm.*********:9443/rm/views?oslc.query=true&projectURL=https%3A%2F%2Flcm.it-qbase.de%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_hYm_Qh9QEeWFK7vjMUdUyg &oslc.prefix=oslc_rm=<http://open-services.net/ns/rm%23>,dcterms=<http://purl.org/dc/terms/>&oslc.select=dcterms:title&oslc.where=oslc_rm:uses in [<https://grarrc.ibm.com:9443/rm/resources/__JnIVvbREeGLlsbcKLgIyg>,<https://grarrc.ibm.com:9443/rm/resources/_AQkwZvbSEeGLlsbcKLgIyg>]s to Reference article used https://jazz.net/library/article/1197 |
Accepted answer
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
Comments
@Donald Nong
Query:
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=<http://open-services.net/ns/rm%23>&oslc.prefix=dcterms=<http://purl.org/dc/terms/>&oslc.select=*&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 :
<rdf:RDF
<rdf:Description>
<err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Error when converting:
oslc.query=true&
oslc.prefix=oslc_rm=<http://open-services.net/ns/rm#>&
oslc.prefix=dcterms=<http://purl.org/dc/terms/>&
oslc.select=*&
oslc.where= oslc_rm:uses in[<https://lcm.*****.de:9443/rm/resources/_WIJUAx_GEeWFK7vjMUdUyg>,<https://lcm.*****.de:9443/rm/resources/_Ztnl4x_GEeWFK7vjMUdUyg>]
com.ibm.oslc.query.parser.where.ParseException: Encountered "" at line 1, column 1.
Was expecting one of:
(More info found at entry [c149bb93357b69af] in the RM application server log)</err:detailedMessage>
<err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Interner Fehler</err:errorMessage>
<err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
>500</err:errorStatus>
</rdf:Description>
</rdf:RDF>
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
<rdf:RDF>
<dcterms:title>Query Results: 2</dcterms:title>
</oslc:ResponseInfo>
<rdfs:member>
<oslc_rm:Requirement rdf:about="https://lcm.*****.de:9443/rm/resources/_kwtnQx_DEeWFK7vjMUdUyg">
<f1:accessControl rdf:resource="https://lcm.*****.de:9443/rm/accessControl/_hYm_Qh9QEeWFK7vjMUdUyg"/>
<dcterms:description/>
<rt:_huz4zB9QEeWFK7vjMUdUyg rdf:resource="https://lcm.*****.de:9443/jts/users/kumar.ramesh"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-07-01T07:34:15.622Z</dcterms:created>
<rt:_htUD8h9QEeWFK7vjMUdUyg rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-07-01T07:34:44.168Z</rt:_htUD8h9QEeWFK7vjMUdUyg>
<rt:_hvspkh9QEeWFK7vjMUdUyg rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-07-01T07:34:15.622Z</rt:_hvspkh9QEeWFK7vjMUdUyg>
</oslc_rm:Requirement>
</rdfs:member>
<rdfs:member>
<oslc_rm:Requirement rdf:about="https://lcm.*****.de:9443/rm/resources/_96df629add844f3283f171750d9f9cae">
<rm:boundArtifact rdf:resource="https://lcm.*****.de:9443/rm/resources/_kwtnQx_DEeWFK7vjMUdUyg"/>
<rmTypes:ArtifactFormat rdf:resource="https://lcm.*****.de:9443/rm/types/_hq7eUh9QEeWFK7vjMUdUyg#Text"/>
<dcterms:creator rdf:resource="https://lcm.*****.de:9443/jts/users/kumar.ramesh"/>
<rt:_huz4zB9QEeWFK7vjMUdUyg rdf:resource="https://lcm.*****.de:9443/jts/users/kumar.ramesh"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-07-01T07:34:15.637Z</dcterms:created>
<rt:_htUD8h9QEeWFK7vjMUdUyg rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-07-01T08:02:09.256Z</rt:_htUD8h9QEeWFK7vjMUdUyg>
<rt:_hvspkh9QEeWFK7vjMUdUyg rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-07-01T07:34:15.637Z</rt:_hvspkh9QEeWFK7vjMUdUyg>
</oslc_rm:Requirement>
</rdfs:member>
</rdf:Description>
</rdf:RDF>
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".
|
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.