It's all about the answers!

Ask a question

How to query RDNG 6.0.3 for requirement collections belonging to a specific component through OSLC?

Ellena Chen (133) | asked Feb 27 '17, 2:16 p.m.

I'm using /rm/views?oslc.query=true&projectURL={ptojectURL}*& to query for requirement collections.  This returns all the requirements collections for the default component on the project.  How do I query for requirement collections on a non-default component?

I've tried adding request parameter componentURI={componentURI} or adding query parameter oslc.where=oslc_config:component={componentURI} or adding net.jazz.jfs.owning-context:{componentURI} request header and none of them returns the correct results.

2 answers

permanent link
Lonnie VanZandt (7011) | answered Aug 19 '17, 7:05 p.m.

Peer advice:

If you want to use OAuth-authorized queries, it is cleaner to have the component and configuration URIs in the Headers rather than in the URL query parameters.

The following uses Basic Authentication to simplify illustrating the protocol when Headers are used. Note, too, that the projectURL is a query parameter because that is how Jazz publishes the queryBase out of its QueryCapability for the Service that the RM ServiceProvider offers for querying Requirements.
curl "*&oslc.paging=true&oslc.query=true" \
     -H "oslc_config.context:" \
     -H "OSLC-Core-Version: 2.0" \
     -H "componentURI:" \
     -H "Cookie: JAZZ_AUTH_TOKEN=1e24af6a07e0483d994a309c6cca2a52&ksHsUqAl39VKdPUNL3TSdCQfgCXmFf0E3R1cgVEqL0; JSESSIONID=0000AKn99IfRwKoFvCdGwMusSoq:5ba41f4b-bd82-4acc-af2d-6a7c7a643bf0; LtpaToken2=AKcriCz3xWsaYKvAV5T0tOTkfabTkQ6+ajBzMVRs6pWPOpKsE0cl/mKmOZFQJhFYPnGH1yfwvqNfG9o6P49Ij1xRZqTXYCnkX3EMjjz8KTRe34TD2jmylszORNyn3keqft7epKDzrBZz63wQJ0ig6JKwqJIH5Cz5uCW3oigc0ops++Jg/Cm56Xmvc5Z6wIBvkExXJhwWibF8mznD+HcF6sy4fvAxAfXH7Xas5EOUBKQruokCFQNeJc6pE60mO6SN4mfcRWWl+GeCDvAGjqjjV+3M2r2oElpzsRqyQcjMUIS/GjnWwXQqL/df7d4grA9E" \
     -H "Accept: application/rdf+xml" \
     -u user:password

permanent link
Donald Nong (14.4k213) | answered Mar 10 '17, 4:12 a.m.

If you are querying for a non-default component, you need the local configuration as well. If fact, since the local configuration is sufficient to get the artifacts you want, you can simply skip the component.

One interesting observation - if I put projectURL, componentURI and oslc.configuration all together in the OSLC query, the query result will show all three of them in the <rdf:Description>. If I put only projectURL and componentURI (without oslc.configuration), the result will only shows projectURL and componentURI is gone, and that is why you see the artifacts in the default component (and the default configuration).

I am not sure whether the last bit is a defect. You can contact Support for this.

Your answer

Register or to post your answer.