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

OSLC RM Query by title doesn't return result after updating a requirement

When I do a PUT on a Requirement resource and then do a OSLC query by title, no result is returned. But if I change and save the title of the Requirement via the Web UI, there are results returned with the same query.

I'm using version 4.0.1 of JTS / RRC.

Using the Example 04 from the OSLC Workshop:
PUT https://localhost:9444/rm/resources/_b5FNdF6yEeOXYZKyXGYZMg
Accept=application/xml Content-Type=application/xml
OSLC-Core-Version=2.0
If-Match="_b5F0gl6yEeOXYZKyXGYZMg"
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:acp="http://jazz.net/ns/acp#" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:dc="http://purl.org/dc/terms/" xmlns:jazz_rm="http://jazz.net/ns/rm#" xmlns:nav="http://jazz.net/ns/rm/navigation#" xmlns:oslc="http://open-services.net/ns/core#" xmlns:oslc_rm="http://open-services.net/ns/rm#" xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/" xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/" xmlns:rm_property="https://localhost:9444/rm/types/">
<oslc_rm:Requirement rdf:about="https://localhost:9444/rm/resources/_b5FNdF6yEeOXYZKyXGYZMg">
  <rdf:type rdf:resource="http://jazz.net/ns/rm#Text"/>
  <dc:contributor rdf:resource="https://localhost:9444/jts/users/aquiles"/>
  <dc:description rdf:parseType="Literal">This is a test document</dc:description>
  <dc:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-12-06T20:10:22.024Z</dc:created>
  <acp:accessControl rdf:resource="https://localhost:9444/rm/accessControl/_L_AhyVwSEeOl7MusTa-26Q"/>
  <dc:title rdf:parseType="Literal">MyDocument</dc:title>
  <rm_property:_NBmAIVwSEeOl7MusTa-26Q rdf:resource="https://localhost:9444/rm/types/_M7ibcVwSEeOl7MusTa-26Q#Text"/>
  <nav:parent rdf:resource="https://localhost:9444/rm/folders/_b14vg16yEeOXYZKyXGYZMg"/>
  <dc:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-12-06T20:10:22.024Z</dc:modified>
  <oslc:instanceShape rdf:resource="https://localhost:9444/rm/types/_NnzEgVwSEeOl7MusTa-26Q"/>
  <jazz_rm:PrimaryText rdf:parseType="Literal"><div id="_Nf2cQJKNEd25PMUBGiN3Dw" xmlns="http://www.w3.org/1999/xhtml"><h1 id="_DwpWsMueEd28xKN9fhQheA">Test Document</h1></div></jazz_rm:PrimaryText>
  <dc:creator rdf:resource="https://localhost:9444/jts/users/aquiles"/>
  <oslc:serviceProvider rdf:resource="https://localhost:9444/rm/discovery/_L_AhyVwSEeOl7MusTa-26Q/services.xml"/>
  <dc:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">85</dc:identifier>
  <oslc_rm:implementedBy rdf:resource="http://www.ibm.com"/></oslc_rm:Requirement>
</rdf:RDF>
Then I get a 200 OK response and the requirement is correctly updated.

Status:
HTTP/1.1 200 OK
Response Headers:
Server: Apache-Coyote/1.1    
Content-Location: https://localhost:9444/rm/resources/_b5FNdF6yEeOXYZKyXGYZMg?revision=_caYjsV6yEeOXYZKyXGYZMg     
Location: https://localhost:9444/rm/resources/_b5FNdF6yEeOXYZKyXGYZMg     
X-Last-Modified-XSD: 2013-12-06T20:10:25.515Z     
Last-Modified: Fri, 06 Dec 2013 20:10:25 GMT     
X-Last-Modified-User: https://localhost:9444/jts/users/aquiles     
ETag: "_caYjsV6yEeOXYZKyXGYZMg"     
OSLC-Core-Version: 2.0     
Content-Type: application/xml     
Transfer-Encoding: chunked     
Date: Fri, 06 Dec 2013 20:10:25 GMT

