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&
oslc.prefix=oslc_rm=<http://open-services.net/ns/rm#>&
oslc.prefix=dcterms=<http://purl.org/dc/terms/>&
oslc.prefix=rp0=<https://jelm.us.lmco.com/rm/types/>&
oslc.select=oslc_rm:uses{dcterms:title}&
oslc.select=oslc_rm:uses{dcterms:identifier}&
oslc.select=oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA}&
oslc.where=dcterms:identifier=1294667 and oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA in ["Opt1"&
oslc.where="Opt2"]}
com.ibm.oslc.query.parser.where.ParseException: Encountered "" at line 1, column 45.
Was expecting one of:
</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?
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER 2 days agohttps://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.
Davyd Norris
2 days ago