It's all about the answers!

Ask a question

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


Alexandre Aquiles (1313) | asked Dec 06 '13, 3:33 p.m.
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?

Accepted answer


permanent link
Gabriel Ruelas (1.1k13) | answered Dec 06 '13, 5:30 p.m.
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

Comments
Alexandre Aquiles commented Dec 07 '13, 6:41 a.m.

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.


Gabriel Ruelas commented Dec 09 '13, 8:25 a.m.

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


Alexandre Aquiles commented Dec 11 '13, 1:05 p.m.

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.


Alexandre Aquiles commented Dec 12 '13, 8:11 a.m. | edited Dec 12 '13, 8:12 a.m.

One other answer



permanent link
Rosa Naranjo (2.9k11623) | answered Dec 06 '13, 4:42 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
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.

Comments
Alexandre Aquiles commented Dec 07 '13, 6:49 a.m.

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!


Alexandre Aquiles commented Dec 07 '13, 7:10 a.m.

Your answer


Register or 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.