Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

OSLC Query API: Use "IN" operator within oslc_rm:uses that is in oscl.where clause

I'm trying to create an OSLC API query that will retrieve artifacts that are within a specific module where a specific custom attribute has a value that is within a list of values.

For example, the query below is attempting to retrieve artifacts within the 1294667 module where their custom attribute  named pvVariants has a value that is "Opt1" or "OPT2": 
https://jelm.us.lmco.com/rm/views?oslc.query=true&oslc_config.context=https://jelm.us.lmco.com/rm/cm/stream/_n6sXQITiEe-Km_7reoRTxw&oslc.prefix=oslc_rm=<http://open-services.net/ns/rm#>,dcterms=<http://purl.org/dc/terms/>,rp0=<https://jelm.us.lmco.com/rm/types/>&oslc.select=oslc_rm:uses{dcterms:title},oslc_rm:uses{dcterms:identifier},oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA}&oslc.where=dcterms:identifier=1294667 and oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA in ["Opt1","Opt2"]}

But doing that query gives the following error: 
Error when converting:
oslc.query=true&amp;
oslc.prefix=dcterms=&lt;http://purl.org/dc/terms/&gt;&amp;
oslc.select=oslc_rm:uses{dcterms:title}&amp;
oslc.select=oslc_rm:uses{dcterms:identifier}&amp;
oslc.select=oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA}&amp;
oslc.where=dcterms:identifier=1294667 and oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA in ["Opt1"&amp;
oslc.where="Opt2"]}
com.ibm.oslc.query.parser.where.ParseException: Encountered "" at line 1, column 45.&#xD;
Was expecting one of:&#xD;
    </err:detailedMessage>
<err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Bad Request</err:errorMessage>
<err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
    >400</err:errorStatus>
</rdf:Description>
</rdf:RDF>

If I change the oslc.where paramter to just retrieve where our custom attribute pvVariants has the value "Opt1" the query works: oslc.where=dcterms:identifier=1294667 and oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA="Opt1"}

Is there no way to use an IN clause within oslc_rm to specify multiple values? If there isn't, is there an alternative way to query in order to specify multiple values?

0 votes

Comments
Are you are aware that OSLC is a documented standard?

and

https://docs.oasis-open-projects.org/oslc-op/cm/v3.0/change-mgt-spec.html

documents this.

There is a document for the query syntax in the OSLC Core documentation e.g.: https://archive.open-services.net/bin/view/Main/OslcCoreSpecification.html#Query_Syntax

EWM supports OSLC CM 2.0 as far as I can tell.

@Ralph - yeah but not fully it turns out :-(

See Josh's previous post where I suggested oslc_rm:uses{*} in the select and Ian Barnard pointed out it doesn't work



One answer

Permanent link

AFAICT from the syntax this is allowed but it seems that DOORS Next doesn't allow it, as you've discovered.

0 votes

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: 2 days ago

Question was seen: 54 times

Last updated: 17 hours ago

Confirmation Cancel Confirm