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

OSCL Query API: Query artifacts within a specific module that have a specific attribute value in DOORS Next Generation 7.0.3

I've been trying to figure out how to query artifacts within a specific module using OSLC API that have a specific attribute value in one of our custom attributes. For example, in the following query I'm attempting to retrieve the title, identifier, and the value of our custom attribute (custom attribute is called pvVariants,) from all artifacts within the 1294667 module where pvVariants = Opt1. For readability purposes, the values in the query below are not URL encoded (I did encode the values in the API request before I sent it).


Query:
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 rp0:AD_r9hZsIc2Ee-bY_dDub0TeA="Opt1"

With this query I get no results returned even though there are artifacts in the module that have "Opt1" as the value of our custom attribute pvVariants. If I remove the "and rp0:AD_r9hZsIc2Ee-bY_dDub0TeA="Opt1" clause from the oslc.where parameter then I get back ALL the artifacts within the module which is not what I want. I also confirmed that regarding syntax of rp0:AD_r9hZsIc2Ee-bY_dDub0TeA="Opt1" in the oscl.where parameter, if I have that clause in a query where I'm querying a specific artifact instead of module artifact, I do get results so I think the syntax for that specifically is correct. Is there a way to accomplish what I'm trying to do? I'm not sure what I'm doing wrong regarding the syntax of my query.

0 votes


Accepted answer

Permanent link

As Davyd points out your query is acting on the module. To check the properties of used artifacts in the module, syntax like this works at least with 7.1:


oslc.where=dcterms:identifier=1294667 and oslc_rm:uses{rp0:AD_r9hZsIc2Ee-bY_dDub0TeA="Opt1"}

HTH
Ian

Joshua Baxter selected this answer as the correct answer

0 votes

Comments

We are using 7.0.3 and it worked! Thanks!




We have another environment that I don't have access to that is using DNG 7.0.2. Is it a safe assumption that since this OSLC query worked for 7.0.3 it should also work for 7.0.2? Should OSLC queries that work in 7.0.3 generally also work in 7.0.2?


One other answer

Permanent link

Is the custom attribute a string or an enumeration? If it's an enumeration you would need to use the internal enum ID

0 votes

Comments

It is a string.

Bummer, but I think I just saw where the issue may be.

Your query the way it's written is looking for the attribute and value on the thing you're querying, which is the module (with ID 1294667?) - you would need to work out how to query the content, which I suspect will involve the rm:uses prefix somehow


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,938

Question asked: Dec 12 '24, 11:52 a.m.

Question was seen: 233 times

Last updated: Dec 18 '24, 1:45 p.m.

Confirmation Cancel Confirm