RRC v4.0.5 and oslc query
Hi,
I've been through the OSLC workshop (https://jazz.net/library/article/635) on RRC v4.0.1 and devloped a java application to extract requirements without any problem.
I've just upgraded one of our test servers to RRC v4.0.5 and neither my application nor the workshop are working.
In the workshop, there's a sample query to retrieve all the requirements for a given project.
My project code is "PRJ_CODE" and let's assume my server name is MYSERVER.
Then, the URL provided in the workshop is:
https://MYSERVER/rm/views?oslc.query=true&projectURL=https%3A%2F%2FMYSERVER%2Fjts%2Fprocess%2Fproject-areas%2FPRJ_CODE&oslc.prefix=rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns%23>,dcterms=<http://purl.org/dc/terms/>&oslc.select=*&oslc.where=rdf:type=<http://openservices.net/ns/rm%23Requirement>
This query was working properly on v4.0.1 but not anymore on v4.0.5.
In my request headers, I have the following options:
Accept:application/xml
OSLC-Core-Version:2.0
Response is an error 500.
See images for header/body reponse.
And here's the server error log (I've truncated part of the message. If complete sequence call is needed, let me know!):
Error: Entry [ca2df761e87bee6d]
java.lang.RuntimeException: Error when converting:
oslc.query=true&
oslc.prefix=rdf&
oslc.select=*&
oslc.where=rdf:type=<http://openservices.net/ns/rm#Requirement>
com.ibm.oslc.query.parser.select.ParseException: Invalid prefix definition: rdf
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.convert(OslcQueryToRql.java:112)
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.<init>(OslcQueryToRql.java:49)
at com.ibm.rdm.fronting.server.rrs.views.OslcViewExecutionRequest.createViewFromOslcQuery(OslcViewExecutionRequest.java:133)
.....
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1646)
Caused by: com.ibm.oslc.query.parser.select.ParseException: Invalid prefix definition: rdf
at com.ibm.oslc.query.parser.prefix.OslcPrefixParser.parsePrefixDefinition(OslcPrefixParser.java:36)
at com.ibm.oslc.query.parser.prefix.OslcPrefixParser.parse(OslcPrefixParser.java:26)
at com.ibm.oslc.query.parser.CustomOslcParser.select(CustomOslcParser.java:31)
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.invokePrefixParser(OslcQueryToRql.java:119)
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.convert(OslcQueryToRql.java:73)
... 59 more
How can I fix this problem?
Thank you.
Nico
Accepted answer
3 other answers
@Venkatesh Nadamuni : I had the same problem, it was caused by forgotting to escape "#" to '%23', it causes the remaining of the request being ignored.
Some hints from my experience with DOORS NG 6.0.5:
-
This article helped me: https://jazz.net/library/article/1197
-
about oslc.prefix : contrary to the article you cannot declare many prefixes in one oslc.prefix parameter. Use one oslc.prefix parameter per prefix.
- Escape all '#' to '%23'
-
URLS , '<' and '>' seem to not need escaping
- double check your prefixes, its easy to mismatch 'http://www.ibm.com/xmlns/rdm/types/' and 'http://www.ibm.com/xmlns/rdm/rdf/' .
- The official OSLC 2.0 query syntax : https://archive.open-services.net/bin/view/Main/OSLCCoreSpecQuery.html