It's all about the answers!

Ask a question

Queried for a Single Requirement with Two Requirements in the Response


magnus Elfving (282) | asked Apr 04, 7:50 a.m.

 Hi,


I have queried for a single requirement in Doors NG with the query:  "... oslc.where=dcterms:identifier=xyz".

The response, however, contains two member results, both with the same identifier, though they seem to be located apart from each other, see below

member 1:
<oslc_rm:Requirement rdf:about="https://.../rm/resources/CA_685b0b6ac75f4b1a8b0f0fd0ec12a510">   

member 2:
<oslc_rm:Requirement rdf:about="https://.../rm/resources/_9mJ9gIi1Eeuc2f2NAwVSqg">

Someone having an idea of why this is happening?

Also,  the ETag in the HttpResponse is null, is this due to a result including more than one requirement? 

Regards 
Magnus 

  

One answer



permanent link
Bartosz Chrabski (2.9k11936) | answered Apr 04, 8:23 a.m.
Hi Magnus,

Easiest way to check is copying resource URL and putting into the web browser.

In Your case You are getting two members because one requirement seems to be added to a module and you are getting one like to base artifact and second one to the module context.

If the artifact would be in two modules then you would get 3 members.

Hope it is answering Your question.

Bartek

Comments
magnus Elfving commented Apr 06, 4:06 a.m.

Thanks for the answer!


Yes you are right,  there is one member reference to a module and one member reference to a base artifact for the same identifier. 

Do you think that the query responding in two members for the same identifier also leads to the missing ETag ?

(That is, the server is not able to uniquely identify a requirements instance by the supplied identifier in the query)

Magnus   


Ian Barnard commented Apr 06, 5:25 a.m. | edited Apr 06, 5:26 a.m.
JAZZ DEVELOPER
Query doesn't retrieve the artifact (in the sense of retrieving something you could update), it returns URIs of artifacts matching the query, optionally with properties specified in oslc.select.

If you want to update a requirement (which is when you need the etag) then you should GET the requirement URI, the result will include the current etag.


If you need to identify which query result is the core artifact and which the artifact in a module, include rm_nav:parent in the oslc.select then you can check for a result with a value for rm_nav:parent (which is the core artifact) or without rm_nav:parent (which is the artifact in a module)


magnus Elfving commented Apr 08, 4:13 a.m.

 Thanks again Ian!


Problem solved  

Regards
Magnus

Your answer


Register or to post your answer.