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

OSCL Query API: Get all attribute values for artifacts within a specific module in Doors Next 7.0.3

Is there a way to get all attribute values for artifacts within a specific module via OSLC API?  For example, the following query works (query is retrieving all artifacts within module 200012 where a custom attribute has the value "TESTVALUE") if I explicitly specify what is returned in the oslc.select parameter. 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):


https://server/rm/views?oslc.query=true&oslc_config.context=context&oslc.prefix=oslc_rm=<http://open-services.net/ns/rm#>,dcterms=<http://purl.org/dc/terms/>,rp0=<https://server/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=200012 and oslc_rm:uses{rp0:AD_sVZsoEnJEe-eqOqeJK18FA="TESTVALUE"}

I know that if you are querying for an artifact directly you would just put  in the oslc.select paramter, but for the above query this will just return the attributes in the module 200012 and not the attributes in the artifacts within the module. I also tried putting oslsc_rm:uses{} in the oslc.select paramter but that didn't work either as it gives me a 400 bad request error.

0 votes


Accepted answer

Permanent link
AFAICT DOORS Next doesn't handle * in a oslc.select nested scope parameter like oslc_rm:uses{*} or *{*} which are both syntactically valid according to the spec https://oslc-op.github.io/oslc-specs/specs/core/oslc-core.html#resourceShapes

You can put a comma-separated list into a nested scope select like oslc_rm:uses{dcterms:identifier,rp0:AD_r9hZsIc2Ee-bY_dDub0TeA} but not the primary text.

If you need the primary text you'll end up post-processing one way or another. It may be simpler to use the reportable rest api to report on artifacts in the module and process that? Maybe you could combine using OSLC Query to get the artifact IDs with the attribute condition you want then pick those artifacts out of the reportable rest output - at least this avoids retrieving each artifact individually.

Joshua Baxter selected this answer as the correct answer

0 votes

Comments
Well that's annoying!

I agree with Ian that I would use the Reportable REST API to retrieve this sort of stuff


One other answer

Permanent link
The problem you have is that you're querying the module but want the contents. Have you tried oslc:select=oslc_rm:uses{*} ? It's a guess and likely won't work but have a go first.

The normal way this is done is by two calls - you first get the module content, which returns a list of basic info for the artefact, but it also returns the URL to retrieve the artefact directly, and a second call to that URL will let you use oslc:select=*

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

Question asked: Dec 16 '24, 10:21 a.m.

Question was seen: 158 times

Last updated: Dec 17 '24, 5:10 p.m.

Related questions
Confirmation Cancel Confirm