Then, if I search for the created Requirement by title with an OSLC query using oslc.where=dc:title="MyDocument", I get no results.
GET https://localhost:9444/rm/views?oslc.query=true&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E&oslc.where=dcterms%3Atitle%3D%22MyDocument%22
The response is:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:jazz_rm="http://jazz.net/ns/rm#" xmlns:oslc="http://open-services.net/ns/core#" xmlns:oslc_rm="http://open-services.net/ns/rm#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
    <oslc:ResponseInfo rdf:about="https://localhost:9444/rm/views?oslc.query=true&amp;oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E&amp;oslc.where=dcterms%3Atitle%3D%22MyDocument%22">
        <dcterms:title>Query Results</dcterms:title>
    </oslc:ResponseInfo>
    <rdf:Description rdf:about="https://localhost:9444/rm/views?oslc.query=true">
     </rdf:Description>
</rdf:RDF>
But with a go to the Web UI, edit the title (without changing it) and save the Requirement, when I do the same query, I get results.
GET https://localhost:9444/rm/views?oslc.query=true&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E&oslc.where=dcterms%3Atitle%3D%22MyDocument%22
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:jazz_rm="http://jazz.net/ns/rm#" xmlns:oslc="http://open-services.net/ns/core#" xmlns:oslc_rm="http://open-services.net/ns/rm#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
    <oslc:ResponseInfo rdf:about="https://localhost:9444/rm/views?oslc.query=true&amp;oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E&amp;oslc.where=dcterms%3Atitle%3D%22MyDocument%22">
        <dcterms:title>Query Results: 1</dcterms:title>
    </oslc:ResponseInfo>
    <rdf:Description rdf:about="https://localhost:9444/rm/views?oslc.query=true">
        <rdfs:member>
            <oslc_rm:Requirement rdf:about="https://localhost:9444/rm/resources/_b5FNdF6yEeOXYZKyXGYZMg">
            </oslc_rm:Requirement>
        </rdfs:member>
     </rdf:Description>
</rdf:RDF>
Does anyone know what am I doing wrong?

0 votes


Accepted answer

Permanent link
If the OSLC query is done just after the OSLC POST then it is that indexing is behind.. you should allow some time between those actions.
Alexandre Aquiles selected this answer as the correct answer

1 vote

Comments

Gabriel, 


Actually it is a PUT, but I will test with a POST.

And the funny thing is, if I do the OSLC query just after the PUT (i.e. in the main() of Example04), it works.

But when the program terminates, if I query again, the requirement is not returned.

So, I don't know if it is an indexing problem.

Alexandre,
      Could you try using the HTTP Requester ( or similar)  tool to emulate the OSLC Consumer? With this test we could verify the functionality of the OSLC provider.  Use following link for it : https://jazz.net/library/article/1197

Gabriel,

I've tried with the HTTP Requester Firefox plugin. Got the same results.

It's nice to notice that after a POST, the query by title returns the expected results.

Just to remind, I'm using version 4.0.1.

I've updated the Defect 83082 with the step-by-step recording of the results.


One other answer

Permanent link
It sounds like there must be something about editing the resource from the Web UI that is triggering the indexes that are behind the query execution.  I would open a defect in RM and put this same information and see if someone can investigate.

1 vote

Comments

Rosa,


As I said to Gabriel below, when I query in the main() of Example04, just after the update, it works. So, I don't know if it is an indexing problem.

Maybe is some inconsistency in the PUT payload RDF/XML.
Although, the XML is just an altered version of the response of the GET request to the requirement URI, with changed parent folder.

Anyway, I will open the defect in RM and put the link here!

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
× 11,047
× 522
× 144

Question asked: Dec 06 '13, 3:33 p.m.

Question was seen: 7,188 times

Last updated: Dec 12 '13, 8:12 a.m.

Confirmation Cancel Confirm