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 OKResponse 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 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%22The 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&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E&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&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E&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
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,
Alexandre Aquiles
commented Dec 11 '13, 1:05 p.m.
Gabriel,
As, Gabriel have written in the Defect 83082, the problem was with my query URI.
|
One other answer
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.
Rosa,
I've opened the Defect 83082. Here is the link:
|
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.